mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Fix jira NCF-243
Problem was that the NC_create code was not checking for the NC_CLASSIC_MODEL mode flag in deciding what dispatch table to use. This meant that it was then defaulting to use the default format, and if that was changed to e.g. NC_FORMAT_NETCDF4, then it would try to create a netcdf-4 format file, even is NC_CLASSIC_MODEL mode flag was set.
This commit is contained in:
parent
ceb736c4b5
commit
1abb2ecb56
@ -2,12 +2,12 @@ NCLIB=../liblib/.libs/libnetcdf.a
|
||||
NCINCL=-I ../liblib
|
||||
|
||||
#CYGWIN
|
||||
LFLAG=-L/usr/local/lib
|
||||
#LFLAG=-L/usr/local/lib
|
||||
#HDF5LIB=/usr/local/lib/libhdf5_hl.a /usr/local/lib/libhdf5.a
|
||||
|
||||
#!CYGWIN
|
||||
#LFLAG=-L/upc/share/ed/local/${HOST}/lib
|
||||
#HDF5LIB=/share/ed/local/${HOST}/lib/libhdf5_hl.a /share/ed/local/${HOST}/lib/libhdf5.a
|
||||
LFLAG=-L/upc/share/ed/local/${HOST}/lib
|
||||
HDF5LIB=/share/ed/local/${HOST}/lib/libhdf5_hl.a /share/ed/local/${HOST}/lib/libhdf5.a
|
||||
|
||||
CURLLIB=-lcurl
|
||||
ZLIB=-lz
|
||||
@ -258,7 +258,7 @@ fix::
|
||||
done
|
||||
|
||||
##################################################
|
||||
T=civ
|
||||
T=civ2
|
||||
|
||||
v::
|
||||
cc -g -c ${T}.c ${INCL}
|
||||
|
@ -79,9 +79,6 @@ NCD3_open(const char * path, int mode,
|
||||
NCDAPCOMMON* dapcomm = NULL;
|
||||
const char* value;
|
||||
|
||||
/* We will use a fake file descriptor as our internal in-memory filename */
|
||||
char tmpname[32];
|
||||
|
||||
if(!nc3dinitialized) nc3dinitialize();
|
||||
|
||||
if(path == NULL)
|
||||
@ -137,11 +134,18 @@ NCD3_open(const char * path, int mode,
|
||||
}
|
||||
|
||||
/* Use libsrc code for storing metadata */
|
||||
{
|
||||
char tmpname[32];
|
||||
|
||||
snprintf(tmpname,sizeof(tmpname),"%d",drno->int_ncid);
|
||||
/* Now, use the file to create the netcdf file; always 64 bit */
|
||||
ncstat = nc_create(tmpname,NC_DISKLESS|NC_64BIT_OFFSET,&drno->substrate);
|
||||
if(ncstat != NC_NOERR) {THROWCHK(ncstat); goto done;}
|
||||
/* Create fake file name: exact name must be unique,
|
||||
but is otherwise irrelevant because we are using NC_DISKLESS
|
||||
*/
|
||||
snprintf(tmpname,sizeof(tmpname),"%d",drno->int_ncid);
|
||||
|
||||
/* Now, use the file to create the netcdf file; force classic. */
|
||||
ncstat = nc_create(tmpname,NC_DISKLESS|NC_CLASSIC_MODEL,&drno->substrate);
|
||||
if(ncstat != NC_NOERR) {THROWCHK(ncstat); goto done;}
|
||||
}
|
||||
|
||||
/* Avoid fill */
|
||||
nc_set_fill(drno->substrate,NC_NOFILL,NULL);
|
||||
|
@ -1446,6 +1446,8 @@ NC_create(const char *path, int cmode, size_t initialsz,
|
||||
if(model == 0) {
|
||||
if(cmode & NC_NETCDF4 || cmode & NC_PNETCDF)
|
||||
model = NC_DISPATCH_NC4;
|
||||
else if(cmode & NC_CLASSIC_MODEL)
|
||||
model = NC_DISPATCH_NC3;
|
||||
}
|
||||
|
||||
if(model == 0) {
|
||||
|
@ -4,4 +4,4 @@ Attributes {
|
||||
Int32 a1 32;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
Dataset {
|
||||
Sequence {
|
||||
Sequence {
|
||||
Float32 v4;
|
||||
} Q2;
|
||||
} Q1;
|
||||
} SYNTH8;
|
Loading…
Reference in New Issue
Block a user