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

Change length of units string to CDI_MAX_NAME.

parent 5fff637f
......@@ -1847,6 +1847,7 @@ void isec1DefLevel(int *isec1, int leveltype, int level1, int level2)
static
void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID)
{
char units[CDI_MAX_NAME];
static bool lwarning_vct = true;
double level;
......@@ -1918,7 +1919,6 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
level = zaxisInqLevel(zaxisID, levelID);
if ( level < 0 ) Warning("Pressure level of %f Pa is below zero!", level);
char units[128];
zaxisInqUnits(zaxisID, units);
if ( (units[0] != 'P') | (units[1] != 'a') ) level *= 100;
......@@ -1935,7 +1935,6 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
{
level = zaxisInqLevel(zaxisID, levelID);
char units[128];
zaxisInqUnits(zaxisID, units);
if ( units[1] == 'm' && !units[2] )
{
......@@ -1959,7 +1958,6 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
}
case ZAXIS_DEPTH_BELOW_LAND:
{
char units[128];
zaxisInqUnits(zaxisID, units);
double factor;
......
......@@ -2325,6 +2325,7 @@ void grib_verfiy_zaxis(int zaxisID, double sf)
static
void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelID, int gcinit, int proddef_template_num)
{
char units[CDI_MAX_NAME];
bool lbounds = false;
double dlevel1 = 0, dlevel2 = 0;
......@@ -2372,7 +2373,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
if ( zaxistype == ZAXIS_HEIGHT )
{
double sf = 1;
char units[128];
zaxisInqUnits(zaxisID, units);
if ( units[1] == 'm' && !units[2] )
{
......@@ -2420,13 +2420,9 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
case ZAXIS_ATMOSPHERE:
{
if ( editionNumber <= 1 )
{
grib1DefLevel(gh, gcinit, grib_ltype, lbounds, level, dlevel1, dlevel2);
}
grib1DefLevel(gh, gcinit, grib_ltype, lbounds, level, dlevel1, dlevel2);
else
{
grib2DefLevel(gh, gcinit, grib_ltype, grib_ltype, lbounds, level, dlevel1, dlevel2);
}
grib2DefLevel(gh, gcinit, grib_ltype, grib_ltype, lbounds, level, dlevel1, dlevel2);
break;
}
......@@ -2459,7 +2455,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
{
if ( level < 0 ) Warning("Pressure level of %f Pa is below zero!", level);
char units[128];
zaxisInqUnits(zaxisID, units);
if ( memcmp(units, "Pa", 2) != 0 )
{
......@@ -2499,7 +2494,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
}
case ZAXIS_DEPTH_BELOW_LAND:
{
char units[128];
zaxisInqUnits(zaxisID, units);
double sf; //scalefactor
......
......@@ -433,7 +433,7 @@ void iegDefLevel(int *pdb, int *gdb, double *vct, int zaxisID, int levelID)
case ZAXIS_PRESSURE:
{
double dum;
char units[128];
char units[CDI_MAX_NAME];
level = zaxisInqLevel(zaxisID, levelID);
if ( level < 0 ) Warning("pressure level of %f Pa is below 0.", level);
......
Supports Markdown
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