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

Fix g++ warnings.

parent 36e5c113
Pipeline #2538 passed with stages
in 15 minutes and 8 seconds
......@@ -533,14 +533,14 @@ void *EcaCwfi(void *process)
sprintf(longname, CWFI_LONGNAME, argN);
if ( OPID_ECA == cdoOperatorID() )
if (OPID_ECA == cdoOperatorID())
{
request.var1.name = CWFI_NAME;
request.var1.longname = longname;
request.var1.refdate = 19550101;
request.var1.units = CWFI_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = CWFI_NAME_ET;
request.var1.longname = CWFI_LONGNAME_ET;
......@@ -612,6 +612,7 @@ void *EcaFd(void *process)
OPID_ECA = cdoOperatorAdd("eca_fd", 0, 31, nullptr);
OPID_ETC = cdoOperatorAdd("etccdi_fd", 0, 10, nullptr);
}
if ( OPID_ECA == cdoOperatorID() )
{
request.var1.name = FD_NAME;
......@@ -619,13 +620,14 @@ void *EcaFd(void *process)
request.var1.refdate = 19550101;
request.var1.units = nullptr;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = FD_NAME_ET;
request.var1.longname = FD_LONGNAME_ET;
request.var1.refdate = 18500101;
request.var1.units = FD_UNITS_ET;
}
request.var1.f1 = vfarselltc;
request.var1.f1arg = TO_KELVIN(0.0);
request.var1.f2 = vfarnum;
......@@ -820,7 +822,7 @@ void *EcaHwfi(void *process)
request.var1.refdate = 19550101;
request.var1.units = HWFI_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = HWFI_NAME_ET;
request.var1.longname = HWFI_LONGNAME_ET;
......@@ -869,18 +871,20 @@ void *EcaId(void *process)
OPID_ETC = cdoOperatorAdd("etccdi_id", 0, 10, nullptr);
OPID_ECA = cdoOperatorAdd("eca_id", 0, 31, nullptr);
}
if ( OPID_ECA == cdoOperatorID() )
{
request.var1.name = ID_NAME;
request.var1.longname = ID_UNITS;
request.var1.units = ID_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = ID_NAME_ET;
request.var1.longname = ID_LONGNAME_ET;
request.var1.units = ID_UNITS_ET;
}
request.var1.f1 = vfarselltc;
request.var1.f1arg = TO_KELVIN(0.0);
request.var1.f2 = vfarnum;
......@@ -930,7 +934,7 @@ void *EcaSu(void *process)
request.var1.refdate = 19550101;
request.var1.units = nullptr;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = SU_NAME_ET;
request.var1.longname = SU_LONGNAME_ET;
......@@ -1092,7 +1096,7 @@ void *EcaTr(void *process)
request.var1.refdate = 19550101;
request.var1.units = TR_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = TR_NAME_ET;
request.var1.longname = TR_LONGNAME_ET;
......@@ -1228,7 +1232,7 @@ void *EcaCdd(void *process)
request.var1.refdate = 19550101;
request.var1.units = CDD_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = CDD_NAME_ET;
request.var1.longname = CDD_LONGNAME_ET;
......@@ -1303,7 +1307,7 @@ void *EcaCwd(void *process)
request.var1.refdate = 19550101;
request.var1.units = CWD_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = CWD_NAME_ET;
request.var1.longname = CWD_LONGNAME_ET;
......@@ -1739,7 +1743,7 @@ EcaRx1day(void *process)
request.var1.refdate = 19550101;
request.var1.units = RX1DAY_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = RX1DAY_NAME_ET;
request.var1.longname = RX1DAY_LONGNAME_ET;
......@@ -1801,7 +1805,7 @@ EcaRx5day(void *process)
request.var1.refdate = 19550101;
request.var1.units = RX5DAY_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = RX5DAY_NAME_ET;
request.var1.longname = RX5DAY_LONGNAME_ET;
......@@ -1863,7 +1867,7 @@ EcaSdii(void *process)
request.var1.longname = lnamebuffer;
request.var1.units = SDII_UNITS;
}
else
else if (OPID_ETC == cdoOperatorID())
{
request.var1.name = SDII_NAME_ET;
request.var1.longname = SDII_LONGNAME_ET;
......
......@@ -637,21 +637,19 @@ export_e5ml(const char *filename, VAR *vars, int nvars, int64_t vdate, int vtime
static void
read_gg3d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxisID)
{
int nlev, nlat, nlon, gridsize, i;
int gridtype, zaxistype;
int nc_var_id;
size_t start[3], count[3];
gridtype = gridInqType(gridID);
zaxistype = zaxisInqType(zaxisID);
int gridtype = gridInqType(gridID);
int zaxistype = zaxisInqType(zaxisID);
inivar(var, gridtype, zaxistype, 0, name, nullptr, nullptr);
nlon = gridInqXsize(gridID);
nlat = gridInqYsize(gridID);
nlev = zaxisInqSize(zaxisID);
int nlon = gridInqXsize(gridID);
int nlat = gridInqYsize(gridID);
int nlev = zaxisInqSize(zaxisID);
gridsize = nlon * nlat;
int gridsize = nlon * nlat;
var->gridID = gridID;
var->zaxisID = zaxisID;
......@@ -660,7 +658,7 @@ read_gg3d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxisID)
var->ptr = (double *) Malloc(nlev * gridsize * sizeof(double));
for (i = 0; i < nlev; i++)
for (int i = 0; i < nlev; i++)
{
start[0] = 0;
start[1] = i;
......@@ -1488,8 +1486,7 @@ Echam5ini(void *process)
int nrecs = 0;
int varID, levelID;
int nvars = 0;
int iv, nlev;
size_t gridsize;
int iv;
size_t nmiss;
int tsID;
......@@ -1561,8 +1558,8 @@ Echam5ini(void *process)
for (varID = 0; varID < nvars; varID++)
{
gridsize = vars[varID].gridsize;
nlev = vars[varID].nlev;
auto gridsize = vars[varID].gridsize;
auto nlev = vars[varID].nlev;
for (levelID = 0; levelID < nlev; levelID++)
{
......@@ -1578,7 +1575,7 @@ Echam5ini(void *process)
else if (operfunc == func_write)
{
VAR *vars = nullptr;
int code, gridID, zaxisID, gridtype, zaxistype, gridsize, nlev;
int code, gridID, zaxisID, gridtype, zaxistype;
char name[CDI_MAX_NAME], longname[CDI_MAX_NAME], units[CDI_MAX_NAME];
int64_t vdate;
int vtime;
......@@ -1650,8 +1647,8 @@ Echam5ini(void *process)
ntr = gridInqTrunc(gridID);
}
gridsize = gridInqSize(gridID);
nlev = zaxisInqSize(zaxisID);
auto gridsize = gridInqSize(gridID);
auto nlev = zaxisInqSize(zaxisID);
if (zaxistype == ZAXIS_HYBRID && nlev == 1) zaxistype = ZAXIS_SURFACE;
......@@ -1679,9 +1676,7 @@ Echam5ini(void *process)
{
cdoInqRecord(streamID1, &varID, &levelID);
gridID = vlistInqVarGrid(vlistID1, varID);
gridsize = gridInqSize(gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
cdoReadRecord(streamID1, vars[varID].ptr + levelID * gridsize, &nmiss);
}
......
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