Commit 539f70da authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

expr: added support for fldsum()

parent e21abd9d
......@@ -72,6 +72,7 @@ int *fill_vars(int vlistID)
void *Arithc(void *argument)
{
int nmiss;
int nrecs, recID;
int varID, levelID;
......@@ -122,7 +123,8 @@ void *Arithc(void *argument)
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t) nmiss;
if ( vars[varID] )
{
......@@ -138,8 +140,9 @@ void *Arithc(void *argument)
if ( DBL_IS_EQUAL(field.ptr[i], field.missval) ) field.nmiss++;
}
nmiss = (int) field.nmiss;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, field.ptr, field.nmiss);
streamWriteRecord(streamID2, field.ptr, nmiss);
}
tsID++;
}
......
......@@ -84,6 +84,7 @@ void *Arithdays(void *argument)
int vdate, vtime;
int year, month, day;
int calendar;
int nmiss;
double rconst;
field_t field;
......@@ -150,15 +151,16 @@ void *Arithdays(void *argument)
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vlistInqVarGrid(vlistID1, varID);
field.missval = vlistInqVarMissval(vlistID1, varID);
farcfun(&field, rconst, operfunc);
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, field.ptr, field.nmiss);
streamWriteRecord(streamID2, field.ptr, (int)field.nmiss);
}
tsID++;
}
......
......@@ -128,7 +128,8 @@ void *Consecstat(void *argument)
int histvdate = 0, histvtime = 0;
int recID, nrecs;
int varID, nvars;
int levelID, nlevels;
int levelID, nlevels;
int nmiss;
double refval = 0.0;
field_t **vars = NULL, **hist = NULL, **periods = NULL;
......@@ -199,7 +200,8 @@ void *Consecstat(void *argument)
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(istreamID, &varID, &levelID);
streamReadRecord(istreamID, field.ptr, &field.nmiss);
streamReadRecord(istreamID, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vlistInqVarGrid(ovlistID, varID);
field.missval = vlistInqVarMissval(ovlistID, varID);
......@@ -209,14 +211,14 @@ void *Consecstat(void *argument)
{
case CONSECSUM:
streamDefRecord(ostreamID, varID, levelID);
streamWriteRecord(ostreamID, vars[varID][levelID].ptr, vars[varID][levelID].nmiss);
streamWriteRecord(ostreamID, vars[varID][levelID].ptr, (int)vars[varID][levelID].nmiss);
break;
case CONSECTS:
if ( itsID != 0 )
{
selEndOfPeriod(&periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], FALSE);
streamDefRecord(ostreamID, varID, levelID);
streamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
streamWriteRecord(ostreamID, periods[varID][levelID].ptr, (int)periods[varID][levelID].nmiss);
}
#if defined(_OPENMP)
#pragma omp parallel for default(shared) schedule(static)
......@@ -251,7 +253,7 @@ void *Consecstat(void *argument)
{
selEndOfPeriod(&periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], TRUE);
streamDefRecord(ostreamID, varID, levelID);
streamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
streamWriteRecord(ostreamID, periods[varID][levelID].ptr, (int)periods[varID][levelID].nmiss);
}
}
}
......
......@@ -210,9 +210,10 @@ void *Fldstat(void *argument)
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.grid = vlistInqVarGrid(vlistID1, varID);
field.nmiss = (size_t)nmiss;
field.grid = vlistInqVarGrid(vlistID1, varID);
field.size = gridInqSize(field.grid);
if ( needWeights && field.grid != lastgrid )
......
......@@ -38,6 +38,7 @@ void *Seascount(void *argument)
int varID, levelID, recID;
int tsID;
int otsID;
int nmiss;
long nsets;
int i;
int year, month, day, seas, seas0 = 0;
......@@ -131,7 +132,8 @@ void *Seascount(void *argument)
vars1[varID][levelID].nmiss = gridsize;
}
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
......@@ -158,7 +160,7 @@ void *Seascount(void *argument)
if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, (int)vars1[varID][levelID].nmiss);
}
if ( nrecs == 0 ) break;
......
......@@ -180,7 +180,8 @@ void *Seasstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
......@@ -295,7 +296,7 @@ void *Seasstat(void *argument)
if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, (int)vars1[varID][levelID].nmiss);
}
if ( nrecs == 0 ) break;
......
......@@ -49,6 +49,7 @@ void *Timcount(void *argument)
int streamID1, streamID2;
int vlistID1, vlistID2, taxisID1, taxisID2;
int nvars;
int nmiss;
int nwpv; // number of words per value; real:1 complex:2
int *recVarID, *recLevelID;
field_t **vars1 = NULL;
......@@ -132,7 +133,8 @@ void *Timcount(void *argument)
vars1[varID][levelID].nmiss = gridsize;
}
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
......@@ -159,7 +161,7 @@ void *Timcount(void *argument)
if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, (int)vars1[varID][levelID].nmiss);
}
if ( nrecs == 0 ) break;
......
......@@ -159,7 +159,7 @@ void *Timselstat(void *argument)
if ( nsets == 0 )
{
streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
vars1[varID][levelID].nmiss = nmiss;
vars1[varID][levelID].nmiss = (size_t)nmiss;
if ( nmiss > 0 || samp1[varID][levelID].ptr )
{
......@@ -176,7 +176,8 @@ void *Timselstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
......@@ -268,7 +269,7 @@ void *Timselstat(void *argument)
if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, (int)vars1[varID][levelID].nmiss);
}
if ( nrecs == 0 ) break;
......
......@@ -285,7 +285,7 @@ void *Timstat(void *argument)
if ( nsets == 0 )
{
streamReadRecord(streamID1, pvar1->ptr, &nmiss);
pvar1->nmiss = nmiss;
pvar1->nmiss = (size_t)nmiss;
if ( nmiss > 0 || samp1[varID][levelID].ptr )
{
if ( samp1[varID][levelID].ptr == NULL )
......@@ -301,9 +301,10 @@ void *Timstat(void *argument)
else
{
if ( CDO_Memtype == MEMTYPE_FLOAT )
streamReadRecordF(streamID1, field.ptrf, &field.nmiss);
streamReadRecordF(streamID1, field.ptrf, &nmiss);
else
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.size = gridsize;
field.grid = pvar1->grid;
field.missval = pvar1->missval;
......@@ -428,7 +429,7 @@ void *Timstat(void *argument)
nmiss = 0;
for ( int i = 0; i < nwpv*gridsize; ++i )
if ( DBL_IS_EQUAL(pvar1->ptr[i], missval) ) nmiss++;
pvar1->nmiss = nmiss;
pvar1->nmiss = (size_t)nmiss;
}
}
}
......@@ -451,7 +452,7 @@ void *Timstat(void *argument)
if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, pvar1->ptr, pvar1->nmiss);
streamWriteRecord(streamID2, pvar1->ptr, (int)pvar1->nmiss);
if ( cdoDiag )
{
......
......@@ -337,7 +337,7 @@ void *Vertstat(void *argument)
if ( levelID == 0 )
{
streamReadRecord(streamID1, vars1[varID].ptr, &nmiss);
vars1[varID].nmiss = nmiss;
vars1[varID].nmiss = (size_t)nmiss;
if ( operatorID == VERTINT && IS_NOT_EQUAL(layer_thickness, 1.0) ) farcmul(&vars1[varID], layer_thickness);
if ( lmean && IS_NOT_EQUAL(layer_weight, 1.0) ) farcmul(&vars1[varID], layer_weight);
......@@ -369,7 +369,8 @@ void *Vertstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[varID].grid;
field.missval = vars1[varID].missval;
......@@ -440,7 +441,7 @@ void *Vertstat(void *argument)
}
streamDefRecord(streamID2, varID, 0);
streamWriteRecord(streamID2, vars1[varID].ptr, vars1[varID].nmiss);
streamWriteRecord(streamID2, vars1[varID].ptr, (int)vars1[varID].nmiss);
vars1[varID].nsamp = 0;
}
}
......
......@@ -152,7 +152,7 @@ void *Ydaystat(void *argument)
if ( nsets[dayoy] == 0 )
{
streamReadRecord(streamID1, vars1[dayoy][varID][levelID].ptr, &nmiss);
vars1[dayoy][varID][levelID].nmiss = nmiss;
vars1[dayoy][varID][levelID].nmiss = (size_t)nmiss;
if ( nmiss > 0 || samp1[dayoy][varID][levelID].ptr )
{
......@@ -169,7 +169,8 @@ void *Ydaystat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[dayoy][varID][levelID].grid;
field.missval = vars1[dayoy][varID][levelID].missval;
......@@ -281,7 +282,7 @@ void *Ydaystat(void *argument)
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[dayoy][varID][levelID].ptr,
vars1[dayoy][varID][levelID].nmiss);
(int)vars1[dayoy][varID][levelID].nmiss);
}
otsID++;
......
......@@ -137,7 +137,7 @@ void *Yearmonstat(void *argument)
if ( nsets == 0 )
{
streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
vars1[varID][levelID].nmiss = nmiss;
vars1[varID][levelID].nmiss = (size_t) nmiss;
farcmul(&vars1[varID][levelID], dpm);
......@@ -155,7 +155,8 @@ void *Yearmonstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t) nmiss;
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
......@@ -220,7 +221,7 @@ void *Yearmonstat(void *argument)
if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
streamWriteRecord(streamID2, vars1[varID][levelID].ptr, (int)vars1[varID][levelID].nmiss);
}
if ( nrecs == 0 ) break;
......
......@@ -177,7 +177,7 @@ void *Yhourstat(void *argument)
if ( nsets[houroy] == 0 )
{
streamReadRecord(streamID1, vars1[houroy][varID][levelID].ptr, &nmiss);
vars1[houroy][varID][levelID].nmiss = nmiss;
vars1[houroy][varID][levelID].nmiss = (size_t) nmiss;
if ( nmiss > 0 || samp1[houroy][varID][levelID].ptr )
{
......@@ -194,7 +194,8 @@ void *Yhourstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t) nmiss;
field.grid = vars1[houroy][varID][levelID].grid;
field.missval = vars1[houroy][varID][levelID].missval;
......@@ -290,7 +291,7 @@ void *Yhourstat(void *argument)
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[houroy][varID][levelID].ptr,
vars1[houroy][varID][levelID].nmiss);
(int)vars1[houroy][varID][levelID].nmiss);
}
otsID++;
......
......@@ -173,7 +173,7 @@ void *Ymonstat(void *argument)
if ( nsets[month] == 0 )
{
streamReadRecord(streamID1, vars1[month][varID][levelID].ptr, &nmiss);
vars1[month][varID][levelID].nmiss = nmiss;
vars1[month][varID][levelID].nmiss = (size_t) nmiss;
if ( nmiss > 0 || samp1[month][varID][levelID].ptr )
{
......@@ -190,7 +190,8 @@ void *Ymonstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t) nmiss;
field.grid = vars1[month][varID][levelID].grid;
field.missval = vars1[month][varID][levelID].missval;
......@@ -314,7 +315,7 @@ void *Ymonstat(void *argument)
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[month][varID][levelID].ptr,
vars1[month][varID][levelID].nmiss);
(int)vars1[month][varID][levelID].nmiss);
}
otsID++;
......
......@@ -165,7 +165,7 @@ void *Yseasstat(void *argument)
if ( nsets[seas] == 0 )
{
streamReadRecord(streamID1, vars1[seas][varID][levelID].ptr, &nmiss);
vars1[seas][varID][levelID].nmiss = nmiss;
vars1[seas][varID][levelID].nmiss = (size_t)nmiss;
if ( nmiss > 0 || samp1[seas][varID][levelID].ptr )
{
......@@ -182,7 +182,8 @@ void *Yseasstat(void *argument)
}
else
{
streamReadRecord(streamID1, field.ptr, &field.nmiss);
streamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.grid = vars1[seas][varID][levelID].grid;
field.missval = vars1[seas][varID][levelID].missval;
......@@ -278,7 +279,7 @@ void *Yseasstat(void *argument)
streamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, vars1[seas][varID][levelID].ptr,
vars1[seas][varID][levelID].nmiss);
(int)vars1[seas][varID][levelID].nmiss);
}
otsID++;
......
......@@ -14,7 +14,6 @@
#include "expr_fun.h"
#include "expr_yacc.h"
void freeNode(nodeType *p);
static const char *ExIn[] = {"expr", "init"};
static const char *tmpvnm = "_tmp_";
......@@ -86,10 +85,11 @@ static func_t fun_sym_tbl[] =
{0, "gamma", (void (*)()) tgamma},
// cdo functions (Reduce grid to point)
{1, "sum", (void (*)()) expr_sum},
// {1, "fldmean", cdo_fldmean},
{1, "fldmin", (void (*)()) fun_fldmin},
{1, "fldmax", (void (*)()) fun_fldmax},
{1, "fldsum", (void (*)()) fun_fldsum},
{1, "fldmean", (void (*)()) fun_fldmean},
{1, "fldavg", (void (*)()) fun_fldavg},
/*
{1, "max", max},
{1, "sum", sum},
......@@ -182,10 +182,10 @@ nodeType *expr_con_con(int oper, nodeType *p1, nodeType *p2)
}
static
void oper_expr_con_var(int oper, int nmiss, long n, double missval1, double missval2,
void oper_expr_con_var(int oper, bool nmiss, size_t n, double missval1, double missval2,
double *restrict odat, double cval, const double *restrict idat)
{
long i;
size_t i;
switch ( oper )
{
......@@ -250,10 +250,10 @@ void oper_expr_con_var(int oper, int nmiss, long n, double missval1, double miss
}
static
void oper_expr_var_con(int oper, int nmiss, long n, double missval1, double missval2,
void oper_expr_var_con(int oper, bool nmiss, size_t n, double missval1, double missval2,
double *restrict odat, const double *restrict idat, double cval)
{
long i;
size_t i;
switch ( oper )
{
......@@ -320,10 +320,10 @@ void oper_expr_var_con(int oper, int nmiss, long n, double missval1, double miss
}
static
void oper_expr_var_var(int oper, int nmiss, long ngp, double missval1, double missval2,
void oper_expr_var_var(int oper, bool nmiss, size_t ngp, double missval1, double missval2,
double *restrict odat, const double *restrict idat1, const double *restrict idat2)
{
long i;
size_t i;
switch ( oper )
{
......@@ -391,7 +391,7 @@ void oper_expr_var_var(int oper, int nmiss, long ngp, double missval1, double mi
else for ( i=0; i<ngp; ++i ) odat[i] = COMPOR(idat1[i], idat2[i]);
break;
default:
cdoAbort("%s: operator %d (%c) unsupported!", __func__, (int)oper, oper);
cdoAbort("%s: operator %d (%c) unsupported!", __func__, oper, oper);
break;
}
}
......@@ -399,13 +399,13 @@ void oper_expr_var_var(int oper, int nmiss, long ngp, double missval1, double mi
static
nodeType *expr_con_var(int init, int oper, nodeType *p1, nodeType *p2)
{
int ngp = p2->param.ngp;
int nlev = p2->param.nlev;
int nmiss = p2->param.nmiss;
size_t ngp = p2->param.ngp;
size_t nlev = p2->param.nlev;
size_t nmiss = p2->param.nmiss;
double missval1 = p2->param.missval;
double missval2 = p2->param.missval;
long n = (long)ngp*nlev;
size_t n = ngp*nlev;
nodeType *p = (nodeType*) Calloc(1, sizeof(nodeType));
......@@ -422,10 +422,10 @@ nodeType *expr_con_var(int init, int oper, nodeType *p1, nodeType *p2)
const double *restrict idat = p2->param.data;
double cval = p1->u.con.value;
oper_expr_con_var(oper, nmiss, n, missval1, missval2, odat, cval, idat);
oper_expr_con_var(oper, nmiss>0, n, missval1, missval2, odat, cval, idat);
nmiss = 0;
for ( long i = 0; i < n; i++ )
for ( size_t i = 0; i < n; i++ )
if ( DBL_IS_EQUAL(odat[i], missval1) ) nmiss++;
p->param.nmiss = nmiss;
......@@ -437,13 +437,13 @@ nodeType *expr_con_var(int init, int oper, nodeType *p1, nodeType *p2)
static
nodeType *expr_var_con(int init, int oper, nodeType *p1, nodeType *p2)
{
int ngp = p1->param.ngp;
int nlev = p1->param.nlev;
int nmiss = p1->param.nmiss;
size_t ngp = p1->param.ngp;
size_t nlev = p1->param.nlev;
size_t nmiss = p1->param.nmiss;
double missval1 = p1->param.missval;
double missval2 = p1->param.missval;
long n = (long)ngp*nlev;
size_t n = ngp*nlev;
nodeType *p = (nodeType*) Calloc(1, sizeof(nodeType));
......@@ -460,10 +460,10 @@ nodeType *expr_var_con(int init, int oper, nodeType *p1, nodeType *p2)
const double *restrict idat = p1->param.data;
double cval = p2->u.con.value;
oper_expr_var_con(oper, nmiss, n, missval1, missval2, odat, idat, cval);
oper_expr_var_con(oper, nmiss>0, n, missval1, missval2, odat, idat, cval);
nmiss = 0;
for ( long i = 0; i < n; i++ )
for ( size_t i = 0; i < n; i++ )
if ( DBL_IS_EQUAL(odat[i], missval1) ) nmiss++;
p->param.nmiss = nmiss;
......@@ -476,15 +476,15 @@ static
nodeType *expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
{
nodeType *px = p1;
int nmiss1 = p1->param.nmiss;
int nmiss2 = p2->param.nmiss;
size_t nmiss1 = p1->param.nmiss;
size_t nmiss2 = p2->param.nmiss;
double missval1 = p1->param.missval;
double missval2 = p2->param.missval;
long ngp1 = p1->param.ngp;
long ngp2 = p2->param.ngp;
size_t ngp1 = p1->param.ngp;
size_t ngp2 = p2->param.ngp;
long ngp = ngp1;
size_t ngp = ngp1;
if ( ngp1 != ngp2 )
{
......@@ -499,10 +499,10 @@ nodeType *expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
}
}
long nlev1 = p1->param.nlev;
long nlev2 = p2->param.nlev;
size_t nlev1 = p1->param.nlev;
size_t nlev2 = p2->param.nlev;
long nlev = nlev1;
size_t nlev = nlev1;
if ( nlev1 != nlev2 )
{
if ( nlev1 == 1 || nlev2 == 1 )
......@@ -530,10 +530,10 @@ nodeType *expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
{
p->param.data = (double*) Malloc(ngp*nlev*sizeof(double));
for ( long k = 0; k < nlev; k++ )
for ( size_t k = 0; k < nlev; k++ )
{
long loff1 = 0, loff2 = 0;
long loff = k*ngp;
size_t loff1 = 0, loff2 = 0;
size_t loff = k*ngp;
if ( nlev1 > 1 ) loff1 = k*ngp1;
if ( nlev2 > 1 ) loff2 = k*ngp2;
......@@ -554,8 +554,8 @@ nodeType *expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
oper_expr_var_var(oper, nmiss, ngp, missval1, missval2, odat, idat1, idat2);
}
int nmiss = 0;
for ( long i = 0; i < ngp*nlev; i++ )
size_t nmiss = 0;
for ( size_t i = 0; i < ngp*nlev; i++ )
if ( DBL_IS_EQUAL(p->param.data[i], missval1) ) nmiss++;
p->param.nmiss = nmiss;
......@@ -567,17 +567,17 @@ nodeType *expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
static
void ex_copy_var(int init, nodeType *p2, nodeType *p1)
{