Commit 4e137bc0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added support for env var CDI_NETCDF_HDR_PAD (pad netCDF header with nbr bytes)

parent b371a080
......@@ -4,6 +4,10 @@
* using EXSE library version 1.3.2
* using CGRIBEX library version 1.6.4
2014-06-16 Uwe Schulzweida
* added support for env var CDI_NETCDF_HDR_PAD (pad netCDF header with nbr bytes)
2014-06-06 Uwe Schulzweida
* Loss of coordinates attribute when merging files [Bug #4880]
......
......@@ -39,6 +39,7 @@ int cdiIgnoreAttCoordinates = FALSE;
int cdiIgnoreValidRange = FALSE;
int cdiSkipRecords = 0;
int cdiInventoryMode = 1;
size_t CDI_netcdf_hdr_pad = 0UL;
char *cdiPartabPath = NULL;
int cdiPartabIntern = 1;
......@@ -200,6 +201,9 @@ void cdiInitialize(void)
value = cdiGetenvInt("CDI_LEVELTYPE");
if ( value >= 0 ) cdiDefaultLeveltype = (int) value;
value = cdiGetenvInt("CDI_NETCDF_HDR_PAD");
if ( value >= 0 ) CDI_netcdf_hdr_pad = (size_t) value;
envString = getenv("CDI_MISSVAL");
if ( envString ) cdiDefaultMissval = atof(envString);
/*
......@@ -403,6 +407,7 @@ void cdiDefGlobal(const char *string, int val)
else if ( strcmp(string, "SORTNAME") == 0 ) cdiSortName = val;
else if ( strcmp(string, "HAVE_MISSVAL") == 0 ) cdiHaveMissval = val;
else if ( strcmp(string, "NC_CHUNKSIZEHINT") == 0 ) cdiNcChunksizehint = val;
else if ( strcmp(string, "NETCDF_HDR_PAD") == 0 ) CDI_netcdf_hdr_pad = (size_t) val;
else Warning("Unsupported global key: %s", string);
}
......
......@@ -7810,6 +7810,7 @@ void cdfEndDef(stream_t *streamptr)
cdfDefGlobalAtts(streamptr);
cdfDefLocalAtts(streamptr);
if ( streamptr->accessmode == 0 )
{
nvars = streamptr->nvars;
......@@ -7821,12 +7822,12 @@ void cdfEndDef(stream_t *streamptr)
if ( streamptr->ncmode == 2 )
{
size_t hdr_pad = 0UL;
extern size_t CDI_netcdf_hdr_pad;
if ( hdr_pad == 0UL )
if ( CDI_netcdf_hdr_pad == 0UL )
cdf_enddef(fileID);
else
cdf__enddef(fileID, hdr_pad);
cdf__enddef(fileID, CDI_netcdf_hdr_pad);
}
streamptr->accessmode = 1;
......
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