Commit 6359a2af authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

zaxisTypeToGrib2ltype: added ZAXIS_DEPTH_BELOW_LAND (bug fix)

parent 8770a6ee
......@@ -2,6 +2,10 @@
* Version 1.7.2 released
2016-05-23 Uwe Schulzweida
* zaxisTypeToGrib2ltype: added ZAXIS_DEPTH_BELOW_LAND (bug fix)
2016-05-16 Uwe Schulzweida
* Seg fault in VCT with GRIB1 (introduced in 1.7.1) [Bug #6780]
......
......@@ -123,23 +123,31 @@ int zaxisTypeToGrib2ltype(int zaxistype)
switch (zaxistype)
{
case ZAXIS_SURFACE: grib_ltype = GRIB2_LTYPE_SURFACE; break;
case ZAXIS_MEANSEA: grib_ltype = GRIB2_LTYPE_MEANSEA; break;
case ZAXIS_GENERIC: grib_ltype = -1; break;
case ZAXIS_HYBRID: grib_ltype = GRIB2_LTYPE_HYBRID; break;
case ZAXIS_HYBRID_HALF: grib_ltype = GRIB2_LTYPE_HYBRID; break;
case ZAXIS_PRESSURE: grib_ltype = GRIB2_LTYPE_ISOBARIC; break;
case ZAXIS_HEIGHT: grib_ltype = GRIB2_LTYPE_HEIGHT; break;
case ZAXIS_ALTITUDE: grib_ltype = GRIB2_LTYPE_ALTITUDE; break;
case ZAXIS_SIGMA: grib_ltype = GRIB2_LTYPE_SIGMA; break;
case ZAXIS_DEPTH_BELOW_SEA: grib_ltype = GRIB2_LTYPE_SEADEPTH; break;
case ZAXIS_DEPTH_BELOW_LAND: grib_ltype = GRIB2_LTYPE_LANDDEPTH; break;
case ZAXIS_ISENTROPIC: grib_ltype = GRIB2_LTYPE_ISENTROPIC; break;
case ZAXIS_TRAJECTORY: grib_ltype = -1; break;
case ZAXIS_ALTITUDE: grib_ltype = GRIB2_LTYPE_ALTITUDE; break;
case ZAXIS_SIGMA: grib_ltype = GRIB2_LTYPE_SIGMA; break;
case ZAXIS_MEANSEA: grib_ltype = GRIB2_LTYPE_MEANSEA; break;
case ZAXIS_TOA: grib_ltype = GRIB2_LTYPE_TOA; break;
case ZAXIS_SEA_BOTTOM: grib_ltype = GRIB2_LTYPE_SEA_BOTTOM; break;
case ZAXIS_ATMOSPHERE: grib_ltype = GRIB2_LTYPE_ATMOSPHERE; break;
case ZAXIS_CLOUD_BASE: grib_ltype = GRIB2_LTYPE_CLOUD_BASE; break;
case ZAXIS_CLOUD_TOP: grib_ltype = GRIB2_LTYPE_CLOUD_TOP; break;
case ZAXIS_ISOTHERM_ZERO: grib_ltype = GRIB2_LTYPE_ISOTHERM0; break;
case ZAXIS_TOA: grib_ltype = GRIB2_LTYPE_TOA; break;
case ZAXIS_SEA_BOTTOM: grib_ltype = GRIB2_LTYPE_SEA_BOTTOM; break;
case ZAXIS_SNOW: grib_ltype = GRIB2_LTYPE_SNOW; break;
case ZAXIS_LAKE_BOTTOM: grib_ltype = GRIB2_LTYPE_LAKE_BOTTOM; break;
case ZAXIS_SEDIMENT_BOTTOM: grib_ltype = GRIB2_LTYPE_SEDIMENT_BOTTOM; break;
case ZAXIS_SEDIMENT_BOTTOM_TA: grib_ltype = GRIB2_LTYPE_SEDIMENT_BOTTOM_TA; break;
case ZAXIS_SEDIMENT_BOTTOM_TW: grib_ltype = GRIB2_LTYPE_SEDIMENT_BOTTOM_TW; break;
case ZAXIS_MIX_LAYER: grib_ltype = GRIB2_LTYPE_MIX_LAYER; break;
case ZAXIS_ATMOSPHERE: grib_ltype = GRIB2_LTYPE_ATMOSPHERE; break;
case ZAXIS_REFERENCE: grib_ltype = GRIB2_LTYPE_REFERENCE; break;
}
return grib_ltype;
......
......@@ -2432,7 +2432,7 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
}
else
{
grib2DefLevel(gh, gcinit, GRIB2_LTYPE_HYBRID, GRIB2_LTYPE_HYBRID, lbounds, level, dlevel1, dlevel2);
grib2DefLevel(gh, gcinit, grib2ltype, grib2ltype, lbounds, level, dlevel1, dlevel2);
}
if ( !gcinit )
......@@ -2488,7 +2488,7 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
; // not available
else
{
grib2DefLevel(gh, gcinit, GRIB2_LTYPE_SNOW, GRIB2_LTYPE_SNOW, lbounds, level, dlevel1, dlevel2);
grib2DefLevel(gh, gcinit, grib2ltype, grib2ltype, lbounds, level, dlevel1, dlevel2);
}
break;
......@@ -2521,7 +2521,7 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
dlevel1 *= scalefactor;
dlevel2 *= scalefactor;
grib2DefLevel(gh, gcinit, GRIB2_LTYPE_LANDDEPTH, GRIB2_LTYPE_LANDDEPTH, lbounds, level, dlevel1, dlevel2);
grib2DefLevel(gh, gcinit, grib2ltype, grib2ltype, lbounds, level, dlevel1, dlevel2);
}
break;
......@@ -2536,8 +2536,8 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
{
if ( lbounds )
{
gribapiDefLevelType(gh, gcinit, "typeOfFirstFixedSurface", GRIB2_LTYPE_REFERENCE);
gribapiDefLevelType(gh, gcinit, "typeOfSecondFixedSurface", GRIB2_LTYPE_REFERENCE);
gribapiDefLevelType(gh, gcinit, "typeOfFirstFixedSurface", grib2ltype);
gribapiDefLevelType(gh, gcinit, "typeOfSecondFixedSurface", grib2ltype);
GRIB_CHECK(my_grib_set_long(gh, "topLevel", (long) dlevel1), 0);
GRIB_CHECK(my_grib_set_long(gh, "bottomLevel", (long) dlevel2), 0);
}
......
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