Commit 65f32915 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added support for zaxis standard name: depth

parent 34e4eab6
......@@ -4084,15 +4084,18 @@ int isDBLAxis(const char *longname)
}
static
int isDBSAxis(const char *longname)
int isDepthAxis(const char *stdname, const char *longname)
{
int status = FALSE;
if ( strcmp(longname, "depth_below_sea") == 0 ||
strcmp(longname, "depth below sea") == 0 )
{
status = TRUE;
}
if ( strcmp(stdname, "depth") == 0 ) status = TRUE;
if ( status == FALSE )
if ( strcmp(longname, "depth_below_sea") == 0 ||
strcmp(longname, "depth below sea") == 0 )
{
status = TRUE;
}
return (status);
}
......@@ -4853,7 +4856,7 @@ void verify_coordinate_vars_1(int ndims, ncdim_t *ncdims, ncvar_t *ncvars, int t
}
else if ( strcmp(ncvars[ncvarid].units, "m") == 0 )
{
if ( isDBSAxis(ncvars[ncvarid].longname) )
if ( isDepthAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_SEA;
else if ( isHeightAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
ncvars[ncvarid].zaxistype = ZAXIS_HEIGHT;
......@@ -4936,7 +4939,7 @@ void verify_coordinate_vars_2(int nvars, ncvar_t *ncvars)
}
else if ( strcmp(ncvars[ncvarid].units, "m") == 0 )
{
if ( isDBSAxis(ncvars[ncvarid].longname) )
if ( isDepthAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_SEA;
else if ( isHeightAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
ncvars[ncvarid].zaxistype = ZAXIS_HEIGHT;
......
......@@ -30,7 +30,7 @@ ZaxistypeEntry[] = {
{2, "lev", "hybrid_half", "", "level"},
{2, "lev", "pressure", "air_pressure", "Pa"},
{1, "height", "height", "height", "m"},
{2, "depth", "depth_below_sea", "", "m"},
{2, "depth", "depth_below_sea", "depth", "m"},
{2, "depth", "depth_below_land", "", "cm"},
{0, "lev", "isentropic", "", "K"},
{0, "lev", "trajectory", "", ""},
......
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