Commit 6e8603ee authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed juldate_sub() to julianDateSub().

parent 66aac200
......@@ -2217,8 +2217,8 @@ get_branch_times(list_t *kvl, int calendar, char *time_units)
childstartdate = juldate_encode(calendar, childsdate, childstime);
/* If time unit is always "days since.." */
branch_time[0] = JulianDateo_seconds(juldate_sub(parentbranchdate, parentstartdate)) / 86400;
branch_time[1] = JulianDateo_seconds(juldate_sub(parentbranchdate, childstartdate)) / 86400;
branch_time[0] = JulianDateo_seconds(julianDateSub(parentbranchdate, parentstartdate)) / 86400;
branch_time[1] = JulianDateo_seconds(julianDateSub(parentbranchdate, childstartdate)) / 86400;
}
else if (numdates > 0)
cdoWarning("Attribute 'parent_dates' is not formatted as expected. Specify two comma separated integers.");
......@@ -4540,7 +4540,7 @@ static double *
get_time_bounds(list_t *kvl, int taxisID, int ifreq, JulianDate ref_date, JulianDate jtime_val, int calendar,
int tunitsec, double *time_bnds, int time_axis, int /*vlistID*/)
{
double time_val = JulianDateo_seconds(juldate_sub(jtime_val, ref_date)) / tunitsec;
double time_val = JulianDateo_seconds(julianDateSub(jtime_val, ref_date)) / tunitsec;
int vtime0b, vtime1b, vtimecorr;
int64_t vdatecorr, vdate0b, vdate1b;
int year, month, day;
......@@ -4679,8 +4679,8 @@ get_time_bounds(list_t *kvl, int taxisID, int ifreq, JulianDate ref_date, Julian
JulianDate time_bnds1;
int halfhourinseconds = 60*30;
time_bnds1 = juldate_add_seconds(halfhourinseconds, jtime_val);
time_bnds[1] = JulianDateo_seconds(juldate_sub(time_bnds1, ref_date)) / tunitsec;
time_bnds[0] = ( JulianDateo_seconds(juldate_sub(time_bnds1, ref_date)) - 3600. ) / tunitsec;
time_bnds[1] = JulianDateo_seconds(julianDateSub(time_bnds1, ref_date)) / tunitsec;
time_bnds[0] = ( JulianDateo_seconds(julianDateSub(time_bnds1, ref_date)) - 3600. ) / tunitsec;
return time_bnds;
}
else if ( ifreq == 8)
......@@ -4695,10 +4695,10 @@ get_time_bounds(list_t *kvl, int taxisID, int ifreq, JulianDate ref_date, Julian
taxisInqVtimeBounds(taxisID, &vtime0b, &vtime1b);
}
JulianDate juldate = juldate_encode(calendar, vdate0b, vtime0b);
time_bnds[0] = JulianDateo_seconds(juldate_sub(juldate, ref_date)) / tunitsec;
time_bnds[0] = JulianDateo_seconds(julianDateSub(juldate, ref_date)) / tunitsec;
juldate = juldate_encode(calendar, vdate1b, vtime1b);
time_bnds[1] = JulianDateo_seconds(juldate_sub(juldate, ref_date)) / tunitsec;
time_bnds[1] = JulianDateo_seconds(julianDateSub(juldate, ref_date)) / tunitsec;
if (time_axis == 3) time_bnds[1] -= 1;
return time_bnds;
......@@ -4885,7 +4885,7 @@ check_append_and_size(list_t *kvl, int /*vlistID*/, char *testIn, int ifreq, int
}
/* Check temporal distance between last chunk date and first file date */
double append_distance = JulianDateo_seconds(juldate_sub(firstdate, juloend)) / 3600.0;
double append_distance = JulianDateo_seconds(julianDateSub(firstdate, juloend)) / 3600.0;
if ( (ifreq == 6 && (append_distance > 2.0 || append_distance < 0))
|| (ifreq == 5 && (append_distance > 6.0 || append_distance < 0))
|| (ifreq == 4 && (append_distance > 12.0 || append_distance < 0))
......@@ -4921,7 +4921,7 @@ check_append_and_size(list_t *kvl, int /*vlistID*/, char *testIn, int ifreq, int
if (Options::cdoVerbose) cdoPrint("Successfully checked temporal gap.");
/* Check file size */
if (Options::cdoVerbose) cdoPrint("Start to check file size of chunk + working file.");
double old_interval_sec = JulianDateo_seconds(juldate_sub(juloend, julostart));
double old_interval_sec = JulianDateo_seconds(julianDateSub(juloend, julostart));
double size_per_sec = (double) filesize / old_interval_sec;
int maxsizegb = atol(kv_get_a_val(kvl, "ms", "2"));
......@@ -5217,7 +5217,7 @@ write_variables(list_t *kvl, int *streamID, struct mapping vars[], int miptab_fr
if (time_axis != 4)
{
jtime_val = get_cmor_time_val(kvl, taxisID, ref_date, tunitsec, calendar, frequency, tsID);
time_val = JulianDateo_seconds(juldate_sub(jtime_val, ref_date)) / tunitsec;
time_val = JulianDateo_seconds(julianDateSub(jtime_val, ref_date)) / tunitsec;
time_bndsp = (time_axis != 1) ? get_time_bounds(kvl, taxisID, ifreq, ref_date, jtime_val, calendar,
tunitsec, time_bnds, time_axis, vlistID)
: 0;
......
......@@ -81,7 +81,7 @@ Deltat(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
const JulianDate juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
const double idt_in_sec = ldivdt ? 1./JulianDateo_seconds(juldate_sub(juldate1, juldate0)) : 1;
const double idt_in_sec = ldivdt ? 1./JulianDateo_seconds(julianDateSub(juldate1, juldate0)) : 1;
juldate0 = juldate1;
taxisCopyTimestep(taxisID2, taxisID1);
......
......@@ -666,7 +666,7 @@ Expr(void *process)
{
JulianDate juldate0 = juldate_encode(calendar, vdate0, vtime0);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
jdelta = JulianDateo_seconds(juldate_sub(juldate, juldate0));
jdelta = JulianDateo_seconds(julianDateSub(juldate, juldate0));
}
vdate0 = vdate;
......
......@@ -216,7 +216,7 @@ Filter(void *process)
JulianDate juldate0 = juldate_encode(calendar, vdate0, vtime0);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
double jdelta = JulianDateo_seconds(juldate_sub(juldate, juldate0));
double jdelta = JulianDateo_seconds(julianDateSub(juldate, juldate0));
if (tsID == 1)
{
......
......@@ -175,9 +175,9 @@ Intgridtraj(void *process)
pstreamDefTimestep(streamID2, tsIDo++);
const double fac1
= JulianDateo_seconds(juldate_sub(juldate2, juldate)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(julianDateSub(juldate2, juldate)) / JulianDateo_seconds(julianDateSub(juldate2, juldate1));
const double fac2
= JulianDateo_seconds(juldate_sub(juldate, juldate1)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(julianDateSub(juldate, juldate1)) / JulianDateo_seconds(julianDateSub(juldate2, juldate1));
/*
printf(" %f %f %f %f %f\n", JulianDateo_seconds(juldate),
JulianDateo_seconds(juldate1),
......
......@@ -130,7 +130,7 @@ Intntime(void *process)
for (int it = 1; it < numts; it++)
{
const double seconds = it * JulianDateo_seconds(juldate_sub(juldate2, juldate1)) / numts;
const double seconds = it * JulianDateo_seconds(julianDateSub(juldate2, juldate1)) / numts;
JulianDate juldate = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldate, &vdate, &vtime);
......@@ -152,8 +152,8 @@ Intntime(void *process)
taxisDefVtime(taxisID2, vtime);
pstreamDefTimestep(streamID2, tsIDo++);
const double fac1 = JulianDateo_seconds(juldate_sub(juldate2, juldate)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
const double fac2 = JulianDateo_seconds(juldate_sub(juldate, juldate1)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
const double fac1 = JulianDateo_seconds(julianDateSub(juldate2, juldate)) / JulianDateo_seconds(julianDateSub(juldate2, juldate1));
const double fac2 = JulianDateo_seconds(julianDateSub(juldate, juldate1)) / JulianDateo_seconds(julianDateSub(juldate2, juldate1));
for (int recID = 0; recID < nrecs; recID++)
{
......
......@@ -216,9 +216,9 @@ Inttime(void *process)
pstreamDefTimestep(streamID2, tsIDo++);
const double fac1
= JulianDateo_seconds(juldate_sub(juldate2, juldate)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(julianDateSub(juldate2, juldate)) / JulianDateo_seconds(julianDateSub(juldate2, juldate1));
const double fac2
= JulianDateo_seconds(juldate_sub(juldate, juldate1)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(julianDateSub(juldate, juldate1)) / JulianDateo_seconds(julianDateSub(juldate2, juldate1));
for (int recID = 0; recID < nrecs; recID++)
{
......
......@@ -563,7 +563,7 @@ Settime(void *process)
{
const JulianDate juldate1 = juldate_encode(calendar, vdateb[0], vtimeb[0]);
const JulianDate juldate2 = juldate_encode(calendar, vdateb[1], vtimeb[1]);
const double seconds = JulianDateo_seconds(juldate_sub(juldate2, juldate1)) / 2;
const double seconds = JulianDateo_seconds(julianDateSub(juldate2, juldate1)) / 2;
const JulianDate juldatem = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldatem, &vdate, &vtime);
}
......
......@@ -134,7 +134,7 @@ printBounds(int taxisID, int calendar)
JulianDate juldate0 = juldate_encode(calendar, vdate0, vtime0);
JulianDate juldate1 = juldate_encode(calendar, vdate1, vtime1);
double jdelta = JulianDateo_seconds(juldate_sub(juldate1, juldate0));
double jdelta = JulianDateo_seconds(julianDateSub(juldate1, juldate0));
int64_t incperiod = 0;
int incunit = 0;
......@@ -340,7 +340,7 @@ Tinfo(void *process)
juldate0 = juldate_encode(calendar, vdate0, vtime0);
juldate = juldate_encode(calendar, vdate, vtime);
jdelta = JulianDateo_seconds(juldate_sub(juldate, juldate0));
jdelta = JulianDateo_seconds(julianDateSub(juldate, juldate0));
getTimeInc(jdelta, vdate0, vdate, &incperiod, &incunit);
......
......@@ -205,7 +205,7 @@ DateTimeList::mean(int nsteps)
vtime = this->dtinfo[i].v.time;
juldate = juldate_encode(calendar, vdate, vtime);
seconds += JulianDateo_seconds(juldate_sub(juldate, juldate0));
seconds += JulianDateo_seconds(julianDateSub(juldate, juldate0));
}
juldate = juldate_add_seconds(lround(seconds / nsteps), juldate0);
......@@ -219,7 +219,7 @@ DateTimeList::mean(int nsteps)
vtime = this->dtinfo[nsteps / 2].v.time;
JulianDate juldate2 = juldate_encode(calendar, vdate, vtime);
double seconds = JulianDateo_seconds(juldate_sub(juldate2, juldate1)) / 2;
double seconds = JulianDateo_seconds(julianDateSub(juldate2, juldate1)) / 2;
JulianDate juldatem = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldatem, &vdate, &vtime);
#endif
......@@ -293,7 +293,7 @@ datetime_avg(int calendar, int ndates, CdoDateTime *datetime)
vtime = datetime[ndates / 2].time;
JulianDate juldate2 = juldate_encode(calendar, vdate, vtime);
double seconds = JulianDateo_seconds(juldate_sub(juldate2, juldate1)) / 2;
double seconds = JulianDateo_seconds(julianDateSub(juldate2, juldate1)) / 2;
JulianDate juldatem = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldatem, &vdate, &vtime);
}
......
......@@ -102,7 +102,7 @@ private:
JulianDate juldate_encode(int calendar, int64_t date, int time);
void juldate_decode(int calendar, JulianDate juldate, int64_t *date, int *time);
JulianDate juldate_sub(const JulianDate &juldate2, const JulianDate &juldate1);
JulianDate julianDateSub(const JulianDate &juldate2, const JulianDate &juldate1);
JulianDate juldate_add_seconds(int64_t seconds, JulianDate juldate);
double JulianDateo_seconds(JulianDate juldate);
......
......@@ -44,7 +44,7 @@ juldate_decode(int calendar, JulianDate juldate, int64_t *date, int *time)
}
JulianDate
juldate_sub(const JulianDate &juldate2, const JulianDate &juldate1)
julianDateSub(const JulianDate &juldate2, const JulianDate &juldate1)
{
JulianDate juldate;
......
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