Commit 3cf12eb4 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed field_t to field_type.

parent 120e4bec
......@@ -97,7 +97,7 @@ double adipot(double t, double s, double p)
}
static
void calc_adisit(long gridsize, long nlevel, double *pressure, field_t tho, field_t sao, field_t tis)
void calc_adisit(long gridsize, long nlevel, double *pressure, field_type tho, field_type sao, field_type tis)
{
/* pressure units: hPa */
/* tho units: Celsius */
......@@ -126,7 +126,7 @@ void calc_adisit(long gridsize, long nlevel, double *pressure, field_t tho, fiel
}
static
void calc_adipot(long gridsize, long nlevel, double *pressure, field_t t, field_t s, field_t tpot)
void calc_adipot(long gridsize, long nlevel, double *pressure, field_type t, field_type s, field_type tpot)
{
/* pressure units: hPa */
/* t units: Celsius */
......@@ -239,7 +239,7 @@ void *Adisit(void *argument)
cdoPrint("%5d %g", i+1, pressure[i]);
}
field_t tho, sao, tis;
field_type tho, sao, tis;
field_init(&tho);
field_init(&sao);
field_init(&tis);
......
......@@ -69,9 +69,9 @@ void *Arith(void *argument)
int streamIDx1 = streamID1;
int streamIDx2 = streamID2;
field_t field1, field2;
field_t *fieldx1 = &field1;
field_t *fieldx2 = &field2;
field_type field1, field2;
field_type *fieldx1 = &field1;
field_type *fieldx2 = &field2;
int vlistID1 = streamInqVlist(streamID1);
int vlistID2 = streamInqVlist(streamID2);
......
......@@ -108,7 +108,7 @@ void *Arithc(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
field_t field;
field_type field;
field_init(&field);
field.ptr = (double*) Malloc(gridsize*sizeof(double));
field.weight = NULL;
......
......@@ -105,7 +105,7 @@ void *Arithdays(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
field_t field;
field_type field;
field_init(&field);
field.ptr = (double*) Malloc(gridsize*sizeof(double));
field.weight = NULL;
......
......@@ -38,7 +38,7 @@
enum {CONSECSUM, CONSECTS};
#define SWITCHWARN "Hit default case!This should never happen (%s).\n"
static void selEndOfPeriod(field_t *periods, field_t history, field_t current, int isLastTimestep)
static void selEndOfPeriod(field_type *periods, field_type history, field_type current, int isLastTimestep)
{
long i;
double pmissval = periods->missval;
......@@ -146,13 +146,13 @@ void *Consecstat(void *argument)
int otaxisID = taxisDuplicate(itaxisID);
vlistDefTaxis(ovlistID, otaxisID);
field_t field;
field_type field;
field_init(&field);
field.ptr = (double*) Malloc(vlistGridsizeMax(ovlistID)*sizeof(double));
int nvars = vlistNvars(ivlistID);
field_t **vars = field_calloc(ivlistID, FIELD_PTR);
field_t **hist = NULL, **periods = NULL;
field_type **vars = field_calloc(ivlistID, FIELD_PTR);
field_type **hist = NULL, **periods = NULL;
if ( operatorID == CONSECTS )
{
hist = field_malloc(ivlistID, FIELD_PTR);
......
......@@ -48,7 +48,7 @@ void *Deltat(void *argument)
streamDefVlist(streamID2, vlistID2);
field_t **vars = field_malloc(vlistID1, FIELD_PTR);
field_type **vars = field_malloc(vlistID1, FIELD_PTR);
int gridsizemax = vlistGridsizeMax(vlistID1);
double *array1 = (double*) Malloc(gridsizemax*sizeof(double));
......
......@@ -72,7 +72,7 @@ void *Detrend(void *argument)
int nmiss;
int nlevel;
double missval;
field_t ***vars = NULL;
field_type ***vars = NULL;
dtlist_type *dtlist = dtlist_new();
typedef struct
{
......@@ -103,7 +103,7 @@ void *Detrend(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vars = (field_t ***) Realloc(vars, nalloc*sizeof(field_t **));
vars = (field_type ***) Realloc(vars, nalloc*sizeof(field_type **));
}
dtlist_taxisInqTimestep(dtlist, taxisID1, tsID);
......
......@@ -32,7 +32,7 @@ void *Duplicate(void *argument)
int nmiss;
int *vdate = NULL, *vtime = NULL;
int ndup = 2;
field_t ***vars = NULL;
field_type ***vars = NULL;
cdoInitialize(argument);
......@@ -81,7 +81,7 @@ void *Duplicate(void *argument)
nalloc += NALLOC_INC;
vdate = (int*) Realloc(vdate, nalloc*sizeof(int));
vtime = (int*) Realloc(vtime, nalloc*sizeof(int));
vars = (field_t***) Realloc(vars, nalloc*sizeof(field_t**));
vars = (field_type***) Realloc(vars, nalloc*sizeof(field_type**));
}
vdate[tsID] = taxisInqVdate(taxisID1);
......
......@@ -94,7 +94,7 @@ void *Ensstat(void *argument)
ens_file_t *ef = (ens_file_t *) Malloc(nfiles*sizeof(ens_file_t));
field_t *field = (field_t *) Malloc(ompNumThreads*sizeof(field_t));
field_type *field = (field_type *) Malloc(ompNumThreads*sizeof(field_type));
for ( int i = 0; i < ompNumThreads; i++ )
{
field_init(&field[i]);
......
......@@ -110,7 +110,7 @@ void *Ensstat3(void *argument)
/* ("first touch strategy") */
/* --> #pragma omp parallel for ... */
/* *************************************************** */
field_t *field = (field_t*) Malloc(ompNumThreads*sizeof(field_t));
field_type *field = (field_type*) Malloc(ompNumThreads*sizeof(field_type));
for ( i = 0; i < ompNumThreads; i++ )
{
field_init(&field[i]);
......
......@@ -34,8 +34,8 @@ void *Eofcoeff(void * argument)
{
char eof_name[8], oname[1024], filesuffix[32];
double missval1 = -999, missval2;
field_t in;
field_t out;
field_type in;
field_type out;
int i, varID, levelID;
int nrecs, nmiss;
......@@ -78,9 +78,9 @@ void *Eofcoeff(void * argument)
filesuffix[0] = 0;
cdoGenFileSuffix(filesuffix, sizeof(filesuffix), streamInqFiletype(streamID1), vlistID1, refname);
field_t ***eof = (field_t***) Malloc(nvars * sizeof(field_t**));
field_type ***eof = (field_type***) Malloc(nvars * sizeof(field_type**));
for ( varID=0; varID<nvars; varID++ )
eof[varID] = (field_t**) Malloc(nlevs*sizeof(field_t*));
eof[varID] = (field_type**) Malloc(nlevs*sizeof(field_type*));
int eofID = 0;
while ( 1 )
......@@ -93,9 +93,9 @@ void *Eofcoeff(void * argument)
streamInqRecord(streamID1, &varID, &levelID);
missval1 = vlistInqVarMissval(vlistID1, varID);
if ( eofID == 0 )
eof[varID][levelID] = (field_t*) Malloc(1*sizeof(field_t));
eof[varID][levelID] = (field_type*) Malloc(1*sizeof(field_type));
else
eof[varID][levelID] = (field_t*) Realloc(eof[varID][levelID], (eofID+1)*sizeof(field_t));
eof[varID][levelID] = (field_type*) Realloc(eof[varID][levelID], (eofID+1)*sizeof(field_type));
eof[varID][levelID][eofID].grid = gridID1;
eof[varID][levelID][eofID].nmiss = 0;
eof[varID][levelID][eofID].missval= missval1;
......
......@@ -34,7 +34,7 @@ void *Eofcoeff3d(void * argument)
{
char eof_name[6], oname[1024], filesuffix[32];
double missval1 = -999, missval2 = -999;
field_t in;
field_type in;
int i, varID, levelID;
int nrecs, nmiss;
......@@ -76,9 +76,9 @@ void *Eofcoeff3d(void * argument)
filesuffix[0] = 0;
cdoGenFileSuffix(filesuffix, sizeof(filesuffix), streamInqFiletype(streamID1), vlistID1, refname);
field_t ***eof = (field_t***) Malloc(nvars * sizeof(field_t**));
field_type ***eof = (field_type***) Malloc(nvars * sizeof(field_type**));
for ( varID=0; varID<nvars; varID++ )
eof[varID] = (field_t**) Malloc(nlevs*sizeof(field_t*));
eof[varID] = (field_type**) Malloc(nlevs*sizeof(field_type*));
int eofID = 0;
while ( 1 )
......@@ -91,9 +91,9 @@ void *Eofcoeff3d(void * argument)
streamInqRecord(streamID1, &varID, &levelID);
missval1 = vlistInqVarMissval(vlistID1, varID);
if ( eofID == 0 )
eof[varID][levelID] = (field_t*) Malloc(1*sizeof(field_t));
eof[varID][levelID] = (field_type*) Malloc(1*sizeof(field_type));
else
eof[varID][levelID] = (field_t*) Realloc(eof[varID][levelID], (eofID+1)*sizeof(field_t));
eof[varID][levelID] = (field_type*) Realloc(eof[varID][levelID], (eofID+1)*sizeof(field_type));
eof[varID][levelID][eofID].grid = gridID1;
eof[varID][levelID][eofID].nmiss = 0;
eof[varID][levelID][eofID].missval= missval1;
......@@ -161,9 +161,9 @@ void *Eofcoeff3d(void * argument)
// ALLOCATE temporary fields for data read and write
in.ptr = (double*) Malloc(gridsize*sizeof(double));
in.grid = gridID1;
field_t **out = (field_t**) Malloc(nvars*sizeof(field_t*));
field_type **out = (field_type**) Malloc(nvars*sizeof(field_type*));
for ( varID = 0; varID < nvars; varID++ ) {
out[varID] = (field_t*) Malloc( neof * sizeof(field_t));
out[varID] = (field_type*) Malloc( neof * sizeof(field_type));
for ( eofID=0; eofID<neof; eofID++ ) {
out[varID][eofID].missval = missval1;
out[varID][eofID].nmiss = 0;
......
......@@ -32,7 +32,7 @@
#include "clipping/geometry.h"
void fillmiss(field_t *field1, field_t *field2, int nfill)
void fillmiss(field_type *field1, field_type *field2, int nfill)
{
int nx, ny, i, j;
int nmiss2 = 0;
......@@ -147,7 +147,7 @@ void fillmiss(field_t *field1, field_t *field2, int nfill)
}
void fillmiss_one_step(field_t *field1, field_t *field2, int maxfill)
void fillmiss_one_step(field_type *field1, field_type *field2, int maxfill)
{
int gridID, nx, ny, i, j;
int nmiss2 = 0;
......@@ -276,7 +276,7 @@ double nbr_compute_weights(unsigned num_neighbors, const int *restrict src_grid_
unsigned nbr_normalize_weights(unsigned num_neighbors, double dist_tot, const int *restrict nbr_mask, int *restrict nbr_add, double *restrict nbr_dist);
static
void setmisstodis(field_t *field1, field_t *field2, int num_neighbors)
void setmisstodis(field_type *field1, field_type *field2, int num_neighbors)
{
int gridID = field1->grid;
int gridID0 = gridID;
......@@ -414,7 +414,7 @@ void *Fillmiss(void *argument)
{
int nmiss;
int nrecs, varID, levelID;
void (*fill_method) (field_t *fin , field_t *fout , int) = NULL;
void (*fill_method) (field_type *fin , field_type *fout , int) = NULL;
cdoInitialize(argument);
......@@ -476,7 +476,7 @@ void *Fillmiss(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
field_t field1, field2;
field_type field1, field2;
field_init(&field1);
field_init(&field2);
field1.ptr = (double*) Malloc(gridsize*sizeof(double));
......
......@@ -130,7 +130,7 @@ void *Filter(void *argument)
bool use_fftw = false;
double fmin = 0, fmax = 0;
double fdata = 0;
field_t ***vars = NULL;
field_type ***vars = NULL;
dtlist_type *dtlist = dtlist_new();
typedef struct
{
......@@ -185,7 +185,7 @@ void *Filter(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vars = (field_t ***) Realloc(vars, nalloc*sizeof(field_t **));
vars = (field_type ***) Realloc(vars, nalloc*sizeof(field_type **));
}
dtlist_taxisInqTimestep(dtlist, taxisID1, tsID);
......
......@@ -87,7 +87,7 @@ void *Fldrms(void *argument)
streamDefVlist(streamID3, vlistID3);
field_t field1, field2, field3;
field_type field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field3);
......
......@@ -90,7 +90,7 @@ void *Fldstat(void *argument)
int varID, levelID;
int nmiss;
double sglval;
field_t field;
field_type field;
cdoInitialize(argument);
......
......@@ -37,7 +37,7 @@ void *Fourier(void *argument)
int nlevel;
int *vdate = NULL, *vtime = NULL;
double missval;
field_t ***vars = NULL;
field_type ***vars = NULL;
typedef struct
{
double *real;
......@@ -75,7 +75,7 @@ void *Fourier(void *argument)
nalloc += NALLOC_INC;
vdate = (int*) Realloc(vdate, nalloc*sizeof(int));
vtime = (int*) Realloc(vtime, nalloc*sizeof(int));
vars = (field_t ***) Realloc(vars, nalloc*sizeof(field_t **));
vars = (field_type ***) Realloc(vars, nalloc*sizeof(field_type **));
}
vdate[tsID] = taxisInqVdate(taxisID1);
......
......@@ -445,7 +445,7 @@ int genBoxGrid(int gridID1, int xinc, int yinc)
}
static
void gridboxstat(field_t *field1, field_t *field2, int xinc, int yinc, int statfunc)
void gridboxstat(field_type *field1, field_type *field2, int xinc, int yinc, int statfunc)
{
bool useWeight = false;
/*
......@@ -456,7 +456,7 @@ void gridboxstat(field_t *field1, field_t *field2, int xinc, int yinc, int statf
if ( field1->weight ) useWeight = true;
int gridsize = xinc*yinc;
field_t *field = (field_t*) Malloc(ompNumThreads*sizeof(field_t));
field_type *field = (field_type*) Malloc(ompNumThreads*sizeof(field_type));
for ( int i = 0; i < ompNumThreads; i++ )
{
field[i].size = gridsize;
......@@ -595,7 +595,7 @@ void *Gridboxstat(void *argument)
streamDefVlist(streamID2, vlistID2);
field_t field1, field2;
field_type field1, field2;
field_init(&field1);
field_init(&field2);
......
......@@ -46,7 +46,7 @@ static double humidityIndex(double t, double e, double r, double missval)
}
static void farexpr(field_t *field1, field_t field2, field_t field3, double (*expression)(double, double, double, double))
static void farexpr(field_type *field1, field_type field2, field_type field3, double (*expression)(double, double, double, double))
{
const int grid1 = field1->grid;
const int nmiss1 = field1->nmiss;
......@@ -113,7 +113,7 @@ void *Hi(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
field_t field1, field2, field3;
field_type field1, field2, field3;
field_init(&field1);
field_init(&field2);
field_init(&field3);
......
......@@ -179,7 +179,7 @@ int genBoxavgGrid(int gridID1, int xinc, int yinc)
}
static
void boxavg(field_t *field1, field_t *field2, int xinc, int yinc)
void boxavg(field_type *field1, field_type *field2, int xinc, int yinc)
{
int gridID1 = field1->grid;
int gridID2 = field2->grid;
......@@ -235,7 +235,7 @@ void boxavg(field_t *field1, field_t *field2, int xinc, int yinc)
}
static
void thinout(field_t *field1, field_t *field2, int xinc, int yinc)
void thinout(field_type *field1, field_type *field2, int xinc, int yinc)
{
int gridID1 = field1->grid;
int gridID2 = field2->grid;
......@@ -379,7 +379,7 @@ void *Intgrid(void *argument)
gridsize = gridInqSize(gridID2);
double *array2 = (double*) Malloc(gridsize*sizeof(double));
field_t field1, field2;
field_type field1, field2;
field_init(&field1);
field_init(&field2);
......
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