Commit 34c2daca authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed field_init() to fieldInit() and changed type of parameter from pointer to reference.

parent a4ef6fad
......@@ -235,9 +235,9 @@ Adisit(void *process)
}
Field tho, sao, tis;
field_init(&tho);
field_init(&sao);
field_init(&tis);
fieldInit(tho);
fieldInit(sao);
fieldInit(tis);
tho.ptr = (double *) Malloc(gridsize * nlevel * sizeof(double));
sao.ptr = (double *) Malloc(gridsize * nlevel * sizeof(double));
tis.ptr = (double *) Malloc(gridsize * nlevel * sizeof(double));
......
......@@ -155,8 +155,8 @@ Arith(void *process)
if (nwpv == 2 && opercplx == false) cdoAbort("Fields with complex numbers are not supported by this operator!");
size_t gridsizemax = nwpv * vlistGridsizeMax(vlistIDx1);
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
field1.ptr = (double *) Malloc(gridsizemax * sizeof(double));
field2.ptr = (double *) Malloc(gridsizemax * sizeof(double));
if (filltype == FILL_VAR || filltype == FILL_VARTS)
......
......@@ -116,7 +116,7 @@ Arithc(void *process)
size_t gridsizemax = nwpv * vlistGridsizeMax(vlistID1);
Field field;
field_init(&field);
fieldInit(field);
field.ptr = (double *) Malloc(gridsizemax * sizeof(double));
field.weight = NULL;
......
......@@ -107,7 +107,7 @@ Arithdays(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
Field field;
field_init(&field);
fieldInit(field);
field.ptr = (double *) Malloc(gridsize * sizeof(double));
field.weight = NULL;
......
......@@ -149,7 +149,7 @@ Consecstat(void *process)
vlistDefTaxis(ovlistID, otaxisID);
Field field;
field_init(&field);
fieldInit(field);
field.ptr = (double *) Malloc(vlistGridsizeMax(ovlistID) * sizeof(double));
int nvars = vlistNvars(ivlistID);
......
......@@ -191,7 +191,7 @@ Ensstat(void *process)
Field *field = (Field *) Malloc(Threading::ompNumThreads * sizeof(Field));
for (int i = 0; i < Threading::ompNumThreads; i++)
{
field_init(&field[i]);
fieldInit(field[i]);
field[i].size = nfiles;
field[i].ptr = (double *) Malloc(nfiles * sizeof(double));
}
......
......@@ -131,7 +131,7 @@ Ensstat3(void *process)
Field *field = (Field *) Malloc(Threading::ompNumThreads * sizeof(Field));
for (i = 0; i < Threading::ompNumThreads; i++)
{
field_init(&field[i]);
fieldInit(field[i]);
field[i].size = nfiles;
field[i].ptr = (double *) Malloc(nfiles * sizeof(double));
field[i].weight = (double *) Malloc(nfiles * sizeof(double));
......
......@@ -560,8 +560,8 @@ Fillmiss(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
field1.ptr = (double *) Malloc(gridsize * sizeof(double));
field2.ptr = (double *) Malloc(gridsize * sizeof(double));
......
......@@ -81,9 +81,9 @@ Fldrms(void *process)
pstreamDefVlist(streamID3, vlistID3);
Field field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field3);
fieldInit(field1);
fieldInit(field2);
fieldInit(field3);
size_t lim = vlistGridsizeMax(vlistID1);
field1.ptr = (double *) Malloc(lim * sizeof(double));
......
......@@ -181,7 +181,7 @@ Fldstat(void *process)
pstreamDefVlist(streamID2, vlistID2);
Field field;
field_init(&field);
fieldInit(field);
size_t gridsizemax = vlistGridsizeMax(vlistID1);
field.ptr = (double *) Malloc(gridsizemax * sizeof(double));
......
......@@ -578,8 +578,8 @@ Gridboxstat(void *process)
pstreamDefVlist(streamID2, vlistID2);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
size_t gridsize1 = gridInqSize(gridID1);
field1.ptr = (double *) Malloc(gridsize1 * sizeof(double));
......
......@@ -113,9 +113,9 @@ Hi(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
Field field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field3);
fieldInit(field1);
fieldInit(field2);
fieldInit(field3);
field1.ptr = (double *) Malloc(gridsize * sizeof(double));
field2.ptr = (double *) Malloc(gridsize * sizeof(double));
field3.ptr = (double *) Malloc(gridsize * sizeof(double));
......
......@@ -332,8 +332,8 @@ Intgrid(void *process)
std::vector<double> array2(gridsize);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
......
......@@ -75,8 +75,8 @@ Intgridtraj(void *process)
int vlistID1 = cdoStreamInqVlist(streamID1);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
int nvars = vlistNvars(vlistID1);
......
......@@ -119,7 +119,7 @@ Isosurface(void *process)
size_t gridsizemax = vlistGridsizeMax(vlistID1);
Field field;
field_init(&field);
fieldInit(field);
field.ptr = (double *) Malloc(gridsizemax * sizeof(double));
int nvars = vlistNvars(vlistID1);
......@@ -138,7 +138,7 @@ Isosurface(void *process)
liso[varID] = (zaxisID == zaxisID1);
field_init(&vars1[varID]);
fieldInit(vars1[varID]);
vars1[varID].grid = gridID;
vars1[varID].zaxis = zaxisID;
vars1[varID].nmiss = 0;
......
......@@ -115,8 +115,8 @@ Merstat(void *process)
size_t lim = vlistGridsizeMax(vlistID1);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
field1.ptr = (double *) Malloc(lim * sizeof(double));
field1.weight = NULL;
......
......@@ -59,8 +59,8 @@ Monarith(void *process)
size_t gridsizemax = vlistGridsizeMax(vlistID1);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
field1.ptr = (double *) Malloc(gridsizemax * sizeof(double));
field2.ptr = (double *) Malloc(gridsizemax * sizeof(double));
......
......@@ -64,8 +64,8 @@ Regres(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
Field field1, field2;
field_init(&field1);
field_init(&field2);
fieldInit(field1);
fieldInit(field2);
field1.ptr = (double *) Malloc(gridsize * sizeof(double));
field2.ptr = (double *) Malloc(gridsize * sizeof(double));
......
......@@ -239,9 +239,9 @@ Rhopot(void *process)
for (int i = 0; i < nlevel; ++i) cdoPrint("%5d %g", i + 1, pressure[i]);
}
field_init(&to);
field_init(&sao);
field_init(&rho);
fieldInit(to);
fieldInit(sao);
fieldInit(rho);
to.ptr = (double *) Malloc(gridsize * nlevel * sizeof(double));
sao.ptr = (double *) Malloc(gridsize * nlevel * sizeof(double));
rho.ptr = (double *) Malloc(gridsize * nlevel * sizeof(double));
......
......@@ -62,7 +62,7 @@ Seascount(void *process)
if (vlistNumber(vlistID1) != CDI_REAL) gridsize *= 2;
Field field;
field_init(&field);
fieldInit(field);
field.ptr = (double *) Malloc(gridsize * sizeof(double));
FieldVector2D vars1;
......
Supports Markdown
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