Commit 7ca61648 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added tabnum to cgribexDefParam (bug fix)

parent 0675f171
...@@ -6128,9 +6128,12 @@ void cdfDefInstitut(int streamID) ...@@ -6128,9 +6128,12 @@ void cdfDefInstitut(int streamID)
if ( longname ) if ( longname )
{ {
len = strlen(longname); len = strlen(longname);
if ( streamptr->ncmode == 2 ) cdf_redef(fileID); if ( len > 0 )
cdf_put_att_text(fileID, NC_GLOBAL, "institution", len, longname); {
if ( streamptr->ncmode == 2 ) cdf_enddef(fileID); if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
cdf_put_att_text(fileID, NC_GLOBAL, "institution", len, longname);
if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
}
} }
} }
#endif #endif
...@@ -6157,9 +6160,12 @@ void cdfDefSource(int streamID) ...@@ -6157,9 +6160,12 @@ void cdfDefSource(int streamID)
if ( longname ) if ( longname )
{ {
len = strlen(longname); len = strlen(longname);
if ( streamptr->ncmode == 2 ) cdf_redef(fileID); if ( len > 0 )
cdf_put_att_text(fileID, NC_GLOBAL, "source", len, longname); {
if ( streamptr->ncmode == 2 ) cdf_enddef(fileID); if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
cdf_put_att_text(fileID, NC_GLOBAL, "source", len, longname);
if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
}
} }
} }
#endif #endif
......
...@@ -1396,7 +1396,7 @@ void cgribexDefModel(int *isec1, int vlistID, int varID) ...@@ -1396,7 +1396,7 @@ void cgribexDefModel(int *isec1, int vlistID, int varID)
} }
static static
void cgribexDefParam(int *isec1, int param) void cgribexDefParam(int *isec1, int param, int tabnum)
{ {
static char func[] = "cgribexDefParam"; static char func[] = "cgribexDefParam";
int pdis, pcat, pnum; int pdis, pcat, pnum;
...@@ -1412,6 +1412,8 @@ void cgribexDefParam(int *isec1, int param) ...@@ -1412,6 +1412,8 @@ void cgribexDefParam(int *isec1, int param)
if ( pnum < 0 ) pnum = -pnum; if ( pnum < 0 ) pnum = -pnum;
if ( pcat == 255 ) pcat = tabnum;
ISEC1_CodeTable = pcat; ISEC1_CodeTable = pcat;
ISEC1_Parameter = pnum; ISEC1_Parameter = pnum;
} }
...@@ -2004,7 +2006,7 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI ...@@ -2004,7 +2006,7 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
datatype = vlistInqVarDatatype(vlistID, varID); datatype = vlistInqVarDatatype(vlistID, varID);
cgribexDefParam(isec1, param); cgribexDefParam(isec1, param, tabnum);
cgribexDefTime(isec1, date, time, numavg, vlistInqTaxis(vlistID)); cgribexDefTime(isec1, date, time, numavg, vlistInqTaxis(vlistID));
cgribexDefGrid(isec1, isec2, gridID); cgribexDefGrid(isec1, isec2, gridID);
cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID); cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
......
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