Commit 24ae64ad authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added option --ignore_time_bounds to ignore time bounds for time range statistics.

parent 4edd4bb7
Pipeline #5628 passed with stages
in 14 minutes and 53 seconds
......@@ -4,6 +4,7 @@
2021-01-05 Uwe Schulzweida
* Added option --ignore_time_bounds to ignore time bounds for time range statistics
* Isosurface: Added memory support for 32-bit float data.
2020-12-17 Uwe Schulzweida
......
......@@ -267,6 +267,7 @@ cdo_usage()
fprintf(stderr,
" F<XXX>, t<RES>, tl<RES>, global_<DXY>, r<NX>x<NY>, g<NX>x<NY>, gme<NI>, lon=<LON>/lat=<LAT>\n");
fprintf(stderr, " -h, --help Help information for the operators\n");
fprintf(stderr, " --ignore_time_bounds Ignores time bounds for time range statistics\n");
fprintf(stderr, " --no_history Do not append to NetCDF \"history\" global attribute\n");
fprintf(stderr, " --netcdf_hdr_pad, --hdr_pad, --header_pad <nbr>\n");
fprintf(stderr, " Pad NetCDF output header with nbr bytes\n");
......@@ -999,6 +1000,7 @@ parseOptionsLong(int argc, char *argv[])
int leccodes;
int lenableexcept;
int lgridsearchradius;
int lignore_time_bounds;
int lnetcdf_hdr_pad;
int lno_remap_weights;
int lpercentile;
......@@ -1031,6 +1033,7 @@ parseOptionsLong(int argc, char *argv[])
{ "enableexcept" , required_argument , &lenableexcept , 1 },
{ "timestat_date" , required_argument , &ltimestat_date , 1 },
{ "no_remap_weights" , no_argument , &lno_remap_weights , 1 },
{ "ignore_time_bounds" , no_argument , &lignore_time_bounds , 1 },
{ "use_time_bounds" , no_argument , &luse_time_bounds , 1 },
{ "cmor" , no_argument , &Options::CMOR_Mode , 1 },
{ "reduce_dim" , no_argument , &Options::CDO_Reduce_Dim , 1 },
......@@ -1093,6 +1096,7 @@ parseOptionsLong(int argc, char *argv[])
lsortparam = 0;
ltimestat_date = 0;
luse_fftw = 0;
lignore_time_bounds = 0;
luse_time_bounds = 0;
int c = cdo_getopt_long(argc, argv, "f:b:e:P:g:i:k:l:m:n:t:D:z:aC:AcdhLMOpQRrsSTuVvWwXZ", opt_long, nullptr);
......@@ -1153,6 +1157,11 @@ parseOptionsLong(int argc, char *argv[])
{
setTimestatDate(CDO_optarg);
}
else if (lignore_time_bounds)
{
extern bool CDO_Ignore_Time_Bounds;
CDO_Ignore_Time_Bounds = true;
}
else if (luse_time_bounds)
{
extern bool CDO_Use_Time_Bounds;
......
......@@ -24,6 +24,7 @@
#include "util_string.h"
TimeStat CDO_Timestat_Date = TimeStat::UNDEF;
bool CDO_Ignore_Time_Bounds = false;
bool CDO_Use_Time_Bounds = false;
static bool dateTimeInit = false;
......@@ -119,16 +120,8 @@ DateTimeList::taxisInqTimestep(const int taxisID, const int tsID)
if (tsID == 0)
{
if (this->has_bounds == -1)
{
this->has_bounds = 0;
if (taxisHasBounds(taxisID)) this->has_bounds = 1;
}
if (this->calendar == -1)
{
this->calendar = taxisInqCalendar(taxisID);
}
if (this->has_bounds == -1) this->has_bounds = CDO_Ignore_Time_Bounds ? 0 : taxisHasBounds(taxisID);
if (this->calendar == -1) this->calendar = taxisInqCalendar(taxisID);
}
if (this->has_bounds)
......
......@@ -86,19 +86,10 @@ DateTimeList
{
public:
DateTimeList() { init(); }
void
setStat(const TimeStat _stat)
{
this->stat = _stat;
}
void
setCalendar(const int _calendar)
{
this->calendar = _calendar;
}
// clang-format off
void setStat(const TimeStat _stat) { this->stat = _stat; }
void setCalendar(const int _calendar) { this->calendar = _calendar; }
// clang-format on
int64_t getVdate(int tsID);
int getVtime(int tsID);
void shift();
......
Markdown is supported
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