Commit 9bb3b6a4 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed status to paramIsMissing.

parent f944cba4
Pipeline #5407 passed with stages
in 15 minutes and 37 seconds
......@@ -294,12 +294,11 @@ cdo_lcc_to_lonlat(int gridID, size_t nvals, double *xvals, double *yvals)
double lon_0, lat_0, lat_1, lat_2, a, rf, xval_0, yval_0, x_0, y_0;
gridInqParamLCC(gridID, grid_missval, &lon_0, &lat_0, &lat_1, &lat_2, &a, &rf, &xval_0, &yval_0, &x_0, &y_0);
int status = 0;
if (!status && checkValIsMiss(projection, "longitude_of_central_meridian", lon_0, grid_missval)) status = 1;
if (!status && checkValIsMiss(projection, "latitude_of_projection_origin", lat_0, grid_missval)) status = 1;
if (!status && checkValIsMiss(projection, "standard_parallel", lat_1, grid_missval)) status = 1;
bool paramIsMissing = checkValIsMiss(projection, "longitude_of_central_meridian", lon_0, grid_missval)
|| checkValIsMiss(projection, "latitude_of_projection_origin", lat_0, grid_missval)
|| checkValIsMiss(projection, "standard_parallel", lat_1, grid_missval);
if (!status && IS_EQUAL(x_0, grid_missval) && IS_EQUAL(y_0, grid_missval) && IS_NOT_EQUAL(xval_0, grid_missval)
if (!paramIsMissing && IS_EQUAL(x_0, grid_missval) && IS_EQUAL(y_0, grid_missval) && IS_NOT_EQUAL(xval_0, grid_missval)
&& IS_NOT_EQUAL(yval_0, grid_missval))
{
#ifdef HAVE_LIBPROJ
......@@ -309,13 +308,13 @@ cdo_lcc_to_lonlat(int gridID, size_t nvals, double *xvals, double *yvals)
x_0 = -x_0;
y_0 = -y_0;
#else
status = 1;
paramIsMissing = true;
cdoWarning("%s mapping parameter %s missing!", projection, "false_easting and false_northing");
cdoAbort("proj library support not compiled in!");
#endif
}
if (status) cdoAbort("%s mapping parameter missing!", projection);
if (paramIsMissing) cdoAbort("%s mapping parameter missing!", projection);
verify_lcc_parameter(lon_0, lat_0, lat_1, lat_2, a, rf, x_0, y_0);
......@@ -436,12 +435,11 @@ cdo_stere_to_lonlat(int gridID, size_t nvals, double *xvals, double *yvals)
double lon_0, lat_ts, lat_0, a, xval_0, yval_0, x_0, y_0;
gridInqParamSTERE(gridID, grid_missval, &lon_0, &lat_ts, &lat_0, &a, &xval_0, &yval_0, &x_0, &y_0);
int status = 0;
if (!status && checkValIsMiss(projection, "straight_vertical_longitude_from_pole", lon_0, grid_missval)) status = 1;
if (!status && checkValIsMiss(projection, "latitude_of_projection_origin", lat_0, grid_missval)) status = 1;
if (!status && checkValIsMiss(projection, "standard_parallel", lat_ts, grid_missval)) status = 1;
bool paramIsMissing = checkValIsMiss(projection, "straight_vertical_longitude_from_pole", lon_0, grid_missval)
|| checkValIsMiss(projection, "latitude_of_projection_origin", lat_0, grid_missval)
|| checkValIsMiss(projection, "standard_parallel", lat_ts, grid_missval);
if (!status && IS_EQUAL(x_0, grid_missval) && IS_EQUAL(y_0, grid_missval) && IS_NOT_EQUAL(xval_0, grid_missval)
if (!paramIsMissing && IS_EQUAL(x_0, grid_missval) && IS_EQUAL(y_0, grid_missval) && IS_NOT_EQUAL(xval_0, grid_missval)
&& IS_NOT_EQUAL(yval_0, grid_missval))
{
#ifdef HAVE_LIBPROJ
......@@ -451,13 +449,13 @@ cdo_stere_to_lonlat(int gridID, size_t nvals, double *xvals, double *yvals)
x_0 = -x_0;
y_0 = -y_0;
#else
status = 1;
paramIsMissing = true;
cdoWarning("%s mapping parameter %s missing!", projection, "false_easting and false_northing");
cdoAbort("proj library support not compiled in!");
#endif
}
if (status) cdoAbort("%s mapping parameter missing!", projection);
if (paramIsMissing) cdoAbort("%s mapping parameter missing!", projection);
verify_stere_parameter(lon_0, lat_ts, lat_0, a, x_0, y_0);
......@@ -537,9 +535,9 @@ cdiInqAttConvertedToFloat(int gridID, int atttype, const char *attname, int attl
static void
grid_inq_param_laea(int gridID, double *a, double *lon_0, double *lat_0, double *x_0, double *y_0)
{
*a = 0;
*lon_0 = 0;
*lat_0 = 0, *x_0 = 0, *y_0 = 0;
*a = 0.0;
*lon_0 = 0.0;
*lat_0 = 0.0, *x_0 = 0.0, *y_0 = 0.0;
const auto gridtype = gridInqType(gridID);
if (gridtype == GRID_PROJECTION)
......@@ -621,7 +619,7 @@ cdo_proj_to_lonlat(char *proj_params, size_t nvals, double *xvals, double *yvals
double
gridGetPlanetRadius(int gridID)
{
double planetRadius = 0;
double planetRadius = 0.0;
const auto gridtype = gridInqType(gridID);
const auto projtype = (gridtype == GRID_PROJECTION) ? gridInqProjType(gridID) : -1;
......
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