Commit a78196a1 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Check units of pressure levels.

parent ed243d7c
......@@ -1964,7 +1964,7 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
if ( level < 0 ) Warning("Pressure level of %f Pa is below zero!", level);
zaxisInqUnits(zaxisID, units);
if ( (units[0] != 'P') | (units[1] != 'a') ) level *= 100;
if ( units[0] && (units[0] != 'P') | (units[1] != 'a') ) level *= 100;
double dum;
if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
......
......@@ -2483,7 +2483,7 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
if ( level < 0 ) Warning("Pressure level of %f Pa is below zero!", level);
zaxisInqUnits(zaxisID, units);
if ( memcmp(units, "Pa", 2) != 0 )
if ( units[0] && (units[0] != 'P') | (units[1] != 'a') )
{
level *= 100;
dlevel1 *= 100;
......
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