mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
udf must take priority in NC_infermodel
This commit is contained in:
parent
108e938b2f
commit
0bbe91e438
@ -395,6 +395,16 @@ NC_omodeinfer(int useparallel, int cmode, NCmodel* model)
|
||||
|
||||
/* Process the cmode; may override some already set flags */
|
||||
|
||||
if(fIsSet(cmode,(NC_UDF0|NC_UDF1))) {
|
||||
model->format = NC_FORMAT_NETCDF4;
|
||||
if(fIsSet(cmode,NC_UDF0)) {
|
||||
model->impl = NC_FORMATX_UDF0;
|
||||
} else {
|
||||
model->impl = NC_FORMATX_UDF1;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(fIsSet(cmode,NC_64BIT_OFFSET)) {
|
||||
model->impl = NC_FORMATX_NC3;
|
||||
model->format = NC_FORMAT_64BIT_OFFSET;
|
||||
@ -416,16 +426,6 @@ NC_omodeinfer(int useparallel, int cmode, NCmodel* model)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(fIsSet(cmode,(NC_UDF0|NC_UDF1))) {
|
||||
model->format = NC_FORMAT_NETCDF4;
|
||||
if(fIsSet(cmode,NC_UDF0)) {
|
||||
model->impl = NC_FORMATX_UDF0;
|
||||
} else {
|
||||
model->impl = NC_FORMATX_UDF1;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Default to classic model */
|
||||
model->format = NC_FORMAT_CLASSIC;
|
||||
model->impl = NC_FORMATX_NC3;
|
||||
|
@ -185,7 +185,7 @@ main(int argc, char **argv)
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* Open file again and abort, which is the same as closing it. */
|
||||
if (nc_open(FILE_NAME, mode[i], &ncid)) ERR;
|
||||
if (nc_open(FILE_NAME, mode[i]|NC_NETCDF4, &ncid)) ERR;
|
||||
if (nc_inq_format(ncid, NULL) != TEST_VAL_42) ERR;
|
||||
if (nc_inq_format_extended(ncid, NULL, NULL) != TEST_VAL_42) ERR;
|
||||
if (nc_abort(ncid) != TEST_VAL_42) ERR;
|
||||
|
Loading…
Reference in New Issue
Block a user