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

Changed type of gridsize to size_t.

parent 421a43e9
......@@ -36,8 +36,8 @@ void rot_uv_back(int gridID, double *us, double *vs)
if ( gridInqType(gridID) == GRID_PROJECTION && gridInqProjType(gridID) == CDI_PROJ_RLL )
gridInqParamRLL(gridID, &xpole, &ypole, &angle);
long nlon = gridInqXsize(gridID);
long nlat = gridInqYsize(gridID);
size_t nlon = gridInqXsize(gridID);
size_t nlat = gridInqYsize(gridID);
double *xvals = (double*) Malloc(nlon*sizeof(double));
double *yvals = (double*) Malloc(nlat*sizeof(double));
......@@ -54,10 +54,10 @@ void rot_uv_back(int gridID, double *us, double *vs)
grid_to_degree(units, nlat, yvals, "grid center lat");
double u, v;
for ( long ilat = 0; ilat < nlat; ilat++ )
for ( long ilon = 0; ilon < nlon; ilon++ )
for ( size_t ilat = 0; ilat < nlat; ilat++ )
for ( size_t ilon = 0; ilon < nlon; ilon++ )
{
long i = ilat*nlon + ilon;
size_t i = ilat*nlon + ilon;
double xval = lamrot_to_lam(yvals[ilat], xvals[ilon], ypole, xpole, angle);
double yval = phirot_to_phi(yvals[ilat], xvals[ilon], ypole, angle);
......@@ -78,9 +78,8 @@ void *Rotuv(void *argument)
{
int varID, levelID;
int varID1, varID2, nlevel1, nlevel2;
int gridsize;
size_t gridsize;
int code, gridID;
int offset;
int nlevel;
int chcodes[MAXARG];
char *chvars[MAXARG];
......@@ -189,7 +188,7 @@ void *Rotuv(void *argument)
recLevelID[recID] = levelID;
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
offset = gridsize*levelID;
size_t offset = gridsize*levelID;
single = vardata[varID] + offset;
pstreamReadRecord(streamID1, single, &varnmiss[varID][levelID]);
if ( varnmiss[varID][levelID] )
......@@ -266,7 +265,7 @@ void *Rotuv(void *argument)
for ( levelID = 0; levelID < nlevel1; levelID++ )
{
offset = gridsize*levelID;
size_t offset = gridsize*levelID;
rot_uv_back(gridID, usvar + offset, vsvar + offset);
}
}
......@@ -276,7 +275,7 @@ void *Rotuv(void *argument)
varID = recVarID[recID];
levelID = recLevelID[recID];
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
offset = gridsize*levelID;
size_t offset = gridsize*levelID;
single = vardata[varID] + offset;
pstreamDefRecord(streamID2, varID, levelID);
......
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