NetCDF  4.3.2
dvarget.c
Go to the documentation of this file.
00001 
00007 #include "ncdispatch.h"
00008 
00009 #undef VARS_USES_VARM
00010 #ifndef VARS_USES_VARM
00011 struct GETodometer {
00012     int            rank;
00013     size_t         index[NC_MAX_VAR_DIMS];
00014     size_t         start[NC_MAX_VAR_DIMS];
00015     size_t         edges[NC_MAX_VAR_DIMS];
00016     ptrdiff_t      stride[NC_MAX_VAR_DIMS];
00017     size_t         stop[NC_MAX_VAR_DIMS];
00018 };
00019 
00020 static void
00021 odom_init(struct GETodometer* odom,
00022             int rank,
00023             const size_t* start, const size_t* edges, const ptrdiff_t* stride)
00024 {
00025     int i;
00026     memset(odom,0,sizeof(struct GETodometer));
00027     odom->rank = rank;
00028     assert(odom->rank <= NC_MAX_VAR_DIMS);
00029     for(i=0;i<odom->rank;i++) {
00030         odom->start[i] = (start != NULL ? start[i] : 0);
00031         odom->edges[i] = (edges != NULL ? edges[i] : 1);
00032         odom->stride[i] = (stride != NULL ? stride[i] : 1);
00033         odom->stop[i] = odom->start[i] + (odom->edges[i]*((size_t)odom->stride[i]));
00034         odom->index[i] = odom->start[i];
00035     }    
00036 }
00037 
00038 static int
00039 odom_more(struct GETodometer* odom)
00040 {
00041     return (odom->index[0] < odom->stop[0]);
00042 }
00043 
00044 static int
00045 odom_next(struct GETodometer* odom)
00046 {
00047     int i;
00048     if(odom->rank == 0) return 0;
00049     for(i=odom->rank-1;i>=0;i--) {
00050         odom->index[i] += (size_t)odom->stride[i];
00051         if(odom->index[i] < odom->stop[i]) break;
00052         if(i == 0) return 0; /* leave the 0th entry if it overflows*/
00053         odom->index[i] = odom->start[i]; /* reset this position*/
00054     }
00055     return 1;
00056 }
00057 #endif
00058 
00063 int
00064 NC_get_vara(int ncid, int varid,
00065             const size_t *start, const size_t *edges,
00066             void *value, nc_type memtype)
00067 {
00068    NC* ncp;
00069    int stat = NC_check_id(ncid, &ncp);
00070    if(stat != NC_NOERR) return stat;
00071 #ifdef USE_NETCDF4
00072    if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
00073 #endif
00074 
00075    if(edges == NULL) {
00076       size_t shape[NC_MAX_VAR_DIMS];
00077       int ndims;
00078       stat = nc_inq_varndims(ncid, varid, &ndims); 
00079       if(stat != NC_NOERR) return stat;
00080       stat = NC_getshape(ncid,varid,ndims,shape);
00081       if(stat != NC_NOERR) return stat;
00082       stat = ncp->dispatch->get_vara(ncid,varid,start,shape,value,memtype);
00083    } else
00084       stat =  ncp->dispatch->get_vara(ncid,varid,start,edges,value,memtype);
00085    return stat;
00086 }
00087 
00091 static int
00092 NC_get_var(int ncid, int varid, void *value, nc_type memtype)
00093 {
00094    int ndims;
00095    size_t shape[NC_MAX_VAR_DIMS];
00096    int stat = nc_inq_varndims(ncid,varid, &ndims);
00097    if(stat) return stat;
00098    stat = NC_getshape(ncid,varid, ndims, shape);
00099    if(stat) return stat;
00100    return NC_get_vara(ncid, varid, NC_coord_zero, shape, value, memtype);
00101 }
00102 
00107 int
00108 NCDEFAULT_get_vars(int ncid, int varid, const size_t * start,
00109             const size_t * edges, const ptrdiff_t * stride,
00110             void *value0, nc_type memtype)
00111 {
00112 #ifdef VARS_USES_VARM
00113    NC* ncp;
00114    int stat = NC_check_id(ncid, &ncp);
00115 
00116    if(stat != NC_NOERR) return stat;
00117    return ncp->dispatch->get_varm(ncid,varid,start,edges,stride,NULL,value0,memtype);
00118 #else
00119   /* Rebuilt get_vars code to simplify and avoid use of get_varm */
00120   
00121    int status = NC_NOERR;
00122    int i,simplestride,isrecvar;
00123    int rank;
00124    struct GETodometer odom;
00125    nc_type vartype = NC_NAT;
00126    NC* ncp;
00127    int memtypelen;
00128    size_t vartypelen;
00129    char* value = (char*)value0;
00130    size_t numrecs;
00131    size_t varshape[NC_MAX_VAR_DIMS];
00132    size_t mystart[NC_MAX_VAR_DIMS];
00133    size_t myedges[NC_MAX_VAR_DIMS];
00134    ptrdiff_t mystride[NC_MAX_VAR_DIMS];
00135    char *memptr = NULL;
00136 
00137    status = NC_check_id (ncid, &ncp);
00138    if(status != NC_NOERR) return status;
00139 
00140    status = nc_inq_vartype(ncid, varid, &vartype); 
00141    if(status != NC_NOERR) return status;
00142 
00143    if(memtype == NC_NAT) memtype = vartype;
00144 
00145    /* compute the variable type size */
00146    status = nc_inq_type(ncid,vartype,NULL,&vartypelen);
00147    if(status != NC_NOERR) return status;
00148 
00149    if(memtype > NC_MAX_ATOMIC_TYPE)
00150         memtypelen = (int)vartypelen;
00151     else
00152         memtypelen = nctypelen(memtype);
00153 
00154    /* Check gross internal/external type compatibility */
00155    if(vartype != memtype) {
00156       /* If !atomic, the two types must be the same */
00157       if(vartype > NC_MAX_ATOMIC_TYPE
00158          || memtype > NC_MAX_ATOMIC_TYPE)
00159          return NC_EBADTYPE;
00160       /* ok, the types differ but both are atomic */
00161       if(memtype == NC_CHAR || vartype == NC_CHAR)
00162          return NC_ECHAR;
00163    }
00164 
00165    /* Get the variable rank */
00166    status = nc_inq_varndims(ncid, varid, &rank); 
00167    if(status != NC_NOERR) return status;
00168 
00169    /* Get variable dimension sizes */
00170    isrecvar = NC_is_recvar(ncid,varid,&numrecs);
00171    NC_getshape(ncid,varid,rank,varshape);       
00172 
00173    /* Optimize out using various checks */
00174    if (rank == 0) {
00175       /*
00176        * The variable is a scalar; consequently,
00177        * there s only one thing to get and only one place to put it.
00178        * (Why was I called?)
00179        */
00180       size_t edge1[1] = {1};
00181       return NC_get_vara(ncid, varid, start, edge1, value, memtype);
00182    }
00183 
00184    /* Do various checks and fixups on start/edges/stride */
00185    simplestride = 1; /* assume so */
00186    for(i=0;i<rank;i++) {
00187         size_t dimlen;
00188         mystart[i] = (start == NULL ? 0 : start[i]);
00189         if(edges == NULL) {
00190            if(i == 0 && isrecvar)
00191               myedges[i] = numrecs - start[i];
00192            else
00193               myedges[i] = varshape[i] - mystart[i];
00194         } else
00195             myedges[i] = edges[i];
00196         if(myedges[i] == 0)
00197             return NC_NOERR; /* cannot read anything */
00198         mystride[i] = (stride == NULL ? 1 : stride[i]);
00199         if(mystride[i] <= 0
00200            /* cast needed for braindead systems with signed size_t */
00201            || ((unsigned long) mystride[i] >= X_INT_MAX))
00202            return NC_ESTRIDE;
00203         if(mystride[i] != 1) simplestride = 0;  
00204         /* illegal value checks */
00205         dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
00206         /* mystart is unsigned, never < 0 */  
00207         //if(mystart[i] < 0 || mystart[i] >= dimlen)
00208         if(mystart[i] >= dimlen)
00209           return NC_EINVALCOORDS;
00210         /* myedges is unsigned, never < 0 */
00211         //if(myedges[i] < 0 || (mystart[i] + myedges[i] > dimlen))
00212         if(mystart[i] + myedges[i] > dimlen)
00213           return NC_EEDGE;
00214    }
00215    if(simplestride) {
00216       return NC_get_vara(ncid, varid, mystart, myedges, value, memtype);
00217    }
00218 
00219    /* memptr indicates where to store the next value */
00220    memptr = value;
00221 
00222    odom_init(&odom,rank,mystart,myedges,mystride);
00223 
00224    /* walk the odometer to extract values */
00225    while(odom_more(&odom)) {
00226       int localstatus = NC_NOERR;
00227       /* Read a single value */
00228       localstatus = NC_get_vara(ncid,varid,odom.index,nc_sizevector1,memptr,memtype);
00229       /* So it turns out that when get_varm is used, all errors are
00230          delayed and ERANGE will be overwritten by more serious errors.
00231       */
00232       if(localstatus != NC_NOERR) {
00233             if(status == NC_NOERR || localstatus != NC_ERANGE)
00234                status = localstatus;
00235       }
00236       memptr += memtypelen;
00237       odom_next(&odom);
00238    }
00239    return status;
00240 #endif
00241 }
00242 
00246 static int
00247 NC_get_var1(int ncid, int varid, const size_t *coord, void* value, 
00248             nc_type memtype)
00249 {
00250    return NC_get_vara(ncid, varid, coord, NC_coord_one, value, memtype);
00251 }
00252 
00256 int
00257 NCDEFAULT_get_varm(int ncid, int varid, const size_t *start,
00258             const size_t *edges, const ptrdiff_t *stride,
00259             const ptrdiff_t *imapp, void *value0, nc_type memtype)
00260 {
00261    int status = NC_NOERR;
00262    nc_type vartype = NC_NAT;
00263    int varndims,maxidim;
00264    NC* ncp;
00265    int memtypelen;
00266    ptrdiff_t cvtmap[NC_MAX_VAR_DIMS];
00267    char* value = (char*)value0;
00268 
00269    status = NC_check_id (ncid, &ncp);
00270    if(status != NC_NOERR) return status;
00271 
00272 /*
00273   if(NC_indef(ncp)) return NC_EINDEFINE;
00274 */
00275 
00276    status = nc_inq_vartype(ncid, varid, &vartype); 
00277    if(status != NC_NOERR) return status;
00278    /* Check that this is an atomic type */
00279    if(vartype > NC_MAX_ATOMIC_TYPE)
00280         return NC_EMAPTYPE;
00281 
00282    status = nc_inq_varndims(ncid, varid, &varndims); 
00283    if(status != NC_NOERR) return status;
00284 
00285    if(memtype == NC_NAT) {
00286       if(imapp != NULL && varndims != 0) {
00287          /*
00288           * convert map units from bytes to units of sizeof(type)
00289           */
00290          size_t ii;
00291          const ptrdiff_t szof = (ptrdiff_t) nctypelen(vartype);
00292          for(ii = 0; ii < varndims; ii++) {
00293             if(imapp[ii] % szof != 0) {
00294                /*free(cvtmap);*/
00295                return NC_EINVAL;
00296             }
00297             cvtmap[ii] = imapp[ii] / szof;
00298          }
00299          imapp = cvtmap;
00300       }
00301       memtype = vartype;
00302    }
00303 
00304    if(memtype == NC_CHAR && vartype != NC_CHAR)
00305       return NC_ECHAR;
00306    else if(memtype != NC_CHAR && vartype == NC_CHAR)  
00307       return NC_ECHAR;
00308 
00309    memtypelen = nctypelen(memtype);
00310 
00311    maxidim = (int) varndims - 1;
00312 
00313    if (maxidim < 0)
00314    {
00315       /*
00316        * The variable is a scalar; consequently,
00317        * there s only one thing to get and only one place to put it.
00318        * (Why was I called?)
00319        */
00320       size_t edge1[1] = {1};
00321       return NC_get_vara(ncid, varid, start, edge1, value, memtype);
00322    }
00323 
00324    /*
00325     * else
00326     * The variable is an array.
00327     */
00328    {
00329       int idim;
00330       size_t *mystart = NULL;
00331       size_t *myedges;
00332       size_t *iocount;    /* count vector */
00333       size_t *stop;   /* stop indexes */
00334       size_t *length; /* edge lengths in bytes */
00335       ptrdiff_t *mystride;
00336       ptrdiff_t *mymap;
00337       size_t varshape[NC_MAX_VAR_DIMS];
00338       int isrecvar;
00339       size_t numrecs;
00340 
00341       /* Compute some dimension related values */
00342       isrecvar = NC_is_recvar(ncid,varid,&numrecs);
00343       NC_getshape(ncid,varid,varndims,varshape);        
00344 
00345       /*
00346        * Verify stride argument; also see if stride is all ones
00347        */
00348       if(stride != NULL) {
00349          int stride1 = 1;
00350          for (idim = 0; idim <= maxidim; ++idim)
00351          {
00352             if (stride[idim] == 0
00353                 /* cast needed for braindead systems with signed size_t */
00354                 || ((unsigned long) stride[idim] >= X_INT_MAX))
00355             {
00356                return NC_ESTRIDE;
00357             }
00358             if(stride[idim] != 1) stride1 = 0;
00359          }
00360          /* If stride1 is true, and there is no imap 
00361             then call get_vara directly.
00362          */
00363          if(stride1 && imapp == NULL) {
00364              return NC_get_vara(ncid, varid, start, edges, value, memtype);
00365          }
00366       }
00367 
00368       /* assert(sizeof(ptrdiff_t) >= sizeof(size_t)); */
00369       /* Allocate space for mystart,mystride,mymap etc.all at once */
00370       mystart = (size_t *)calloc((size_t)(varndims * 7), sizeof(ptrdiff_t));
00371       if(mystart == NULL) return NC_ENOMEM;
00372       myedges = mystart + varndims;
00373       iocount = myedges + varndims;
00374       stop = iocount + varndims;
00375       length = stop + varndims;
00376       mystride = (ptrdiff_t *)(length + varndims);
00377       mymap = mystride + varndims;
00378 
00379       /*
00380        * Initialize I/O parameters.
00381        */
00382       for (idim = maxidim; idim >= 0; --idim)
00383       {
00384          mystart[idim] = start != NULL
00385             ? start[idim]
00386             : 0;
00387 
00388          if (edges != NULL && edges[idim] == 0)
00389          {
00390             status = NC_NOERR;    /* read/write no data */
00391             goto done;
00392          }
00393 
00394 #ifdef COMPLEX
00395          myedges[idim] = edges != NULL
00396             ? edges[idim]
00397             : idim == 0 && isrecvar
00398             ? numrecs - mystart[idim]
00399             : varshape[idim] - mystart[idim];
00400 #else
00401          if(edges != NULL)
00402             myedges[idim] = edges[idim];
00403          else if (idim == 0 && isrecvar)
00404             myedges[idim] = numrecs - mystart[idim];
00405          else
00406             myedges[idim] = varshape[idim] - mystart[idim];
00407 #endif
00408 
00409          mystride[idim] = stride != NULL
00410             ? stride[idim]
00411             : 1;
00412 
00413          /* Remember: imapp is byte oriented, not index oriented */
00414 #ifdef COMPLEX
00415          mymap[idim] = (imapp != NULL
00416                         ? imapp[idim]
00417                         : (idim == maxidim ? 1
00418                            : mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1]));
00419 #else
00420          if(imapp != NULL)
00421             mymap[idim] = imapp[idim];
00422          else if (idim == maxidim)
00423             mymap[idim] = 1;
00424          else
00425             mymap[idim] = 
00426                mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1];
00427 #endif
00428          iocount[idim] = 1;
00429          length[idim] = ((size_t)mymap[idim]) * myedges[idim];
00430          stop[idim] = (mystart[idim] + myedges[idim] * (size_t)mystride[idim]);
00431       }
00432 
00433       /*
00434        * Check start, edges
00435        */
00436       for (idim = maxidim; idim >= 0; --idim)
00437       {
00438          size_t dimlen = 
00439             idim == 0 && isrecvar
00440             ? numrecs
00441             : varshape[idim];
00442          if (mystart[idim] >= dimlen)
00443          {
00444             status = NC_EINVALCOORDS;
00445             goto done;
00446          }
00447 
00448          if (mystart[idim] + myedges[idim] > dimlen)
00449          {
00450             status = NC_EEDGE;
00451             goto done;
00452          }
00453 
00454       }
00455 
00456 
00457       /* Lower body */
00458       /*
00459        * As an optimization, adjust I/O parameters when the fastest 
00460        * dimension has unity stride both externally and internally.
00461        * In this case, the user could have called a simpler routine
00462        * (i.e. ncvar$1()
00463        */
00464       if (mystride[maxidim] == 1
00465           && mymap[maxidim] == 1)
00466       {
00467          iocount[maxidim] = myedges[maxidim];
00468          mystride[maxidim] = (ptrdiff_t) myedges[maxidim];
00469          mymap[maxidim] = (ptrdiff_t) length[maxidim];
00470       }
00471 
00472       /* 
00473        * Perform I/O.  Exit when done.
00474        */
00475       for (;;)
00476       {
00477          /* TODO: */
00478          int lstatus = NC_get_vara(ncid, varid, mystart, iocount,
00479                                    value, memtype);
00480          if (lstatus != NC_NOERR) {
00481             if(status == NC_NOERR || lstatus != NC_ERANGE)
00482                status = lstatus;
00483          }
00484          /*
00485           * The following code permutes through the variable s
00486           * external start-index space and it s internal address
00487           * space.  At the UPC, this algorithm is commonly
00488           * called "odometer code".
00489           */
00490          idim = maxidim;
00491         carry:
00492          value += (((int)mymap[idim]) * memtypelen);
00493          mystart[idim] += (size_t)mystride[idim];
00494          if (mystart[idim] == stop[idim])
00495          {
00496             size_t l = (length[idim] * (size_t)memtypelen);
00497             value -= l;
00498             mystart[idim] = start[idim];
00499             if (--idim < 0)
00500                break; /* normal return */
00501             goto carry;
00502          }
00503       } /* I/O loop */
00504      done:
00505       free(mystart);
00506    } /* variable is array */
00507    return status;
00508 }
00509 
00513 static int
00514 NC_get_vars(int ncid, int varid, const size_t *start, 
00515             const size_t *edges, const ptrdiff_t *stride, void *value,
00516             nc_type memtype)
00517 {
00518    NC* ncp;
00519    int stat = NC_check_id(ncid, &ncp);
00520 
00521    if(stat != NC_NOERR) return stat;
00522 #ifdef USE_NETCDF4
00523    if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
00524 #endif
00525    return ncp->dispatch->get_vars(ncid,varid,start,edges,stride,value,memtype);
00526 }
00527 
00532 static int
00533 NC_get_varm(int ncid, int varid, const size_t *start, 
00534             const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t* map,
00535             void *value, nc_type memtype)
00536 {
00537    NC* ncp;
00538    int stat = NC_check_id(ncid, &ncp);
00539 
00540    if(stat != NC_NOERR) return stat;
00541 #ifdef USE_NETCDF4
00542    if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
00543 #endif
00544    return ncp->dispatch->get_varm(ncid,varid,start,edges,stride,map,value,memtype);
00545 }
00546  /* All these functions are part of this named group... */
00551 
00626 int
00627 nc_get_vara(int ncid, int varid, const size_t *startp, 
00628             const size_t *countp, void *ip)
00629 {
00630    NC* ncp = NULL;
00631    nc_type xtype = NC_NAT;
00632    int stat = NC_check_id(ncid, &ncp);
00633    if(stat != NC_NOERR) return stat;
00634    stat = nc_inq_vartype(ncid, varid, &xtype);
00635    if(stat != NC_NOERR) return stat;
00636    return NC_get_vara(ncid, varid, startp, countp, ip, xtype);
00637 }
00638 
00639 int
00640 nc_get_vara_text(int ncid, int varid, const size_t *startp, 
00641                  const size_t *countp, char *ip)
00642 {
00643    NC* ncp;
00644    int stat = NC_check_id(ncid, &ncp);
00645    if(stat != NC_NOERR) return stat;
00646    return NC_get_vara(ncid, varid, startp, countp, 
00647                       (void *)ip, NC_CHAR);
00648 }
00649 
00650 int
00651 nc_get_vara_schar(int ncid, int varid, const size_t *startp, 
00652                   const size_t *countp, signed char *ip)
00653 {
00654    NC* ncp;
00655    int stat = NC_check_id(ncid, &ncp);
00656    if(stat != NC_NOERR) return stat;
00657    return NC_get_vara(ncid, varid, startp, countp, 
00658                       (void *)ip, NC_BYTE);
00659 }
00660 
00661 int
00662 nc_get_vara_uchar(int ncid, int varid, const size_t *startp, 
00663                   const size_t *countp, unsigned char *ip)
00664 {
00665    NC* ncp;
00666    int stat = NC_check_id(ncid, &ncp);
00667    if(stat != NC_NOERR) return stat;
00668    return NC_get_vara(ncid, varid, startp, countp, 
00669                       (void *)ip, T_uchar);
00670 }
00671 
00672 int
00673 nc_get_vara_short(int ncid, int varid, const size_t *startp, 
00674                   const size_t *countp, short *ip)
00675 {
00676    NC* ncp;
00677    int stat = NC_check_id(ncid, &ncp);
00678    if(stat != NC_NOERR) return stat;
00679    return NC_get_vara(ncid, varid, startp, countp, 
00680                       (void *)ip, NC_SHORT);
00681 }
00682 
00683 int
00684 nc_get_vara_int(int ncid, int varid,
00685                 const size_t *startp, const size_t *countp, int *ip)
00686 {
00687    NC* ncp;
00688    int stat = NC_check_id(ncid, &ncp);
00689    if(stat != NC_NOERR) return stat;
00690    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_INT);
00691 }
00692 
00693 int
00694 nc_get_vara_long(int ncid, int varid,
00695                  const size_t *startp, const size_t *countp, long *ip)
00696 {
00697    NC* ncp;
00698    int stat = NC_check_id(ncid, &ncp);
00699    if(stat != NC_NOERR) return stat;
00700    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_long);
00701 }
00702 
00703 int
00704 nc_get_vara_float(int ncid, int varid,
00705                   const size_t *startp, const size_t *countp, float *ip)
00706 {
00707    NC* ncp;
00708    int stat = NC_check_id(ncid, &ncp);
00709    if(stat != NC_NOERR) return stat;
00710    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_float);
00711 }
00712 
00713 
00714 int
00715 nc_get_vara_double(int ncid, int varid, const size_t *startp, 
00716                    const size_t *countp, double *ip)
00717 {
00718    NC* ncp;
00719    int stat = NC_check_id(ncid, &ncp);
00720    if(stat != NC_NOERR) return stat;
00721    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_double);
00722 }
00723 
00724 int
00725 nc_get_vara_ubyte(int ncid, int varid,
00726                   const size_t *startp, const size_t *countp, unsigned char *ip)
00727 {
00728    NC* ncp;
00729    int stat = NC_check_id(ncid, &ncp);
00730    if(stat != NC_NOERR) return stat;
00731    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_ubyte);
00732 }
00733 
00734 int
00735 nc_get_vara_ushort(int ncid, int varid,
00736                    const size_t *startp, const size_t *countp, unsigned short *ip)
00737 {
00738    NC* ncp;
00739    int stat = NC_check_id(ncid, &ncp);
00740    if(stat != NC_NOERR) return stat;
00741    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_ushort);
00742 }
00743 
00744 int
00745 nc_get_vara_uint(int ncid, int varid,
00746                  const size_t *startp, const size_t *countp, unsigned int *ip)
00747 {
00748    NC* ncp;
00749    int stat = NC_check_id(ncid, &ncp);
00750    if(stat != NC_NOERR) return stat;
00751    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_uint);
00752 }
00753 
00754 int
00755 nc_get_vara_longlong(int ncid, int varid,
00756                      const size_t *startp, const size_t *countp, long long *ip)
00757 {
00758    NC* ncp;
00759    int stat = NC_check_id(ncid, &ncp);
00760    if(stat != NC_NOERR) return stat;
00761    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_longlong);
00762 }
00763 
00764 int
00765 nc_get_vara_ulonglong(int ncid, int varid,
00766                       const size_t *startp, const size_t *countp, unsigned long long *ip)
00767 {
00768    NC* ncp;
00769    int stat = NC_check_id(ncid, &ncp);
00770    if(stat != NC_NOERR) return stat;
00771    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_UINT64);
00772 }
00773 
00774 #ifdef USE_NETCDF4
00775 int
00776 nc_get_vara_string(int ncid, int varid,
00777                    const size_t *startp, const size_t *countp, char* *ip)
00778 {
00779    NC* ncp;
00780    int stat = NC_check_id(ncid, &ncp);
00781    if(stat != NC_NOERR) return stat;
00782    return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_STRING);
00783 }
00784 
00785 #endif /*USE_NETCDF4*/
00786 
00822 int
00823 nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip)
00824 {
00825    return NC_get_var1(ncid, varid, indexp, ip, NC_NAT);
00826 }
00827 
00828 int
00829 nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip)
00830 {
00831    NC* ncp;
00832    int stat = NC_check_id(ncid, &ncp);
00833    if(stat != NC_NOERR) return stat;
00834    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_CHAR);
00835 }
00836 
00837 int
00838 nc_get_var1_schar(int ncid, int varid, const size_t *indexp, signed char *ip)
00839 {
00840    NC* ncp;
00841    int stat = NC_check_id(ncid, &ncp);
00842    if(stat != NC_NOERR) return stat;
00843    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_BYTE);
00844 }
00845 
00846 int
00847 nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, unsigned char *ip)
00848 {
00849    NC* ncp;
00850    int stat = NC_check_id(ncid, &ncp);
00851    if(stat != NC_NOERR) return stat;
00852    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UBYTE);
00853 }
00854 
00855 int
00856 nc_get_var1_short(int ncid, int varid, const size_t *indexp, short *ip)
00857 {
00858    NC* ncp;
00859    int stat = NC_check_id(ncid, &ncp);
00860    if(stat != NC_NOERR) return stat;
00861    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_SHORT);
00862 }
00863 
00864 int
00865 nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip)
00866 {
00867    NC* ncp;
00868    int stat = NC_check_id(ncid, &ncp);
00869    if(stat != NC_NOERR) return stat;
00870    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_INT);
00871 }
00872 
00873 int
00874 nc_get_var1_long(int ncid, int varid, const size_t *indexp, 
00875                  long *ip)
00876 {
00877    NC* ncp;
00878    int stat = NC_check_id(ncid, &ncp);
00879    if(stat != NC_NOERR) return stat;
00880    return NC_get_var1(ncid, varid, indexp, (void *)ip, longtype);
00881 }
00882 
00883 int
00884 nc_get_var1_float(int ncid, int varid, const size_t *indexp, 
00885                   float *ip)
00886 {
00887    NC* ncp;
00888    int stat = NC_check_id(ncid, &ncp);
00889    if(stat != NC_NOERR) return stat;
00890    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_FLOAT);
00891 }
00892 
00893 int
00894 nc_get_var1_double(int ncid, int varid, const size_t *indexp, 
00895                    double *ip)
00896 {
00897    NC* ncp;
00898    int stat = NC_check_id(ncid, &ncp);
00899    if(stat != NC_NOERR) return stat;
00900    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_DOUBLE);
00901 }
00902 
00903 int
00904 nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, 
00905                   unsigned char *ip)
00906 {
00907    NC* ncp;
00908    int stat = NC_check_id(ncid, &ncp);
00909    if(stat != NC_NOERR) return stat;
00910    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UBYTE);
00911 }
00912 
00913 int
00914 nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, 
00915                    unsigned short *ip)
00916 {
00917    NC* ncp;
00918    int stat = NC_check_id(ncid, &ncp);
00919    if(stat != NC_NOERR) return stat;
00920    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_USHORT);
00921 }
00922 
00923 int
00924 nc_get_var1_uint(int ncid, int varid, const size_t *indexp, 
00925                  unsigned int *ip)
00926 {
00927    NC* ncp;
00928    int stat = NC_check_id(ncid, &ncp);
00929    if(stat != NC_NOERR) return stat;
00930    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UINT);
00931 }
00932 
00933 int
00934 nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, 
00935                      long long *ip)
00936 {
00937    NC* ncp;
00938    int stat = NC_check_id(ncid, &ncp);
00939    if(stat != NC_NOERR) return stat;
00940    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_INT64);
00941 }
00942 
00943 int
00944 nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, 
00945                       unsigned long long *ip)
00946 {
00947    NC* ncp;
00948    int stat = NC_check_id(ncid, &ncp);
00949    if(stat != NC_NOERR) return stat;
00950    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UINT64);
00951 }
00952 
00953 #ifdef USE_NETCDF4
00954 int
00955 nc_get_var1_string(int ncid, int varid, const size_t *indexp, char* *ip)
00956 {
00957    NC* ncp;
00958    int stat = NC_check_id(ncid, &ncp);
00959    if(stat != NC_NOERR) return stat;
00960    return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_STRING);
00961 }
00962 #endif /*USE_NETCDF4*/
00963 
01008 int
01009 nc_get_var(int ncid, int varid, void *ip)
01010 {
01011    return NC_get_var(ncid, varid, ip, NC_NAT);
01012 }
01013 
01014 int
01015 nc_get_var_text(int ncid, int varid, char *ip)
01016 {
01017    NC *ncp;
01018    int stat = NC_check_id(ncid, &ncp);
01019    if(stat != NC_NOERR) return stat;
01020    return NC_get_var(ncid, varid, (void *)ip, NC_CHAR);
01021 }
01022 
01023 int
01024 nc_get_var_schar(int ncid, int varid, signed char *ip)
01025 {
01026    NC *ncp;
01027    int stat = NC_check_id(ncid, &ncp);
01028    if(stat != NC_NOERR) return stat;
01029    return NC_get_var(ncid, varid, (void *)ip, NC_BYTE);
01030 }
01031 
01032 int
01033 nc_get_var_uchar(int ncid, int varid, unsigned char *ip)
01034 {
01035    NC *ncp;
01036    int stat = NC_check_id(ncid, &ncp);
01037    if(stat != NC_NOERR) return stat;
01038    return NC_get_var(ncid,varid, (void *)ip, NC_UBYTE);
01039 }
01040 
01041 int
01042 nc_get_var_short(int ncid, int varid, short *ip)
01043 {
01044    NC* ncp;
01045    int stat = NC_check_id(ncid, &ncp);
01046    if(stat != NC_NOERR) return stat;
01047    return NC_get_var(ncid, varid, (void *)ip, NC_SHORT);
01048 }
01049 
01050 int
01051 nc_get_var_int(int ncid, int varid, int *ip)
01052 {
01053    NC* ncp;
01054    int stat = NC_check_id(ncid, &ncp);
01055    if(stat != NC_NOERR) return stat;
01056    return NC_get_var(ncid,varid, (void *)ip, NC_INT);
01057 }
01058 
01059 int
01060 nc_get_var_long(int ncid, int varid, long *ip)
01061 {
01062    NC* ncp;
01063    int stat = NC_check_id(ncid, &ncp);
01064    if(stat != NC_NOERR) return stat;
01065    return NC_get_var(ncid,varid, (void *)ip, longtype);
01066 }
01067 
01068 int
01069 nc_get_var_float(int ncid, int varid, float *ip)
01070 {
01071    NC* ncp;
01072    int stat = NC_check_id(ncid, &ncp);
01073    if(stat != NC_NOERR) return stat;
01074    return NC_get_var(ncid,varid, (void *)ip, NC_FLOAT);
01075 }
01076 
01077 int
01078 nc_get_var_double(int ncid, int varid, double *ip)
01079 {
01080    NC* ncp;
01081    int stat = NC_check_id(ncid, &ncp);
01082    if(stat != NC_NOERR) return stat;
01083    return NC_get_var(ncid,varid, (void *)ip, NC_DOUBLE);
01084 }
01085 
01086 int
01087 nc_get_var_ubyte(int ncid, int varid, unsigned char *ip)
01088 {
01089    NC* ncp;
01090    int stat = NC_check_id(ncid, &ncp);
01091    if(stat != NC_NOERR) return stat;
01092    return NC_get_var(ncid,varid, (void *)ip, NC_UBYTE);
01093 }
01094 
01095 int
01096 nc_get_var_ushort(int ncid, int varid, unsigned short *ip)
01097 {
01098    NC* ncp;
01099    int stat = NC_check_id(ncid, &ncp);
01100    if(stat != NC_NOERR) return stat;
01101    return NC_get_var(ncid,varid, (void *)ip, NC_USHORT);
01102 }
01103 
01104 int
01105 nc_get_var_uint(int ncid, int varid, unsigned int *ip)
01106 {
01107    NC* ncp;
01108    int stat = NC_check_id(ncid, &ncp);
01109    if(stat != NC_NOERR) return stat;
01110    return NC_get_var(ncid,varid, (void *)ip, NC_UINT);
01111 }
01112 
01113 int
01114 nc_get_var_longlong(int ncid, int varid, long long *ip)
01115 {
01116    NC* ncp;
01117    int stat = NC_check_id(ncid, &ncp);
01118    if(stat != NC_NOERR) return stat;
01119    return NC_get_var(ncid,varid, (void *)ip, NC_INT64);
01120 }
01121 
01122 int
01123 nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip)
01124 {
01125    NC* ncp;
01126    int stat = NC_check_id(ncid, &ncp);
01127    if(stat != NC_NOERR) return stat;
01128    return NC_get_var(ncid,varid, (void *)ip,NC_UINT64);
01129 }
01130 
01131 #ifdef USE_NETCDF4
01132 int
01133 nc_get_var_string(int ncid, int varid, char* *ip)
01134 {
01135    NC* ncp;
01136    int stat = NC_check_id(ncid, &ncp);
01137    if(stat != NC_NOERR) return stat;
01138    return NC_get_var(ncid,varid, (void *)ip,NC_STRING);
01139 }
01140 #endif /*USE_NETCDF4*/
01141 
01183 int
01184 nc_get_vars (int ncid, int varid, const size_t * startp,
01185              const size_t * countp, const ptrdiff_t * stridep,
01186              void *ip)
01187 {
01188    NC* ncp;
01189    int stat = NC_NOERR;
01190 
01191    if ((stat = NC_check_id(ncid, &ncp)))
01192        return stat;
01193    return ncp->dispatch->get_vars(ncid, varid, startp, countp, stridep,
01194                       ip, NC_NAT);
01195 }
01196 
01197 int
01198 nc_get_vars_text(int ncid, int varid, const size_t *startp, 
01199                  const size_t *countp, const ptrdiff_t * stridep,
01200                  char *ip)
01201 {
01202    NC* ncp;
01203    int stat = NC_check_id(ncid, &ncp);
01204    if(stat != NC_NOERR) return stat;
01205    return NC_get_vars(ncid,varid,startp, countp, stridep,
01206                       (void *)ip, NC_CHAR);
01207 }
01208 
01209 int
01210 nc_get_vars_schar(int ncid, int varid, const size_t *startp, 
01211                   const size_t *countp, const ptrdiff_t * stridep,
01212                   signed char *ip)
01213 {
01214    NC* ncp;
01215    int stat = NC_check_id(ncid, &ncp);
01216    if(stat != NC_NOERR) return stat;
01217    return NC_get_vars(ncid,varid,startp, countp, stridep,
01218                       (void *)ip, NC_BYTE);
01219 }
01220 
01221 int
01222 nc_get_vars_uchar(int ncid, int varid, const size_t *startp, 
01223                   const size_t *countp, const ptrdiff_t * stridep,
01224                   unsigned char *ip)
01225 {
01226    NC* ncp;
01227    int stat = NC_check_id(ncid, &ncp);
01228    if(stat != NC_NOERR) return stat;
01229    return NC_get_vars(ncid,varid,startp, countp, stridep,
01230                       (void *)ip, T_uchar);
01231 }
01232 
01233 int
01234 nc_get_vars_short(int ncid, int varid, const size_t *startp, 
01235                   const size_t *countp, const ptrdiff_t *stridep,
01236                   short *ip)
01237 {
01238    NC* ncp;
01239    int stat = NC_check_id(ncid, &ncp);
01240    if(stat != NC_NOERR) return stat;
01241    return NC_get_vars(ncid,varid,startp, countp, stridep, 
01242                       (void *)ip, NC_SHORT);
01243 }
01244 
01245 int
01246 nc_get_vars_int(int ncid, int varid, const size_t *startp, 
01247                 const size_t *countp, const ptrdiff_t * stridep,
01248                 int *ip)
01249 {
01250    NC* ncp;
01251    int stat = NC_check_id(ncid, &ncp);
01252    if(stat != NC_NOERR) return stat;
01253    return NC_get_vars(ncid,varid,startp, countp, stridep,
01254                       (void *)ip, NC_INT);
01255 }
01256 
01257 int
01258 nc_get_vars_long(int ncid, int varid, const size_t *startp, 
01259                  const size_t *countp, const ptrdiff_t * stridep,
01260                  long *ip)
01261 {
01262    NC* ncp;
01263    int stat = NC_check_id(ncid, &ncp);
01264    if(stat != NC_NOERR) return stat;
01265    return NC_get_vars(ncid,varid,startp, countp, stridep,
01266                       (void *)ip, T_long);
01267 }
01268 
01269 int
01270 nc_get_vars_float(int ncid, int varid, const size_t *startp, 
01271                   const size_t *countp, const ptrdiff_t * stridep,
01272                   float *ip)
01273 {
01274    NC* ncp;
01275    int stat = NC_check_id(ncid, &ncp);
01276    if(stat != NC_NOERR) return stat;
01277    return NC_get_vars(ncid,varid,startp, countp, stridep,
01278                       (void *)ip, T_float);
01279 }
01280 
01281 int
01282 nc_get_vars_double(int ncid, int varid, const size_t *startp, 
01283                    const size_t *countp, const ptrdiff_t * stridep,
01284                    double *ip)
01285 {
01286    NC* ncp;
01287    int stat = NC_check_id(ncid, &ncp);
01288    if(stat != NC_NOERR) return stat;
01289    return NC_get_vars(ncid,varid,startp, countp, stridep,
01290                       (void *)ip, T_double);
01291 }
01292 
01293 int
01294 nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, 
01295                   const size_t *countp, const ptrdiff_t * stridep,
01296                   unsigned char *ip)
01297 {
01298    NC* ncp;
01299    int stat = NC_check_id(ncid, &ncp);
01300    if(stat != NC_NOERR) return stat;
01301    return NC_get_vars(ncid,varid, startp, countp, stridep,
01302                       (void *)ip, T_ubyte);
01303 }
01304 
01305 int
01306 nc_get_vars_ushort(int ncid, int varid, const size_t *startp, 
01307                    const size_t *countp, const ptrdiff_t * stridep,
01308                    unsigned short *ip)
01309 {
01310    NC* ncp;
01311    int stat = NC_check_id(ncid, &ncp);
01312    if(stat != NC_NOERR) return stat;
01313    return NC_get_vars(ncid,varid,startp,countp, stridep,
01314                       (void *)ip, T_ushort);
01315 }
01316 
01317 int
01318 nc_get_vars_uint(int ncid, int varid, const size_t *startp, 
01319                  const size_t *countp, const ptrdiff_t * stridep,
01320                  unsigned int *ip)
01321 {
01322    NC* ncp;
01323    int stat = NC_check_id(ncid, &ncp);
01324    if(stat != NC_NOERR) return stat;
01325    return NC_get_vars(ncid,varid,startp, countp, stridep,
01326                       (void *)ip, T_uint);
01327 }
01328 
01329 int
01330 nc_get_vars_longlong(int ncid, int varid, const size_t *startp, 
01331                      const size_t *countp, const ptrdiff_t * stridep,
01332                      long long *ip)
01333 {
01334    NC* ncp;
01335    int stat = NC_check_id(ncid, &ncp);
01336    if(stat != NC_NOERR) return stat;
01337    return NC_get_vars(ncid, varid, startp, countp, stridep,
01338                       (void *)ip, T_longlong);
01339 }
01340 
01341 int
01342 nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, 
01343                       const size_t *countp, const ptrdiff_t * stridep,
01344                       unsigned long long *ip)
01345 {
01346    NC* ncp;
01347    int stat = NC_check_id(ncid, &ncp);
01348    if(stat != NC_NOERR) return stat;
01349    return NC_get_vars(ncid, varid, startp, countp, stridep,
01350                       (void *)ip, NC_UINT64);
01351 }
01352 
01353 #ifdef USE_NETCDF4
01354 int
01355 nc_get_vars_string(int ncid, int varid,
01356                    const size_t *startp, const size_t *countp,
01357                    const ptrdiff_t * stridep,
01358                    char* *ip)
01359 {
01360    NC* ncp;
01361    int stat = NC_check_id(ncid, &ncp);
01362    if(stat != NC_NOERR) return stat;
01363    return NC_get_vars(ncid, varid, startp, countp, stridep, 
01364                       (void *)ip, NC_STRING);
01365 }
01366 #endif /*USE_NETCDF4*/
01367 
01423 int
01424 nc_get_varm(int ncid, int varid, const size_t * startp,
01425             const size_t * countp, const ptrdiff_t * stridep,
01426             const ptrdiff_t * imapp, void *ip)
01427 {
01428    NC* ncp;
01429    int stat = NC_NOERR;
01430 
01431    if ((stat = NC_check_id(ncid, &ncp)))
01432        return stat;
01433    return ncp->dispatch->get_varm(ncid, varid, startp, countp, 
01434                                   stridep, imapp, ip, NC_NAT);
01435 }
01436 
01437 int
01438 nc_get_varm_schar(int ncid, int varid,
01439                   const size_t *startp, const size_t *countp,
01440                   const ptrdiff_t *stridep, 
01441                   const ptrdiff_t *imapp, signed char *ip)
01442 {
01443    NC *ncp;
01444    int stat = NC_check_id(ncid, &ncp);
01445    if(stat != NC_NOERR) return stat;
01446    return NC_get_varm(ncid, varid, startp, countp,
01447                       stridep, imapp, (void *)ip, NC_BYTE);
01448 }
01449 
01450 int
01451 nc_get_varm_uchar(int ncid, int varid,
01452                   const size_t *startp, const size_t *countp,
01453                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01454                   unsigned char *ip)
01455 {
01456    NC *ncp;
01457    int stat = NC_check_id(ncid, &ncp);
01458    if(stat != NC_NOERR) return stat;
01459    return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_uchar);
01460 }
01461 
01462 int
01463 nc_get_varm_short(int ncid, int varid, const size_t *startp, 
01464                   const size_t *countp, const ptrdiff_t *stridep, 
01465                   const ptrdiff_t *imapp, short *ip)
01466 {
01467    NC *ncp;
01468    int stat = NC_check_id(ncid, &ncp);
01469    if(stat != NC_NOERR) return stat;
01470    return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,NC_SHORT);
01471 }
01472 
01473 int
01474 nc_get_varm_int(int ncid, int varid,
01475                 const size_t *startp, const size_t *countp,
01476                 const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01477                 int *ip)
01478 {
01479    NC *ncp;
01480    int stat = NC_check_id(ncid, &ncp);
01481    if(stat != NC_NOERR) return stat;
01482    return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,NC_INT);
01483 }
01484 
01485 int
01486 nc_get_varm_long(int ncid, int varid,
01487                  const size_t *startp, const size_t *countp,
01488                  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01489                  long *ip)
01490 {
01491    NC *ncp;
01492    int stat = NC_check_id(ncid, &ncp);
01493    if(stat != NC_NOERR) return stat;
01494    return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_long);
01495 }
01496 
01497 int
01498 nc_get_varm_float(int ncid, int varid,
01499                   const size_t *startp, const size_t *countp,
01500                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01501                   float *ip)
01502 {
01503    NC *ncp;
01504    int stat = NC_check_id(ncid, &ncp);
01505    if(stat != NC_NOERR) return stat;
01506    return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_float);
01507 }
01508 
01509 int
01510 nc_get_varm_double(int ncid, int varid,
01511                    const size_t *startp, const size_t *countp,
01512                    const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01513                    double *ip)
01514 {
01515    NC *ncp;
01516    int stat = NC_check_id(ncid, &ncp);
01517    if(stat != NC_NOERR) return stat;
01518    return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_double);
01519 }
01520 
01521 int
01522 nc_get_varm_ubyte(int ncid, int varid,
01523                   const size_t *startp, const size_t *countp,
01524                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01525                   unsigned char *ip)
01526 {
01527    NC *ncp;
01528    int stat = NC_check_id(ncid, &ncp);
01529    if(stat != NC_NOERR) return stat;
01530    return NC_get_varm(ncid,varid,startp,countp,stridep,
01531                       imapp, (void *)ip, T_ubyte);
01532 }
01533 
01534 int
01535 nc_get_varm_ushort(int ncid, int varid,
01536                    const size_t *startp, const size_t *countp,
01537                    const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01538                    unsigned short *ip)
01539 {
01540    NC *ncp;
01541    int stat = NC_check_id(ncid, &ncp);
01542    if(stat != NC_NOERR) return stat;
01543    return NC_get_varm(ncid, varid, startp, countp, stridep,
01544                       imapp, (void *)ip, T_ushort);
01545 }
01546 
01547 int
01548 nc_get_varm_uint(int ncid, int varid,
01549                  const size_t *startp, const size_t *countp,
01550                  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01551                  unsigned int *ip)
01552 {
01553    NC *ncp;
01554    int stat = NC_check_id(ncid, &ncp);
01555    if(stat != NC_NOERR) return stat;
01556    return NC_get_varm(ncid, varid, startp, countp,
01557                       stridep, imapp, (void *)ip, T_uint);
01558 }
01559 
01560 int
01561 nc_get_varm_longlong(int ncid, int varid, const size_t *startp, 
01562                      const size_t *countp, const ptrdiff_t *stridep, 
01563                      const ptrdiff_t *imapp, long long *ip)
01564 {
01565    NC *ncp;
01566    int stat = NC_check_id(ncid, &ncp);
01567    if(stat != NC_NOERR) return stat;
01568    return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
01569                       (void *)ip, T_longlong);
01570 }
01571 
01572 int
01573 nc_get_varm_ulonglong(int ncid, int varid,
01574                       const size_t *startp, const size_t *countp,
01575                       const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01576                       unsigned long long *ip)
01577 {
01578    NC *ncp;
01579    int stat = NC_check_id(ncid, &ncp);
01580    if(stat != NC_NOERR) return stat;
01581    return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
01582                       (void *)ip, NC_UINT64);
01583 }
01584 
01585 int
01586 nc_get_varm_text(int ncid, int varid, const size_t *startp, 
01587                  const size_t *countp, const ptrdiff_t *stridep, 
01588                  const ptrdiff_t *imapp, char *ip)
01589 {
01590    NC *ncp;
01591    int stat = NC_check_id(ncid, &ncp);
01592    if(stat != NC_NOERR) return stat;
01593    return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
01594                       (void *)ip, NC_CHAR);
01595 }
01596 
01597 #ifdef USE_NETCDF4
01598 int
01599 nc_get_varm_string(int ncid, int varid, const size_t *startp, 
01600                    const size_t *countp, const ptrdiff_t *stridep, 
01601                    const ptrdiff_t *imapp, char **ip)
01602 {
01603    NC *ncp;
01604    int stat = NC_check_id(ncid, &ncp);
01605    if(stat != NC_NOERR) return stat;
01606    return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
01607                       (void *)ip, NC_STRING);
01608 }
01610 #endif /*USE_NETCDF4*/
01611 
01612  /* End of named group... */
01614 
 All Data Structures Files Functions Variables Typedefs Defines