mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
more testing
This commit is contained in:
parent
828304ed41
commit
e859be9a1d
@ -47,200 +47,201 @@ main(int argc, char **argv)
|
||||
|
||||
fprintf(stderr,"*** Testing more renames\n");
|
||||
|
||||
/* for (format = 0; format < NUM_FORMATS; format++) */
|
||||
/* { */
|
||||
/* fprintf(stderr,"*** test renaming 3 dimensions with format %d...", */
|
||||
/* formats[format]); */
|
||||
/* { */
|
||||
/* char filename[NC_MAX_NAME + 1]; */
|
||||
/* int ncid, dimid[NDIM3]; */
|
||||
/* int dimid_in; */
|
||||
/* int enddef_setting; */
|
||||
for (format = 0; format < NUM_FORMATS; format++)
|
||||
{
|
||||
fprintf(stderr,"*** test renaming 3 dimensions with format %d...",
|
||||
formats[format]);
|
||||
{
|
||||
char filename[NC_MAX_NAME + 1];
|
||||
int ncid, dimid[NDIM3];
|
||||
int dimid_in;
|
||||
int enddef_setting;
|
||||
|
||||
/* if (nc_set_default_format(formats[format], NULL)) ERR; */
|
||||
if (nc_set_default_format(formats[format], NULL)) ERR;
|
||||
|
||||
/* for (enddef_setting = 0; enddef_setting < NUM_ENDDEF_SETTINGS; */
|
||||
/* enddef_setting++) */
|
||||
/* { */
|
||||
/* sprintf(filename, "%s_%d_%d.nc", TEST_NAME, formats[format], */
|
||||
/* enddef_setting); */
|
||||
for (enddef_setting = 0; enddef_setting < NUM_ENDDEF_SETTINGS;
|
||||
enddef_setting++)
|
||||
{
|
||||
sprintf(filename, "%s_%d_%d.nc", TEST_NAME, formats[format],
|
||||
enddef_setting);
|
||||
|
||||
/* /\* Create file with three dims. *\/ */
|
||||
/* if (nc_create(filename, 0, &ncid)) ERR; */
|
||||
/* if (nc_def_dim(ncid, LAT, DIM1_LEN, &dimid[0])) ERR; */
|
||||
/* if (nc_def_dim(ncid, LON, DIM1_LEN, &dimid[1])) ERR; */
|
||||
/* if (nc_def_dim(ncid, LEV, DIM1_LEN, &dimid[2])) ERR; */
|
||||
/* Create file with three dims. */
|
||||
if (nc_create(filename, 0, &ncid)) ERR;
|
||||
if (nc_def_dim(ncid, LAT, DIM1_LEN, &dimid[0])) ERR;
|
||||
if (nc_def_dim(ncid, LON, DIM1_LEN, &dimid[1])) ERR;
|
||||
if (nc_def_dim(ncid, LEV, DIM1_LEN, &dimid[2])) ERR;
|
||||
|
||||
/* if (enddef_setting) */
|
||||
/* { */
|
||||
/* if (nc_enddef(ncid)) ERR; */
|
||||
/* if (nc_redef(ncid)) ERR; */
|
||||
/* } */
|
||||
if (enddef_setting)
|
||||
{
|
||||
if (nc_enddef(ncid)) ERR;
|
||||
if (nc_redef(ncid)) ERR;
|
||||
}
|
||||
|
||||
/* /\* Rename the dimensions. *\/ */
|
||||
/* if (nc_rename_dim(ncid, 0, DIM_X)) ERR; */
|
||||
/* if (nc_rename_dim(ncid, 1, DIM_Y)) ERR; */
|
||||
/* if (nc_rename_dim(ncid, 2, DIM_Z)) ERR; */
|
||||
/* Rename the dimensions. */
|
||||
if (nc_rename_dim(ncid, 0, DIM_X)) ERR;
|
||||
if (nc_rename_dim(ncid, 1, DIM_Y)) ERR;
|
||||
if (nc_rename_dim(ncid, 2, DIM_Z)) ERR;
|
||||
|
||||
/* /\* Close the file. *\/ */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* Close the file. */
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* /\* Reopen the file and check. *\/ */
|
||||
/* if (nc_open(filename, NC_NOWRITE, &ncid)) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_X, &dimid_in)) ERR; */
|
||||
/* if (dimid_in != 0) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_Y, &dimid_in)) ERR; */
|
||||
/* if (dimid_in != 1) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_Z, &dimid_in)) ERR; */
|
||||
/* if (dimid_in != 2) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* } /\* next enddef setting *\/ */
|
||||
/* } */
|
||||
/* SUMMARIZE_ERR; */
|
||||
/* Reopen the file and check. */
|
||||
if (nc_open(filename, NC_NOWRITE, &ncid)) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_X, &dimid_in)) ERR;
|
||||
if (dimid_in != 0) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_Y, &dimid_in)) ERR;
|
||||
if (dimid_in != 1) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_Z, &dimid_in)) ERR;
|
||||
if (dimid_in != 2) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
} /* next enddef setting */
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
|
||||
/* fprintf(stderr,"*** test renaming 3 dims with coord data format %d...", */
|
||||
/* formats[format]); */
|
||||
/* { */
|
||||
/* char filename[NC_MAX_NAME + 1]; */
|
||||
/* int ncid, dimid[NDIM3], varid[NDIM3]; */
|
||||
/* int dimid_in; */
|
||||
/* int lat_data[DIM1_LEN] = {0, 1, 2, 3}; */
|
||||
/* int lon_data[DIM1_LEN] = {0, 10, 20, 30}; */
|
||||
/* int lev_data[DIM1_LEN] = {0, 100, 200, 300}; */
|
||||
fprintf(stderr,"*** test renaming 3 dims with coord data format %d...",
|
||||
formats[format]);
|
||||
{
|
||||
char filename[NC_MAX_NAME + 1];
|
||||
int ncid, dimid[NDIM3], varid[NDIM3];
|
||||
int dimid_in;
|
||||
int lat_data[DIM1_LEN] = {0, 1, 2, 3};
|
||||
int lon_data[DIM1_LEN] = {0, 10, 20, 30};
|
||||
int lev_data[DIM1_LEN] = {0, 100, 200, 300};
|
||||
|
||||
/* if (nc_set_default_format(formats[format], NULL)) ERR; */
|
||||
if (nc_set_default_format(formats[format], NULL)) ERR;
|
||||
|
||||
/* sprintf(filename, "%s_data_%d.nc", TEST_NAME, formats[format]); */
|
||||
sprintf(filename, "%s_data_%d.nc", TEST_NAME, formats[format]);
|
||||
|
||||
/* /\* Create file with three dims. *\/ */
|
||||
/* if (nc_create(filename, 0, &ncid)) ERR; */
|
||||
/* if (nc_def_dim(ncid, LAT, DIM1_LEN, &dimid[0])) ERR; */
|
||||
/* if (nc_def_dim(ncid, LON, DIM1_LEN, &dimid[1])) ERR; */
|
||||
/* if (nc_def_dim(ncid, LEV, DIM1_LEN, &dimid[2])) ERR; */
|
||||
/* Create file with three dims. */
|
||||
if (nc_create(filename, 0, &ncid)) ERR;
|
||||
if (nc_def_dim(ncid, LAT, DIM1_LEN, &dimid[0])) ERR;
|
||||
if (nc_def_dim(ncid, LON, DIM1_LEN, &dimid[1])) ERR;
|
||||
if (nc_def_dim(ncid, LEV, DIM1_LEN, &dimid[2])) ERR;
|
||||
|
||||
/* /\* Define coordinate data vars. *\/ */
|
||||
/* if (nc_def_var(ncid, LAT, NC_INT, NDIM1, &dimid[0], &varid[0])) ERR; */
|
||||
/* if (nc_def_var(ncid, LON, NC_INT, NDIM1, &dimid[1], &varid[1])) ERR; */
|
||||
/* if (nc_def_var(ncid, LEV, NC_INT, NDIM1, &dimid[2], &varid[2])) ERR; */
|
||||
/* Define coordinate data vars. */
|
||||
if (nc_def_var(ncid, LAT, NC_INT, NDIM1, &dimid[0], &varid[0])) ERR;
|
||||
if (nc_def_var(ncid, LON, NC_INT, NDIM1, &dimid[1], &varid[1])) ERR;
|
||||
if (nc_def_var(ncid, LEV, NC_INT, NDIM1, &dimid[2], &varid[2])) ERR;
|
||||
|
||||
/* if (nc_enddef(ncid)) ERR; */
|
||||
if (nc_enddef(ncid)) ERR;
|
||||
|
||||
/* if (nc_put_var(ncid, 0, lat_data)) ERR; */
|
||||
/* if (nc_put_var(ncid, 1, lon_data)) ERR; */
|
||||
/* if (nc_put_var(ncid, 2, lev_data)) ERR; */
|
||||
if (nc_put_var(ncid, 0, lat_data)) ERR;
|
||||
if (nc_put_var(ncid, 1, lon_data)) ERR;
|
||||
if (nc_put_var(ncid, 2, lev_data)) ERR;
|
||||
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* if (nc_open(filename, NC_WRITE, &ncid)) ERR; */
|
||||
/* if (nc_redef(ncid)) ERR; */
|
||||
if (nc_close(ncid)) ERR;
|
||||
if (nc_open(filename, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_redef(ncid)) ERR;
|
||||
|
||||
/* /\* Rename the dimensions. *\/ */
|
||||
/* if (nc_rename_dim(ncid, 0, DIM_X)) ERR; */
|
||||
/* if (nc_rename_dim(ncid, 1, DIM_Y)) ERR; */
|
||||
/* if (nc_rename_dim(ncid, 2, DIM_Z)) ERR; */
|
||||
/* Rename the dimensions. */
|
||||
if (nc_rename_dim(ncid, 0, DIM_X)) ERR;
|
||||
if (nc_rename_dim(ncid, 1, DIM_Y)) ERR;
|
||||
if (nc_rename_dim(ncid, 2, DIM_Z)) ERR;
|
||||
|
||||
/* /\* Close the file. *\/ */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* Close the file. */
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* /\* Reopen the file and check. *\/ */
|
||||
/* if (nc_open(filename, NC_NOWRITE, &ncid)) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_X, &dimid_in)) ERR; */
|
||||
/* if (dimid_in != 0) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_Y, &dimid_in)) ERR; */
|
||||
/* if (dimid_in != 1) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_Z, &dimid_in)) ERR; */
|
||||
/* if (dimid_in != 2) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* } */
|
||||
/* SUMMARIZE_ERR; */
|
||||
/* Reopen the file and check. */
|
||||
if (nc_open(filename, NC_NOWRITE, &ncid)) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_X, &dimid_in)) ERR;
|
||||
if (dimid_in != 0) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_Y, &dimid_in)) ERR;
|
||||
if (dimid_in != 1) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_Z, &dimid_in)) ERR;
|
||||
if (dimid_in != 2) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
|
||||
/* } /\* next format *\/ */
|
||||
} /* next format */
|
||||
|
||||
/* #define FILE_NAME1 "tst_dims_foo1.nc" */
|
||||
/* #define DIM_NAME "lat_T42" */
|
||||
/* #define VAR_NAME DIM_NAME */
|
||||
/* #define DIM_NAME2 "lat" */
|
||||
/* #define VAR_NAME2 DIM_NAME2 */
|
||||
/* #define RANK_lat_T42 1 */
|
||||
/* fprintf(stderr,"*** test renaming with sync..."); */
|
||||
/* { */
|
||||
/* int ncid, dimid, varid; */
|
||||
/* char file_name[NC_MAX_NAME + 1]; */
|
||||
/* char name[NC_MAX_NAME + 1]; */
|
||||
#define FILE_NAME1 "tst_dims_foo1.nc"
|
||||
#define DIM_NAME "lat_T42"
|
||||
#define VAR_NAME DIM_NAME
|
||||
#define DIM_NAME2 "lat"
|
||||
#define VAR_NAME2 DIM_NAME2
|
||||
#define RANK_lat_T42 1
|
||||
fprintf(stderr,"*** test renaming with sync...");
|
||||
{
|
||||
int ncid, dimid, varid;
|
||||
char file_name[NC_MAX_NAME + 1];
|
||||
char name[NC_MAX_NAME + 1];
|
||||
|
||||
/* /\* Create file with dim and associated coordinate var. *\/ */
|
||||
/* sprintf(file_name, "%s_sync.nc", TEST_NAME); */
|
||||
/* nc_set_log_level(4); */
|
||||
/* if (nc_create(file_name, NC_CLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR; */
|
||||
/* if (nc_def_dim(ncid, DIM_NAME_END, DIM1_LEN, &dimid)) ERR; */
|
||||
/* if (nc_def_var(ncid, DIM_NAME_END, NC_INT, NDIM1, &dimid, &varid)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* Create file with dim and associated coordinate var. */
|
||||
sprintf(file_name, "%s_sync.nc", TEST_NAME);
|
||||
nc_set_log_level(4);
|
||||
if (nc_create(file_name, NC_CLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
|
||||
if (nc_def_dim(ncid, DIM_NAME_END, DIM1_LEN, &dimid)) ERR;
|
||||
if (nc_def_var(ncid, DIM_NAME_END, NC_INT, NDIM1, &dimid, &varid)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* if (nc_create(file_name, NC_CLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR; */
|
||||
/* if (nc_def_dim(ncid, DIM_NAME_START, DIM1_LEN, &dimid)) ERR; */
|
||||
/* if (nc_def_var(ncid, DIM_NAME_END, NC_INT, NDIM1, &dimid, &varid)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
if (nc_create(file_name, NC_CLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
|
||||
if (nc_def_dim(ncid, DIM_NAME_START, DIM1_LEN, &dimid)) ERR;
|
||||
if (nc_def_var(ncid, DIM_NAME_END, NC_INT, NDIM1, &dimid, &varid)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* if (nc_open(file_name, NC_WRITE, &ncid)) ERR; */
|
||||
/* if (nc_rename_dim(ncid, dimid, DIM_NAME_END)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_rename_dim(ncid, dimid, DIM_NAME_END)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* /\* Reopen file and check, *\/ */
|
||||
/* if (nc_open(file_name, NC_WRITE, &ncid)) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_NAME_END, &dimid)) ERR; */
|
||||
/* if (nc_inq_varid(ncid, DIM_NAME_END, &varid)) ERR; */
|
||||
/* if (nc_inq_dimname(ncid, dimid, name)) ERR; */
|
||||
/* if (strcmp(name, DIM_NAME_END)) ERR; */
|
||||
/* if (nc_inq_varname(ncid, varid, name)) ERR; */
|
||||
/* if (strcmp(name, DIM_NAME_END)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* } */
|
||||
/* SUMMARIZE_ERR; */
|
||||
/* fprintf(stderr,"*** test renaming with sync..."); */
|
||||
/* { */
|
||||
/* int ncid, dimid, varid; */
|
||||
/* char file_name[NC_MAX_NAME + 1]; */
|
||||
/* char name[NC_MAX_NAME + 1]; */
|
||||
/* Reopen file and check, */
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_NAME_END, &dimid)) ERR;
|
||||
if (nc_inq_varid(ncid, DIM_NAME_END, &varid)) ERR;
|
||||
if (nc_inq_dimname(ncid, dimid, name)) ERR;
|
||||
if (strcmp(name, DIM_NAME_END)) ERR;
|
||||
if (nc_inq_varname(ncid, varid, name)) ERR;
|
||||
if (strcmp(name, DIM_NAME_END)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
fprintf(stderr,"*** test renaming with sync...");
|
||||
{
|
||||
int ncid, dimid, varid;
|
||||
char file_name[NC_MAX_NAME + 1];
|
||||
char name[NC_MAX_NAME + 1];
|
||||
|
||||
/* /\* Create file with dim and associated coordinate var. *\/ */
|
||||
/* sprintf(file_name, "%s_sync.nc", TEST_NAME); */
|
||||
/* if (nc_create(file_name, NC_CLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR; */
|
||||
/* if (nc_def_dim(ncid, DIM_NAME_START, DIM1_LEN, &dimid)) ERR; */
|
||||
/* if (nc_def_var(ncid, VAR_NAME_START, NC_INT, NDIM1, &dimid, &varid)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* Create file with dim and associated coordinate var. */
|
||||
sprintf(file_name, "%s_sync.nc", TEST_NAME);
|
||||
if (nc_create(file_name, NC_CLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
|
||||
if (nc_def_dim(ncid, DIM_NAME_START, DIM1_LEN, &dimid)) ERR;
|
||||
if (nc_def_var(ncid, VAR_NAME_START, NC_INT, NDIM1, &dimid, &varid)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* nc_set_log_level(4); */
|
||||
/* /\* Open the file and rename the var. *\/ */
|
||||
/* if (nc_open(file_name, NC_WRITE, &ncid)) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_NAME_START, &dimid)) ERR; */
|
||||
/* if (nc_inq_varid(ncid, VAR_NAME_START, &varid)) ERR; */
|
||||
/* if (nc_rename_var(ncid, varid, VAR_NAME_END)) ERR; */
|
||||
nc_set_log_level(4);
|
||||
/* Open the file and rename the var. */
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_NAME_START, &dimid)) ERR;
|
||||
if (nc_inq_varid(ncid, VAR_NAME_START, &varid)) ERR;
|
||||
if (nc_rename_var(ncid, varid, VAR_NAME_END)) ERR;
|
||||
|
||||
/* /\* Sync to disk. Now the file has one dim and one var. The dim */
|
||||
/* * is a dimscale only dataset, and the var is a dataset with a */
|
||||
/* * dimscale attached pointing to the dim. *\/ */
|
||||
/* /\* if (nc_sync(ncid)) ERR; *\/ */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* if (nc_open(file_name, NC_WRITE, &ncid)) ERR; */
|
||||
/* /\* Now rename the dim to the same name as the var. After this */
|
||||
/* * there will be one dataset, called DIM_NAME_END, which will be */
|
||||
/* * a dimscale. *\/ */
|
||||
/* if (nc_rename_dim(ncid, dimid, DIM_NAME_END)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* Sync to disk. Now the file has one dim and one var. The dim
|
||||
* is a dimscale only dataset, and the var is a dataset with a
|
||||
* dimscale attached pointing to the dim. */
|
||||
/* if (nc_sync(ncid)) ERR; */
|
||||
if (nc_close(ncid)) ERR;
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
/* Now rename the dim to the same name as the var. After this
|
||||
* there will be one dataset, called DIM_NAME_END, which will be
|
||||
* a dimscale. */
|
||||
if (nc_rename_dim(ncid, dimid, DIM_NAME_END)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* /\* Reopen file and check, *\/ */
|
||||
/* if (nc_open(file_name, NC_WRITE, &ncid)) ERR; */
|
||||
/* if (nc_inq_dimid(ncid, DIM_NAME_END, &dimid)) ERR; */
|
||||
/* if (nc_inq_varid(ncid, VAR_NAME_END, &varid)) ERR; */
|
||||
/* if (nc_inq_dimname(ncid, dimid, name)) ERR; */
|
||||
/* if (strcmp(name, DIM_NAME_END)) ERR; */
|
||||
/* if (nc_inq_varname(ncid, varid, name)) ERR; */
|
||||
/* if (strcmp(name, VAR_NAME_END)) ERR; */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
/* } */
|
||||
/* SUMMARIZE_ERR; */
|
||||
/* Reopen file and check, */
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_inq_dimid(ncid, DIM_NAME_END, &dimid)) ERR;
|
||||
if (nc_inq_varid(ncid, VAR_NAME_END, &varid)) ERR;
|
||||
if (nc_inq_dimname(ncid, dimid, name)) ERR;
|
||||
if (strcmp(name, DIM_NAME_END)) ERR;
|
||||
if (nc_inq_varname(ncid, varid, name)) ERR;
|
||||
if (strcmp(name, VAR_NAME_END)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
fprintf(stderr,"*** test renaming two coord vars...");
|
||||
{
|
||||
int ncid, dimid1, dimid2, varid1, varid2;
|
||||
int dimid_in, varid_in;
|
||||
char file_name[NC_MAX_NAME + 1];
|
||||
char name[NC_MAX_NAME + 1];
|
||||
|
||||
@ -257,18 +258,18 @@ main(int argc, char **argv)
|
||||
nc_set_log_level(4);
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_rename_var(ncid, varid1, TMP_NAME)) ERR;
|
||||
/* if (nc_rename_var(ncid, varid2, D1_NAME)) ERR; */
|
||||
if (nc_rename_var(ncid, varid2, D1_NAME)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
|
||||
/* Reopen file and check, */
|
||||
/* if (nc_open(file_name, NC_WRITE, &ncid)) ERR; */
|
||||
/* /\* if (nc_inq_dimid(ncid, DIM_NAME_END, &dimid)) ERR; *\/ */
|
||||
/* /\* if (nc_inq_varid(ncid, VAR_NAME_END, &varid)) ERR; *\/ */
|
||||
/* /\* if (nc_inq_dimname(ncid, dimid, name)) ERR; *\/ */
|
||||
/* /\* if (strcmp(name, DIM_NAME_END)) ERR; *\/ */
|
||||
/* /\* if (nc_inq_varname(ncid, varid, name)) ERR; *\/ */
|
||||
/* /\* if (strcmp(name, VAR_NAME_END)) ERR; *\/ */
|
||||
/* if (nc_close(ncid)) ERR; */
|
||||
if (nc_open(file_name, NC_WRITE, &ncid)) ERR;
|
||||
if (nc_inq_dimid(ncid, D1_NAME, &dimid_in)) ERR;
|
||||
if (dimid_in != dimid1) ERR;
|
||||
if (nc_inq_dimid(ncid, D2_NAME, &dimid_in)) ERR;
|
||||
if (dimid_in != dimid2) ERR;
|
||||
if (nc_inq_dimid(ncid, TMP_NAME, &dimid_in) != NC_EBADDIM) ERR;
|
||||
if (nc_inq_varid(ncid, TMP_NAME, &varid_in)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
FINAL_RESULTS;
|
||||
|
Loading…
Reference in New Issue
Block a user