#include #include #define ERR {if(err!=NC_NOERR){printf("Error at line %d in %s: %s\n", __LINE__,__FILE__, nc_strerror(err));nerrs++;}} #define EXP_ERR(exp,err) { \ if (err != exp) { \ nerrs++; \ printf("Error at line %d in %s: expecting %s but got %d\n", \ __LINE__,__FILE__,#exp, err); \ } \ } int main(int argc, char *argv[]) { int i, err, nerrs=0, ncid, dimid[NC_MAX_VAR_DIMS+2], varid; err = nc_create("tst_max_var_dims.nc", NC_CLOBBER, &ncid); ERR; err = nc_def_dim(ncid, "dim0", NC_UNLIMITED, &dimid[0]); ERR; err = nc_def_dim(ncid, "dim1", 1, &dimid[1]); ERR; for (i=2; i 0); }