Commit 288ee20d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed set_zaxistype() to cdf_set_zaxistype().

parent 04d62998
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include "dmemory.h" #include "dmemory.h"
#include "cdi.h" #include "cdi.h"
#include "cdi_int.h"
#include "cdf_util.h" #include "cdf_util.h"
#include "error.h" #include "error.h"
...@@ -307,25 +309,25 @@ void set_gridtype(const char *attstring, int *gridtype) ...@@ -307,25 +309,25 @@ void set_gridtype(const char *attstring, int *gridtype)
} }
void set_zaxistype(const char *attstring, int *zaxistype) void cdf_set_zaxistype(const char *attstring, int *zaxistype)
{ {
// clang-format off // clang-format off
if ( strcmp(attstring, "toa") == 0 ) *zaxistype = ZAXIS_TOA; if (strIsEqual(attstring, "toa")) *zaxistype = ZAXIS_TOA;
else if ( strcmp(attstring, "tropopause") == 0 ) *zaxistype = ZAXIS_TROPOPAUSE; else if (strIsEqual(attstring, "tropopause")) *zaxistype = ZAXIS_TROPOPAUSE;
else if ( strcmp(attstring, "cloudbase") == 0 ) *zaxistype = ZAXIS_CLOUD_BASE; else if (strIsEqual(attstring, "cloudbase")) *zaxistype = ZAXIS_CLOUD_BASE;
else if ( strcmp(attstring, "cloudtop") == 0 ) *zaxistype = ZAXIS_CLOUD_TOP; else if (strIsEqual(attstring, "cloudtop")) *zaxistype = ZAXIS_CLOUD_TOP;
else if ( strcmp(attstring, "isotherm0") == 0 ) *zaxistype = ZAXIS_ISOTHERM_ZERO; else if (strIsEqual(attstring, "isotherm0")) *zaxistype = ZAXIS_ISOTHERM_ZERO;
else if ( strcmp(attstring, "seabottom") == 0 ) *zaxistype = ZAXIS_SEA_BOTTOM; else if (strIsEqual(attstring, "seabottom")) *zaxistype = ZAXIS_SEA_BOTTOM;
else if ( strcmp(attstring, "lakebottom") == 0 ) *zaxistype = ZAXIS_LAKE_BOTTOM; else if (strIsEqual(attstring, "lakebottom")) *zaxistype = ZAXIS_LAKE_BOTTOM;
else if ( strcmp(attstring, "sedimentbottom") == 0 ) *zaxistype = ZAXIS_SEDIMENT_BOTTOM; else if (strIsEqual(attstring, "sedimentbottom")) *zaxistype = ZAXIS_SEDIMENT_BOTTOM;
else if ( strcmp(attstring, "sedimentbottomta") == 0 ) *zaxistype = ZAXIS_SEDIMENT_BOTTOM_TA; else if (strIsEqual(attstring, "sedimentbottomta")) *zaxistype = ZAXIS_SEDIMENT_BOTTOM_TA;
else if ( strcmp(attstring, "sedimentbottomtw") == 0 ) *zaxistype = ZAXIS_SEDIMENT_BOTTOM_TW; else if (strIsEqual(attstring, "sedimentbottomtw")) *zaxistype = ZAXIS_SEDIMENT_BOTTOM_TW;
else if ( strcmp(attstring, "mixlayer") == 0 ) *zaxistype = ZAXIS_MIX_LAYER; else if (strIsEqual(attstring, "mixlayer")) *zaxistype = ZAXIS_MIX_LAYER;
else if ( strcmp(attstring, "atmosphere") == 0 ) *zaxistype = ZAXIS_ATMOSPHERE; else if (strIsEqual(attstring, "atmosphere")) *zaxistype = ZAXIS_ATMOSPHERE;
else else
{ {
static bool warn = true; static bool warn = true;
if ( warn ) if (warn)
{ {
warn = false; warn = false;
Warning("NetCDF attribute level_type='%s' unsupported!", attstring); Warning("NetCDF attribute level_type='%s' unsupported!", attstring);
...@@ -338,15 +340,15 @@ void set_zaxistype(const char *attstring, int *zaxistype) ...@@ -338,15 +340,15 @@ void set_zaxistype(const char *attstring, int *zaxistype)
void set_calendar(const char *attstring, int *calendar) void set_calendar(const char *attstring, int *calendar)
{ {
// clang-format off // clang-format off
if ( strStartsWith(attstring, "standard") ) *calendar = CALENDAR_STANDARD; if (strStartsWith(attstring, "standard")) *calendar = CALENDAR_STANDARD;
else if ( strStartsWith(attstring, "gregorian") ) *calendar = CALENDAR_GREGORIAN; else if (strStartsWith(attstring, "gregorian")) *calendar = CALENDAR_GREGORIAN;
else if ( strStartsWith(attstring, "none") ) *calendar = CALENDAR_NONE; else if (strStartsWith(attstring, "none")) *calendar = CALENDAR_NONE;
else if ( strStartsWith(attstring, "proleptic") ) *calendar = CALENDAR_PROLEPTIC; else if (strStartsWith(attstring, "proleptic")) *calendar = CALENDAR_PROLEPTIC;
else if ( strStartsWith(attstring, "360") ) *calendar = CALENDAR_360DAYS; else if (strStartsWith(attstring, "360")) *calendar = CALENDAR_360DAYS;
else if ( strStartsWith(attstring, "365") || else if (strStartsWith(attstring, "365") ||
strStartsWith(attstring, "noleap") ) *calendar = CALENDAR_365DAYS; strStartsWith(attstring, "noleap")) *calendar = CALENDAR_365DAYS;
else if ( strStartsWith(attstring, "366") || else if (strStartsWith(attstring, "366") ||
strStartsWith(attstring, "all_leap") ) *calendar = CALENDAR_366DAYS; strStartsWith(attstring, "all_leap")) *calendar = CALENDAR_366DAYS;
else Warning("calendar >%s< unsupported!", attstring); else Warning("calendar >%s< unsupported!", attstring);
// clang-format on // clang-format on
} }
...@@ -22,7 +22,7 @@ bool is_x_axis(const char *units, const char *stdname); ...@@ -22,7 +22,7 @@ bool is_x_axis(const char *units, const char *stdname);
bool is_y_axis(const char *units, const char *stdname); bool is_y_axis(const char *units, const char *stdname);
void set_gridtype(const char *attstring, int *gridtype); void set_gridtype(const char *attstring, int *gridtype);
void set_zaxistype(const char *attstring, int *zaxistype); void cdf_set_zaxistype(const char *attstring, int *zaxistype);
void set_calendar(const char *attstring, int *calendar); void set_calendar(const char *attstring, int *calendar);
#endif #endif
...@@ -1282,7 +1282,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int ...@@ -1282,7 +1282,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
else if ( isText && strIsEqual(attname, "level_type") ) else if ( isText && strIsEqual(attname, "level_type") )
{ {
strToLower(attstring); strToLower(attstring);
set_zaxistype(attstring, &ncvars[ncvarid].zaxistype); cdf_set_zaxistype(attstring, &ncvars[ncvarid].zaxistype);
cdf_set_var(ncvars, ncvarid, TRUE); cdf_set_var(ncvars, ncvarid, TRUE);
} }
else if ( isNumber && strIsEqual(attname, "trunc_count") ) else if ( isNumber && strIsEqual(attname, "trunc_count") )
......
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