Commit 866ba861 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Set zaxistype to ZAXIS_PRESSURE only if zaxistype is undefined.

parent a42ea933
......@@ -858,7 +858,6 @@ static
bool isHybridSigmaPressureCoordinate(int ncid, int ncvarid, ncvar_t *ncvars, const ncdim_t *ncdims)
{
bool status = false;
int ncfvarid = ncvarid;
ncvar_t *ncvar = &ncvars[ncvarid];
if ( strcmp(ncvar->stdname, "atmosphere_hybrid_sigma_pressure_coordinate") == 0 )
......@@ -872,6 +871,7 @@ bool isHybridSigmaPressureCoordinate(int ncid, int ncvarid, ncvar_t *ncvars, con
int ret;
int apvarid1 = -1, bvarid1 = -1, psvarid1 = -1, avarid1 = -1, p0varid1 = -1;
int ncfvarid = ncvarid;
if ( ncvars[ncfvarid].lformula && ncvars[ncfvarid].lformulaterms )
ret = scan_hybrid_formula(ncid, ncfvarid, &apvarid1, &bvarid1, &psvarid1, &avarid1, &p0varid1);
if ( apvarid1 != -1 ) ncvars[apvarid1].isvar = FALSE;
......@@ -1931,11 +1931,6 @@ void verify_coordinate_vars_2(int nvars, ncvar_t *ncvars)
ncvars[ncvarid].isy = true;
continue;
}
else if ( is_pressure_units(ncvars[ncvarid].units) )
{
ncvars[ncvarid].zaxistype = ZAXIS_PRESSURE;
continue;
}
else if ( strcmp(ncvars[ncvarid].units, "level") == 0 || strcmp(ncvars[ncvarid].units, "1") == 0 )
{
if ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer midpoints") == 0 )
......@@ -1950,6 +1945,11 @@ void verify_coordinate_vars_2(int nvars, ncvar_t *ncvars)
ncvars[ncvarid].zaxistype = ZAXIS_GENERIC;
continue;
}
else if ( ncvars[ncvarid].zaxistype == UNDEFID && is_pressure_units(ncvars[ncvarid].units) )
{
ncvars[ncvarid].zaxistype = ZAXIS_PRESSURE;
continue;
}
else if ( is_DBL_axis(ncvars[ncvarid].longname) )
{
ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_LAND;
......
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