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

Use cdi branch gridsize.

parent a850c3f0
libcdi @ 15e51519
Subproject commit 4114be8ac84dd4d7f7a60f5f9762ac95ed6381f3
Subproject commit 15e515199d6b5f13bf4669b730f676f346fcede1
......@@ -1707,7 +1707,7 @@ void after_postcntl(struct Control *globs, struct Variable *vars)
gridID = vars[code].igridID;
zaxisID = vars[code].izaxisID;
zaxisName(zaxisInqType(zaxisID), zaxistypename);
fprintf(stderr," Detected Code %3d grid %-8s size %5d level %2d %-8s\n",
fprintf(stderr," Detected Code %3d grid %-8s size %5zu level %2d %-8s\n",
code, gridNamePtr(gridInqType(gridID)), gridInqSize(gridID),
zaxisInqSize(zaxisID), zaxistypename);
}
......@@ -1812,7 +1812,7 @@ void after_postcntl(struct Control *globs, struct Variable *vars)
gridID = vars[code].ogridID;
zaxisID = vars[code].ozaxisID;
zaxisName(zaxisInqType(zaxisID), zaxistypename);
fprintf(stderr," Selected Code %3d grid %-8s size %5d level %2d %-8s\n",
fprintf(stderr," Selected Code %3d grid %-8s size %5zu level %2d %-8s\n",
code, gridNamePtr(gridInqType(gridID)), gridInqSize(gridID),
zaxisInqSize(zaxisID), zaxistypename);
}
......
......@@ -42,8 +42,8 @@ void *Arith(void *argument)
int nlevels2 = 1;
int varID, levelID;
int levelID2;
int *varnmiss2 = NULL;
int **varnmiss = NULL;
size_t *varnmiss2 = NULL;
size_t **varnmiss = NULL;
double *vardata2 = NULL;
double **vardata = NULL;
......@@ -152,7 +152,7 @@ void *Arith(void *argument)
if ( filltype == FILL_VAR || filltype == FILL_VARTS )
{
vardata2 = (double*) Malloc(gridsize*nlevels2*sizeof(double));
varnmiss2 = (int*) Malloc(nlevels2*sizeof(int));
varnmiss2 = (size_t*) Malloc(nlevels2*sizeof(size_t));
}
if ( cdoVerbose ) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
......@@ -181,13 +181,13 @@ void *Arith(void *argument)
{
nvars = vlistNvars(vlistIDx2);
vardata = (double **) Malloc(nvars*sizeof(double *));
varnmiss = (int **) Malloc(nvars*sizeof(int *));
varnmiss = (size_t **) Malloc(nvars*sizeof(size_t *));
for ( varID = 0; varID < nvars; varID++ )
{
int gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
int nlev = zaxisInqSize(vlistInqVarZaxis(vlistIDx2, varID));
vardata[varID] = (double*) Malloc(nlev*gridsize*sizeof(double));
varnmiss[varID] = (int*) Malloc(nlev*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(nlev*sizeof(size_t));
}
}
}
......@@ -250,7 +250,7 @@ void *Arith(void *argument)
{
pstreamInqRecord(streamIDx1, &varID, &levelID);
pstreamReadRecord(streamIDx1, fieldx1->ptr, &nmiss);
fieldx1->nmiss = (size_t) nmiss;
fieldx1->nmiss = nmiss;
int varID2 = varID;
if ( tsID == 0 || filltype == FILL_NONE || filltype == FILL_FILE || filltype == FILL_VARTS )
......@@ -261,7 +261,7 @@ void *Arith(void *argument)
{
pstreamInqRecord(streamIDx2, &varID2, &levelID2);
pstreamReadRecord(streamIDx2, fieldx2->ptr, &nmiss);
fieldx2->nmiss = (size_t) nmiss;
fieldx2->nmiss = nmiss;
if ( varID != varID2 ) cdoAbort("Internal error, varIDs of input streams differ!");
if ( levelID != levelID2 ) cdoAbort("Internal error, levelIDs of input streams differ!");
}
......@@ -311,7 +311,7 @@ void *Arith(void *argument)
farfun(&field1, field2, operfunc);
pstreamDefRecord(streamID3, varID, levelID);
pstreamWriteRecord(streamID3, field1.ptr, (int)field1.nmiss);
pstreamWriteRecord(streamID3, field1.ptr, field1.nmiss);
}
tsID++;
......
......@@ -125,7 +125,7 @@ void *Arithc(void *argument)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t) nmiss;
field.nmiss = nmiss;
if ( vars[varID] )
{
......@@ -141,7 +141,7 @@ void *Arithc(void *argument)
if ( DBL_IS_EQUAL(field.ptr[i], field.missval) ) field.nmiss++;
}
nmiss = (int) field.nmiss;
nmiss = field.nmiss;
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, field.ptr, nmiss);
}
......
......@@ -143,14 +143,14 @@ void *Arithdays(void *argument)
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.nmiss = nmiss;
field.grid = vlistInqVarGrid(vlistID1, varID);
field.missval = vlistInqVarMissval(vlistID1, varID);
farcfun(&field, rconst, operfunc);
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, field.ptr, (int)field.nmiss);
pstreamWriteRecord(streamID2, field.ptr, field.nmiss);
}
tsID++;
}
......
......@@ -941,7 +941,8 @@ static void addcharvar(keyValues_t *charvars, int vlistID, const char *key, stru
{
while ( nrecs-- )
{
int varIDrw, levelIDrw, nmiss;
int varIDrw, levelIDrw;
size_t nmiss;
pstreamInqRecord(streamID2, &varIDrw, &levelIDrw);
for ( int i = 0; i < charvars->nvalues; i++ )
if ( varIDrw == varIDs[i] )
......
......@@ -39,7 +39,7 @@ void *Cond(void *argument)
int i;
double missval1 = -9.E33;
double missval2 = -9.E33;
int **varnmiss1 = NULL;
size_t **varnmiss1 = NULL;
double **vardata1 = NULL;
cdoInitialize(argument);
......@@ -103,13 +103,13 @@ void *Cond(void *argument)
nvars = vlistNvars(vlistID1);
vardata1 = (double **) Malloc(nvars*sizeof(double *));
varnmiss1 = (int **) Malloc(nvars*sizeof(int *));
varnmiss1 = (size_t **) Malloc(nvars*sizeof(size_t *));
for ( varID = 0; varID < nvars; varID++ )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlev = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
vardata1[varID] = (double*) Malloc(nlev*gridsize*sizeof(double));
varnmiss1[varID] = (int*) Malloc(nlev*sizeof(int));
varnmiss1[varID] = (size_t*) Malloc(nlev*sizeof(size_t));
}
}
}
......
......@@ -38,7 +38,7 @@ void *Cond2(void *argument)
int i;
double missval1 = -9.E33;
double missval2 = -9.E33;
int **varnmiss1 = NULL;
size_t **varnmiss1 = NULL;
double **vardata1 = NULL;
cdoInitialize(argument);
......@@ -106,13 +106,13 @@ void *Cond2(void *argument)
nvars = vlistNvars(vlistID1);
vardata1 = (double **) Malloc(nvars*sizeof(double *));
varnmiss1 = (int **) Malloc(nvars*sizeof(int *));
varnmiss1 = (size_t **) Malloc(nvars*sizeof(size_t *));
for ( varID = 0; varID < nvars; varID++ )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlev = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
vardata1[varID] = (double*) Malloc(nlev*gridsize*sizeof(double));
varnmiss1[varID] = (int*) Malloc(nlev*sizeof(int));
varnmiss1[varID] = (size_t*) Malloc(nlev*sizeof(size_t));
}
}
}
......
......@@ -197,7 +197,7 @@ void *Consecstat(void *argument)
{
pstreamInqRecord(istreamID, &varID, &levelID);
pstreamReadRecord(istreamID, field.ptr, &nmiss);
field.nmiss = (size_t)nmiss;
field.nmiss = nmiss;
field.grid = vlistInqVarGrid(ovlistID, varID);
field.missval = vlistInqVarMissval(ovlistID, varID);
......@@ -207,14 +207,14 @@ void *Consecstat(void *argument)
{
case CONSECSUM:
pstreamDefRecord(ostreamID, varID, levelID);
pstreamWriteRecord(ostreamID, vars[varID][levelID].ptr, (int)vars[varID][levelID].nmiss);
pstreamWriteRecord(ostreamID, vars[varID][levelID].ptr, vars[varID][levelID].nmiss);
break;
case CONSECTS:
if ( itsID != 0 )
{
selEndOfPeriod(&periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], FALSE);
pstreamDefRecord(ostreamID, varID, levelID);
pstreamWriteRecord(ostreamID, periods[varID][levelID].ptr, (int)periods[varID][levelID].nmiss);
pstreamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
}
#if defined(_OPENMP)
#pragma omp parallel for default(shared) schedule(static)
......@@ -249,7 +249,7 @@ void *Consecstat(void *argument)
{
selEndOfPeriod(&periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], TRUE);
pstreamDefRecord(ostreamID, varID, levelID);
pstreamWriteRecord(ostreamID, periods[varID][levelID].ptr, (int)periods[varID][levelID].nmiss);
pstreamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
}
}
}
......
......@@ -185,7 +185,7 @@ void *Diff(void *argument)
set_text_color(stdout, RESET, GREEN);
double level = cdoZaxisInqLevel(zaxisID, levelID);
fprintf(stdout, "%7g ", level);
fprintf(stdout, "%8d %7d ", gridsize, MAX(nmiss1, nmiss2));
fprintf(stdout, "%8d %7zu ", gridsize, MAX(nmiss1, nmiss2));
fprintf(stdout, "%7d ", ndiff);
reset_text_color(stdout);
......
......@@ -1433,7 +1433,8 @@ void *Echam5ini(void *argument)
int vlistID1, vlistID2;
int nvars = 0;
int iv, nlev;
int gridsize, nmiss;
int gridsize;
size_t nmiss;
int taxisID, tsID;
cdoInitialize(argument);
......
......@@ -79,7 +79,8 @@ void *Enlarge(void *argument)
for ( int recID = 0; recID < nrecs; recID++ )
{
int varID, levelID, nmiss;
int varID, levelID;
size_t nmiss;
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, array1, &nmiss);
......
......@@ -215,7 +215,8 @@ void *Enlargegrid(void *argument)
for ( int recID = 0; recID < nrecs; recID++ )
{
int varID, levelID, nmiss1;
int varID, levelID;
size_t nmiss1;
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, array1, &nmiss1);
......
......@@ -52,7 +52,8 @@ double roc_curve_integrate(const double **roc, const int n);
void *Ensstat3(void *argument)
{
int i,j;
int nrecs = 0, nrecs0, nmiss;
int nrecs = 0, nrecs0;
size_t nmiss;
int cum;
int chksum; // for check of histogram population
int levelID, varID, binID = 0;
......
......@@ -43,7 +43,8 @@ enum RESTYPE_CRPS { CRPS_RES,CRPS_RELI,CRPS_POT };
void *Ensval(void *argument)
{
int i,k;
int nrecs = 0, nrecs0, nmiss, nostreams = 0, ngrids;
int nrecs = 0, nrecs0, nostreams = 0, ngrids;
size_t nmiss;
int levelID, varID;
int gridsize = 0;
int vlistID;
......
......@@ -37,7 +37,8 @@ void *Eofcoeff(void * argument)
field_type in;
field_type out;
int i, varID, levelID;
int nrecs, nmiss;
int nrecs;
size_t nmiss;
cdoInitialize(argument);
......@@ -108,7 +109,7 @@ void *Eofcoeff(void * argument)
cdoAbort("Internal error - too high levelID");
pstreamReadRecord(streamID1, eof[varID][levelID][eofID].ptr, &nmiss);
eof[varID][levelID][eofID].nmiss = (size_t) nmiss;
eof[varID][levelID][eofID].nmiss = nmiss;
}
eofID++;
}
......@@ -181,7 +182,7 @@ void *Eofcoeff(void * argument)
pstreamInqRecord(streamID2, &varID, &levelID);
missval2 = vlistInqVarMissval(vlistID2, varID);
pstreamReadRecord(streamID2, in.ptr, &nmiss);
in.nmiss = (size_t) nmiss;
in.nmiss = nmiss;
for ( eofID = 0; eofID < neof; eofID++ )
{
......
......@@ -36,7 +36,8 @@ void *Eofcoeff3d(void * argument)
double missval1 = -999, missval2 = -999;
field_type in;
int i, varID, levelID;
int nrecs, nmiss;
int nrecs;
size_t nmiss;
cdoInitialize(argument);
......@@ -106,7 +107,7 @@ void *Eofcoeff3d(void * argument)
cdoAbort("Internal error - too high levelID");
pstreamReadRecord(streamID1, eof[varID][levelID][eofID].ptr, &nmiss);
eof[varID][levelID][eofID].nmiss = (size_t) nmiss;
eof[varID][levelID][eofID].nmiss = nmiss;
}
eofID++;
}
......@@ -199,7 +200,7 @@ void *Eofcoeff3d(void * argument)
pstreamInqRecord(streamID2, &varID, &levelID);
pstreamReadRecord(streamID2, in.ptr, &nmiss);
missval2 = vlistInqVarMissval(vlistID2, varID);
in.nmiss = (size_t) nmiss;
in.nmiss = nmiss;
for ( eofID = 0; eofID < neof; eofID++ )
{
......@@ -235,7 +236,7 @@ void *Eofcoeff3d(void * argument)
for ( eofID = 0; eofID < neof; eofID++ ) {
for ( varID = 0; varID < nvars; varID++ ) {
pstreamDefRecord(streamIDs[eofID], varID, 0);
pstreamWriteRecord(streamIDs[eofID], out[varID][eofID].ptr, (int)out[varID][eofID].nmiss);
pstreamWriteRecord(streamIDs[eofID], out[varID][eofID].ptr, out[varID][eofID].nmiss);
}
}
......
......@@ -25,7 +25,8 @@ void *EstFreq(void *argument)
{
int nrecs;
int varID, levelID;
int gridsize, nmiss;
int gridsize;
size_t nmiss;
cdoInitialize(argument);
......
......@@ -116,10 +116,10 @@ void *Fldrms(void *argument)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field1.ptr, &nmiss);
field1.nmiss = (size_t) nmiss;
field1.nmiss = nmiss;
pstreamInqRecord(streamID2, &varID, &levelID);
pstreamReadRecord(streamID2, field2.ptr, &nmiss);
field2.nmiss = (size_t) nmiss;
field2.nmiss = nmiss;
field1.grid = vlistInqVarGrid(vlistID1, varID);
field2.grid = vlistInqVarGrid(vlistID2, varID);
......@@ -147,7 +147,7 @@ void *Fldrms(void *argument)
fldrms(field1, field2, &field3);
pstreamDefRecord(streamID3, varID, levelID);
pstreamWriteRecord(streamID3, &sglval, (int)field3.nmiss);
pstreamWriteRecord(streamID3, &sglval, field3.nmiss);
}
tsID++;
}
......
......@@ -616,7 +616,7 @@ void *Gridboxstat(void *argument)
size_t nmiss;
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field1.ptr, &nmiss);
field1.nmiss = (size_t) nmiss;
field1.nmiss = nmiss;
field1.grid = vlistInqVarGrid(vlistID1, varID);
field1.size = gridInqSize(field1.grid);
......@@ -640,7 +640,7 @@ void *Gridboxstat(void *argument)
gridboxstat(&field1, &field2, xinc, yinc, operfunc);
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, field2.ptr, (int)field2.nmiss);
pstreamWriteRecord(streamID2, field2.ptr, field2.nmiss);
}
tsID++;
}
......
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