|
|
Definition at line 25 of file tst_v2.c.
References DIM1_NAME, DIM1_SIZE, DIM2_NAME, DIM2_SIZE, ERR, FILE_NAME, FINAL_RESULTS, NC_CLOBBER, NC_DOUBLE, NC_INT, NC_SHORT, NC_VERBOSE, NC_WRITE, ncclose(), nccreate(), ncdimdef(), ncid, ncopen(), ncopts, ncredef(), ncvardef(), NDIMS, SUMMARIZE_ERR, VAR1_NAME, VAR2_NAME, and VAR3_NAME. 00026 {
00027
00028
00029 printf("\n*** Testing netcdf-4 v2 API functions.\n");
00030 printf("*** testing simple opens and creates...");
00031 {
00032 int ncid, varid, dimids[2];
00033
00034
00035 ncopts = NC_VERBOSE;
00036
00037
00038 if ((ncid = nccreate(FILE_NAME, NC_CLOBBER)) == -1) ERR;
00039 if (ncclose(ncid) == -1) ERR;
00040
00041
00042 if ((ncid = ncopen(FILE_NAME, NC_WRITE)) == -1) ERR;
00043 if (ncredef(ncid) == -1) ERR;
00044 if ((dimids[0] = ncdimdef(ncid, DIM1_NAME, DIM1_SIZE)) == -1) ERR;
00045 if ((dimids[1] = ncdimdef(ncid, DIM2_NAME, DIM2_SIZE)) == -1) ERR;
00046 if ((varid = ncvardef(ncid, VAR1_NAME, NC_DOUBLE, NDIMS, dimids)) == -1) ERR;
00047 if ((varid = ncvardef(ncid, VAR2_NAME, NC_INT, NDIMS, dimids)) == -1) ERR;
00048 if ((varid = ncvardef(ncid, VAR3_NAME, NC_SHORT, NDIMS, dimids)) == -1) ERR;
00049 if (ncclose(ncid) == -1) ERR;
00050 }
00051
00052 SUMMARIZE_ERR;
00053
00054 FINAL_RESULTS;
00055 }
|