WSL/SLF GitLab Repository

Commit 220a09aa authored by Mathias Bavay's avatar Mathias Bavay
Browse files

More size_t related issues have been found (thanks to the new snowpack server)...

More size_t related issues have been found (thanks to the new snowpack server) and fixed. Basically, please remember that any variable used with/for the return value of a call to size() MUST be of type size_t (this becomes specially relevant in 64 bits).

The water triple point pressure has been updated to a better value.
parent 4e590e4e
......@@ -175,7 +175,7 @@ void A3DIO::readStationData(const Date& timestamp, std::vector<StationData>& vec
void A3DIO::readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& /*stationindex*/)
const size_t& /*stationindex*/)
{
//if dateStart and dateEnd are the same: return exact match for date
//if dateStart > dateEnd: return first data set with date > dateStart
......
......@@ -48,7 +48,7 @@ class A3DIO : public IOInterface {
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
const size_t& stationindex=IOUtils::npos);
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="");
......
......@@ -192,7 +192,7 @@ const std::vector< METEO_TIMESERIE >& BufferedIOHandler::get_complete_buffer(Dat
void BufferedIOHandler::readMeteoData(const Date& date_start, const Date& date_end,
std::vector< METEO_TIMESERIE >& vecMeteo,
const unsigned int& /*stationindex*/)
const size_t& /*stationindex*/)
{
vecMeteo.clear();
const Date new_buffer_start(date_start-buff_before); //taking centering into account
......
......@@ -102,7 +102,7 @@ class BufferedIOHandler : public IOInterface {
virtual void readSpecialPoints(std::vector<Coords>& pts);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< METEO_TIMESERIE >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
const size_t& stationindex=IOUtils::npos);
#ifdef _POPC_
virtual void writeMeteoData(std::vector< METEO_TIMESERIE >& vecMeteo,
const std::string& name="");
......@@ -140,8 +140,8 @@ class BufferedIOHandler : public IOInterface {
Date buffer_start, buffer_end;
Duration chunk_size; ///< How much data to read at once
Duration buff_before; ///< How much data to read before the requested date in buffer
unsigned int chunks; ///< How many chuncks to buffer
unsigned int max_grids; ///< How many grids to buffer (grids, dems, landuse and assimilation grids together)
size_t chunks; ///< How many chuncks to buffer
size_t max_grids; ///< How many grids to buffer (grids, dems, landuse and assimilation grids together)
};
} //end namespace
#endif
......@@ -235,7 +235,7 @@ void IOHandler::readMeteoData(const Date& date, METEO_TIMESERIE& vecMeteo)
void IOHandler::readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector<METEO_TIMESERIE>& vecMeteo,
const unsigned& stationindex)
const size_t& stationindex)
{
IOInterface *plugin = getPlugin("METEO", "Input");
plugin->readMeteoData(dateStart, dateEnd, vecMeteo, stationindex);
......
......@@ -71,7 +71,7 @@ class IOHandler : public IOInterface {
#endif
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector<METEO_TIMESERIE>& vecMeteo,
const unsigned& stationindex=IOUtils::npos);
const size_t& stationindex=IOUtils::npos);
void readMeteoData(const Date& date, METEO_TIMESERIE& vecMeteo);
virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
......
......@@ -44,7 +44,7 @@ namespace mio {
* throw IOException("Nothing implemented here", AT);
* }
* @endcode
*
*
* It is the responsibility of the plugin to properly convert the units toward the SI as used in MeteoIO (see the MeteoData class for a list of parameters and their units). This includes converting the nodata value used internally in the plugin (as could be defined in the data itself) into the unified IOUtils::nodata nodata value. Moreover, it is required by the BufferedIOHandler that each plugin that implements readMeteoData @em also implements the readStationData method. This is required so that the metadata is available even if not data exists for the requested time period.
*
* Finally, plugins must properly handle time zones. The Date class provides everything that is necessary, but the plugin developer must still properly set the time zone to each Date object (using the "TZ" key in the io.ini configuration file at least as a default value and afterwards overwriting with a plugin specified time zone specification if available). The time zone should be set \em before setting the date (so that the date that is given is understood as a date within the specified time zone).
......@@ -52,13 +52,13 @@ namespace mio {
* The meteorological data must be returned in a vector of vectors of MeteoData (and similarly, of StationData in order to provide the metadata). This consists of building a vector of MeteoData objects, each containing a set of measurements for a given timestamp, at a given location. This vector that contains the time series at one specific location is then added to a vector (pushed) that will then contain all locations.
* \image html vector_vector.png "vector of vector structure"
* \image latex vector_vector.eps "vector of vector structure" width=0.9\textwidth
*
*
* Various classes from MeteoIO can prove convenient for use by plugins: for example the Coords class should be used for geographic coordinates conversions, while the Config class should be used for getting configuration information from the user's configuration file. Please do NOT implement your own version of this kind of feature in your plugin but exclusively rely on the matching classes of MeteoIO, extending them if necessary.
* A template for writing a plugin class is available in the plugin directory under the name template.cc and template.h. Simply copy these two files under a new name and fill the methods that you want to implement. Some easy example implementation can be found in ARCIO or A3DIO.
*
*
* @section plugins_registration Plugins registration
* Once a plugin has been written, it must be "registered" so that it is known by the rest of the library. This is done in IOHandler::registerPlugins by adding a plugin key (that will be used by the user in the configuration file when he wants to use the said plugin), the name of the dynamic library that the plugin is bunddled in (knowing that CMake adds "lib" to prefix all library names, which means that you should expect a file name to look like "libmyplugin"), the name of its implementation class, a pointer to the implementation class (use NULL and it will be properly initialized), and a pointer to the dynamicl library (again, set as NULL and the proper initialization will take place). For more information, see the IOPlugin class.
*
*
* Finally, the build system has to be updated so that it offers the plugin to be build: a local file (<a href="../../meteoio/plugins/CMakeLists.txt">meteoio/plugins/CMakeLists.txt</a>) has to be edited so that the plugin is really built, then the toplevel file has to be modified so the user can choose to build the plugin if he wishes (<a href="../../CMakeLists.txt">CMakeLists.txt</a>). Please keep in mind that all plugins should be optional (ie: they should not prevent the build of MeteoIO without them) and please call your plugin compilation flag similarly as the other plugins (ie: PLUGIN_MYNAME).
*
* @section plugins_documentation Plugins documentation
......@@ -66,7 +66,7 @@ namespace mio {
* - format, for describing the data format
* - units, expressing what the input units should be
* - keywords, listing (with a brief description) the keywords that are recognized by the plugin for its configuration
*
*
* The internal documentation of the plugin can remain as normal C++ comments (since they are addressed to the maintainer of the plugin).
*
* @section plugins_testing Plugins testing and validation
......@@ -81,7 +81,7 @@ namespace mio {
/**
* @class IOInterface
* @brief An abstract class representing the IO Layer of the software Alpine3D. For each type of IO (File, DB, Webservice, etc)
* a derived class is to be created that holds the specific implementation of the purely virtual member funtions.
* a derived class is to be created that holds the specific implementation of the purely virtual member funtions.
* The IOHandler class is a wrapper class that is able to deal with all above implementations of the IOInterface abstract base class.
*
* @ingroup plugins
......@@ -95,16 +95,16 @@ class IOInterface : public PluginObject {
virtual ~IOInterface();
/**
* @brief A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for addressing the
* @brief A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for addressing the
* specific 2D grid to be parsed into the Grid2DObject.
* @param grid_out A Grid2DObject instance
* @param grid_out A Grid2DObject instance
* @param parameter A std::string representing some information for the function on what grid to retrieve
*/
*/
virtual void read2DGrid(Grid2DObject& grid_out, const std::string& parameter="") = 0;
/**
* @brief Parse the DEM (Digital Elevation Model) into the Grid2DObject
*
*
* Example Usage:
* @code
* Grid2DObject dem;
......@@ -117,7 +117,7 @@ class IOInterface : public PluginObject {
/**
* @brief Parse the landuse model into the Grid2DObject
*
*
* Example Usage:
* @code
* Grid2DObject landuse;
......@@ -129,7 +129,7 @@ class IOInterface : public PluginObject {
virtual void readLanduse(Grid2DObject& landuse_out) = 0;
/**
* @brief Fill vecStation with StationData objects for a certain date of interest
* @brief Fill vecStation with StationData objects for a certain date of interest
*
* Example Usage:
* @code
......@@ -152,7 +152,7 @@ class IOInterface : public PluginObject {
* - if dateStart > dateEnd: return first data set with date > dateStart
* - read in all data starting with dateStart until dateEnd
* - if there is no data at all then the vectors will be empty, no exception will be thrown
*
*
* Example Usage:
* @code
* vector< vector<MeteoData> > vecMeteo; //empty vector
......@@ -166,9 +166,9 @@ class IOInterface : public PluginObject {
* @param vecMeteo A vector of vector<MeteoData> objects to be filled with data
* @param stationindex (optional) update only the station given by this index
*/
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos) = 0;
const size_t& stationindex=IOUtils::npos) = 0;
/**
* @brief Write vecMeteo time series to a certain destination
......@@ -191,14 +191,14 @@ class IOInterface : public PluginObject {
* @endcode
* @param vecMeteo A vector of vector<MeteoData> objects to be filled with data
* @param name (optional string) Identifier usefull for the output plugin (it could become part
* of a file name, a db table, etc)
* of a file name, a db table, etc)
*/
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="") = 0;
/**
* @brief Parse the assimilation data into a Grid2DObject for a certain date represented by the Date object
*
*
* Example Usage:
* @code
* Grid2DObject adata;
......
......@@ -29,7 +29,7 @@ namespace Cst {
const double gaz_constant_water_vapor = 461.9; // (J kg-1 K-1)
const double gaz_constant = 8.31451; // (J mol-1 K-1)
const double p_water_triple_pt = 610.78; // (Pa)
const double p_water_triple_pt = 611.73; // (Pa)
const double t_water_freezing_pt = 273.15; // (K)
const double t_water_triple_pt = 273.16; // (K)
const double l_water_sublimation = 2.838e6; // (J Kg-1)
......
......@@ -248,7 +248,7 @@ void ARCIO::readStationData(const Date&, std::vector<StationData>&)
}
void ARCIO::readMeteoData(const Date&, const Date&, std::vector< std::vector<MeteoData> >&,
const unsigned int&)
const size_t&)
{
//Nothing so far
throw IOException("Nothing implemented here", AT);
......
......@@ -56,10 +56,10 @@ class ARCIO : public IOInterface {
virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
std::vector< std::vector<MeteoData> >& vecMeteo,
const size_t& stationindex=IOUtils::npos);
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="");
const std::string& name="");
virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
virtual void readSpecialPoints(std::vector<Coords>& pts);
virtual void write2DGrid(const Grid2DObject& grid_in, const std::string& filename);
......
......@@ -158,7 +158,7 @@ void ARPSIO::readStationData(const Date&, std::vector<StationData>& /*vecStation
void ARPSIO::readMeteoData(const Date& /*dateStart*/, const Date& /*dateEnd*/,
std::vector< std::vector<MeteoData> >& /*vecMeteo*/,
const unsigned int&)
const size_t&)
{
//Nothing so far
throw IOException("Nothing implemented here", AT);
......
......@@ -61,9 +61,9 @@ class ARPSIO : public IOInterface {
virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
const size_t& stationindex=IOUtils::npos);
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="");
virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
......
......@@ -118,7 +118,7 @@ void BormaIO::readStationData(const Date&, std::vector<StationData>&)
void BormaIO::readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex)
const size_t& stationindex)
{
if (vecStationName.size() == 0)
readStationNames(); //reads station names into vector<string> vecStationName
......
......@@ -57,12 +57,12 @@ class BormaIO : public IOInterface {
virtual void readLanduse(Grid2DObject& landuse_out);
virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const size_t& stationindex=IOUtils::npos);
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="");
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="");
virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
virtual void readSpecialPoints(std::vector<Coords>& pts);
......@@ -87,7 +87,7 @@ class BormaIO : public IOInterface {
void getFiles(const std::string& stationsname, const Date& start_date, const Date& end_date,
std::vector<std::string>& vecFiles, std::vector<Date>& vecDate);
void readStationNames(void);
bool bufferData(const Date& dateStart, const Date& dateEnd,
bool bufferData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationnr);
......
......@@ -85,7 +85,7 @@ CosmoXMLIO::CosmoXMLIO(const Config& cfgreader) : IOInterface(NULL), cfg(cfgread
CosmoXMLIO::~CosmoXMLIO() throw()
{
}
void CosmoXMLIO::read2DGrid(Grid2DObject& /*grid_out*/, const std::string& /*_name*/)
......@@ -118,26 +118,26 @@ void CosmoXMLIO::readStationData(const Date& station_date, std::vector<StationDa
string meteopath = "", station_path="";
cfg.getValue("METEOPATH", "Input", meteopath);
if (meteopath == "")
throw ConversionFailedException("Error while reading value for METEOPATH", AT);
throw ConversionFailedException("Error while reading value for METEOPATH", AT);
const string pattern = "xml";
list<string> dirlist;
IOUtils::readDirectory(meteopath, dirlist, pattern);
dirlist.sort();
vecStation.clear(); //Initialize Station Vector
list<string>::iterator itr; //To loop in the stations list
for( itr = dirlist.begin(); itr != dirlist.end(); itr++ ) { //Loop over all stations in the meteopath directory
station_path = meteopath + "/" + *itr;
StationData sd;
//Initialize variables
double altitude=IOUtils::nodata, latitude=IOUtils::nodata, longitude=IOUtils::nodata;
string station_name="", station_ID="";
bool is_first=true;
Date first_date=IOUtils::nodata, last_date=IOUtils::nodata, date_read=IOUtils::nodata;
//Read station and meteo data
xmlpp::TextReader reader(station_path);
while(reader.read()) {
......@@ -172,7 +172,7 @@ void CosmoXMLIO::readStationData(const Date& station_date, std::vector<StationDa
//End of date test
}
}
//Write station data if the given date is in the station data interval
if ((station_date > first_date) && (station_date < last_date)) {
sd.stationName = station_name;
......@@ -180,7 +180,7 @@ void CosmoXMLIO::readStationData(const Date& station_date, std::vector<StationDa
sd.position.setLatLon(latitude, longitude, altitude);
vecStation.push_back(sd); //Store results in vecStation
}
//Write station data for any date
// sd.stationName = station_name;
// sd.stationID = station_ID;
......@@ -241,7 +241,7 @@ Date CosmoXMLIO::getDateValue(xmlpp::TextReader& reader) {
}
//Converts dew point to humidity and writes station position
void CosmoXMLIO::finishMeteo(const double& latitude, const double& longitude, const double& altitude,
void CosmoXMLIO::finishMeteo(const double& latitude, const double& longitude, const double& altitude,
double& dew_point, MeteoData& meteo) {
// Set position
if(altitude!=IOUtils::nodata && latitude!=IOUtils::nodata && longitude!=IOUtils::nodata) {
......@@ -249,12 +249,12 @@ void CosmoXMLIO::finishMeteo(const double& latitude, const double& longitude, co
} else {
throw InvalidFormatException("Meteo data found, but no position information", AT);
}
//Set RH
if(meteo.ta!=IOUtils::nodata && dew_point!=IOUtils::nodata) {
meteo.rh=Atmosphere::DewPointtoRh(dew_point, meteo.ta,TRUE);
}
//Reset dew_point
dew_point = IOUtils::nodata;
}
......@@ -262,34 +262,34 @@ void CosmoXMLIO::finishMeteo(const double& latitude, const double& longitude, co
//----------> Read Station and Meteo data, uses all stations in the "meteopath" directory <----------
void CosmoXMLIO::readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int&)
{
const size_t&)
{
//Get all files from directory
string meteopath = "", station_path="";
cfg.getValue("METEOPATH", "Input", meteopath);
if (meteopath == "")
throw ConversionFailedException("Error while reading value for METEOPATH", AT);
throw ConversionFailedException("Error while reading value for METEOPATH", AT);
const string pattern = "xml";
list<string> dirlist;
IOUtils::readDirectory(meteopath, dirlist, pattern);
dirlist.sort();
vecMeteo.clear(); //Initialize Meteo Vector
vecMeteo.insert(vecMeteo.begin(), dirlist.size(), std::vector<MeteoData>()); //Allocation for the vectors
list<string>::iterator itr; //To loop in the stations list
unsigned int ii=0; //Declare and initialize counter (to know which station we are dealing with)
for( itr = dirlist.begin(); itr != dirlist.end(); itr++ ) { //Loop over all stations in the meteopath directory
station_path = meteopath + "/" + *itr;
MeteoData meteo;
//Initialize variables
double altitude=IOUtils::nodata, latitude=IOUtils::nodata, longitude=IOUtils::nodata;
double dew_point=IOUtils::nodata;
bool is_first=true;
bool next_station = false;
//Read station and meteo data
xmlpp::TextReader reader(station_path);
while(reader.read()) {
......@@ -306,7 +306,7 @@ void CosmoXMLIO::readMeteoData(const Date& dateStart, const Date& dateEnd,
// if(key=="model_station_latitude") latitude = getDoubleValue(reader);
// if(key=="model_station_longitude") longitude = getDoubleValue(reader);
if(key=="missing_value_code") plugin_nodata = getDoubleValue(reader);
//MeteoData
if(key=="T_2M") meteo.ta = c2k( getDoubleValue(reader) );
if(key=="TD_2M") dew_point = c2k( getDoubleValue(reader) );
......@@ -372,12 +372,12 @@ void CosmoXMLIO::writeHeader(std::stringstream& XMLdata)
}
//Writes station data
void CosmoXMLIO::writeLocationHeader(const StationData& station, std::stringstream& XMLdata)
void CosmoXMLIO::writeLocationHeader(const StationData& station, std::stringstream& XMLdata)
{
XMLdata << "<col>\n<ttable id=\"data\">\n<row>" << endl;
XMLdata << "<col id=\"identifier\">" << station.getStationName() << "</col>\n";
XMLdata << "<col id=\"station_abbreviation\">" << station.getStationID() << "</col>\n";
//Same altitude, latitude and longitude data for station and model.
XMLdata << "<col id=\"station.height\">" << station.position.getAltitude() << "</col>\n";
XMLdata << "<col id=\"station.latitude\">" << station.position.getLat() << "</col>\n";
......@@ -419,14 +419,14 @@ void CosmoXMLIO::writeMeteo(const std::vector<MeteoData>& vecMeteo, std::strings
tmp_date.setTimeZone(out_tz);
XMLdata << "<col id=\"reference_ts\">" << tmp_date.toString(Date::NUM) << "</col>\n";
XMLdata << "<col id=\"T_2M\">" << k2c(vecMeteo[jj].ta) << "</col>\n";
if (vecMeteo[jj].rh==IOUtils::nodata || vecMeteo[jj].ta==IOUtils::nodata) {
XMLdata << "<col id=\"TD_2M\">" << IOUtils::nodata << "</col>\n";
} else {
const double dew_point=Atmosphere::RhtoDewPoint(vecMeteo[jj].rh, vecMeteo[jj].ta, TRUE);
XMLdata << "<col id=\"TD_2M\">" << k2c(dew_point) << "</col>\n";
}
XMLdata << "<col id=\"GLOB\">" << vecMeteo[jj].iswr << "</col>\n";
XMLdata << "<col id=\"TOT_PREC\">" << vecMeteo[jj].hnw << "</col>\n";
XMLdata << "<col id=\"FF_10M\">" << vecMeteo[jj].vw << "</col>\n";
......@@ -455,12 +455,12 @@ void CosmoXMLIO::writeMeteoData(const std::vector< std::vector<MeteoData> >& vec
std::cout << "[E] Station " << ii+1 << " exists but contains no data! Skip writing it...\n";
continue;
}
XMLdata.str(""); //Initialize XMLdata stringstream
//Write the first part of the XML file (header and station data description)
writeHeader(XMLdata);
//Insert station data
writeLocationHeader( vecMeteo[ii][0].meta, XMLdata );
......@@ -501,7 +501,7 @@ void CosmoXMLIO::write2DGrid(const Grid2DObject& /*grid_in*/, const std::string&
void CosmoXMLIO::cleanup() throw()
{
}
#ifndef _METEOIO_JNI
......
......@@ -33,10 +33,10 @@ along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
#include <iostream>
namespace mio {
/**
* @class CosmoXMLIO
* @brief Reading of FieldExtra XML meteorological data.
* @brief Reading of FieldExtra XML meteorological data.
* This is the plugin for reading the XML data genereated by FieldExtra, the post-processor
* of the MeteoSwiss COSMO meteorological model.
*
......@@ -46,26 +46,26 @@ namespace mio {
class CosmoXMLIO : public IOInterface {
public:
CosmoXMLIO(void (*delObj)(void*), const Config& i_cfg);
CosmoXMLIO(const std::string& configfile);
CosmoXMLIO(const CosmoXMLIO&);
CosmoXMLIO(const Config& cfgreader);
~CosmoXMLIO() throw();
virtual void read2DGrid(Grid2DObject& grid_out, const std::string& parameter="");
virtual void readDEM(DEMObject& dem_out);
virtual void readLanduse(Grid2DObject& landuse_out);
virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo, const unsigned int& stationindex=IOUtils::npos);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo, const size_t& stationindex=IOUtils::npos);
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo, const std::string& name="");
virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
virtual void readSpecialPoints(std::vector<Coords>& pts);
virtual void write2DGrid(const Grid2DObject& grid_in, const std::string& filename);
private:
void cleanup() throw();
std::string getValue(xmlpp::TextReader& reader);
......@@ -73,21 +73,21 @@ namespace mio {
Date getDateValue(xmlpp::TextReader& reader);
double c2k(const double& value);
double k2c(const double& value);
void finishMeteo(const double& latitude, const double& longitude, const double& altitude,
void finishMeteo(const double& latitude, const double& longitude, const double& altitude,
double& dew_point, MeteoData& meteo);
void writeHeader(std::stringstream& XMLdata); //Write the first lines of the XML output file
void writeLocationHeader(const StationData& station, std::stringstream& XMLdata);
void writeMeteoDataDescription(std::stringstream& XMLdata); //Write the middle of the XML output file
void writeMeteo(const std::vector<MeteoData>& vecMeteo, std::stringstream& XMLdata);
void writeFooter(std::stringstream& XMLdata); //Write the last lines of the XML output file
Config cfg;
double plugin_nodata; //plugin specific no data value
static const double in_tz, out_tz; //plugin specific time zones
std::string coordin, coordinparam, coordout, coordoutparam; //projection parameters
};
} //namespace
#endif
......@@ -94,7 +94,7 @@ void GSNIO::initGSNConnection(){
//soap_init(&gsn);
//soap_init2(&gsn, SOAP_IO_KEEPALIVE, SOAP_IO_KEEPALIVE);
cfg.getValue("ENDPOINT", "INPUT", endpoint, Config::nothrow);
if (endpoint != ""){
gsn.soap_endpoint = endpoint.c_str();
......@@ -291,7 +291,7 @@ void GSNIO::convertStringToDouble(double& d, const std::string& in_string, const
}
void GSNIO::readData(const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo,
const StationData& sd, const unsigned int& stationindex)
const StationData& sd, const size_t& stationindex)
{
_ns1__getMeteoData meteodata_req;
_ns1__getMeteoDataResponse meteodata;
......
......@@ -54,11 +54,11 @@ class GSNIO : public IOInterface {
~GSNIO() throw();
virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
const size_t& stationindex=IOUtils::npos);
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string& name="");
virtual void read2DGrid(Grid2DObject& dem_out, const std::string& parameter="");
......@@ -75,7 +75,7 @@ class GSNIO : public IOInterface {
void initGSNConnection();
void readStationNames();
void readStationMetaData(StationData& sd, const unsigned int& stationindex);
void readData(const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo,
void readData(const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo,
const StationData& sd, const unsigned int& stationindex);
A3DWebServiceSoap12BindingProxy gsn;
......
......@@ -113,7 +113,7 @@ void GeotopIO::initParamNames(std::map<std::string, unsigned int>& mapParam)
void GeotopIO::writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::string&)
const std::string&)
{
string path="";
vector<string> vecSequence;
......@@ -209,8 +209,8 @@ void GeotopIO::readStationData(const Date&, std::vector<StationData>& vecStation
}