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

fix some compiler warnings

parent 4da08767
......@@ -86,16 +86,16 @@ case "${HOSTNAME}" in
if test "$COMP" = icc ; then
${CONFPATH}configure --prefix=$HOME/local \
$CDOLIBS \
CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native" CXX=icpc
CC=icc CFLAGS="-g -Wall -Wwrite-strings -O2 -qopt-report=5 -march=native" CXX=icpc
elif test "$COMP" = clang ; then
${CONFPATH}configure \
$CDOLIBS \
CC=clang CFLAGS="-g -Wall -Ofast -march=native"
CC=clang CFLAGS="-g -Wall -Wwrite-strings -Ofast -march=native"
else
${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \
$CDOLIBS \
CC=gcc CFLAGS="-g -pipe -Wall -W -Wfloat-equal -pedantic -O3 -march=native -fstack-protector -Wa,-q"
CC=gcc CFLAGS="-g -pipe -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3 -march=native -fstack-protector -Wa,-q"
# --with-libxml2=/usr \
# --with-magics=/Users/m214003/local/Magics-2.18.14nio \
fi
......
......@@ -32,7 +32,7 @@ void *Varrms(void *argument)
{
int streamID1, streamID2, streamID3;
int vlistID1, vlistID2, vlistID3;
int gridID1, gridID2, gridID3, lastgrid = -1;
int gridID1, gridID3, lastgrid = -1;
int wstatus = FALSE;
int code = 0, oldcode = 0;
int index, ngrids;
......@@ -84,7 +84,6 @@ void *Varrms(void *argument)
ngrids = vlistNgrids(vlistID1);
index = 0;
gridID1 = vlistGrid(vlistID1, index);
gridID2 = vlistGrid(vlistID1, index);
if ( needWeights &&
gridInqType(gridID1) != GRID_LONLAT &&
......
......@@ -54,12 +54,6 @@ void add_vars_mv(int gridsize, double missval, const double *restrict var1, cons
}
}
static
void add_vars(int gridsize, const double *restrict var1, const double *restrict var2, double *restrict var3)
{
for ( int i = 0; i < gridsize; ++i )
var3[i] = var2[i] + var1[i];
}
void *Vertcum(void *argument)
{
......
......@@ -45,8 +45,8 @@ void *Vertwind(void *argument)
int gridsize, i;
int offset;
int nmiss, nmiss_out;
int temp_code, sq_code, ps_code, omega_code, lsp_code;
int tempID = -1, sqID = -1, psID = -1, omegaID = -1, lnpsID = -1;
int temp_code, sq_code, ps_code, omega_code;
int tempID = -1, sqID = -1, psID = -1, omegaID = -1;
char varname[CDI_MAX_NAME];
double *vct = NULL;
double tv, rho;
......@@ -61,13 +61,12 @@ void *Vertwind(void *argument)
int vlistID1 = streamInqVlist(streamID1);
int ngp = vlist_check_gridsize(vlistID1);
vlist_check_gridsize(vlistID1);
temp_code = 130;
sq_code = 133;
ps_code = 134;
omega_code = 135;
lsp_code = 152;
nvars = vlistNvars(vlistID1);
for ( varID = 0; varID < nvars; ++varID )
......@@ -89,14 +88,12 @@ void *Vertwind(void *argument)
else if ( strcmp(varname, "sq") == 0 ) code = 133;
else if ( strcmp(varname, "aps") == 0 ) code = 134;
else if ( strcmp(varname, "omega") == 0 ) code = 135;
else if ( strcmp(varname, "lsp") == 0 ) code = 152;
}
if ( code == temp_code ) tempID = varID;
else if ( code == sq_code ) sqID = varID;
else if ( code == ps_code ) psID = varID;
else if ( code == omega_code ) omegaID = varID;
else if ( code == lsp_code ) lnpsID = varID;
}
if ( tempID == -1 || sqID == -1 || omegaID == -1 )
......
......@@ -35,7 +35,7 @@ int equals(double expected, double actual, double eps)
{
return (int) fabs(expected - actual) < eps;
}
/*
static
double humidityIndex(double t, double p, double r, double missval)
{
......@@ -47,7 +47,7 @@ double humidityIndex(double t, double p, double r, double missval)
return t + (5.0 / 9.0) * ((0.01 * r * p * 6.112 * pow(10.0, (7.5 * t) / (237.7 + t))) - 10.0);
}
*/
/* reads a NetCDF file containing data for a single grid point */
static
void readNcFile(const char path[], double **vars, int nvars, int nts)
......@@ -178,7 +178,7 @@ void destroyVars(double **vars)
/* gets the path of the CDO binary executable */
static
char *getCdoPath()
const char *getCdoPath()
{
char *cdoPath = getenv("CDO_PATH");
......@@ -396,7 +396,7 @@ void testEcaGsl()
destroyVars(vars);
}
/*
static
void testHi()
{
......@@ -424,7 +424,7 @@ void testHi()
destroyVars(vars);
}
*/
static
void testTimcount()
{
......@@ -463,14 +463,14 @@ void testTimcount()
destroyVars(vars);
}
/*
static
void testSeascount()
{
const double array[] = {MISSVAL, MISSVAL, TO_KELVIN(1.0), MISSVAL,
TO_KELVIN(1.0), TO_KELVIN(1.0)};
/* number of output variables and time steps */
// number of output variables and time steps
int nvars = 1;
int nts = 1;
......@@ -502,7 +502,7 @@ void testSeascount()
destroyVars(vars);
}
*/
static
void testWct()
{
......
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