21 #define FILE_NAME "simple_xy.nc"
30 #define ERR(e) {printf("Error: %s\n", nc_strerror(e)); exit(ERRCODE);}
57 for (x = 0; x < NX; x++)
58 for (y = 0; y < NY; y++)
59 if (data_in[x][y] != x * NY + y)
66 printf(
"*** SUCCESS reading example file %s!\n", FILE_NAME);
EXTERNL int nc_close(int ncid)
Close an open netCDF dataset.
EXTERNL int nc_open(const char *path, int mode, int *ncidp)
Open an existing netCDF file.
EXTERNL int nc_inq_varid(int ncid, const char *name, int *varidp)
Find the ID of a variable, from the name.
int nc_get_var_int(int ncid, int varid, int *ip)
Read an entire variable in one call.
Main header file for the C API.
#define NC_NOWRITE
Set read-only access for nc_open().