Line | |
---|
1 | #include <netcdf.h> |
---|
2 | #include "error.h" |
---|
3 | |
---|
4 | int nc_inq_dimlen_by_name(int ncid, const char *name, size_t *size){ |
---|
5 | int status; |
---|
6 | int dimid; |
---|
7 | if(((status = nc_inq_dimid(ncid, name, &dimid)) != NC_NOERR) || |
---|
8 | ((status = nc_inq_dimlen(ncid, dimid, size)) != NC_NOERR)) |
---|
9 | AnugaVis_NetCDFError(status); |
---|
10 | return status; |
---|
11 | } |
---|
12 | |
---|
13 | int nc_get_var_float_by_name(int ncid, const char *name, float *fp){ |
---|
14 | int status; |
---|
15 | int varid; |
---|
16 | if(((status = nc_inq_varid(ncid, name, &varid)) != NC_NOERR) || |
---|
17 | ((status = nc_get_var_float(ncid, varid, fp)) != NC_NOERR)) |
---|
18 | AnugaVis_NetCDFError(status); |
---|
19 | return status; |
---|
20 | } |
---|
21 | |
---|
22 | int nc_get_var_int_by_name(int ncid, const char *name, int *ip){ |
---|
23 | int status; |
---|
24 | int varid; |
---|
25 | if(((status = nc_inq_varid(ncid, name, &varid)) != NC_NOERR) || |
---|
26 | ((status = nc_get_var_int(ncid, varid, ip)) != NC_NOERR)) |
---|
27 | AnugaVis_NetCDFError(status); |
---|
28 | return status; |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.