Commit 1f7ef2f4 authored by Fabian Wachsmann's avatar Fabian Wachsmann
Browse files

Solved remaining merge problems

parent 38e94139
......@@ -1443,7 +1443,7 @@ get_txtatt(int vlistID, int varID, const char *key)
}
static void
get_all_atts(list_t *kvl, int vlistID, const char **infileAttSpecLong, const char **infileAttSpecShort, char *project_id)
get_all_atts(list_t *kvl, int vlistID, const char **infileAttSpecLong, const char **infileAttSpecShort)
{
int natts, type = 0, len = 0;
cdiInqNatts(vlistID, CDI_GLOBAL, &natts);
......@@ -1481,7 +1481,7 @@ add_globalhybrids(list_t *kvl, int vlistID)
const char *infileAttSpecShort[] = { "pd", "ci", "di", nullptr };
int i = 0;
if (strcmp(kv_get_a_val(kvl, "kaa", "n"), "y") == 0 || strcmp(kv_get_a_val(kvl, "keep_all_attributes", "n"), "y") == 0)
get_all_atts(kvl, vlistID, infileAttSpecLong, infileAttSpecShort, project_id);
get_all_atts(kvl, vlistID, infileAttSpecLong, infileAttSpecShort);
else
{
while (infileAttSpecLong[i] != nullptr)
......@@ -3745,7 +3745,7 @@ register_lon_axis(int gridID, int xlength, int *axis_ids)
int xnbounds = gridInqXbounds(gridID, xcell_bounds.data());
check_and_gen_bounds(gridID, xnbounds, xlength, xcoord_vals.data(), xcell_bounds.data(), 1);
int cmf = cmor_axis(new_axis_id(axis_ids), (char *) "longitude", (char *) "degrees_east", xlength,
(void *) xcoord_vals, 'd', (void *) xcell_bounds.data(), 2, nullptr);
(void *) xcoord_vals.data(), 'd', (void *) xcell_bounds.data(), 2, nullptr);
if (cmf != 0) cdoAbort("ERROR (infile: '%s')! Function cmor_axis failed!", cdoGetStreamName(0));
}
}
......@@ -4707,60 +4707,60 @@ get_cmor_time_val(list_t *kvl, int taxisID, JulianDate ref_date, int /*tunitsec*
{
long int vdate;
int vtime;
juldate_decode(calendar, juldate, &vdate, &vtime);
julianDateDecode(calendar, juldate, &vdate, &vtime);
cdiDecodeTime(vtime, &hour, &min, &sec);
if (strcmp(frequency, "6hr") == 0)
{
int iv[]= {0,6,12,18,24};
size_t ivsize = sizeof(iv)/sizeof(iv[0]);
int minid = 0;
double diff = juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(0, 0, 0))));
double diff = julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(0, 0, 0))));
for ( size_t loopid = 1; loopid < ivsize; loopid++ )
{
if ( std::fabs(juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
if ( std::fabs(julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
{
minid = loopid;
diff = std::fabs(juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(iv[minid], 0, 0)))));
diff = std::fabs(julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(iv[minid], 0, 0)))));
}
}
juldate = juldate_encode(calendar, taxisInqVdate(taxisID), cdiEncodeTime(iv[minid], 0, 0));
juldate = julianDateEncode(calendar, taxisInqVdate(taxisID), cdiEncodeTime(iv[minid], 0, 0));
}
else if (strcmp(frequency, "3hr") == 0)
{
int iv[]= {0,3,6,9,12,15,18,21,24};
size_t ivsize = sizeof(iv)/sizeof(iv[0]);
int minid = 0;
double diff = juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(0, 0, 0))));
double diff = julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(0, 0, 0))));
for ( size_t loopid = 1; loopid < ivsize; loopid++ )
{
if ( std::fabs(juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
if ( std::fabs(julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
{
minid = loopid;
diff = std::fabs(juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(iv[minid], 0, 0)))));
diff = std::fabs(julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(iv[minid], 0, 0)))));
}
}
juldate = juldate_encode(calendar, taxisInqVdate(taxisID), cdiEncodeTime(iv[minid], 0, 0));
juldate = julianDateEncode(calendar, taxisInqVdate(taxisID), cdiEncodeTime(iv[minid], 0, 0));
}
else if (strcmp(frequency, "1hr") == 0)
{
size_t ivsize = 25;
int minid = 0;
double diff = juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(0, 0, 0))));
double diff = julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(0, 0, 0))));
for ( size_t loopid = 1; loopid < ivsize; loopid++ )
{
if ( std::fabs(juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(loopid, 0, 0))))) < diff )
if ( std::fabs(julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(loopid, 0, 0))))) < diff )
{
minid = loopid;
diff = std::fabs(juldate_to_seconds(juldate_sub(juldate, juldate_encode(calendar, vdate, cdiEncodeTime(minid, 0, 0)))));
diff = std::fabs(julianDateToSeconds(julianDateSub(juldate, julianDateEncode(calendar, vdate, cdiEncodeTime(minid, 0, 0)))));
}
}
juldate = juldate_encode(calendar, vdate, cdiEncodeTime(minid, 0, 0));
juldate = julianDateEncode(calendar, vdate, cdiEncodeTime(minid, 0, 0));
}
}
return juldate;
......@@ -4899,13 +4899,13 @@ get_time_bounds(list_t *kvl, int taxisID, int ifreq, JulianDate ref_date, Julian
int iv[]= {0,6,12,18,24};
size_t ivsize = sizeof(iv)/sizeof(iv[0]);
int minid = 0, newhour[2];
double diff = juldate_to_seconds(juldate_sub(jtime_val, juldate_encode(calendar, vdatecorr, cdiEncodeTime(0, 0, 0))));
double diff = julianDateToSeconds(julianDateSub(jtime_val, julianDateEncode(calendar, vdatecorr, cdiEncodeTime(0, 0, 0))));
for ( size_t loopid = 1; loopid < ivsize; loopid++ )
{
if ( std::fabs(juldate_to_seconds(juldate_sub(jtime_val, juldate_encode(calendar, vdatecorr, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
if ( std::fabs(julianDateToSeconds(julianDateSub(jtime_val, julianDateEncode(calendar, vdatecorr, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
{
minid = loopid;
diff = std::fabs(juldate_to_seconds(juldate_sub(jtime_val, juldate_encode(calendar, vdatecorr, cdiEncodeTime(iv[minid], 0, 0)))));
diff = std::fabs(julianDateToSeconds(julianDateSub(jtime_val, julianDateEncode(calendar, vdatecorr, cdiEncodeTime(iv[minid], 0, 0)))));
}
}
newhour[0] = ( hour-iv[minid] < 0 ) ? iv[minid-1] : iv[minid];
......@@ -4923,13 +4923,13 @@ get_time_bounds(list_t *kvl, int taxisID, int ifreq, JulianDate ref_date, Julian
int iv[]= {0,3,6,9,12,15,18,21,24};
size_t ivsize = sizeof(iv)/sizeof(iv[0]);
int minid = 0, newhour[2];
double diff = juldate_to_seconds(juldate_sub(jtime_val, juldate_encode(calendar, vdatecorr, cdiEncodeTime(0, 0, 0))));
double diff = julianDateToSeconds(julianDateSub(jtime_val, julianDateEncode(calendar, vdatecorr, cdiEncodeTime(0, 0, 0))));
for ( size_t loopid = 1; loopid < ivsize; loopid++ )
{
if ( std::fabs(juldate_to_seconds(juldate_sub(jtime_val, juldate_encode(calendar, vdatecorr, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
if ( std::fabs(julianDateToSeconds(julianDateSub(jtime_val, julianDateEncode(calendar, vdatecorr, cdiEncodeTime(iv[loopid], 0, 0))))) < diff )
{
minid = loopid;
diff = std::fabs(juldate_to_seconds(juldate_sub(jtime_val, juldate_encode(calendar, vdatecorr, cdiEncodeTime(iv[minid], 0, 0)))));
diff = std::fabs(julianDateToSeconds(julianDateSub(jtime_val, julianDateEncode(calendar, vdatecorr, cdiEncodeTime(iv[minid], 0, 0)))));
}
}
newhour[0] = ( hour-iv[minid] < 0 ) ? iv[minid-1] : iv[minid];
......@@ -5907,7 +5907,7 @@ read_maptab(list_t *kvl, int streamID, char *miptabfreq, struct mapping vars[])
keyValues_t *kvn = kvlist_search(kvl, "n");
keyValues_t *kvc = kvlist_search(kvl, "c");
keyValues_t *kvcn = kvlist_search(kvl, "cn");
int filetype = pstreamInqFiletype(cdoStreamOpenRead(cdoStreamName(0)));
int filetype = cdoInqFiletype(streamID);
if (maptab && maptabdir)
if (maptab[0] != '/')
......
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