Commit 6933cc4c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdi_generate_vars: set level to level1 if zaxis bounds are available.

parent 6b38c8af
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.9.5 * using CGRIBEX library version 1.9.5
* Version 1.9.9 released * Version 1.9.9 released
2020-09-25 Uwe Schulzweida
* cdi_generate_vars: set level to level1 if zaxis bounds are available (removed level = (level1 + level2) / 2)
2020-09-21 Uwe Schulzweida 2020-09-21 Uwe Schulzweida
* Ignore netCDF attribute _NCProperties * Ignore netCDF attribute _NCProperties
......
...@@ -552,14 +552,14 @@ void cdi_generate_vars(stream_t *streamptr) ...@@ -552,14 +552,14 @@ void cdi_generate_vars(stream_t *streamptr)
const int param = vartable[varid].param; const int param = vartable[varid].param;
const int ltype1 = vartable[varid].ltype1; const int ltype1 = vartable[varid].ltype1;
const int ltype2 = vartable[varid].ltype2; const int ltype2 = vartable[varid].ltype2;
int zaxistype = vartable[varid].zaxistype; int zaxistype = vartable[varid].zaxistype;
if ( ltype1 == 0 && zaxistype == ZAXIS_GENERIC && cdiDefaultLeveltype != -1 ) if ( ltype1 == 0 && zaxistype == ZAXIS_GENERIC && cdiDefaultLeveltype != -1 )
zaxistype = cdiDefaultLeveltype; zaxistype = cdiDefaultLeveltype;
const int lbounds = vartable[varid].lbounds; const int lbounds = vartable[varid].lbounds;
const int prec = vartable[varid].prec; const int prec = vartable[varid].prec;
int instID = vartable[varid].instID; int instID = vartable[varid].instID;
int modelID = vartable[varid].modelID; int modelID = vartable[varid].modelID;
int tableID = vartable[varid].tableID; int tableID = vartable[varid].tableID;
const int tsteptype = vartable[varid].tsteptype; const int tsteptype = vartable[varid].tsteptype;
const int comptype = vartable[varid].comptype; const int comptype = vartable[varid].comptype;
...@@ -602,11 +602,12 @@ void cdi_generate_vars(stream_t *streamptr) ...@@ -602,11 +602,12 @@ void cdi_generate_vars(stream_t *streamptr)
double *dlevels = (double *) Malloc(nlevels*sizeof(double)); double *dlevels = (double *) Malloc(nlevels*sizeof(double));
/*
if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF ) if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
for ( unsigned levelID = 0; levelID < nlevels; levelID++ ) for ( unsigned levelID = 0; levelID < nlevels; levelID++ )
dlevels[levelID] = (level_sf*levelTable[levelID].level1 + dlevels[levelID] = (level_sf*levelTable[levelID].level1 + level_sf*levelTable[levelID].level2) / 2.0;
level_sf*levelTable[levelID].level2)/2;
else else
*/
for ( unsigned levelID = 0; levelID < nlevels; levelID++ ) for ( unsigned levelID = 0; levelID < nlevels; levelID++ )
dlevels[levelID] = level_sf*levelTable[levelID].level1; dlevels[levelID] = level_sf*levelTable[levelID].level1;
...@@ -645,11 +646,12 @@ void cdi_generate_vars(stream_t *streamptr) ...@@ -645,11 +646,12 @@ void cdi_generate_vars(stream_t *streamptr)
if ( lsort ) if ( lsort )
{ {
/*
if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF ) if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
for ( unsigned levelID = 0; levelID < nlevels; levelID++ ) for ( unsigned levelID = 0; levelID < nlevels; levelID++ )
dlevels[levelID] = (level_sf*levelTable[levelID].level1 + dlevels[levelID] = (level_sf*levelTable[levelID].level1 + level_sf*levelTable[levelID].level2) / 2.0;
level_sf*levelTable[levelID].level2)/2.;
else else
*/
for ( unsigned levelID = 0; levelID < nlevels; levelID++ ) for ( unsigned levelID = 0; levelID < nlevels; levelID++ )
dlevels[levelID] = level_sf*levelTable[levelID].level1; dlevels[levelID] = level_sf*levelTable[levelID].level1;
} }
......
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