Commit 83093ffd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

removed compiler warnings for unused variables

parent 2aa3a2b5
......@@ -194,6 +194,8 @@ void *Adisit(void *argument)
ADISIT = cdoOperatorAdd("adisit", 1, 1, "");
ADIPOT = cdoOperatorAdd("adipot", 1, 1, "");
UNUSED(ADIPOT);
operatorID = cdoOperatorID();
if ( operatorArgc() == 1 ) pin = atof(operatorArgv()[0]);
......
......@@ -49,10 +49,14 @@ void *CDItest(void *argument)
NCOPY = cdoOperatorAdd("ncopy", 0, 0, NULL);
UNUSED(NCOPY);
// if ( UNCHANGED_RECORD ) lcopy = TRUE;
operatorID = cdoOperatorID();
UNUSED(operatorID);
// operatorInputArg("Number of copies");
if ( operatorArgc() == 1 ) max_copy = atoi(operatorArgv()[0]);
......
......@@ -140,6 +140,8 @@ int com_list(char *arg)
/* The user wishes to quit using this program. Just set DONE non-zero. */
int com_quit(char *arg)
{
UNUSED(arg);
Done = 1;
return (0);
......@@ -150,6 +152,8 @@ int com_stat(char *arg)
{
int nrecs;
int tsID;
UNUSED(arg);
fprintf(stdout, "name=%s\n", all_vars[gl_varID].name);
......@@ -301,6 +305,8 @@ void command_init()
gl_vlistID = streamInqVlist(gl_streamID);
taxisID = vlistInqTaxis(gl_vlistID);
UNUSED(taxisID);
gridsize = vlistGridsizeMax(gl_vlistID);
gl_data = (double*) malloc(gridsize*sizeof(double));
......@@ -319,9 +325,8 @@ void command_init()
void *Command(void *argument)
{
int nrecs;
int recID, varID, levelID;
int nmiss;
// int recID, varID, levelID;
// int nmiss;
double s_utime, s_stime;
double e_utime, e_stime;
double c_cputime = 0, c_usertime = 0, c_systime = 0;
......
......@@ -32,7 +32,7 @@ void *Deltime(void *argument)
int recID, varID, levelID;
int vlistID1, vlistID2;
int taxisID1, taxisID2;
int vdate, vtime;
int vdate /*, vtime */;
int copytimestep;
int lcopy = FALSE;
int gridsize;
......@@ -48,6 +48,8 @@ void *Deltime(void *argument)
DELDAY = cdoOperatorAdd("delday", 0, 0, NULL);
DEL29FEB = cdoOperatorAdd("del29feb", 0, 0, NULL);
UNUSED(DELDAY);
operatorID = cdoOperatorID();
if ( operatorID == DEL29FEB )
......@@ -66,7 +68,7 @@ void *Deltime(void *argument)
sarg = operatorArgv()[0];
dday = atoi(sarg);
dmon = 0;
while ( isdigit(*sarg) ) *sarg++;
while ( isdigit(*sarg) ) sarg++;
if ( isalpha(*sarg) )
{
char smon[32];
......@@ -109,7 +111,7 @@ void *Deltime(void *argument)
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
vdate = taxisInqVdate(taxisID1);
vtime = taxisInqVtime(taxisID1);
// vtime = taxisInqVtime(taxisID1);
cdiDecodeDate(vdate, &year, &month, &day);
......
......@@ -210,6 +210,8 @@ int import_e5ml(const char *filename, VAR **vars)
gridtype = (*vars)[iv].gridtype;
zaxistype = (*vars)[iv].zaxistype;
UNUSED(zaxistype);
if ( gridtype == GRID_GAUSSIAN )
{
(*vars)[iv].gridID = gridIDgp;
......@@ -283,7 +285,7 @@ void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtim
int varid, code;
int ilev;
int lon, lat;
int nlon, nlat, nlev, nlevp1, nvct, nsp, n2, i, nvclev;
int nlon, nlat, nlev, nlevp1/*, nvct*/, nsp, n2, i, nvclev;
int lat_dimid, lon_dimid, nlev_dimid, nlevp1_dimid, nsp_dimid, nvclev_dimid, n2_dimid;
int gridIDgp = -1, gridIDsp, zaxisIDml = -1;
int gridtype, zaxistype;
......@@ -293,7 +295,7 @@ void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtim
const double *vct;
char atttext[1024];
size_t attlen;
int attint;
//int attint;
char *username;
char timestr[30];
time_t date_and_time_in_sec;
......@@ -335,6 +337,7 @@ void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtim
else if ( gridtype == GRID_SPECTRAL && nsp == 0 )
{
gridIDsp = vars[varid].gridID;
UNUSED(gridIDsp);
nsp = gridInqSize(vars[varid].gridID);
nsp = nsp/2;
}
......@@ -424,7 +427,7 @@ void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtim
nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "vdate", NC_INT, 1, &vdate));
nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "vtime", NC_INT, 1, &vtime));
attint = 31;
//attint = 31;
nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "spherical_truncation_n", NC_INT, 1, &ntr));
nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "spherical_truncation_m", NC_INT, 1, &ntr));
nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "spherical_truncation_k", NC_INT, 1, &ntr));
......@@ -482,7 +485,7 @@ void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtim
/* define model level */
nvct = nvclev*2;
// nvct = nvclev*2;
/* vct = (double*) malloc(nvct*sizeof(double)); */
......@@ -747,6 +750,8 @@ int import_e5res(const char *filename, VAR **vars, ATTS *atts)
nce(nc_inq_dimlen(nc_file_id, spc_dimid, &dimlen));
spc = (int) dimlen;
UNUSED(spc);
nce(nc_inq_dimid(nc_file_id, "nvclev", &nvclev_dimid));
nce(nc_inq_dimlen(nc_file_id, nvclev_dimid, &dimlen));
nvclev = (int) dimlen;
......@@ -771,6 +776,7 @@ int import_e5res(const char *filename, VAR **vars, ATTS *atts)
nce(nc_inq_dimlen(nc_file_id, ilev_dimid, &dimlen));
ilev = (int) dimlen;
UNUSED(ilev);
/*
nce(nc_inq_dimid(nc_file_id, "surface", &surface_dimid));
nce(nc_inq_dimlen(nc_file_id, surface_dimid, &surface));
......@@ -1083,7 +1089,7 @@ void export_e5res(const char *filename, VAR *vars, int nvars)
int varid;
size_t nvals;
size_t start[4], count[4];
int nlon, nlat, nlev, nvct, nfc, i;
int nlon, nlat, nlev/*, nvct*/, nfc, i;
int gridIDgp = -1, zaxisIDml = -1;
int nc_file_id;
double *xvals, *yvals;
......@@ -1392,7 +1398,7 @@ void export_e5res(const char *filename, VAR *vars, int nvars)
/* define model level */
nlev = lev;
nvct = nvclev*2;
//nvct = nvclev*2;
/* vct = (double*) malloc(nvct*sizeof(double)); */
......
......@@ -46,7 +46,6 @@ void *Eofcoeff(void * argument)
int i, varID, recID, levelID, tsID, eofID;
int gridID1, gridID3;
int nrecs, nvars, nlevs, neof, nchars, nmiss, ngrids;
int reached_eof;
int streamID1, streamID2, *streamIDs;
int taxisID2, taxisID3;
int vlistID1, vlistID2, vlistID3;
......@@ -82,7 +81,7 @@ void *Eofcoeff(void * argument)
cdoAbort("Too many grids in input");
nvars = vlistNvars(vlistID1)==vlistNvars(vlistID2) ? vlistNvars(vlistID1) : -1;
nrecs = vlistNrecs(vlistID1);
nrecs = vlistNrecs(vlistID1);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, 0));
//w = (double*) malloc(gridsize*sizeof(double));
//gridWeights(gridID2, w);
......@@ -104,16 +103,13 @@ void *Eofcoeff(void * argument)
eof = (field_t***) malloc(nvars * sizeof(field_t**));
for ( varID=0; varID<nvars; varID++)
eof[varID] = (field_t**) malloc(nlevs*sizeof(field_t*));
reached_eof=0;
eofID = 0;
while ( 1 )
{
nrecs = streamInqTimestep(streamID1, eofID);
if ( nrecs == 0)
{
reached_eof = 1;
break;
}
if ( nrecs == 0) break;
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
......@@ -192,17 +188,11 @@ void *Eofcoeff(void * argument)
out.nmiss = 0;
out.ptr = (double*) malloc(1*sizeof(double));
//
reached_eof=0;
tsID=0;
while ( 1 )
{
nrecs = streamInqTimestep(streamID2, tsID);
if ( nrecs == 0 )
{
reached_eof=1;
break;
}
if ( nrecs == 0 ) break;
taxisCopyTimestep(taxisID3, taxisID2);
/*for ( eofID=0; eofID<neof; eofID++)
......
......@@ -46,7 +46,6 @@ void *Eofcoeff3d(void * argument)
int i, varID, recID, levelID, tsID, eofID, *varID3;
int gridID1,gridID3;
int nrecs, nvars, nlevs, neof, nchars, nmiss;
int reached_eof;
int streamID1, streamID2, *streamIDs;
int taxisID2, taxisID3;
int vlistID1, vlistID2, vlistID3;
......@@ -103,16 +102,13 @@ void *Eofcoeff3d(void * argument)
eof = (field_t***) malloc(nvars * sizeof(field_t**));
for ( varID=0; varID<nvars; varID++)
eof[varID] = (field_t**) malloc(nlevs*sizeof(field_t*));
reached_eof=0;
eofID = 0;
while ( 1 )
{
nrecs = streamInqTimestep(streamID1, eofID);
if ( nrecs == 0)
{
reached_eof = 1;
break;
}
if ( nrecs == 0) break;
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
......@@ -199,16 +195,11 @@ void *Eofcoeff3d(void * argument)
}
}
reached_eof=0;
tsID=0;
while ( 1 )
{
nrecs = streamInqTimestep(streamID2, tsID);
if ( nrecs == 0 )
{
reached_eof=1;
break;
}
if ( nrecs == 0 ) break;
for ( varID = 0; varID < nvars; varID++ )
for ( eofID = 0; eofID < neof; eofID++ ) {
......
......@@ -56,7 +56,7 @@ void *Expr(void *argument)
int gridsize, nlevel;
int nmiss;
int taxisID1, taxisID2;
int lwarn = TRUE;
//int lwarn = TRUE;
double missval;
double *array = NULL;
double *single1, *single2;
......@@ -74,6 +74,8 @@ void *Expr(void *argument)
AEXPR = cdoOperatorAdd("aexpr", 0, 0, "expressions");
AEXPRF = cdoOperatorAdd("aexprf", 0, 0, "expr script filename");
UNUSED(AEXPRF);
operatorID = cdoOperatorID();
operatorInputArg(cdoOperatorEnter(operatorID));
......
......@@ -237,7 +237,7 @@ void *Importobs(void *argument)
if ( i < xsize && j < ysize && index >= 0 )
{
pstation = station;
while (isalpha(*pstation)) *pstation++;
while (isalpha(*pstation)) pstation++;
// printf("station %s %d\n", pstation, atoi(pstation));
data[index][j*xsize+i] = value;
data[ 4][j*xsize+i] = height1;
......
......@@ -1477,7 +1477,10 @@ int main(int argc, char *argv[])
get_env_vars();
parse_options_long(argc, argv);
if ( 1 )
parse_options_long(argc, argv);
else
parse_options(argc, argv);
cdo_set_options();
......
......@@ -24,6 +24,9 @@
#include "util.h"
#include "text.h"
/* dummy use of unused parameters to silence compiler warnings */
#define UNUSED(x) (void)x
#undef TRUE
#define TRUE 1
#undef FALSE
......
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