Commit 9b159681 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

stream_cgribex: check range of pfactor

parent ba57b8d9
2010-02-15 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cgribexDefTime: bug fix for timerange = -1
2010-02-10 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added support for complex packing of spectral data in GRIB
......
......@@ -2151,7 +2151,11 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
}
if ( isec4[2] == 128 && isec4[3] == 64 )
isec4[16] = (int) (1000*calculate_pfactor(data, ISEC2_PentaJ, isec4[17]));
{
isec4[16] = (int) (1000*calculate_pfactor(data, ISEC2_PentaJ, isec4[17]));
if ( isec4[16] < -10000 ) isec4[16] = -10000;
if ( isec4[16] > 10000 ) isec4[16] = 10000;
}
//printf("isec4[16] %d\n", isec4[16]);
gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, (double*) data,
......
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