Commit 59f43728 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed juldate_t to JulianDate.

parent dbc6f467
......@@ -2195,7 +2195,7 @@ get_branch_times(list_t *kvl, int calendar, char *time_units)
if (numdates == 2 && kv_get_a_val(kvl, "parent_experiment_id", nullptr))
{
int parentdates[2], parentyears[2], parentmonths[2], parentdays[2], parentvdates[2], parentvtimes[2];
juldate_t parentstartdate, parentbranchdate, childstartdate;
JulianDate parentstartdate, parentbranchdate, childstartdate;
for (int i = 0; i < 2; i++)
{
parentdates[i] = atol(branch_times_p[i]);
......@@ -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] = juldate_to_seconds(juldate_sub(parentbranchdate, parentstartdate)) / 86400;
branch_time[1] = juldate_to_seconds(juldate_sub(parentbranchdate, childstartdate)) / 86400;
branch_time[0] = JulianDateo_seconds(juldate_sub(parentbranchdate, parentstartdate)) / 86400;
branch_time[1] = JulianDateo_seconds(juldate_sub(parentbranchdate, childstartdate)) / 86400;
}
else if (numdates > 0)
cdoWarning("Attribute 'parent_dates' is not formatted as expected. Specify two comma separated integers.");
......@@ -4439,12 +4439,12 @@ get_tunitsec(int tunit)
}
}
static juldate_t
get_cmor_time_val(list_t *kvl, int taxisID, juldate_t ref_date, int /*tunitsec*/, int calendar, char *frequency, int ts_id)
static JulianDate
get_cmor_time_val(list_t *kvl, int taxisID, JulianDate ref_date, int /*tunitsec*/, int calendar, char *frequency, int ts_id)
{
int year, month, day;
cdiDecodeDate(taxisInqVdate(taxisID), &year, &month, &day);
juldate_t juldate = juldate_encode(calendar, taxisInqVdate(taxisID), taxisInqVtime(taxisID));
JulianDate juldate = juldate_encode(calendar, taxisInqVdate(taxisID), taxisInqVtime(taxisID));
if (month == 0 || day == 0)
{
......@@ -4537,10 +4537,10 @@ get_cmor_time_val(list_t *kvl, int taxisID, juldate_t ref_date, int /*tunitsec*/
}
static double *
get_time_bounds(list_t *kvl, int taxisID, int ifreq, juldate_t ref_date, juldate_t jtime_val, int calendar,
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 = juldate_to_seconds(juldate_sub(jtime_val, ref_date)) / tunitsec;
double time_val = JulianDateo_seconds(juldate_sub(jtime_val, ref_date)) / tunitsec;
int vtime0b, vtime1b, vtimecorr;
int64_t vdatecorr, vdate0b, vdate1b;
int year, month, day;
......@@ -4676,11 +4676,11 @@ get_time_bounds(list_t *kvl, int taxisID, int ifreq, juldate_t ref_date, juldate
}
else if ( ifreq == 6)
{
juldate_t time_bnds1;
JulianDate time_bnds1;
int halfhourinseconds = 60*30;
time_bnds1 = juldate_add_seconds(halfhourinseconds, jtime_val);
time_bnds[1] = juldate_to_seconds(juldate_sub(time_bnds1, ref_date)) / tunitsec;
time_bnds[0] = ( juldate_to_seconds(juldate_sub(time_bnds1, ref_date)) - 3600. ) / tunitsec;
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;
return time_bnds;
}
else if ( ifreq == 8)
......@@ -4694,11 +4694,11 @@ get_time_bounds(list_t *kvl, int taxisID, int ifreq, juldate_t ref_date, juldate
taxisInqVdateBounds(taxisID, &vdate0b, &vdate1b);
taxisInqVtimeBounds(taxisID, &vtime0b, &vtime1b);
}
juldate_t juldate = juldate_encode(calendar, vdate0b, vtime0b);
time_bnds[0] = juldate_to_seconds(juldate_sub(juldate, ref_date)) / tunitsec;
JulianDate juldate = juldate_encode(calendar, vdate0b, vtime0b);
time_bnds[0] = JulianDateo_seconds(juldate_sub(juldate, ref_date)) / tunitsec;
juldate = juldate_encode(calendar, vdate1b, vtime1b);
time_bnds[1] = juldate_to_seconds(juldate_sub(juldate, ref_date)) / tunitsec;
time_bnds[1] = JulianDateo_seconds(juldate_sub(juldate, ref_date)) / tunitsec;
if (time_axis == 3) time_bnds[1] -= 1;
return time_bnds;
......@@ -4856,8 +4856,8 @@ check_append_and_size(list_t *kvl, int /*vlistID*/, char *testIn, int ifreq, int
int cdi_starttime = cdiEncodeTime(old_start_hr, old_start_min, 0);
int cdi_endtime = cdiEncodeTime(old_end_hr, old_end_min, 0);
juldate_t julostart = juldate_encode(calendar, cdi_startdate, cdi_starttime);
juldate_t juloend = juldate_encode(calendar, cdi_enddate, cdi_endtime);
JulianDate julostart = juldate_encode(calendar, cdi_startdate, cdi_starttime);
JulianDate juloend = juldate_encode(calendar, cdi_enddate, cdi_endtime);
if (Options::cdoVerbose) cdoPrint("Successfully calculated juldates.");
/* Read in first vdate in case not piped */
......@@ -4872,7 +4872,7 @@ check_append_and_size(list_t *kvl, int /*vlistID*/, char *testIn, int ifreq, int
int streamID2 = streamOpenRead(cdoGetStreamName(0));
int vlistID2 = streamInqVlist(streamID2);
int taxisID2 = vlistInqTaxis(vlistID2);
juldate_t firstdate = juldate_encode(calendar, taxisInqVdate(taxisID2), taxisInqVtime(taxisID2));
JulianDate firstdate = juldate_encode(calendar, taxisInqVdate(taxisID2), taxisInqVtime(taxisID2));
int fyear, fmonth, dummy;
cdiDecodeDate(taxisInqVdate(taxisID2), &fyear, &fmonth, &dummy);
......@@ -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 = juldate_to_seconds(juldate_sub(firstdate, juloend)) / 3600.0;
double append_distance = JulianDateo_seconds(juldate_sub(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 = juldate_to_seconds(juldate_sub(juloend, julostart));
double old_interval_sec = JulianDateo_seconds(juldate_sub(juloend, julostart));
double size_per_sec = (double) filesize / old_interval_sec;
int maxsizegb = atol(kv_get_a_val(kvl, "ms", "2"));
......@@ -5144,7 +5144,7 @@ write_variables(list_t *kvl, int *streamID, struct mapping vars[], int miptab_fr
int sdate, stime, time_unit;
get_taxis(kv_get_a_val(kvl, "rtu", nullptr), &sdate, &stime, &time_unit);
int tunitsec = get_tunitsec(time_unit);
juldate_t ref_date = juldate_encode(calendar, sdate, stime);
JulianDate ref_date = juldate_encode(calendar, sdate, stime);
char *frequency = nullptr;
if (time_axis != 4)
{
......@@ -5212,12 +5212,12 @@ write_variables(list_t *kvl, int *streamID, struct mapping vars[], int miptab_fr
{
double time_bnds[2];
double *time_bndsp;
juldate_t jtime_val;
JulianDate jtime_val;
double time_val;
if (time_axis != 4)
{
jtime_val = get_cmor_time_val(kvl, taxisID, ref_date, tunitsec, calendar, frequency, tsID);
time_val = juldate_to_seconds(juldate_sub(jtime_val, ref_date)) / tunitsec;
time_val = JulianDateo_seconds(juldate_sub(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;
......
......@@ -67,7 +67,7 @@ Deltat(void *process)
int tsID = 0;
int nrecs = cdoStreamInqTimestep(streamID1, tsID);
juldate_t juldate0 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
JulianDate juldate0 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
for (int recID = 0; recID < nrecs; ++recID)
{
......@@ -80,8 +80,8 @@ Deltat(void *process)
int tsID2 = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
juldate_t juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
double idt_in_sec = ldivdt ? 1./juldate_to_seconds(juldate_sub(juldate1, juldate0)) : 1;
JulianDate juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
double idt_in_sec = ldivdt ? 1./JulianDateo_seconds(juldate_sub(juldate1, juldate0)) : 1;
juldate0 = juldate1;
taxisCopyTimestep(taxisID2, taxisID1);
......
......@@ -461,7 +461,7 @@ EOFs(void *process)
int64_t vdate = 10101;
int vtime = 0;
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
double *out = in;
double *eig_val = nullptr;
......
......@@ -431,7 +431,7 @@ EOF3d(void *process)
int64_t vdate = 10101;
int vtime = 0;
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
for (tsID = 0; tsID < n; tsID++)
{
juldate = juldate_add_seconds(60, juldate);
......
......@@ -664,9 +664,9 @@ Expr(void *process)
if (tsID)
{
juldate_t juldate0 = juldate_encode(calendar, vdate0, vtime0);
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
jdelta = juldate_to_seconds(juldate_sub(juldate, juldate0));
JulianDate juldate0 = juldate_encode(calendar, vdate0, vtime0);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
jdelta = JulianDateo_seconds(juldate_sub(juldate, juldate0));
}
vdate0 = vdate;
......
......@@ -214,9 +214,9 @@ Filter(void *process)
cdiDecodeDate(vdate0, &year0, &month0, &day0);
cdiDecodeDate(vdate, &year, &month, &day);
juldate_t juldate0 = juldate_encode(calendar, vdate0, vtime0);
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
double jdelta = juldate_to_seconds(juldate_sub(juldate, juldate0));
JulianDate juldate0 = juldate_encode(calendar, vdate0, vtime0);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
double jdelta = JulianDateo_seconds(juldate_sub(juldate, juldate0));
if (tsID == 1)
{
......
......@@ -29,7 +29,7 @@
#include "printinfo.h"
static int
readnextpos(FILE *fp, int calendar, juldate_t *juldate, double *xpos, double *ypos)
readnextpos(FILE *fp, int calendar, JulianDate *juldate, double *xpos, double *ypos)
{
int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
......@@ -68,7 +68,7 @@ Intgridtraj(void *process)
FILE *fp = fopen(posfile, "r");
if (fp == nullptr) cdoAbort("Open failed on %s!", posfile);
juldate_t juldate;
JulianDate juldate;
readnextpos(fp, calendar, &juldate, &xpos, &ypos);
const int streamID1 = cdoStreamOpenRead(cdoStreamName(0));
......@@ -125,7 +125,7 @@ Intgridtraj(void *process)
int tsID = 0;
int nrecs = cdoStreamInqTimestep(streamID1, tsID++);
juldate_t juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
JulianDate juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
......@@ -137,11 +137,11 @@ Intgridtraj(void *process)
}
int tsIDo = 0;
while (juldate_to_seconds(juldate1) <= juldate_to_seconds(juldate))
while (JulianDateo_seconds(juldate1) <= JulianDateo_seconds(juldate))
{
nrecs = cdoStreamInqTimestep(streamID1, tsID++);
if (nrecs == 0) break;
juldate_t juldate2 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
JulianDate juldate2 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
for (int recID = 0; recID < nrecs; recID++)
{
......@@ -158,10 +158,10 @@ Intgridtraj(void *process)
if (nmiss) cdoAbort("Missing values unsupported for this operator!");
}
while (juldate_to_seconds(juldate) < juldate_to_seconds(juldate2))
while (JulianDateo_seconds(juldate) < JulianDateo_seconds(juldate2))
{
if (juldate_to_seconds(juldate) >= juldate_to_seconds(juldate1)
&& juldate_to_seconds(juldate) < juldate_to_seconds(juldate2))
if (JulianDateo_seconds(juldate) >= JulianDateo_seconds(juldate1)
&& JulianDateo_seconds(juldate) < JulianDateo_seconds(juldate2))
{
if (streamID2 == CDI_UNDEFID)
{
......@@ -175,13 +175,13 @@ Intgridtraj(void *process)
pstreamDefTimestep(streamID2, tsIDo++);
const double fac1
= juldate_to_seconds(juldate_sub(juldate2, juldate)) / juldate_to_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(juldate_sub(juldate2, juldate)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
const double fac2
= juldate_to_seconds(juldate_sub(juldate, juldate1)) / juldate_to_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(juldate_sub(juldate, juldate1)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
/*
printf(" %f %f %f %f %f\n", juldate_to_seconds(juldate),
juldate_to_seconds(juldate1),
juldate_to_seconds(juldate2),
printf(" %f %f %f %f %f\n", JulianDateo_seconds(juldate),
JulianDateo_seconds(juldate1),
JulianDateo_seconds(juldate2),
fac1, fac2);
*/
for (int recID = 0; recID < nrecs; recID++)
......
......@@ -93,7 +93,7 @@ Intntime(void *process)
int nrecs = cdoStreamInqTimestep(streamID1, tsID++);
const int64_t vdate1 = taxisInqVdate(taxisID1);
const int vtime1 = taxisInqVtime(taxisID1);
juldate_t juldate1 = juldate_encode(calendar, vdate1, vtime1);
JulianDate juldate1 = juldate_encode(calendar, vdate1, vtime1);
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsIDo++);
......@@ -113,7 +113,7 @@ Intntime(void *process)
{
int64_t vdate2 = taxisInqVdate(taxisID1);
int vtime2 = taxisInqVtime(taxisID1);
juldate_t juldate2 = juldate_encode(calendar, vdate2, vtime2);
JulianDate juldate2 = juldate_encode(calendar, vdate2, vtime2);
for (int recID = 0; recID < nrecs; recID++)
{
......@@ -130,8 +130,8 @@ Intntime(void *process)
for (int it = 1; it < numts; it++)
{
const double seconds = it * juldate_to_seconds(juldate_sub(juldate2, juldate1)) / numts;
juldate_t juldate = juldate_add_seconds(lround(seconds), juldate1);
const double seconds = it * JulianDateo_seconds(juldate_sub(juldate2, juldate1)) / numts;
JulianDate juldate = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldate, &vdate, &vtime);
......@@ -139,9 +139,9 @@ Intntime(void *process)
{
char vdatestr[32], vtimestr[32];
/*
cdoPrint("juldate1 %f", juldate_to_seconds(juldate1));
cdoPrint("juldate %f", juldate_to_seconds(juldate));
cdoPrint("juldate2 %f", juldate_to_seconds(juldate2));
cdoPrint("juldate1 %f", JulianDateo_seconds(juldate1));
cdoPrint("juldate %f", JulianDateo_seconds(juldate));
cdoPrint("juldate2 %f", JulianDateo_seconds(juldate2));
*/
date2str(vdate, vdatestr, sizeof(vdatestr));
time2str(vtime, vtimestr, sizeof(vtimestr));
......@@ -152,8 +152,8 @@ Intntime(void *process)
taxisDefVtime(taxisID2, vtime);
pstreamDefTimestep(streamID2, tsIDo++);
const double fac1 = juldate_to_seconds(juldate_sub(juldate2, juldate)) / juldate_to_seconds(juldate_sub(juldate2, juldate1));
const double fac2 = juldate_to_seconds(juldate_sub(juldate, juldate1)) / juldate_to_seconds(juldate_sub(juldate2, juldate1));
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));
for (int recID = 0; recID < nrecs; recID++)
{
......
......@@ -129,18 +129,18 @@ Inttime(void *process)
const int calendar = taxisInqCalendar(taxisID1);
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
JulianDate juldate = juldate_encode(calendar, vdate, vtime);
if (Options::cdoVerbose)
{
cdoPrint("date %ld time %d", vdate, vtime);
cdoPrint("juldate = %f", juldate_to_seconds(juldate));
cdoPrint("juldate = %f", JulianDateo_seconds(juldate));
cdoPrint("ijulinc = %lld", ijulinc);
}
int tsID = 0;
int nrecs = cdoStreamInqTimestep(streamID1, tsID++);
juldate_t juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
JulianDate juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
......@@ -153,22 +153,22 @@ Inttime(void *process)
if (Options::cdoVerbose)
{
cdoPrint("date %ld time %d", taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
cdoPrint("juldate1 = %f", juldate_to_seconds(juldate1));
cdoPrint("juldate1 = %f", JulianDateo_seconds(juldate1));
}
if (juldate_to_seconds(juldate1) > juldate_to_seconds(juldate)) cdoWarning("start time %ld %d out of range!", vdate, vtime);
if (JulianDateo_seconds(juldate1) > JulianDateo_seconds(juldate)) cdoWarning("start time %ld %d out of range!", vdate, vtime);
int tsIDo = 0;
while (juldate_to_seconds(juldate1) <= juldate_to_seconds(juldate))
while (JulianDateo_seconds(juldate1) <= JulianDateo_seconds(juldate))
{
nrecs = cdoStreamInqTimestep(streamID1, tsID++);
if (nrecs == 0) break;
juldate_t juldate2 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
JulianDate juldate2 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
if (Options::cdoVerbose)
{
cdoPrint("date %ld time %d", taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
cdoPrint("juldate2 = %f", juldate_to_seconds(juldate2));
cdoPrint("juldate2 = %f", JulianDateo_seconds(juldate2));
}
for (int recID = 0; recID < nrecs; recID++)
......@@ -185,10 +185,10 @@ Inttime(void *process)
pstreamReadRecord(streamID1, single2, &nmiss2[varID][levelID]);
}
while (juldate_to_seconds(juldate) <= juldate_to_seconds(juldate2))
while (JulianDateo_seconds(juldate) <= JulianDateo_seconds(juldate2))
{
if (juldate_to_seconds(juldate) >= juldate_to_seconds(juldate1)
&& juldate_to_seconds(juldate) <= juldate_to_seconds(juldate2))
if (JulianDateo_seconds(juldate) >= JulianDateo_seconds(juldate1)
&& JulianDateo_seconds(juldate) <= JulianDateo_seconds(juldate2))
{
juldate_decode(calendar, juldate, &vdate, &vtime);
......@@ -196,13 +196,13 @@ Inttime(void *process)
{
char vdatestr[32], vtimestr[32];
/*
cdoPrint("juldate1 %f", juldate_to_seconds(juldate1));
cdoPrint("juldate %f", juldate_to_seconds(juldate));
cdoPrint("juldate2 %f", juldate_to_seconds(juldate2));
cdoPrint("juldate1 %f", JulianDateo_seconds(juldate1));
cdoPrint("juldate %f", JulianDateo_seconds(juldate));
cdoPrint("juldate2 %f", JulianDateo_seconds(juldate2));
*/
date2str(vdate, vdatestr, sizeof(vdatestr));
time2str(vtime, vtimestr, sizeof(vtimestr));
cdoPrint("%s %s %f %d", vdatestr, vtimestr, juldate_to_seconds(juldate), calendar);
cdoPrint("%s %s %f %d", vdatestr, vtimestr, JulianDateo_seconds(juldate), calendar);
}
if (streamID2 == -1)
......@@ -216,9 +216,9 @@ Inttime(void *process)
pstreamDefTimestep(streamID2, tsIDo++);
const double fac1
= juldate_to_seconds(juldate_sub(juldate2, juldate)) / juldate_to_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(juldate_sub(juldate2, juldate)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
const double fac2
= juldate_to_seconds(juldate_sub(juldate, juldate1)) / juldate_to_seconds(juldate_sub(juldate2, juldate1));
= JulianDateo_seconds(juldate_sub(juldate, juldate1)) / JulianDateo_seconds(juldate_sub(juldate2, juldate1));
for (int recID = 0; recID < nrecs; recID++)
{
......
......@@ -147,7 +147,7 @@ shifttime(int calendar, int tunit, int64_t ijulinc, int64_t *pdate, int *ptime)
}
else
{
juldate_t juldate;
JulianDate juldate;
juldate = juldate_encode(calendar, vdate, vtime);
juldate = juldate_add_seconds(ijulinc, juldate);
juldate_decode(calendar, juldate, &vdate, &vtime);
......@@ -156,14 +156,14 @@ shifttime(int calendar, int tunit, int64_t ijulinc, int64_t *pdate, int *ptime)
*ptime = vtime;
if (Options::cdoVerbose)
cdoPrint("juldate, ijulinc, vdate, vtime: %g %lld %lld %d", juldate_to_seconds(juldate), ijulinc, vdate, vtime);
cdoPrint("juldate, ijulinc, vdate, vtime: %g %lld %lld %d", JulianDateo_seconds(juldate), ijulinc, vdate, vtime);
}
}
static void
time_gen_bounds(int calendar, int tunit, int incperiod, int64_t vdate, int vtime, int64_t *vdateb, int *vtimeb)
{
juldate_t juldate;
JulianDate juldate;
vdateb[0] = vdate;
vdateb[1] = vdate;
......@@ -245,7 +245,7 @@ Settime(void *process)
bool copy_timestep = false;
int newcalendar = CALENDAR_STANDARD;
// int nargs;
juldate_t juldate;
JulianDate juldate;
cdoInitialize(process);
......@@ -561,10 +561,10 @@ Settime(void *process)
if (Options::CMOR_Mode)
{
const juldate_t juldate1 = juldate_encode(calendar, vdateb[0], vtimeb[0]);
const juldate_t juldate2 = juldate_encode(calendar, vdateb[1], vtimeb[1]);
const double seconds = juldate_to_seconds(juldate_sub(juldate2, juldate1)) / 2;
const juldate_t juldatem = juldate_add_seconds(lround(seconds), juldate1);
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 JulianDate juldatem = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldatem, &vdate, &vtime);
}
}
......
......@@ -132,9 +132,9 @@ printBounds(int taxisID, int calendar)
time2str(vtime1, vtimestr, sizeof(vtimestr));
fprintf(stdout, " %s %s", vdatestr, vtimestr);
juldate_t juldate0 = juldate_encode(calendar, vdate0, vtime0);
juldate_t juldate1 = juldate_encode(calendar, vdate1, vtime1);
double jdelta = juldate_to_seconds(juldate_sub(juldate1, juldate0));
JulianDate juldate0 = juldate_encode(calendar, vdate0, vtime0);
JulianDate juldate1 = juldate_encode(calendar, vdate1, vtime1);
double jdelta = JulianDateo_seconds(juldate_sub(juldate1, juldate0));
int64_t incperiod = 0;
int incunit = 0;
......@@ -148,7 +148,7 @@ printBounds(int taxisID, int calendar)
static int
fill_gap(int ngaps, int ntsm[MAX_NTSM], int rangetsm[MAX_GAPS][2], int64_t vdatem[MAX_GAPS][MAX_NTSM],
int vtimem[MAX_GAPS][MAX_NTSM], int tsID, int64_t incperiod0, int incunit0, int64_t vdate, int vdate0, int vtime0,
int calendar, int day0, juldate_t juldate, juldate_t juldate0)
int calendar, int day0, JulianDate juldate, JulianDate juldate0)
{
int its = 0;
int year, month, day;
......@@ -204,7 +204,7 @@ fill_gap(int ngaps, int ntsm[MAX_NTSM], int rangetsm[MAX_GAPS][2], int64_t vdate
{
its = 0;
juldate0 = juldate_add_seconds(ijulinc, juldate0);
while (juldate_to_seconds(juldate0) < juldate_to_seconds(juldate))
while (JulianDateo_seconds(juldate0) < JulianDateo_seconds(juldate))
{
juldate_decode(calendar, juldate0, &ndate, &ntime);
juldate0 = juldate_add_seconds(ijulinc, juldate0);
......@@ -242,7 +242,7 @@ Tinfo(void *process)
int rangetsm[MAX_GAPS][2];
int64_t vdatem[MAX_GAPS][MAX_NTSM];
int vtimem[MAX_GAPS][MAX_NTSM];
juldate_t juldate, juldate0;
JulianDate juldate, juldate0;
double jdelta = 0, jdelta0 = 0;
int arrow = 0;
int i, len;
......@@ -340,7 +340,7 @@ Tinfo(void *process)
juldate0 = juldate_encode(calendar, vdate0, vtime0);
juldate = juldate_encode(calendar, vdate, vtime);
jdelta = juldate_to_seconds(juldate_sub(juldate, juldate0));
jdelta = JulianDateo_seconds(juldate_sub(juldate, juldate0));
getTimeInc(jdelta, vdate0, vdate, &incperiod, &incunit);
......
......@@ -139,18 +139,18 @@ DateTimeList::taxisInqTimestep(int taxisID, int tsID)
int64_t vdate = this->dtinfo[tsID].b[0].date;
int vtime = this->dtinfo[tsID].b[0].time;
juldate_t juldate1 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate1 = juldate_encode(calendar, vdate, vtime);
vdate = this->dtinfo[tsID].b[1].date;
vtime = this->dtinfo[tsID].b[1].time;
juldate_t juldate2 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate2 = juldate_encode(calendar, vdate, vtime);
// int hour, minute, second;
// cdiDecodeTime(vtime, &hour, &minute, &second);
if (vtime == 0 && juldate_to_seconds(juldate1) < juldate_to_seconds(juldate2))
if (vtime == 0 && JulianDateo_seconds(juldate1) < JulianDateo_seconds(juldate2))
{
juldate_t juldate = juldate_add_seconds(-1, juldate2);
JulianDate juldate = juldate_add_seconds(-1, juldate2);
juldate_decode(calendar, juldate, &vdate, &vtime);
this->dtinfo[tsID].c.date = vdate;
......@@ -195,9 +195,9 @@ DateTimeList::mean(int nsteps)
#ifdef TEST_DTLIST_MEAN
vdate = this->dtinfo[0].v.date;
vtime = this->dtinfo[0].v.time;
juldate_t juldate0 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate0 = juldate_encode(calendar, vdate, vtime);
juldate_t juldate;
JulianDate juldate;
double seconds = 0;
for (int i = 1; i < nsteps; ++i)
{
......@@ -205,7 +205,7 @@ DateTimeList::mean(int nsteps)
vtime = this->dtinfo[i].v.time;
juldate = juldate_encode(calendar, vdate, vtime);
seconds += juldate_to_seconds(juldate_sub(juldate, juldate0));
seconds += JulianDateo_seconds(juldate_sub(juldate, juldate0));
}
juldate = juldate_add_seconds(lround(seconds / nsteps), juldate0);
......@@ -213,14 +213,14 @@ DateTimeList::mean(int nsteps)
#else
vdate = this->dtinfo[nsteps / 2 - 1].v.date;
vtime = this->dtinfo[nsteps / 2 - 1].v.time;
juldate_t juldate1 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate1 = juldate_encode(calendar, vdate, vtime);
vdate = this->dtinfo[nsteps / 2].v.date;
vtime = this->dtinfo[nsteps / 2].v.time;
juldate_t juldate2 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate2 = juldate_encode(calendar, vdate, vtime);
double seconds = juldate_to_seconds(juldate_sub(juldate2, juldate1)) / 2;
juldate_t juldatem = juldate_add_seconds(lround(seconds), juldate1);
double seconds = JulianDateo_seconds(juldate_sub(juldate2, juldate1)) / 2;
JulianDate juldatem = juldate_add_seconds(lround(seconds), juldate1);
juldate_decode(calendar, juldatem, &vdate, &vtime);
#endif
}
......@@ -287,14 +287,14 @@ datetime_avg(int calendar, int ndates, CdoDateTime *datetime)
{
vdate = datetime[ndates / 2 - 1].date;
vtime = datetime[ndates / 2 - 1].time;
juldate_t juldate1 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate1 = juldate_encode(calendar, vdate, vtime);
vdate = datetime[ndates / 2].date;
vtime = datetime[ndates / 2].time;
juldate_t juldate2 = juldate_encode(calendar, vdate, vtime);
JulianDate juldate2 = juldate_encode(calendar, vdate, vtime);