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

Renamed field_type to Field.

parent b5c63335
......@@ -89,7 +89,7 @@ adipot(double t, double s, double p)
}
static void
calc_adisit(long gridsize, long nlevel, double *pressure, field_type tho, field_type sao, field_type tis)
calc_adisit(long gridsize, long nlevel, double *pressure, Field tho, Field sao, Field tis)
{
/* pressure units: hPa */
/* tho units: Celsius */
......@@ -117,7 +117,7 @@ calc_adisit(long gridsize, long nlevel, double *pressure, field_type tho, field_
}
static void
calc_adipot(long gridsize, long nlevel, double *pressure, field_type t, field_type s, field_type tpot)
calc_adipot(long gridsize, long nlevel, double *pressure, Field t, Field s, Field tpot)
{
/* pressure units: hPa */
/* t units: Celsius */
......@@ -234,7 +234,7 @@ Adisit(void *process)
for (i = 0; i < nlevel; ++i) cdoPrint("%5d %g", i + 1, pressure[i]);
}
field_type tho, sao, tis;
Field tho, sao, tis;
field_init(&tho);
field_init(&sao);
field_init(&tis);
......
......@@ -78,9 +78,9 @@ Arith(void *process)
int streamIDx1 = streamID1;
int streamIDx2 = streamID2;
field_type field1, field2;
field_type *fieldx1 = &field1;
field_type *fieldx2 = &field2;
Field field1, field2;
Field *fieldx1 = &field1;
Field *fieldx2 = &field2;
int vlistID1 = cdoStreamInqVlist(streamID1);
int vlistID2 = cdoStreamInqVlist(streamID2);
......
......@@ -106,7 +106,7 @@ Arithc(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
field_type field;
Field field;
field_init(&field);
field.ptr = (double *) Malloc(gridsize * sizeof(double));
field.weight = NULL;
......
......@@ -106,7 +106,7 @@ Arithdays(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
field_type field;
Field field;
field_init(&field);
field.ptr = (double *) Malloc(gridsize * sizeof(double));
field.weight = NULL;
......
......@@ -43,7 +43,7 @@ enum
#define SWITCHWARN "Hit default case!This should never happen (%s).\n"
static void
selEndOfPeriod(field_type *periods, field_type history, field_type current, int isLastTimestep)
selEndOfPeriod(Field *periods, Field history, Field current, int isLastTimestep)
{
size_t i;
double pmissval = periods->missval;
......@@ -148,13 +148,13 @@ Consecstat(void *process)
int otaxisID = taxisDuplicate(itaxisID);
vlistDefTaxis(ovlistID, otaxisID);
field_type field;
Field field;
field_init(&field);
field.ptr = (double *) Malloc(vlistGridsizeMax(ovlistID) * sizeof(double));
int nvars = vlistNvars(ivlistID);
field_type **vars = field_calloc(ivlistID, FIELD_PTR);
field_type **hist = NULL, **periods = NULL;
Field **vars = field_calloc(ivlistID, FIELD_PTR);
Field **hist = NULL, **periods = NULL;
if (operatorID == CONSECTS)
{
hist = field_malloc(ivlistID, FIELD_PTR);
......
......@@ -46,7 +46,7 @@ Deltat(void *process)
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1), cdoFiletype());
pstreamDefVlist(streamID2, vlistID2);
field_type **vars = field_malloc(vlistID1, FIELD_PTR);
Field **vars = field_malloc(vlistID1, FIELD_PTR);
size_t gridsizemax = vlistGridsizeMax(vlistID1);
std::vector<double> array1(gridsizemax);
......
......@@ -86,7 +86,7 @@ Detrend(void *process)
pstreamDefVlist(streamID2, vlistID2);
int nvars = vlistNvars(vlistID1);
std::vector<field_type **> vars;
std::vector<Field **> vars;
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
......
......@@ -68,7 +68,7 @@ Duplicate(void *process)
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1), cdoFiletype());
pstreamDefVlist(streamID2, vlistID2);
std::vector<field_type **> vars;
std::vector<Field **> vars;
std::vector<int> vdate, vtime;
int tsID = 0;
......
......@@ -60,7 +60,7 @@ typedef struct
ens_file_t *ef;
double *array2;
double *count2;
field_type *field;
Field *field;
int operfunc;
double pn;
bool lpctl;
......@@ -77,7 +77,7 @@ ensstat_func(void *ensarg)
int t = arg->t;
int nfiles = arg->nfiles;
ens_file_t *ef = arg->ef;
field_type *field = arg->field;
Field *field = arg->field;
bool lmiss = false;
for (int fileID = 0; fileID < nfiles; fileID++)
......@@ -188,7 +188,7 @@ Ensstat(void *process)
ens_file_t *ef = (ens_file_t *) Malloc(nfiles * sizeof(ens_file_t));
field_type *field = (field_type *) Malloc(Threading::ompNumThreads * sizeof(field_type));
Field *field = (Field *) Malloc(Threading::ompNumThreads * sizeof(Field));
for (int i = 0; i < Threading::ompNumThreads; i++)
{
field_init(&field[i]);
......
......@@ -128,7 +128,7 @@ Ensstat3(void *process)
/* ("first touch strategy") */
/* --> #pragma omp parallel for ... */
/* *************************************************** */
field_type *field = (field_type *) Malloc(Threading::ompNumThreads * sizeof(field_type));
Field *field = (Field *) Malloc(Threading::ompNumThreads * sizeof(Field));
for (i = 0; i < Threading::ompNumThreads; i++)
{
field_init(&field[i]);
......
......@@ -34,8 +34,8 @@ Eofcoeff(void *process)
{
char eof_name[16], oname[1024], filesuffix[32];
double missval1 = -999, missval2;
field_type in;
field_type out;
Field in;
Field out;
int i, varID, levelID;
int nrecs;
size_t nmiss;
......@@ -78,8 +78,8 @@ Eofcoeff(void *process)
filesuffix[0] = 0;
cdoGenFileSuffix(filesuffix, sizeof(filesuffix), pstreamInqFiletype(streamID1), vlistID1, refname);
field_type ***eof = (field_type ***) Malloc(nvars * sizeof(field_type **));
for (varID = 0; varID < nvars; varID++) eof[varID] = (field_type **) Malloc(nlevs * sizeof(field_type *));
Field ***eof = (Field ***) Malloc(nvars * sizeof(Field **));
for (varID = 0; varID < nvars; varID++) eof[varID] = (Field **) Malloc(nlevs * sizeof(Field *));
int eofID = 0;
while (1)
......@@ -92,9 +92,9 @@ Eofcoeff(void *process)
pstreamInqRecord(streamID1, &varID, &levelID);
missval1 = vlistInqVarMissval(vlistID1, varID);
if (eofID == 0)
eof[varID][levelID] = (field_type *) Malloc(1 * sizeof(field_type));
eof[varID][levelID] = (Field *) Malloc(1 * sizeof(Field));
else
eof[varID][levelID] = (field_type *) Realloc(eof[varID][levelID], (eofID + 1) * sizeof(field_type));
eof[varID][levelID] = (Field *) Realloc(eof[varID][levelID], (eofID + 1) * sizeof(Field));
eof[varID][levelID][eofID].grid = gridID1;
eof[varID][levelID][eofID].nmiss = 0;
eof[varID][levelID][eofID].missval = missval1;
......
......@@ -34,7 +34,7 @@ Eofcoeff3d(void *process)
{
char eof_name[16], oname[1024], filesuffix[32];
double missval1 = -999, missval2 = -999;
field_type in;
Field in;
int i, varID, levelID;
int nrecs;
size_t nmiss;
......@@ -75,8 +75,8 @@ Eofcoeff3d(void *process)
filesuffix[0] = 0;
cdoGenFileSuffix(filesuffix, sizeof(filesuffix), pstreamInqFiletype(streamID1), vlistID1, refname);
field_type ***eof = (field_type ***) Malloc(nvars * sizeof(field_type **));
for (varID = 0; varID < nvars; varID++) eof[varID] = (field_type **) Malloc(nlevs * sizeof(field_type *));
Field ***eof = (Field ***) Malloc(nvars * sizeof(Field **));
for (varID = 0; varID < nvars; varID++) eof[varID] = (Field **) Malloc(nlevs * sizeof(Field *));
int eofID = 0;
while (1)
......@@ -89,9 +89,9 @@ Eofcoeff3d(void *process)
pstreamInqRecord(streamID1, &varID, &levelID);
missval1 = vlistInqVarMissval(vlistID1, varID);
if (eofID == 0)
eof[varID][levelID] = (field_type *) Malloc(1 * sizeof(field_type));
eof[varID][levelID] = (Field *) Malloc(1 * sizeof(Field));
else
eof[varID][levelID] = (field_type *) Realloc(eof[varID][levelID], (eofID + 1) * sizeof(field_type));
eof[varID][levelID] = (Field *) Realloc(eof[varID][levelID], (eofID + 1) * sizeof(Field));
eof[varID][levelID][eofID].grid = gridID1;
eof[varID][levelID][eofID].nmiss = 0;
eof[varID][levelID][eofID].missval = missval1;
......@@ -159,10 +159,10 @@ Eofcoeff3d(void *process)
// ALLOCATE temporary fields for data read and write
in.ptr = (double *) Malloc(gridsize * sizeof(double));
in.grid = gridID1;
field_type **out = (field_type **) Malloc(nvars * sizeof(field_type *));
Field **out = (Field **) Malloc(nvars * sizeof(Field *));
for (varID = 0; varID < nvars; varID++)
{
out[varID] = (field_type *) Malloc(neof * sizeof(field_type));
out[varID] = (Field *) Malloc(neof * sizeof(Field));
for (eofID = 0; eofID < neof; eofID++)
{
out[varID][eofID].missval = missval1;
......
......@@ -30,7 +30,7 @@
#include "cdoOptions.h"
void
fillmiss(field_type *field1, field_type *field2, int nfill)
fillmiss(Field *field1, Field *field2, int nfill)
{
int nx, ny, i, j;
size_t nmiss2 = 0;
......@@ -205,7 +205,7 @@ fillmiss(field_type *field1, field_type *field2, int nfill)
}
void
fillmiss_one_step(field_type *field1, field_type *field2, int maxfill)
fillmiss_one_step(Field *field1, Field *field2, int maxfill)
{
int gridID, nx, ny, i, j;
size_t nmiss2 = 0;
......@@ -376,7 +376,7 @@ fillmiss_one_step(field_type *field1, field_type *field2, int maxfill)
}
static void
setmisstodis(field_type *field1, field_type *field2, int numNeighbors)
setmisstodis(Field *field1, Field *field2, int numNeighbors)
{
int gridID = field1->grid;
int gridID0 = gridID;
......@@ -501,7 +501,7 @@ Fillmiss(void *process)
{
size_t nmiss;
int nrecs, varID, levelID;
void (*fill_method)(field_type * fin, field_type * fout, int) = NULL;
void (*fill_method)(Field * fin, Field * fout, int) = NULL;
cdoInitialize(process);
......@@ -565,7 +565,7 @@ Fillmiss(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
field_type field1, field2;
Field field1, field2;
field_init(&field1);
field_init(&field2);
field1.ptr = (double *) Malloc(gridsize * sizeof(double));
......
......@@ -172,7 +172,7 @@ Filter(void *process)
int calendar = taxisInqCalendar(taxisID1);
int nvars = vlistNvars(vlistID1);
std::vector<field_type **> vars;
std::vector<Field **> vars;
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
......
......@@ -80,7 +80,7 @@ Fldrms(void *process)
int streamID3 = cdoStreamOpenWrite(cdoStreamName(2), cdoFiletype());
pstreamDefVlist(streamID3, vlistID3);
field_type field1, field2, field3;
Field field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field3);
......
......@@ -182,7 +182,7 @@ Fldstat(void *process)
pstreamDefVlist(streamID2, vlistID2);
field_type field;
Field field;
field_init(&field);
size_t gridsizemax = vlistGridsizeMax(vlistID1);
......
......@@ -57,7 +57,7 @@ Fourier(void *process)
pstreamDefVlist(streamID2, vlistID2);
int nvars = vlistNvars(vlistID1);
std::vector<field_type **> vars;
std::vector<Field **> vars;
std::vector<int> vdate, vtime;
int tsID = 0;
......
......@@ -444,7 +444,7 @@ genBoxGrid(int gridID1, size_t xinc, size_t yinc)
}
static void
gridboxstat(field_type *field1, field_type *field2, size_t xinc, size_t yinc, int statfunc)
gridboxstat(Field *field1, Field *field2, size_t xinc, size_t yinc, int statfunc)
{
bool useWeight = (field1->weight != NULL);
/*
......@@ -454,7 +454,7 @@ gridboxstat(field_type *field1, field_type *field2, size_t xinc, size_t yinc, in
*/
size_t gridsize = xinc * yinc;
field_type *field = (field_type *) Malloc(Threading::ompNumThreads * sizeof(field_type));
Field *field = (Field *) Malloc(Threading::ompNumThreads * sizeof(Field));
for (int i = 0; i < Threading::ompNumThreads; i++)
{
field[i].size = gridsize;
......@@ -582,7 +582,7 @@ Gridboxstat(void *process)
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1), cdoFiletype());
pstreamDefVlist(streamID2, vlistID2);
field_type field1, field2;
Field field1, field2;
field_init(&field1);
field_init(&field2);
......
......@@ -49,7 +49,7 @@ humidityIndex(double t, double e, double r, double missval)
}
static void
farexpr(field_type *field1, field_type field2, field_type field3, double (*expression)(double, double, double, double))
farexpr(Field *field1, Field field2, Field field3, double (*expression)(double, double, double, double))
{
const int grid1 = field1->grid;
const size_t nmiss1 = field1->nmiss;
......@@ -112,7 +112,7 @@ Hi(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
field_type field1, field2, field3;
Field field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field3);
......
......@@ -159,7 +159,7 @@ genBoxavgGrid(int gridID1, size_t xinc, size_t yinc)
}
static void
boxavg(field_type *field1, field_type *field2, size_t xinc, size_t yinc)
boxavg(Field *field1, Field *field2, size_t xinc, size_t yinc)
{
int gridID1 = field1->grid;
int gridID2 = field2->grid;
......@@ -204,7 +204,7 @@ boxavg(field_type *field1, field_type *field2, size_t xinc, size_t yinc)
}
static void
thinout(field_type *field1, field_type *field2, int xinc, int yinc)
thinout(Field *field1, Field *field2, int xinc, int yinc)
{
int gridID1 = field1->grid;
int gridID2 = field2->grid;
......@@ -331,7 +331,7 @@ Intgrid(void *process)
gridsize = gridInqSize(gridID2);
std::vector<double> array2(gridsize);
field_type field1, field2;
Field field1, field2;
field_init(&field1);
field_init(&field2);
......
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