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

added cdf__enddef()

parent 35dfdb48
......@@ -148,6 +148,20 @@ void cdf_enddef(int ncid)
}
void cdf__enddef(const int ncid, const size_t hdr_pad)
{
int status;
const size_t v_align = 4UL; /* [B] Alignment of beginning of data section for fixed variables */
const size_t v_minfree = 0UL; /* [B] Pad at end of data section for fixed size variables */
const size_t r_align = 4UL; /* [B] Alignment of beginning of data section for record variables */
/* nc_enddef(ncid) is equivalent to nc__enddef(ncid, 0, 4, 0, 4) */
status = nc__enddef(ncid, hdr_pad, v_align, v_minfree, r_align);
if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
}
void cdf_sync(int ncid)
{
int status;
......
......@@ -10,9 +10,10 @@ void cdf_create (const char *path, int cmode, int *idp);
int cdf_open (const char *path, int omode, int *idp);
void cdf_close (int ncid);
void cdf_redef (int ncid);
void cdf_enddef (int ncid);
void cdf_sync (int ncid);
void cdf_redef(int ncid);
void cdf_enddef(int ncid);
void cdf__enddef(const int ncid, const size_t hdr_pad);
void cdf_sync(int ncid);
void cdf_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp);
......
......@@ -7819,7 +7819,15 @@ void cdfEndDef(stream_t *streamptr)
for ( varID = 0; varID < nvars; varID++ )
cdfDefVar(streamptr, varID);
if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
if ( streamptr->ncmode == 2 )
{
size_t hdr_pad = 0UL;
if ( hdr_pad == 0UL )
cdf_enddef(fileID);
else
cdf__enddef(fileID, 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