WSL/SLF GitLab Repository

Commit 2e774d9b authored by Mathias Bavay's avatar Mathias Bavay
Browse files

A cleaner way of implementing the Date optimization has been implemented...

A cleaner way of implementing the Date optimization has been implemented (relying on a define to switch back to the previous implementation if necessary). The compilation of the GSN plugin is now turned on by default. The version numbers have been pushed to 2.2.0 in order to get ready for the release.
parent b79a85a4
......@@ -3,8 +3,8 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tools/cmake/")
# Version of library
SET(VERSION_MAJOR 2 CACHE INTERNAL "")
SET(VERSION_MINOR 1 CACHE INTERNAL "")
SET(VERSION_PATCH 2 CACHE INTERNAL "")
SET(VERSION_MINOR 2 CACHE INTERNAL "")
SET(VERSION_PATCH 0 CACHE INTERNAL "")
SET(POPCC popcc)
SET(LIBPREFIX "lib") #make sure ALL plugins are libXXX for ALL plateforms
......@@ -115,7 +115,7 @@ SET(PLUGIN_COSMOXMLIO OFF CACHE BOOL "Compilation COSMOXMLIO ON or OFF")
SET(PLUGIN_GEOTOPIO ON CACHE BOOL "Compilation GEOTOPIO ON or OFF")
SET(PLUGIN_GRASSIO ON CACHE BOOL "Compilation GRASSIO ON or OFF")
SET(PLUGIN_GRIBIO OFF CACHE BOOL "Compilation GRIBIO ON or OFF")
SET(PLUGIN_GSNIO OFF CACHE BOOL "Compilation GSNIO ON or OFF")
SET(PLUGIN_GSNIO ON CACHE BOOL "Compilation GSNIO ON or OFF")
SET(PLUGIN_IMISIO OFF CACHE BOOL "Compilation IMISIO ON or OFF")
SET(PLUGIN_PGMIO ON CACHE BOOL "Compilation PGMIO ON or OFF")
SET(PLUGIN_PNGIO OFF CACHE BOOL "Compilation PNGIO ON or OFF")
......
Begin4
Title: MeteoIO
Version: 2.1.2
Entered-date: 2011-11-10
Version: 2.2.0
Entered-date: 2012-05-31
Description: Meteorological data preprocessing library: it covers data retrieval, data filtering, data transformations and statistical spatial interpolations. Convenience classes are also available for related issues.
Keywords: meteorological data access filtering spatial interpolation
Author: bavay@slf.ch (Mathias Bavay)
Maintained-by: bavay@slf.ch (Mathias Bavay)
Primary-site: http://slfsmm.indefero.net p/meteoio/downloads/71/get/
1.5 M MeteoIO-2.1.2-src.tgz
2.4 M MeteoIO-2.2.0-src.tgz
Home-page: http://slfsmm.indefero.net/p/meteoio/
Platforms: Linux and other Unices, Windows, OsX
Copying-policy: GNU Lesser Public License version 3
......
......@@ -639,16 +639,17 @@ bool Date::operator!=(const Date& indate) const {
return !(*this==indate);
}
//If dates could be negative, all comparison operators would have to
//test equality between *this and indate and then run the standard operator
//on gmt_julian and indate (deleting the epsilon from the expressions).
bool Date::operator<(const Date& indate) const {
if(undef==true || indate.isUndef()) {
throw UnknownValueException("Date object is undefined!", AT);
}
//if(*this==indate) return false;
#ifdef NEGATIVE_JULIAN
if(*this==indate) return false;
return (gmt_julian < indate.gmt_julian);
#else
return (gmt_julian < (indate.gmt_julian-epsilon));
#endif
}
bool Date::operator<=(const Date& indate) const {
......@@ -656,8 +657,12 @@ bool Date::operator<=(const Date& indate) const {
throw UnknownValueException("Date object is undefined!", AT);
}
//if(*this==indate) return true;
#ifdef NEGATIVE_JULIAN
if(*this==indate) return true;
return (gmt_julian <= indate.gmt_julian);
#else
return (gmt_julian <= (indate.gmt_julian+epsilon));
#endif
}
bool Date::operator>(const Date& indate) const {
......@@ -665,8 +670,12 @@ bool Date::operator>(const Date& indate) const {
throw UnknownValueException("Date object is undefined!", AT);
}
//if(*this==indate) return false;
#ifdef NEGATIVE_JULIAN
if(*this==indate) return false;
return (gmt_julian > indate.gmt_julian);
#else
return (gmt_julian > (indate.gmt_julian+epsilon));
#endif
}
bool Date::operator>=(const Date& indate) const {
......@@ -674,8 +683,12 @@ bool Date::operator>=(const Date& indate) const {
throw UnknownValueException("Date object is undefined!", AT);
}
//if(*this==indate) return true;
#ifdef NEGATIVE_JULIAN
if(*this==indate) return true;
return (gmt_julian >= indate.gmt_julian);
#else
return (gmt_julian >= (indate.gmt_julian-epsilon));
#endif
}
const Date Date::operator+(const Date& indate) const {
......
......@@ -27,6 +27,7 @@
#include <iostream>
#include <ctime>
//#define NEGATIVE_JULIAN
namespace mio {
/**
......@@ -38,8 +39,8 @@ namespace mio {
* it can not be automatically calculated. Therefore, it has to be provided by the caller: when the dst flag
* is set, the dst time shift is automatically applied. When the dst flag ceases to be set, the dst time shift
* is no longer applied. This is very crude, but please keep in mind that using DST for monitoring data is
* usually a bad idea... Finally, we assume that dates are positive. If this would not be the case, the
* comparison operators would have to be modified (as shown in the source code).
* usually a bad idea... Finally, we assume that dates are positive. If this would not be the case, this
* class has to be recompiled with the proper define.
*
* Internally, the date is stored as true julian date in GMT.
* The maximal precision is 1 minute (that can be easily brought to 1 seconds if
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment