Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

netcdf.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1993-1996 University Corporation for Atmospheric Research/Unidata
00003  * 
00004  * Portions of this software were developed by the Unidata Program at the 
00005  * University Corporation for Atmospheric Research.
00006  * 
00007  * Access and use of this software shall impose the following obligations
00008  * and understandings on the user. The user is granted the right, without
00009  * any fee or cost, to use, copy, modify, alter, enhance and distribute
00010  * this software, and any derivative works thereof, and its supporting
00011  * documentation for any purpose whatsoever, provided that this entire
00012  * notice appears in all copies of the software, derivative works and
00013  * supporting documentation.  Further, UCAR requests that the user credit
00014  * UCAR/Unidata in any publications that result from the use of this
00015  * software or in any product that includes this software. The names UCAR
00016  * and/or Unidata, however, may not be used in any advertising or publicity
00017  * to endorse or promote any products or commercial entity unless specific
00018  * written permission is obtained from UCAR/Unidata. The user also
00019  * understands that UCAR/Unidata is not obligated to provide the user with
00020  * any support, consulting, training or assistance of any kind with regard
00021  * to the use, operation and performance of this software nor to provide
00022  * the user with any updates, revisions, new versions or "bug fixes."
00023  * 
00024  * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR
00025  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00026  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027  * DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL,
00028  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
00029  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
00030  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
00031  * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
00032  */
00033 
00034 #ifndef _NETCDF_
00035 #define _NETCDF_
00036 
00037 #include <stddef.h> /* size_t, ptrdiff_t */
00038 #include <errno.h>  /* netcdf functions sometimes return system errors */
00039 
00040 #if defined(__cplusplus)
00041 extern "C" {
00042 #endif
00043 
00044 /*
00045  *  The netcdf external data types
00046  */
00047 typedef enum {
00048         NC_NAT =        0,      /* NAT = 'Not A Type' (c.f. NaN) */
00049         NC_BYTE =       1,      /* signed 1 byte integer */
00050         NC_CHAR =       2,      /* ISO/ASCII character */
00051         NC_SHORT =      3,      /* signed 2 byte integer */
00052         NC_INT =        4,      /* signed 4 byte integer */
00053         NC_FLOAT =      5,      /* single precision floating point number */
00054         NC_DOUBLE =     6       /* double precision floating point number */
00055 } nc_type;
00056 
00057 
00058 /*
00059  *      Default fill values, used unless _FillValue attribute is set.
00060  * These values are stuffed into newly allocated space as appropriate.
00061  * The hope is that one might use these to notice that a particular datum
00062  * has not been set.
00063  */
00064 #define NC_FILL_BYTE    ((signed char)-127)
00065 #define NC_FILL_CHAR    ((char)0)
00066 #define NC_FILL_SHORT   ((short)-32767)
00067 #define NC_FILL_INT     (-2147483647L)
00068 #define NC_FILL_FLOAT   (9.9692099683868690e+36f) /* near 15 * 2^119 */
00069 #define NC_FILL_DOUBLE  (9.9692099683868690e+36)
00070 
00071 
00072 /*
00073  * The above values are defaults.
00074  * If you wish a variable to use a different value than the above
00075  * defaults, create an attribute with the same type as the variable
00076  * and the following reserved name. The value you give the attribute
00077  * will be used as the fill value for that variable.
00078  */
00079 #define _FillValue      "_FillValue"
00080 
00081 
00082 /*
00083  * 'mode' flags for nccreate and ncopen
00084  */
00085 #define NC_NOWRITE      0       /* default is read only */
00086 #define NC_WRITE        0x1     /* read & write */
00087 #define NC_CLOBBER      0
00088 #define NC_NOCLOBBER    0x4     /* Don't destroy existing file on create */
00089 #define NC_FILL         0       /* argument to ncsetfill to clear NC_NOFILL */
00090 #define NC_NOFILL       0x100   /* Don't fill data section an records */
00091 #define NC_LOCK         0x0400  /* Use locking if available */
00092 #define NC_SHARE        0x0800  /* Share updates, limit cacheing */
00093 
00094 /*
00095  * Let nc__create() or nc__open() figure out
00096  * as suitable chunk size.
00097  */
00098 #define NC_SIZEHINT_DEFAULT 0
00099 
00100 /*
00101  * In nc__enddef(), align to the chunk size.
00102  */
00103 #define NC_ALIGN_CHUNK ((size_t)(-1))
00104 
00105 /*
00106  * 'size' argument to ncdimdef for an unlimited dimension
00107  */
00108 #define NC_UNLIMITED 0L
00109 
00110 /*
00111  * attribute id to put/get a global attribute
00112  */
00113 #define NC_GLOBAL -1
00114 
00115 
00116 /*
00117  * These maximums are enforced by the interface, to facilitate writing
00118  * applications and utilities.  However, nothing is statically allocated to
00119  * these sizes internally.
00120  */
00121 #define NC_MAX_DIMS     100      /* max dimensions per file */
00122 #define NC_MAX_ATTRS    2000     /* max global or per variable attributes */
00123 #define NC_MAX_VARS     2000     /* max variables per file */
00124 #define NC_MAX_NAME     128      /* max length of a name */
00125 #define NC_MAX_VAR_DIMS NC_MAX_DIMS /* max per variable dimensions */
00126 
00127 
00128 /*
00129  * The netcdf version 3 functions all return integer error status.
00130  * These are the possible values, in addition to certain
00131  * values from the system errno.h.
00132  */
00133 
00134 #define NC_ISSYSERR(err)        ((err) > 0)
00135 
00136 #define NC_NOERR        0       /* No Error */
00137 
00138 #define NC_EBADID       (-33)   /* Not a netcdf id */
00139 #define NC_ENFILE       (-34)   /* Too many netcdfs open */
00140 #define NC_EEXIST       (-35)   /* netcdf file exists && NC_NOCLOBBER */
00141 #define NC_EINVAL       (-36)   /* Invalid Argument */
00142 #define NC_EPERM        (-37)   /* Write to read only */
00143 #define NC_ENOTINDEFINE (-38)   /* Operation not allowed in data mode */
00144 #define NC_EINDEFINE    (-39)   /* Operation not allowed in define mode */
00145 #define NC_EINVALCOORDS (-40)   /* Index exceeds dimension bound */
00146 #define NC_EMAXDIMS     (-41)   /* NC_MAX_DIMS exceeded */
00147 #define NC_ENAMEINUSE   (-42)   /* String match to name in use */
00148 #define NC_ENOTATT      (-43)   /* Attribute not found */
00149 #define NC_EMAXATTS     (-44)   /* NC_MAX_ATTRS exceeded */
00150 #define NC_EBADTYPE     (-45)   /* Not a netcdf data type */
00151 #define NC_EBADDIM      (-46)   /* Invalid dimension id or name */
00152 #define NC_EUNLIMPOS    (-47)   /* NC_UNLIMITED in the wrong index */
00153 #define NC_EMAXVARS     (-48)   /* NC_MAX_VARS exceeded */
00154 #define NC_ENOTVAR      (-49)   /* Variable not found */
00155 #define NC_EGLOBAL      (-50)   /* Action prohibited on NC_GLOBAL varid */
00156 #define NC_ENOTNC       (-51)   /* Not a netcdf file */
00157 #define NC_ESTS         (-52)   /* In Fortran, string too short */
00158 #define NC_EMAXNAME     (-53)   /* NC_MAX_NAME exceeded */
00159 #define NC_EUNLIMIT     (-54)   /* NC_UNLIMITED size already in use */
00160 #define NC_ENORECVARS   (-55)   /* nc_rec op when there are no record vars */
00161 #define NC_ECHAR        (-56)   /* Attempt to convert between text & numbers */
00162 #define NC_EEDGE        (-57)   /* Edge+start exceeds dimension bound */
00163 #define NC_ESTRIDE      (-58)   /* Illegal stride */
00164 #define NC_EBADNAME     (-59)   /* Attribute or variable name
00165                                          contains illegal characters */
00166 /* N.B. following must match value in ncx.h */
00167 #define NC_ERANGE       (-60)   /* Math result not representable */
00168 #define NC_ENOMEM       (-61)   /* Memory allocation (malloc) failure */
00169 
00170 /*
00171  * The Interface
00172  */
00173 
00174 /* Declaration modifiers for DLL support (MSC et al) */
00175 
00176 #if defined(DLL_NETCDF) /* define when library is a DLL */
00177 #  if defined(DLL_EXPORT) /* define when building the library */
00178 #   define MSC_EXTRA __declspec(dllexport)
00179 #  else
00180 #   define MSC_EXTRA __declspec(dllimport)
00181 #  endif
00182 #else
00183 #define MSC_EXTRA
00184 #endif  /* defined(DLL_NETCDF) */
00185 
00186 # define EXTERNL extern MSC_EXTRA
00187 
00188 EXTERNL const char *
00189 nc_inq_libvers(void);
00190 
00191 EXTERNL const char *
00192 nc_strerror(int ncerr);
00193 
00194 EXTERNL int
00195 nc__create(const char *path, int cmode, size_t initialsz,
00196          size_t *chunksizehintp, int *ncidp);
00197 
00198 EXTERNL int
00199 nc_create(const char *path, int cmode, int *ncidp);
00200 
00201 EXTERNL int
00202 nc__open(const char *path, int mode, 
00203         size_t *chunksizehintp, int *ncidp);
00204 
00205 EXTERNL int
00206 nc_open(const char *path, int mode, int *ncidp);
00207 
00208 EXTERNL int
00209 nc_set_fill(int ncid, int fillmode, int *old_modep);
00210 
00211 EXTERNL int
00212 nc_redef(int ncid);
00213 
00214 EXTERNL int
00215 nc__enddef(int ncid, size_t h_minfree, size_t v_align,
00216         size_t v_minfree, size_t r_align);
00217 
00218 EXTERNL int
00219 nc_enddef(int ncid);
00220 
00221 EXTERNL int
00222 nc_sync(int ncid);
00223 
00224 EXTERNL int
00225 nc_abort(int ncid);
00226 
00227 EXTERNL int
00228 nc_close(int ncid);
00229 
00230 EXTERNL int
00231 nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp);
00232 
00233 EXTERNL int 
00234 nc_inq_ndims(int ncid, int *ndimsp);
00235 
00236 EXTERNL int 
00237 nc_inq_nvars(int ncid, int *nvarsp);
00238 
00239 EXTERNL int 
00240 nc_inq_natts(int ncid, int *nattsp);
00241 
00242 EXTERNL int 
00243 nc_inq_unlimdim(int ncid, int *unlimdimidp);
00244 
00245 /* Begin _dim */
00246 
00247 EXTERNL int
00248 nc_def_dim(int ncid, const char *name, size_t len, int *idp);
00249 
00250 EXTERNL int
00251 nc_inq_dimid(int ncid, const char *name, int *idp);
00252 
00253 EXTERNL int
00254 nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp);
00255 
00256 EXTERNL int 
00257 nc_inq_dimname(int ncid, int dimid, char *name);
00258 
00259 EXTERNL int 
00260 nc_inq_dimlen(int ncid, int dimid, size_t *lenp);
00261 
00262 EXTERNL int
00263 nc_rename_dim(int ncid, int dimid, const char *name);
00264 
00265 /* End _dim */
00266 /* Begin _att */
00267 
00268 EXTERNL int
00269 nc_inq_att(int ncid, int varid, const char *name,
00270          nc_type *xtypep, size_t *lenp);
00271 
00272 EXTERNL int 
00273 nc_inq_attid(int ncid, int varid, const char *name, int *idp);
00274 
00275 EXTERNL int 
00276 nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep);
00277 
00278 EXTERNL int 
00279 nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp);
00280 
00281 EXTERNL int
00282 nc_inq_attname(int ncid, int varid, int attnum, char *name);
00283 
00284 EXTERNL int
00285 nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
00286 
00287 EXTERNL int
00288 nc_rename_att(int ncid, int varid, const char *name, const char *newname);
00289 
00290 EXTERNL int
00291 nc_del_att(int ncid, int varid, const char *name);
00292 
00293 /* End _att */
00294 /* Begin {put,get}_att */
00295 
00296 EXTERNL int
00297 nc_put_att_text(int ncid, int varid, const char *name,
00298         size_t len, const char *op);
00299 
00300 EXTERNL int
00301 nc_get_att_text(int ncid, int varid, const char *name, char *ip);
00302 
00303 EXTERNL int
00304 nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype,
00305         size_t len, const unsigned char *op);
00306 
00307 EXTERNL int
00308 nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip);
00309 
00310 EXTERNL int
00311 nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype,
00312         size_t len, const signed char *op);
00313 
00314 EXTERNL int
00315 nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip);
00316 
00317 EXTERNL int
00318 nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype,
00319         size_t len, const short *op);
00320 
00321 EXTERNL int
00322 nc_get_att_short(int ncid, int varid, const char *name, short *ip);
00323 
00324 EXTERNL int
00325 nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
00326         size_t len, const int *op);
00327 
00328 EXTERNL int
00329 nc_get_att_int(int ncid, int varid, const char *name, int *ip);
00330 
00331 EXTERNL int
00332 nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype,
00333         size_t len, const long *op);
00334 
00335 EXTERNL int
00336 nc_get_att_long(int ncid, int varid, const char *name, long *ip);
00337 
00338 EXTERNL int
00339 nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype,
00340         size_t len, const float *op);
00341 
00342 EXTERNL int
00343 nc_get_att_float(int ncid, int varid, const char *name, float *ip);
00344 
00345 EXTERNL int
00346 nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
00347         size_t len, const double *op);
00348 
00349 EXTERNL int
00350 nc_get_att_double(int ncid, int varid, const char *name, double *ip);
00351 
00352 /* End {put,get}_att */
00353 /* Begin _var */
00354 
00355 EXTERNL int
00356 nc_def_var(int ncid, const char *name,
00357          nc_type xtype, int ndims, const int *dimidsp, int *varidp);
00358 
00359 EXTERNL int
00360 nc_inq_var(int ncid, int varid, char *name,
00361          nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp);
00362 
00363 EXTERNL int
00364 nc_inq_varid(int ncid, const char *name, int *varidp);
00365 
00366 EXTERNL int 
00367 nc_inq_varname(int ncid, int varid, char *name);
00368 
00369 EXTERNL int 
00370 nc_inq_vartype(int ncid, int varid, nc_type *xtypep);
00371 
00372 EXTERNL int 
00373 nc_inq_varndims(int ncid, int varid, int *ndimsp);
00374 
00375 EXTERNL int 
00376 nc_inq_vardimid(int ncid, int varid, int *dimidsp);
00377 
00378 EXTERNL int 
00379 nc_inq_varnatts(int ncid, int varid, int *nattsp);
00380 
00381 EXTERNL int
00382 nc_rename_var(int ncid, int varid, const char *name);
00383 
00384 EXTERNL int
00385 nc_copy_var(int ncid_in, int varid, int ncid_out);
00386 #ifndef ncvarcpy
00387 /* support the old name for now */
00388 #define ncvarcpy(ncid_in, varid, ncid_out) ncvarcopy((ncid_in), (varid), (ncid_out))
00389 #endif
00390 
00391 /* End _var */
00392 /* Begin {put,get}_var1 */
00393 
00394 EXTERNL int
00395 nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op);
00396 
00397 EXTERNL int
00398 nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip);
00399 
00400 EXTERNL int
00401 nc_put_var1_uchar(int ncid, int varid, const size_t *indexp,
00402         const unsigned char *op);
00403 
00404 EXTERNL int
00405 nc_get_var1_uchar(int ncid, int varid, const size_t *indexp,
00406         unsigned char *ip);
00407 
00408 EXTERNL int
00409 nc_put_var1_schar(int ncid, int varid, const size_t *indexp,
00410         const signed char *op);
00411 
00412 EXTERNL int
00413 nc_get_var1_schar(int ncid, int varid, const size_t *indexp,
00414         signed char *ip);
00415 
00416 EXTERNL int
00417 nc_put_var1_short(int ncid, int varid, const size_t *indexp,
00418         const short *op);
00419 
00420 EXTERNL int
00421 nc_get_var1_short(int ncid, int varid, const size_t *indexp,
00422         short *ip);
00423 
00424 EXTERNL int
00425 nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op);
00426 
00427 EXTERNL int
00428 nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip);
00429 
00430 EXTERNL int
00431 nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op);
00432 
00433 EXTERNL int
00434 nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip);
00435 
00436 EXTERNL int
00437 nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op);
00438 
00439 EXTERNL int
00440 nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip);
00441 
00442 EXTERNL int
00443 nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op);
00444 
00445 EXTERNL int
00446 nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip);
00447 
00448 /* End {put,get}_var1 */
00449 /* Begin {put,get}_vara */
00450 
00451 EXTERNL int
00452 nc_put_vara_text(int ncid, int varid,
00453         const size_t *startp, const size_t *countp, const char *op);
00454 
00455 EXTERNL int
00456 nc_get_vara_text(int ncid, int varid,
00457         const size_t *startp, const size_t *countp, char *ip);
00458 
00459 EXTERNL int
00460 nc_put_vara_uchar(int ncid, int varid,
00461         const size_t *startp, const size_t *countp, const unsigned char *op);
00462 
00463 EXTERNL int
00464 nc_get_vara_uchar(int ncid, int varid,
00465         const size_t *startp, const size_t *countp, unsigned char *ip);
00466 
00467 EXTERNL int
00468 nc_put_vara_schar(int ncid, int varid,
00469         const size_t *startp, const size_t *countp, const signed char *op);
00470 
00471 EXTERNL int
00472 nc_get_vara_schar(int ncid, int varid,
00473         const size_t *startp, const size_t *countp, signed char *ip);
00474 
00475 EXTERNL int
00476 nc_put_vara_short(int ncid, int varid,
00477         const size_t *startp, const size_t *countp, const short *op);
00478 
00479 EXTERNL int
00480 nc_get_vara_short(int ncid, int varid,
00481         const size_t *startp, const size_t *countp, short *ip);
00482 
00483 EXTERNL int
00484 nc_put_vara_int(int ncid, int varid,
00485         const size_t *startp, const size_t *countp, const int *op);
00486 
00487 EXTERNL int
00488 nc_get_vara_int(int ncid, int varid,
00489         const size_t *startp, const size_t *countp, int *ip);
00490 
00491 EXTERNL int
00492 nc_put_vara_long(int ncid, int varid,
00493         const size_t *startp, const size_t *countp, const long *op);
00494 
00495 EXTERNL int
00496 nc_get_vara_long(int ncid, int varid,
00497         const size_t *startp, const size_t *countp, long *ip);
00498 
00499 EXTERNL int
00500 nc_put_vara_float(int ncid, int varid,
00501         const size_t *startp, const size_t *countp, const float *op);
00502 
00503 EXTERNL int
00504 nc_get_vara_float(int ncid, int varid,
00505         const size_t *startp, const size_t *countp, float *ip);
00506 
00507 EXTERNL int
00508 nc_put_vara_double(int ncid, int varid,
00509         const size_t *startp, const size_t *countp, const double *op);
00510 
00511 EXTERNL int
00512 nc_get_vara_double(int ncid, int varid,
00513         const size_t *startp, const size_t *countp, double *ip);
00514 
00515 /* End {put,get}_vara */
00516 /* Begin {put,get}_vars */
00517 
00518 EXTERNL int
00519 nc_put_vars_text(int ncid, int varid,
00520         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00521         const char *op);
00522 
00523 EXTERNL int
00524 nc_get_vars_text(int ncid, int varid,
00525         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00526         char *ip);
00527 
00528 EXTERNL int
00529 nc_put_vars_uchar(int ncid, int varid,
00530         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00531         const unsigned char *op);
00532 
00533 EXTERNL int
00534 nc_get_vars_uchar(int ncid, int varid,
00535         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00536         unsigned char *ip);
00537 
00538 EXTERNL int
00539 nc_put_vars_schar(int ncid, int varid,
00540         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00541         const signed char *op);
00542 
00543 EXTERNL int
00544 nc_get_vars_schar(int ncid, int varid,
00545         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00546         signed char *ip);
00547 
00548 EXTERNL int
00549 nc_put_vars_short(int ncid, int varid,
00550         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00551         const short *op);
00552 
00553 EXTERNL int
00554 nc_get_vars_short(int ncid, int varid,
00555         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00556         short *ip);
00557 
00558 EXTERNL int
00559 nc_put_vars_int(int ncid, int varid,
00560         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00561         const int *op);
00562 
00563 EXTERNL int
00564 nc_get_vars_int(int ncid, int varid,
00565         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00566         int *ip);
00567 
00568 EXTERNL int
00569 nc_put_vars_long(int ncid, int varid,
00570         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00571         const long *op);
00572 
00573 EXTERNL int
00574 nc_get_vars_long(int ncid, int varid,
00575         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00576         long *ip);
00577 
00578 EXTERNL int
00579 nc_put_vars_float(int ncid, int varid,
00580         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00581         const float *op);
00582 
00583 EXTERNL int
00584 nc_get_vars_float(int ncid, int varid,
00585         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00586         float *ip);
00587 
00588 EXTERNL int
00589 nc_put_vars_double(int ncid, int varid,
00590         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00591         const double *op);
00592 
00593 EXTERNL int
00594 nc_get_vars_double(int ncid, int varid,
00595         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00596         double *ip);
00597 
00598 /* End {put,get}_vars */
00599 /* Begin {put,get}_varm */
00600 
00601 EXTERNL int
00602 nc_put_varm_text(int ncid, int varid,
00603         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00604         const ptrdiff_t *imapp, 
00605         const char *op);
00606 
00607 EXTERNL int
00608 nc_get_varm_text(int ncid, int varid,
00609         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00610         const ptrdiff_t *imapp, 
00611         char *ip);
00612 
00613 EXTERNL int
00614 nc_put_varm_uchar(int ncid, int varid,
00615         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00616         const ptrdiff_t *imapp, 
00617         const unsigned char *op);
00618 
00619 EXTERNL int
00620 nc_get_varm_uchar(int ncid, int varid,
00621         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00622         const ptrdiff_t *imapp, 
00623         unsigned char *ip);
00624 
00625 EXTERNL int
00626 nc_put_varm_schar(int ncid, int varid,
00627         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00628         const ptrdiff_t *imapp, 
00629         const signed char *op);
00630 
00631 EXTERNL int
00632 nc_get_varm_schar(int ncid, int varid,
00633         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00634         const ptrdiff_t *imapp, 
00635         signed char *ip);
00636 
00637 EXTERNL int
00638 nc_put_varm_short(int ncid, int varid,
00639         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00640         const ptrdiff_t *imapp, 
00641         const short *op);
00642 
00643 EXTERNL int
00644 nc_get_varm_short(int ncid, int varid,
00645         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00646         const ptrdiff_t *imapp, 
00647         short *ip);
00648 
00649 EXTERNL int
00650 nc_put_varm_int(int ncid, int varid,
00651         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00652         const ptrdiff_t *imapp, 
00653         const int *op);
00654 
00655 EXTERNL int
00656 nc_get_varm_int(int ncid, int varid,
00657         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00658         const ptrdiff_t *imapp, 
00659         int *ip);
00660 
00661 EXTERNL int
00662 nc_put_varm_long(int ncid, int varid,
00663         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00664         const ptrdiff_t *imapp, 
00665         const long *op);
00666 
00667 EXTERNL int
00668 nc_get_varm_long(int ncid, int varid,
00669         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00670         const ptrdiff_t *imapp, 
00671         long *ip);
00672 
00673 EXTERNL int
00674 nc_put_varm_float(int ncid, int varid,
00675         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00676         const ptrdiff_t *imapp, 
00677         const float *op);
00678 
00679 EXTERNL int
00680 nc_get_varm_float(int ncid, int varid,
00681         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00682         const ptrdiff_t *imapp, 
00683         float *ip);
00684 
00685 EXTERNL int
00686 nc_put_varm_double(int ncid, int varid,
00687         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00688         const ptrdiff_t *imapp, 
00689         const double *op);
00690 
00691 EXTERNL int
00692 nc_get_varm_double(int ncid, int varid,
00693         const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
00694         const ptrdiff_t * imap, 
00695         double *ip);
00696 
00697 /* End {put,get}_varm */
00698 /* Begin {put,get}_var */
00699 
00700 EXTERNL int
00701 nc_put_var_text(int ncid, int varid, const char *op);
00702 
00703 EXTERNL int
00704 nc_get_var_text(int ncid, int varid, char *ip);
00705 
00706 EXTERNL int
00707 nc_put_var_uchar(int ncid, int varid, const unsigned char *op);
00708 
00709 EXTERNL int
00710 nc_get_var_uchar(int ncid, int varid, unsigned char *ip);
00711 
00712 EXTERNL int
00713 nc_put_var_schar(int ncid, int varid, const signed char *op);
00714 
00715 EXTERNL int
00716 nc_get_var_schar(int ncid, int varid, signed char *ip);
00717 
00718 EXTERNL int
00719 nc_put_var_short(int ncid, int varid, const short *op);
00720 
00721 EXTERNL int
00722 nc_get_var_short(int ncid, int varid, short *ip);
00723 
00724 EXTERNL int
00725 nc_put_var_int(int ncid, int varid, const int *op);
00726 
00727 EXTERNL int
00728 nc_get_var_int(int ncid, int varid, int *ip);
00729 
00730 EXTERNL int
00731 nc_put_var_long(int ncid, int varid, const long *op);
00732 
00733 EXTERNL int
00734 nc_get_var_long(int ncid, int varid, long *ip);
00735 
00736 EXTERNL int
00737 nc_put_var_float(int ncid, int varid, const float *op);
00738 
00739 EXTERNL int
00740 nc_get_var_float(int ncid, int varid, float *ip);
00741 
00742 EXTERNL int
00743 nc_put_var_double(int ncid, int varid, const double *op);
00744 
00745 EXTERNL int
00746 nc_get_var_double(int ncid, int varid, double *ip);
00747 
00748 /* End {put,get}_var */
00749 
00750 /* #ifdef _CRAYMPP */
00751 /*
00752  * Public interfaces to better support
00753  * CRAY multi-processor systems like T3E.
00754  * A tip of the hat to NERSC.
00755  */
00756 /*
00757  * It turns out we need to declare and define
00758  * these public interfaces on all platforms
00759  * or things get ugly working out the
00760  * FORTRAN interface. On !_CRAYMPP platforms,
00761  * these functions work as advertised, but you
00762  * can only use "processor element" 0.
00763  */
00764 
00765 EXTERNL int
00766 nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe,
00767          size_t *chunksizehintp, int *ncidp);
00768 
00769 EXTERNL int
00770 nc__open_mp(const char *path, int mode, int basepe,
00771         size_t *chunksizehintp, int *ncidp);
00772 
00773 EXTERNL int
00774 nc_delete_mp(const char * path, int basepe);
00775 
00776 EXTERNL int
00777 nc_set_base_pe(int ncid, int pe);
00778 
00779 EXTERNL int
00780 nc_inq_base_pe(int ncid, int *pe);
00781 
00782 /* #endif _CRAYMPP */
00783 
00784 
00785 /* Begin v2.4 backward compatiblity */
00786 /*
00787  * defining NO_NETCDF_2 to the preprocessor
00788  * turns off backward compatiblity declarations.
00789  */
00790 #ifndef NO_NETCDF_2
00791 
00792 /*
00793  * Backward compatible aliases
00794  */
00795 #define FILL_BYTE       NC_FILL_BYTE
00796 #define FILL_CHAR       NC_FILL_CHAR
00797 #define FILL_SHORT      NC_FILL_SHORT
00798 #define FILL_LONG       NC_FILL_INT
00799 #define FILL_FLOAT      NC_FILL_FLOAT
00800 #define FILL_DOUBLE     NC_FILL_DOUBLE
00801 
00802 #define MAX_NC_DIMS     NC_MAX_DIMS
00803 #define MAX_NC_ATTRS    NC_MAX_ATTRS
00804 #define MAX_NC_VARS     NC_MAX_VARS
00805 #define MAX_NC_NAME     NC_MAX_NAME
00806 #define MAX_VAR_DIMS    NC_MAX_VAR_DIMS
00807 
00808 /*
00809  * If and when 64 integer types become ubiquitous,
00810  * we would like to use NC_LONG for that. 
00811  * For now, define for backward compatibility.
00812  */
00813 #define NC_LONG NC_INT
00814 
00815 /*
00816  * Global error status
00817  */
00818 EXTERNL int ncerr;
00819 
00820 #define NC_ENTOOL       NC_EMAXNAME   /* Backward compatibility */
00821 #define NC_EXDR         (-32)   /* */
00822 #define NC_SYSERR       (-31)
00823 
00824 /*
00825  * Avoid use of this meaningless macro
00826  * Use sysconf(_SC_OPEN_MAX).
00827  */
00828 #ifndef MAX_NC_OPEN
00829 #define MAX_NC_OPEN 32
00830 #endif
00831 
00832 /*
00833  * Global options variable.
00834  * Used to determine behavior of error handler.
00835  */
00836 #define NC_FATAL        1
00837 #define NC_VERBOSE      2
00838 
00839 EXTERNL int ncopts;     /* default is (NC_FATAL | NC_VERBOSE) */
00840 
00841 EXTERNL void
00842 nc_advise(const char *cdf_routine_name, int err, const char *fmt,...);
00843 
00844 /*
00845  * C data type corresponding to a netCDF NC_LONG argument,
00846  * a signed 32 bit object.
00847  * 
00848  * This is the only thing in this file which architecture dependent.
00849  */
00850 typedef int nclong;
00851 
00852 EXTERNL int
00853 nctypelen(nc_type datatype);
00854 
00855 EXTERNL int
00856 nccreate(const char* path, int cmode);
00857 
00858 EXTERNL int
00859 ncopen(const char* path, int mode);
00860 
00861 EXTERNL int
00862 ncsetfill(int ncid, int fillmode);
00863 
00864 EXTERNL int
00865 ncredef(int ncid);
00866 
00867 EXTERNL int
00868 ncendef(int ncid);
00869 
00870 EXTERNL int
00871 ncsync(int ncid);
00872 
00873 EXTERNL int
00874 ncabort(int ncid);
00875 
00876 EXTERNL int
00877 ncclose(int ncid);
00878 
00879 EXTERNL int
00880 ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp);
00881 
00882 EXTERNL int
00883 ncdimdef(int ncid, const char *name, long len);
00884 
00885 EXTERNL int
00886 ncdimid(int ncid, const char *name);
00887 
00888 EXTERNL int
00889 ncdiminq(int ncid, int dimid, char *name, long *lenp);
00890 
00891 EXTERNL int
00892 ncdimrename(int ncid, int dimid, const char *name);
00893 
00894 EXTERNL int
00895 ncattput(int ncid, int varid, const char *name, nc_type xtype,
00896         int len, const void *op);
00897 
00898 EXTERNL int
00899 ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp);
00900 
00901 EXTERNL int
00902 ncattget(int ncid, int varid, const char *name, void *ip);
00903 
00904 EXTERNL int
00905 ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out,
00906         int varid_out);
00907 
00908 EXTERNL int
00909 ncattname(int ncid, int varid, int attnum, char *name);
00910 
00911 EXTERNL int
00912 ncattrename(int ncid, int varid, const char *name, const char *newname);
00913 
00914 EXTERNL int
00915 ncattdel(int ncid, int varid, const char *name);
00916 
00917 EXTERNL int
00918 ncvardef(int ncid, const char *name, nc_type xtype,
00919         int ndims, const int *dimidsp);
00920 
00921 EXTERNL int
00922 ncvarid(int ncid, const char *name);
00923 
00924 EXTERNL int
00925 ncvarinq(int ncid, int varid, char *name, nc_type *xtypep,
00926         int *ndimsp, int *dimidsp, int *nattsp);
00927 
00928 EXTERNL int
00929 ncvarput1(int ncid, int varid, const long *indexp, const void *op);
00930 
00931 EXTERNL int
00932 ncvarget1(int ncid, int varid, const long *indexp, void *ip);
00933 
00934 EXTERNL int
00935 ncvarput(int ncid, int varid, const long *startp, const long *countp,
00936         const void *op);
00937 
00938 EXTERNL int
00939 ncvarget(int ncid, int varid, const long *startp, const long *countp, 
00940         void *ip);
00941 
00942 EXTERNL int
00943 ncvarputs(int ncid, int varid, const long *startp, const long *countp,
00944         const long *stridep, const void *op);
00945 
00946 EXTERNL int
00947 ncvargets(int ncid, int varid, const long *startp, const long *countp,
00948         const long *stridep, void *ip);
00949 
00950 EXTERNL int
00951 ncvarputg(int ncid, int varid, const long *startp, const long *countp,
00952         const long *stridep, const long *imapp, const void *op);
00953 
00954 EXTERNL int
00955 ncvargetg(int ncid, int varid, const long *startp, const long *countp,
00956         const long *stridep, const long *imapp, void *ip);
00957 
00958 EXTERNL int
00959 ncvarrename(int ncid, int varid, const char *name);
00960 
00961 EXTERNL int
00962 ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp);
00963 
00964 EXTERNL int
00965 ncrecget(int ncid, long recnum, void **datap);
00966 
00967 EXTERNL int
00968 ncrecput(int ncid, long recnum, void *const *datap);
00969 
00970 /* End v2.4 backward compatiblity */
00971 #endif /*!NO_NETCDF_2*/
00972 
00973 #if defined(__cplusplus)
00974 }
00975 #endif
00976 
00977 #endif /* _NETCDF_ */
 

Powered by Plone

This site conforms to the following standards: