Commit ea0d6452 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Merge declaration and definition.

parent d86071a1
......@@ -234,10 +234,8 @@ void *Vargen(void *argument)
{
int ntimesteps, nlevels = 1;
int varID, varID2 = -1, levelID;
int i;
int gridID = -1, gridIDdata = -1, zaxisID;
int vdate, vtime;
double rval, rstart = 0, rstop = 0, rinc = 0;
double rstart = 0, rstop = 0, rinc = 0;
double rconst = 0;
double *levels = NULL;
double lon[NLON], lat[NLAT];
......@@ -333,7 +331,7 @@ void *Vargen(void *argument)
levels = (double *) listArrayPtr(flist);
//listDelete(flist);
if ( cdoVerbose ) for ( i = 0; i < nlevels; ++i ) printf("levels %d: %g\n", i, levels[i]);
if ( cdoVerbose ) for ( int i = 0; i < nlevels; ++i ) printf("levels %d: %g\n", i, levels[i]);
gridID = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID, 1);
......@@ -429,9 +427,9 @@ void *Vargen(void *argument)
for ( int tsID = 0; tsID < ntimesteps; tsID++ )
{
rval = rstart + rinc*tsID;
vdate = julday_to_date(CALENDAR_PROLEPTIC, julday + tsID);
vtime = 0;
double rval = rstart + rinc*tsID;
int vdate = julday_to_date(CALENDAR_PROLEPTIC, julday + tsID);
int vtime = 0;
taxisDefVdate(taxisID, vdate);
taxisDefVtime(taxisID, vtime);
streamDefTimestep(streamID, tsID);
......@@ -445,7 +443,7 @@ void *Vargen(void *argument)
if ( operatorID == RANDOM )
{
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
array[i] = ((double)rand())/((double)RAND_MAX);
}
else if ( operatorID == SINCOS || operatorID == COSHILL )
......@@ -477,12 +475,12 @@ void *Vargen(void *argument)
if ( operatorID == SINCOS )
{
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
array[i] = cos(1.0 * xvals[i]) * sin(2.0 * yvals[i]);
}
else if ( operatorID == COSHILL )
{
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
array[i] = 2 - cos(acos(cos(xvals[i]) * cos(yvals[i]))/1.2);
}
......@@ -491,13 +489,13 @@ void *Vargen(void *argument)
}
else if ( operatorID == CONST )
{
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
array[i] = rconst;
}
else if ( operatorID == TOPO )
{
#if defined(ENABLE_DATA)
for ( i = 0; i < datasize; i++ )
for ( int i = 0; i < datasize; i++ )
data[i] = etopo[i]/etopo_scale - etopo_offset;
#else
cdoAbort("Operator support disabled!");
......@@ -506,7 +504,7 @@ void *Vargen(void *argument)
else if ( operatorID == TEMP )
{
#if defined(ENABLE_DATA)
for ( i = 0; i < datasize; i++ )
for ( int i = 0; i < datasize; i++ )
data[i] = temp[i]/temp_scale - temp_offset;
#else
cdoAbort("Operator support disabled!");
......@@ -515,7 +513,7 @@ void *Vargen(void *argument)
else if ( operatorID == MASK )
{
#if defined(ENABLE_DATA)
for ( i = 0; i < datasize; i++ )
for ( int i = 0; i < datasize; i++ )
data[i] = mask[i]/mask_scale - mask_offset;
#else
cdoAbort("Operator support disabled!");
......
......@@ -30,60 +30,50 @@
void *Varrms(void *argument)
{
int streamID1, streamID2, streamID3;
int vlistID1, vlistID2, vlistID3;
int gridID1, gridID3, lastgrid = -1;
int lastgrid = -1;
int wstatus = FALSE;
int code = 0, oldcode = 0;
int index, ngrids;
int recID, nrecs;
int nvars, nlevel;
int oldcode = 0;
int nrecs;
int gridsize;
int nmiss;
int tsID, varID, levelID;
int lim;
int needWeights = FALSE;
int varID, levelID;
long offset;
double *single;
double **vardata1 = NULL, **vardata2 = NULL;
double slon, slat;
double sglval;
field_t field1, field2, field3;
int taxisID1, taxisID3;
cdoInitialize(argument);
needWeights = TRUE;
bool needWeights = true;
streamID1 = streamOpenRead(cdoStreamName(0));
streamID2 = streamOpenRead(cdoStreamName(1));
int streamID1 = streamOpenRead(cdoStreamName(0));
int streamID2 = streamOpenRead(cdoStreamName(1));
vlistID1 = streamInqVlist(streamID1);
vlistID2 = streamInqVlist(streamID2);
int vlistID1 = streamInqVlist(streamID1);
int vlistID2 = streamInqVlist(streamID2);
slon = 0;
slat = 0;
gridID3 = gridCreate(GRID_LONLAT, 1);
double slon = 0;
double slat = 0;
int gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
gridDefYsize(gridID3, 1);
gridDefXvals(gridID3, &slon);
gridDefYvals(gridID3, &slat);
vlistClearFlag(vlistID1);
nvars = vlistNvars(vlistID1);
int nvars = vlistNvars(vlistID1);
for ( varID = 0; varID < nvars; varID++ )
vlistDefFlag(vlistID1, varID, 0, TRUE);
vlistID3 = vlistCreate();
int vlistID3 = vlistCreate();
vlistCopyFlag(vlistID3, vlistID1);
taxisID1 = vlistInqTaxis(vlistID1);
taxisID3 = taxisDuplicate(taxisID1);
int taxisID1 = vlistInqTaxis(vlistID1);
int taxisID3 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID3, taxisID3);
ngrids = vlistNgrids(vlistID1);
index = 0;
gridID1 = vlistGrid(vlistID1, index);
int ngrids = vlistNgrids(vlistID1);
int index = 0;
int gridID1 = vlistGrid(vlistID1, index);
if ( needWeights &&
gridInqType(gridID1) != GRID_LONLAT &&
......@@ -93,26 +83,27 @@ void *Varrms(void *argument)
vlistChangeGridIndex(vlistID3, index, gridID3);
if ( ngrids > 1 ) cdoAbort("Too many different grids!");
streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
int streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
streamDefVlist(streamID3, vlistID3);
vardata1 = (double**) Malloc(nvars*sizeof(double*));
vardata2 = (double**) Malloc(nvars*sizeof(double*));
double **vardata1 = (double**) Malloc(nvars*sizeof(double*));
double **vardata2 = (double**) Malloc(nvars*sizeof(double*));
for ( varID = 0; varID < nvars; varID++ )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
int gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
int nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
vardata1[varID] = (double*) Malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = (double*) Malloc(gridsize*nlevel*sizeof(double));
}
field_t field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field2);
lim = vlistGridsizeMax(vlistID1);
int lim = vlistGridsizeMax(vlistID1);
field1.weight = NULL;
if ( needWeights )
field1.weight = (double*) Malloc(lim*sizeof(double));
......@@ -122,7 +113,7 @@ void *Varrms(void *argument)
field3.ptr = &sglval;
field3.grid = gridID3;
tsID = 0;
int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
nrecs = streamInqTimestep(streamID2, tsID);
......@@ -131,7 +122,7 @@ void *Varrms(void *argument)
streamDefTimestep(streamID3, tsID);
for ( recID = 0; recID < nrecs; recID++ )
for ( int recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
......@@ -163,7 +154,7 @@ void *Varrms(void *argument)
lastgrid = field1.grid;
wstatus = gridWeights(field1.grid, field1.weight);
}
code = vlistInqVarCode(vlistID1, varID);
int code = vlistInqVarCode(vlistID1, varID);
if ( wstatus != 0 && tsID == 0 && code != oldcode )
cdoWarning("Using constant area weights for code %d!", oldcode=code);
......
......@@ -57,12 +57,10 @@ void add_vars_mv(int gridsize, double missval, const double *restrict var1, cons
void *Vertcum(void *argument)
{
int recID, nrecs;
int i, gridsize, nlevs = 0, nlevs2 = 0, nlevshl = 0;
int varID, levelID, zaxisID;
int nrecs;
int i, nlevshl = 0;
int varID, levelID;
int nmiss;
double *single;
double missval;
cdoInitialize(argument);
......@@ -88,10 +86,10 @@ void *Vertcum(void *argument)
double *vct = NULL;
int lhybrid = FALSE;
int nzaxis = vlistNzaxis(vlistID1);
for ( i = 0; i < nzaxis; ++i )
for ( int i = 0; i < nzaxis; ++i )
{
zaxisID = vlistZaxis(vlistID1, i);
nlevs = zaxisInqSize(zaxisID);
int zaxisID = vlistZaxis(vlistID1, i);
int nlevs = zaxisInqSize(zaxisID);
if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && nlevs > 1 )
{
......@@ -126,9 +124,9 @@ void *Vertcum(void *argument)
for ( varID = 0; varID < nvars; varID++ )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
int gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
int nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
int nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
varnmiss[varID] = (int*) Malloc(nlevs*sizeof(int));
vardata1[varID] = (double**) Malloc(nlevs*sizeof(double*));
......@@ -154,7 +152,7 @@ void *Vertcum(void *argument)
streamDefTimestep(streamID2, tsID);
for ( recID = 0; recID < nrecs; recID++ )
for ( int recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
streamReadRecord(streamID1, vardata1[varID][levelID], &varnmiss[varID][levelID]);
......@@ -162,9 +160,9 @@ void *Vertcum(void *argument)
for ( varID = 0; varID < nvars; ++varID )
{
missval = vlistInqVarMissval(vlistID2, varID);
gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
double missval = vlistInqVarMissval(vlistID2, varID);
int gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
int nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
if ( operatorID == VERTCUMHL && nlevs2 == nlevshl )
{
......@@ -178,13 +176,9 @@ void *Vertcum(void *argument)
for ( levelID = 1; levelID < nlevs2; ++levelID )
{
if ( operatorID == VERTCUMHL && nlevs2 == nlevshl )
{
add_vars_mv(gridsize, missval, vardata1[varID][levelID-1], vardata2[varID][levelID-1], vardata2[varID][levelID]);
}
add_vars_mv(gridsize, missval, vardata1[varID][levelID-1], vardata2[varID][levelID-1], vardata2[varID][levelID]);
else
{
add_vars_mv(gridsize, missval, vardata1[varID][levelID], vardata2[varID][levelID-1], vardata2[varID][levelID]);
}
add_vars_mv(gridsize, missval, vardata1[varID][levelID], vardata2[varID][levelID-1], vardata2[varID][levelID]);
}
if ( operatorID == VERTCUMHL && nlevs2 == nlevshl )
......@@ -206,15 +200,15 @@ void *Vertcum(void *argument)
for ( varID = 0; varID < nvars; ++varID )
{
missval = vlistInqVarMissval(vlistID2, varID);
gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
double missval = vlistInqVarMissval(vlistID2, varID);
int gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
int nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
for ( levelID = 0; levelID < nlevs2; ++levelID )
{
single = vardata2[varID][levelID];
double *single = vardata2[varID][levelID];
nmiss = 0;
for ( i = 0; i < gridsize; ++i )
for ( int i = 0; i < gridsize; ++i )
if ( DBL_IS_EQUAL(single[i], missval) ) nmiss++;
streamDefRecord(streamID2, varID, levelID);
......@@ -227,8 +221,8 @@ void *Vertcum(void *argument)
for ( varID = 0; varID < nvars; ++varID )
{
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
int nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
int nlevs2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
for ( levelID = 0; levelID < nlevs; ++levelID ) Free(vardata1[varID][levelID]);
for ( levelID = 0; levelID < nlevs2; ++levelID ) Free(vardata2[varID][levelID]);
Free(vardata1[varID]);
......
......@@ -69,19 +69,15 @@ void *Vertintap(void *argument)
int i, k, offset;
int varID, levelID;
int zaxisIDp, zaxisIDh = -1;
int gridID, zaxisID;
int nhlev = 0, nhlevf = 0, nhlevh = 0, nlevel;
int *vert_index = NULL;
int apressID = -1, dpressID = -1;
int psID = -1, tempID = -1;
int param;
//int sortlevels = TRUE;
int *pnmiss = NULL;
char paramstr[32];
char stdname[CDI_MAX_NAME];
char varname[CDI_MAX_NAME];
double minval, maxval;
double missval;
double *vct = NULL;
double *single1, *single2;
double *ps_prog = NULL, *full_press = NULL, *dpress = NULL;
......@@ -193,9 +189,9 @@ void *Vertintap(void *argument)
if ( apressID == -1 ) cdoAbort("%s not found!", var_stdname(air_pressure));
int nzaxis = vlistNzaxis(vlistID1);
for ( i = 0; i < nzaxis; i++ )
for ( int i = 0; i < nzaxis; i++ )
{
zaxisID = vlistZaxis(vlistID1, i);
int zaxisID = vlistZaxis(vlistID1, i);
if ( zaxisID == vlistInqVarZaxis(vlistID1, apressID) )
{
bool mono_level = true;
......@@ -272,7 +268,7 @@ void *Vertintap(void *argument)
height2pressure(phlev, plev, nplev);
if ( cdoVerbose )
for ( i = 0; i < nplev; ++i )
for ( int i = 0; i < nplev; ++i )
cdoPrint("level = %d height = %g pressure = %g", i+1, plev[i], phlev[i]);
memcpy(plev, phlev, nplev*sizeof(double));
......@@ -283,9 +279,9 @@ void *Vertintap(void *argument)
for ( varID = 0; varID < nvars; varID++ )
{
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
nlevel = zaxisInqSize(zaxisID);
int gridID = vlistInqVarGrid(vlistID1, varID);
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
int nlevel = zaxisInqSize(zaxisID);
if ( gridInqType(gridID) == GRID_SPECTRAL )
cdoAbort("Spectral data unsupported!");
......@@ -338,7 +334,6 @@ void *Vertintap(void *argument)
}
taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID);
for ( int recID = 0; recID < nrecs; recID++ )
......@@ -385,6 +380,7 @@ void *Vertintap(void *argument)
}
/* check range of ps_prog */
double minval, maxval;
minmaxval(gridsize, ps_prog, NULL, &minval, &maxval);
if ( minval < MIN_PS || maxval > MAX_PS )
cdoWarning("Surface pressure out of range (min=%g max=%g)!", minval, maxval);
......@@ -410,9 +406,9 @@ void *Vertintap(void *argument)
{
if ( vars[varID] )
{
zaxisID = vlistInqVarZaxis(vlistID1, varID);
missval = vlistInqVarMissval(vlistID1, varID);
nlevel = zaxisInqSize(zaxisID);
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
int nlevel = zaxisInqSize(zaxisID);
double missval = vlistInqVarMissval(vlistID1, varID);
if ( varinterp[varID] )
{
if ( nlevel == nhlevf )
......@@ -421,7 +417,7 @@ void *Vertintap(void *argument)
}
else
{
param = vlistInqVarParam(vlistID1, varID);
int param = vlistInqVarParam(vlistID1, varID);
cdiParamToString(param, paramstr, sizeof(paramstr));
cdoAbort("Number of generalized height level differ from full/half level (param=%s)!", paramstr);
}
......@@ -445,7 +441,7 @@ void *Vertintap(void *argument)
{
if ( vars[varID] )
{
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
int nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
for ( levelID = 0; levelID < nlevel; levelID++ )
{
offset = gridsize*levelID;
......
......@@ -45,15 +45,12 @@ void *Vertintml(void *argument)
int i, k, offset;
int varID, levelID;
int zaxisIDp, zaxisIDh = -1;
int gridID, zaxisID;
int nhlev = 0, nhlevf = 0, nhlevh = 0, nlevel;
int nhlev = 0, nhlevf = 0, nhlevh = 0;
int *vert_index = NULL;
int nvct = 0;
bool sgeopot_needed = false;
bool extrapolate = false;
int sgeopotID = -1, geopotID = -1, tempID = -1, psID = -1, lnpsID = -1, presID = -1, gheightID = -1;
int code;
int pnum, pcat, pdis;
//int sortlevels = TRUE;
int *pnmiss = NULL;
char paramstr[32];
......@@ -62,7 +59,6 @@ void *Vertintml(void *argument)
double *rvct = NULL; /* reduced VCT for LM */
double *single1, *single2;
double *sgeopot = NULL, *ps_prog = NULL, *full_press = NULL, *half_press = NULL;
int instNum, tableNum;
gribcode_t gribcodes = {0};
LIST *flist = listNew(FLT_LIST);
......@@ -178,7 +174,7 @@ void *Vertintml(void *argument)
int nvars = vlistNvars(vlistID1);
int vars[nvars];
bool vars[nvars];
double *vardata1[nvars];
double *vardata2[nvars];
int *varnmiss[nvars];
......@@ -234,7 +230,7 @@ void *Vertintml(void *argument)
bool useTable = false;
for ( varID = 0; varID < nvars; varID++ )
{
tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
int tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
if ( tableNum > 0 && tableNum != 255 )
{
useTable = true;
......@@ -246,17 +242,18 @@ void *Vertintml(void *argument)
for ( varID = 0; varID < nvars; varID++ )
{
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
int gridID = vlistInqVarGrid(vlistID1, varID);
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
// gridsize = gridInqSize(gridID);
nlevel = zaxisInqSize(zaxisID);
instNum = institutInqCenter(vlistInqVarInstitut(vlistID1, varID));
tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
int nlevel = zaxisInqSize(zaxisID);
int instNum = institutInqCenter(vlistInqVarInstitut(vlistID1, varID));
int tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
code = vlistInqVarCode(vlistID1, varID);
int code = vlistInqVarCode(vlistID1, varID);
int param = vlistInqVarParam(vlistID1, varID);
cdiParamToString(param, paramstr, sizeof(paramstr));
int pnum, pcat, pdis;
cdiDecodeParam(param, &pnum, &pcat, &pdis);
if ( pdis >= 0 && pdis < 255 ) code = -1;
......@@ -425,18 +422,17 @@ void *Vertintml(void *argument)
int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
for ( varID = 0; varID < nvars; ++varID ) vars[varID] = FALSE;
for ( varID = 0; varID < nvars; ++varID ) vars[varID] = false;
taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID);
for ( int recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
//gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
zaxisID = vlistInqVarZaxis(vlistID1, varID);
nlevel = zaxisInqSize(zaxisID);
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
int nlevel = zaxisInqSize(zaxisID);
/*
if ( sortlevels && zaxisIDh != -1 && zaxisID == zaxisIDh && nlevel == nhlev )
{
......@@ -451,7 +447,7 @@ void *Vertintml(void *argument)
single1 = vardata1[varID] + offset;
streamReadRecord(streamID1, single1, &varnmiss[varID][levelID]);
vars[varID] = TRUE;
vars[varID] = true;
}
if ( zaxisIDh != -1 )
......@@ -509,11 +505,9 @@ void *Vertintml(void *argument)
{
if ( vars[varID] )
{
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
int nlevel = zaxisInqSize(zaxisID);
double missval = vlistInqVarMissval(vlistID1, varID);
//gridsize = gridInqSize(gridID);
nlevel = zaxisInqSize(zaxisID);
if ( varinterp[varID] )
{
/*
......@@ -591,7 +585,7 @@ void *Vertintml(void *argument)
{
if ( vars[varID] )
{
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
int nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
for ( levelID = 0; levelID < nlevel; levelID++ )
{
//gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
......
......@@ -43,12 +43,11 @@
int getSurfaceID(int vlistID)
{
int surfID = -1;
int zaxisID;
int nzaxis = vlistNzaxis(vlistID);
for ( int index = 0; index < nzaxis; ++index )
{
zaxisID = vlistZaxis(vlistID, index);
int zaxisID = vlistZaxis(vlistID, index);
if ( IS_SURFACE_LEVEL(zaxisID) )
{
surfID = vlistZaxis(vlistID, index);
......@@ -64,12 +63,11 @@ int getSurfaceID(int vlistID)
static
void setSurfaceID(int vlistID, int surfID)
{
int zaxisID;
int nzaxis = vlistNzaxis(vlistID);
for ( int index = 0; index < nzaxis; ++index )
{
zaxisID = vlistZaxis(vlistID, index);
int zaxisID = vlistZaxis(vlistID, index);
if ( zaxisID != surfID || !IS_SURFACE_LEVEL(zaxisID) )
vlistChangeZaxisIndex(vlistID, index, surfID);
}
......@@ -97,7 +95,7 @@ void genLayerBounds(int nlev, double *levels, double *lbounds, double *ubounds)
}
int getLayerThickness(int genbounds, int index, int zaxisID, int nlev, double *thickness, double *weights)
int getLayerThickness(bool genbounds, int index, int zaxisID, int nlev, double *thickness, double *weights)
{
int status = 0;
int i;
......@@ -156,12 +154,10 @@ int getLayerThickness(int genbounds, int index, int zaxisID, int nlev, double *t
void *Vertstat(void *argument)
{
int recID, nrecs;
int nrecs;
int gridID;
int i;
int varID, levelID;
int nmiss;
double missval;
typedef struct {
int zaxisID;
int status;
......@@ -184,14 +180,14 @@ void *Vertstat(void *argument)
cdoOperatorAdd("vertstd", func_std, 1, NULL);
cdoOperatorAdd("vertstd1", func_std1, 1, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
int needWeights = cdoOperatorF2(operatorID);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
bool needWeights = cdoOperatorF2(operatorID);
int lmean = operfunc == func_mean || operfunc == func_avg;
int lstd = operfunc == func_std || operfunc == func_std1;
int lvarstd = operfunc == func_std || operfunc ==