Commit 04be33f7 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

Merge branch 'develop' of git.mpimet.mpg.de:cdo into develop

parents 2d2143d5 3f6a9991
2017-08-14 Uwe Schulzweida
* eof, eof3d: set default of env. CDO_WEIGHT_MODE to off
* eof3d: preserve variable name on first output file [report: Frank Kauker]
* eof3d, eofcoeff3d: preserve variable name on output files [report: Frank Kauker]
2017-08-12 Uwe Schulzweida
......
......@@ -4,7 +4,7 @@ CDO NEWS
Version 1.9.1 (27 September 2017):
Changes operators:
* eof, eof3d: set default of environment variable CDO_WEIGHT_MODE to off
* eof, eof3d: set default value of environment variable CDO_WEIGHT_MODE to off
Fixed bugs:
* eof3d: weight array was allocated for only one level (bug fix)
......
......@@ -105,12 +105,12 @@ case "${HOSTNAME}" in
if test "$COMP" = intel ; then
${CONFPATH}configure --prefix=$HOME/local --disable-openmp \
$CDOLIBS \
$CDOLIBS LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib" \
CXX=icpc CXXFLAGS="-g -Wall -O2 -qopt-report=5 -march=native" \
CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native"
elif test "$COMP" = clang ; then
${CONFPATH}configure \
$CDOLIBS \
$CDOLIBS LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib" \
CXX=clang++ CXXFLAGS="-g -Wall -pedantic -O3" \
CC=clang CFLAGS="-g -Wall -pedantic -O3"
elif test "$COMP" = clang4 ; then
......@@ -120,7 +120,7 @@ case "${HOSTNAME}" in
CC=clang-mp-4.0 CFLAGS="-g -Wall -pedantic -O3"
elif test "$COMP" = pgi ; then
${CONFPATH}configure --disable-openmp \
$CDOLIBS \
$CDOLIBS LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib" \
CXX=pgc++ CXXFLAGS="-g -fast" \
CC=pgcc CFLAGS="-g -fast"
else
......
......@@ -176,9 +176,6 @@ void *EOFs(void * argument)
int timer_cov = 0, timer_eig = 0;
int calendar = CALENDAR_STANDARD;
juldate_t juldate;
double missval = 0;
typedef struct {
bool init;
......@@ -320,9 +317,7 @@ void *EOFs(void * argument)
for ( varID = 0; varID < nvars; ++varID )
{
gridsize = vlistGridsizeMax(vlistID1);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
missval = vlistInqVarMissval(vlistID1, varID);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
eofdata[varID] = (eofdata_t *) Malloc(nlevs*sizeof(eofdata_t));
......@@ -360,8 +355,8 @@ void *EOFs(void * argument)
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, in, &nmiss);
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
missval = vlistInqVarMissval(vlistID1, varID);
size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
double missval = vlistInqVarMissval(vlistID1, varID);
if ( npack == ULONG_MAX )
{
npack = 0;
......@@ -471,7 +466,7 @@ void *EOFs(void * argument)
int vdate = 10101;
int vtime = 0;
juldate = juldate_encode(calendar, vdate, vtime);
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
double *out = in;
double *eig_val = NULL;
......@@ -499,8 +494,9 @@ void *EOFs(void * argument)
{
char vname[256];
vlistInqVarName(vlistID1, varID, vname);
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
double missval = vlistInqVarMissval(vlistID1, varID);
for ( levelID = 0; levelID < nlevs; levelID++ )
{
......@@ -619,8 +615,8 @@ void *EOFs(void * argument)
pstreamWriteRecord(streamID3, out, nmiss);
} // loop n_eig
nmiss = 0;
if ( DBL_IS_EQUAL(eig_val[tsID], missval) ) nmiss = 1;
nmiss = (DBL_IS_EQUAL(eig_val[tsID], missval)) ? 1 : 0;
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, &eig_val[tsID], nmiss);
} // loop nlevs
......
......@@ -52,17 +52,14 @@ void *EOF3d(void * argument)
size_t temp_size = 0, npack = 0;
int varID, levelID;
int missval_warning = 0;
bool missval_warning = false;
int nmiss, ngrids;
int n = 0;
size_t nlevs = 0;
size_t offset;
int timer_cov = 0, timer_eig = 0;
int calendar = CALENDAR_STANDARD;
juldate_t juldate;
double missval = 0;
double sum_w;
double **cov = NULL; /* TODO: covariance matrix / eigenvectors after solving */
double *eigv;
......@@ -146,10 +143,10 @@ void *EOF3d(void * argument)
size_t maxlevs = 0;
for ( varID = 0; varID < nvars; ++varID )
{
size_t gridsize = vlistGridsizeMax(vlistID1);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
temp_size = gridsize * nlevs;
missval = vlistInqVarMissval(vlistID1, varID);
size_t gridsize = vlistGridsizeMax(vlistID1);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
temp_size = gridsize * nlevs;
double missval = vlistInqVarMissval(vlistID1, varID);
if ( nlevs > maxlevs ) maxlevs = nlevs;
......@@ -217,11 +214,11 @@ void *EOF3d(void * argument)
pstreamInqRecord(streamID1, &varID, &levelID);
size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
double missval = vlistInqVarMissval(vlistID1, varID);
missval = vlistInqVarMissval(vlistID1, varID);
pstreamReadRecord(streamID1, in, &nmiss);
offset = gridsize * levelID;
size_t offset = gridsize * levelID;
for ( size_t i = 0; i < gridsize; ++i )
{
if ( ! DBL_IS_EQUAL(in[i], missval ) )
......@@ -231,11 +228,12 @@ void *EOF3d(void * argument)
}
else
{
if ( missval_warning == 0 )
if ( datacounts[varID][offset + i] != 0 ) cdoAbort("Missing values unsupported!");
if ( missval_warning == false )
{
cdoWarning("Missing Value Support not checked for this Operator!");
cdoWarning("Does not work with changing locations of missing values in time.");
missval_warning = 1;
// cdoWarning("Missing Value Support not checked for this Operator!");
// cdoWarning("Does not work with changing locations of missing values in time.");
missval_warning = true;
}
datafields[varID][tsID][i+offset] = 0;
}
......@@ -254,6 +252,7 @@ void *EOF3d(void * argument)
size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
temp_size = gridsize * nlevs;
double missval = vlistInqVarMissval(vlistID1, varID);
if ( cdoVerbose )
{
......@@ -287,7 +286,7 @@ void *EOF3d(void * argument)
{
char vname[64];
vlistInqVarName(vlistID1,varID,&vname[0]);
cdoWarning("Refusing to calculate EOF from a single time step for var%i (%s)",varID,&vname[0]);
cdoWarning("Refusing to calculate EOF from a single time step for var%i (%s)", varID+1, &vname[0]);
continue;
}
......@@ -441,7 +440,7 @@ void *EOF3d(void * argument)
int vdate = 10101;
int vtime = 0;
juldate = juldate_encode(calendar, vdate, vtime);
juldate_t juldate = juldate_encode(calendar, vdate, vtime);
for ( tsID = 0; tsID < n; tsID++ )
{
juldate = juldate_add_seconds(60, juldate);
......@@ -460,10 +459,11 @@ void *EOF3d(void * argument)
for ( varID = 0; varID < nvars; varID++ )
{
double missval = vlistInqVarMissval(vlistID1, varID);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for ( levelID = 0; levelID < (int)nlevs; levelID++ )
{
offset = levelID * gridsizemax;
size_t offset = levelID * gridsizemax;
if ( tsID < n_eig )
{
nmiss = 0;
......@@ -474,8 +474,9 @@ void *EOF3d(void * argument)
pstreamWriteRecord(streamID3, &eigenvectors[varID][tsID][offset], nmiss);
}
}
if ( DBL_IS_EQUAL(eigenvalues[varID][tsID][0], missval) ) nmiss = 1;
else nmiss = 0;
nmiss = (DBL_IS_EQUAL(eigenvalues[varID][tsID][0], missval)) ? 1 : 0;
pstreamDefRecord(streamID2, varID, 0);
pstreamWriteRecord(streamID2, eigenvalues[varID][tsID],nmiss);
} // for ( varID = 0; ... )
......
......@@ -101,6 +101,7 @@ void *Eofcoeff(void * argument)
eof[varID][levelID][eofID].missval= missval1;
eof[varID][levelID][eofID].ptr = (double*) Malloc(gridsize*sizeof(double));
memset(&eof[varID][levelID][eofID].ptr[0], missval1, gridsize*sizeof(double));
if ( varID >= nvars )
cdoAbort("Internal error - too high varID");
if ( levelID >= nlevs )
......@@ -111,6 +112,7 @@ void *Eofcoeff(void * argument)
}
eofID++;
}
int neof = eofID;
if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0)->args, neof);
......@@ -118,17 +120,14 @@ void *Eofcoeff(void * argument)
int gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
gridDefYsize(gridID3, 1);
double *xvals = (double*) Malloc(1*sizeof(double));
double *yvals = (double*) Malloc(1*sizeof(double));
xvals[0]=0;
yvals[0]=0;
gridDefXvals(gridID3, xvals);
gridDefYvals(gridID3, yvals);
double xvals = 0;
double yvals = 0;
gridDefXvals(gridID3, &xvals);
gridDefYvals(gridID3, &yvals);
// Create var-list and time-axis for output
int ngrids = vlistNgrids(vlistID3);
for ( i = 0; i < ngrids; i++ )
vlistChangeGridIndex(vlistID3, i, gridID3);
......@@ -141,7 +140,7 @@ void *Eofcoeff(void * argument)
for ( eofID = 0; eofID < neof; eofID++)
{
oname[nchars] = '\0';
for(varID=0; varID<nvars; varID++)
sprintf(eof_name, "%5.5i", eofID);
strcat(oname, eof_name);
if ( filesuffix[0] )
......
......@@ -32,7 +32,7 @@
void *Eofcoeff3d(void * argument)
{
char eof_name[6], oname[1024], filesuffix[32];
char eof_name[8], oname[1024], filesuffix[32];
double missval1 = -999, missval2 = -999;
field_type in;
int i, varID, levelID;
......@@ -62,7 +62,7 @@ void *Eofcoeff3d(void * argument)
cdoAbort("Gridsize of input files does not match!");
if ( vlistNgrids(vlistID2) > 1 || vlistNgrids(vlistID1) > 1 )
cdoAbort("Too many grids in input");
cdoAbort("Too many different grids in input");
int nvars = vlistNvars(vlistID1)==vlistNvars(vlistID2) ? vlistNvars(vlistID1) : -1;
int nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, 0));
......@@ -110,6 +110,7 @@ void *Eofcoeff3d(void * argument)
}
eofID++;
}
int neof = eofID;
if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0)->args, neof);
......@@ -117,25 +118,32 @@ void *Eofcoeff3d(void * argument)
int gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
gridDefYsize(gridID3, 1);
double *xvals= (double*) Malloc(1*sizeof(double));
double *yvals= (double*) Malloc(1*sizeof(double));
xvals[0]=0;
yvals[0]=0;
gridDefXvals(gridID3, xvals);
gridDefYvals(gridID3, yvals);
double xvals = 0;
double yvals = 0;
gridDefXvals(gridID3, &xvals);
gridDefYvals(gridID3, &yvals);
double *zvals = (double *) Malloc( 1* sizeof(double ));
zvals[0] = 0.;
double zvals = 0.;
int zaxisID3 = zaxisCreate(ZAXIS_GENERIC,1);
zaxisDefLevels(zaxisID3,zvals);
zaxisDefLevels(zaxisID3, &zvals);
zaxisDefName(zaxisID3,"zaxis_Reduced");
zaxisDefLongname(zaxisID3,"Reduced zaxis from EOF3D - only one coefficient per 3D eigenvector and time step");
int vlistID3 = vlistCreate();
// Create var-list and time-axis for output
int vlistID3 = vlistDuplicate(vlistID2);
int ngrids = vlistNgrids(vlistID3);
for ( i = 0; i < ngrids; i++ )
vlistChangeGridIndex(vlistID3, i, gridID3);
int nzaxis = vlistNzaxis(vlistID3);
for ( i = 0; i < nzaxis; i++ )
vlistChangeZaxisIndex(vlistID3, i, zaxisID3);
vlistDefTaxis(vlistID3,taxisID3);
int *varID3 = (int*) Malloc(nvars * sizeof(int));
for ( varID=0; varID<nvars; varID++ )
varID3[varID] = vlistDefVar(vlistID3, gridID3, zaxisID3, TSTEP_INSTANT);
for (varID =0; varID<nvars; varID++)
vlistDefVarTsteptype(vlistID3, varID, TSTEP_INSTANT);
// open streams for eofcoeff output
int *streamIDs = (int*) Malloc(neof*sizeof(int));
......@@ -157,7 +165,7 @@ void *Eofcoeff3d(void * argument)
pstreamDefVlist(streamIDs[eofID], vlistID3);
}
// ALLOCATE temporary fields for data read and write
in.ptr = (double*) Malloc(gridsize*sizeof(double));
in.grid = gridID1;
......@@ -210,11 +218,12 @@ void *Eofcoeff3d(void * argument)
else
nmiss += 1;
}
/*
if ( nmiss ) {
out[varID][eofID].nmiss=1;
out[varID][eofID].ptr[0]=missval2;
}
*/
}
if ( varID >= nvars )
......
......@@ -505,7 +505,7 @@ void *Expr(void *argument)
pstreamDefTimestep(streamID2, tsID);
for ( int varID = 0; varID < nvars1; varID++ )
if ( tsID == 0 || params[varID].steptype != TIME_CONSTANT )
if ( tsID == 0 || params[varID].steptype != TSTEP_CONSTANT )
params[varID].nmiss = 0;
for ( int recID = 0; recID < nrecs; recID++ )
......@@ -540,7 +540,7 @@ void *Expr(void *argument)
{
int pidx = varIDmap[varID];
if ( tsID > 0 && params[pidx].steptype == TIME_CONSTANT ) continue;
if ( tsID > 0 && params[pidx].steptype == TSTEP_CONSTANT ) continue;
double missval = vlistInqVarMissval(vlistID2, varID);
......
......@@ -96,45 +96,6 @@ void yar_store_link_cnsrv(remapvars_t *rv, long add1, long add2, double weight)
rv->wts[nlink] = weight;
}
static
void gen_xbounds(int nx, double *xvals, double *xbounds)
{
int i;
for ( i = 0; i < nx-1; i++ )
{
xbounds[i+1] = 0.5*(xvals[i] + xvals[i+1]);
}
xbounds[0] = 2*xvals[0] - xbounds[1];
xbounds[nx] = 2*xvals[nx-1] - xbounds[nx-1];
}
static
void gen_ybounds(int ny, double *yvals, double *ybounds)
{
int i;
for ( i = 0; i < ny-1; i++ )
{
ybounds[i+1] = 0.5*(yvals[i] + yvals[i+1]);
}
ybounds[0] = 2*yvals[0] - ybounds[1];
ybounds[ny] = 2*yvals[ny-1] - ybounds[ny-1];
if ( yvals[0] > yvals[ny-1] )
{
if ( ybounds[0] > 88 ) ybounds[0] = 90;
if ( ybounds[ny] < -88 ) ybounds[ny] = -90;
}
else
{
if ( ybounds[0] < -88 ) ybounds[0] = -90;
if ( ybounds[ny] > 88 ) ybounds[ny] = 90;
}
}
void set_source_data(double * source_data, double init_value,
unsigned size_x, unsigned size_y) {
......@@ -149,6 +110,7 @@ void set_source_data(double * source_data, double init_value,
This routine stores the address and weight for four links associated with one destination
point in the appropriate address and weight arrays and resizes those arrays if necessary.
*/
#if defined(HAVE_LIBYAC)
static
void store_link_bilin(remapvars_t *rv, int dst_add, int src_add[4], double weights[4])
{
......@@ -177,34 +139,16 @@ void store_link_bilin(remapvars_t *rv, int dst_add, int src_add[4], double weigh
}
} /* store_link_bilin */
#endif
void yar_remap_bil(field_type *field1, field_type *field2)
{
int nlonIn, nlatIn;
int nlonOut, nlatOut;
int ilat, ilon;
int gridIDin, gridIDout;
int i, nmiss;
int gridsize1, gridsize2;
double *lonIn, *latIn;
double *lonOut, *latOut;
double *xlonIn, *xlatIn;
double *xlonOut, *xlatOut;
double **fieldIn;
double **field;
double *array = NULL;
double *array1, *array2;
double missval;
int testit = 1;
double dxIn, dxOut;
remap_t remap;
/* static int index = 0; */
gridIDin = field1->grid;
gridIDout = field2->grid;
array1 = field1->ptr;
array2 = field2->ptr;
missval = field1->missval;
int gridIDin = field1->grid;
int gridIDout = field2->grid;
if ( ! (gridInqXvals(gridIDin, NULL) && gridInqYvals(gridIDin, NULL)) )
cdoAbort("Source grid has no values");
......@@ -220,18 +164,18 @@ void yar_remap_bil(field_type *field1, field_type *field2)
if ( cdoTimer ) timer_start(timer_yar_remap_init);
nlonIn = gridInqXsize(gridIDin);
nlatIn = gridInqYsize(gridIDin);
gridsize1 = gridInqSize(gridIDin);
lonIn = (double*) Malloc(nlonIn*sizeof(double));
latIn = (double*) Malloc(nlatIn*sizeof(double));
int nlonIn = gridInqXsize(gridIDin);
int nlatIn = gridInqYsize(gridIDin);
// int gridsize1 = gridInqSize(gridIDin);
double *lonIn = (double*) Malloc(nlonIn*sizeof(double));
double *latIn = (double*) Malloc(nlatIn*sizeof(double));
gridInqXvals(gridIDin, lonIn);
gridInqYvals(gridIDin, latIn);
for ( int i = 0; i < nlonIn; ++i ) lonIn[i] *= DEG2RAD;
for ( int i = 0; i < nlatIn; ++i ) latIn[i] *= DEG2RAD;
xlonIn = (double*) Malloc((nlonIn+1)*sizeof(double));
xlatIn = (double*) Malloc((nlatIn+1)*sizeof(double));
double *xlonIn = (double*) Malloc((nlonIn+1)*sizeof(double));
double *xlatIn = (double*) Malloc((nlatIn+1)*sizeof(double));
gridInqXvals(gridIDin, xlonIn);
gridInqYvals(gridIDin, xlatIn);
dxIn = xlonIn[1] - xlonIn[0];
......@@ -245,18 +189,18 @@ void yar_remap_bil(field_type *field1, field_type *field2)
if ( ! (gridInqXvals(gridIDout, NULL) && gridInqYvals(gridIDout, NULL)) )
cdoAbort("Target grid has no values");
nlonOut = gridInqXsize(gridIDout);
nlatOut = gridInqYsize(gridIDout);
gridsize2 = gridInqSize(gridIDout);
lonOut = (double*) Malloc(nlonOut*sizeof(double));
latOut = (double*) Malloc(nlatOut*sizeof(double));
int nlonOut = gridInqXsize(gridIDout);
int nlatOut = gridInqYsize(gridIDout);
// int gridsize2 = gridInqSize(gridIDout);
double *lonOut = (double*) Malloc(nlonOut*sizeof(double));
double *latOut = (double*) Malloc(nlatOut*sizeof(double));
gridInqXvals(gridIDout, lonOut);
gridInqYvals(gridIDout, latOut);
for ( int i = 0; i < nlonOut; ++i ) lonOut[i] *= DEG2RAD;
for ( int i = 0; i < nlatOut; ++i ) latOut[i] *= DEG2RAD;
xlonOut = (double*) Malloc((nlonOut+1)*sizeof(double));
xlatOut = (double*) Malloc((nlatOut+1)*sizeof(double));
double *xlonOut = (double*) Malloc((nlonOut+1)*sizeof(double));
double *xlatOut = (double*) Malloc((nlatOut+1)*sizeof(double));
gridInqXvals(gridIDout, xlonOut);
gridInqYvals(gridIDout, xlatOut);
dxOut = xlonOut[1] - xlonOut[0];
......@@ -408,12 +352,16 @@ void yar_remap_bil(field_type *field1, field_type *field2)
if ( cdoTimer ) timer_stop(timer_yar_remap_bil);
double *array1 = field1->ptr;
double *array2 = field2->ptr;
double missval = field1->missval;
if ( cdoTimer ) timer_start(timer_yar_remap);
yar_remap(array2, missval, gridInqSize(gridIDout), remap.vars.num_links, remap.vars.wts,
remap.vars.num_wts, remap.vars.tgt_cell_add, remap.vars.src_cell_add, array1);
if ( cdoTimer ) timer_stop(timer_yar_remap);
nmiss = 0;
int nmiss = 0;
for ( int i = 0; i < gridInqSize(gridIDout); ++i )
if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
......@@ -424,7 +372,6 @@ void yar_remap_bil(field_type *field1, field_type *field2)
//free(latIn);
//free(lonOut);
//free(latOut);
//free(fieldIn);
#endif
}
......@@ -433,27 +380,17 @@ void yar_remap_con(field_type *field1, field_type *field2)
{
int nlonIn, nlatIn;
int nlonOut, nlatOut;
int ilat, ilon;
int gridIDin, gridIDout;
int i, nmiss;
int gridsize1, gridsize2;
double *lonIn, *latIn;
double *lonOut, *latOut;
double *xlonIn, *xlatIn;
double *xlonOut, *xlatOut;
double **fieldIn;
double **field;
double *array1, *array2;
double missval;
double dxIn, dxOut;
remap_t remap;
/* static int index = 0; */
gridIDin = field1->grid;
gridIDout = field2->grid;
array1 = field1->ptr;
array2 = field2->ptr;
missval = field1->missval;
if ( ! (gridInqXvals(gridIDin, NULL) && gridInqYvals(gridIDin, NULL)) )
cdoAbort("Source grid has no values");
......@@ -471,7 +408,7 @@ void yar_remap_con(field_type *field1, field_type *field2)
if ( cdoTimer ) timer_start(timer_yar_remap_init);
nlonIn = gridInqXsize(gridIDin);
nlatIn = gridInqYsize(gridIDin);
gridsize1 = gridInqSize(gridIDin);
// int gridsize1 = gridInqSize(gridIDin);
lonIn = (double*) Malloc((nlonIn+1)*sizeof(double));
latIn = (double*) Malloc((nlatIn+1)*sizeof(double));
gridInqXvals(gridIDin, lonIn);
......@@ -493,7 +430,7 @@ void yar_remap_con(field_type *field1, field_type *field2)
nlonOut = gridInqXsize(gridIDout);
nlatOut = gridInqYsize(gridIDout);
gridsize2 = gridInqSize(gridIDout);
// int gridsize2 = gridInqSize(gridIDout);
lonOut = (double*) Malloc((nlonOut+1)*sizeof(double));
latOut = (double*) Malloc((nlatOut+1)*sizeof(double));
gridInqXvals(gridIDout, lonOut);
......@@ -712,12 +649,16 @@ void yar_remap_con(field_type *field1, field_type *field2)
//polygon_destroy ( &polygons );
if ( cdoTimer ) timer_stop(timer_yar_remap_con);
double *array1 = field1->ptr;
double *array2 = field2->ptr;
double missval = field1->missval;
if ( cdoTimer ) timer_start(timer_yar_remap);
yar_remap(array2, missval, gridInqSize(gridIDout), remap.vars.num_links, remap.vars.wts,
remap.vars.num_wts, remap.vars.tgt_cell_add, remap.vars.src_cell_add, array1);
if ( cdoTimer ) timer_stop(timer_yar_remap);
nmiss = 0;
int nmiss = 0;
for ( int i = 0; i < gridInqSize(gridIDout); ++i )
if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
......@@ -738,7 +679,6 @@ void yar_remap_con(field_type *field1, field_type *field2)
//free(latIn);
//free(lonOut);