NetCDF  4.3.2
dvarput.c
00001 
00008 #include "ncdispatch.h"
00009 
00010 #undef VARS_USES_VARM
00011 #ifndef VARS_USES_VARM
00012 struct PUTodometer {
00013     int            rank;
00014     size_t         index[NC_MAX_VAR_DIMS];
00015     size_t         start[NC_MAX_VAR_DIMS];
00016     size_t         edges[NC_MAX_VAR_DIMS];
00017     ptrdiff_t      stride[NC_MAX_VAR_DIMS];
00018     size_t         stop[NC_MAX_VAR_DIMS];
00019 };
00020 
00021 static void
00022 odom_init(struct PUTodometer* odom,
00023             int rank,
00024             const size_t* start, const size_t* edges, const ptrdiff_t* stride)
00025 {
00026     int i;
00027     memset(odom,0,sizeof(struct PUTodometer));
00028     odom->rank = rank;
00029     assert(odom->rank <= NC_MAX_VAR_DIMS);
00030     for(i=0;i<odom->rank;i++) {
00031         odom->start[i] = (start != NULL ? start[i] : 0);
00032         odom->edges[i] = (edges != NULL ? edges[i] : 1);
00033         odom->stride[i] = (stride != NULL ? stride[i] : 1);
00034         odom->stop[i] = odom->start[i] + (odom->edges[i]*(size_t)odom->stride[i]);
00035         odom->index[i] = odom->start[i];
00036     }    
00037 }
00038 
00039 static int
00040 odom_more(struct PUTodometer* odom)
00041 {
00042     return (odom->index[0] < odom->stop[0]);
00043 }
00044 
00045 static int
00046 odom_next(struct PUTodometer* odom)
00047 {
00048     int i;
00049     if(odom->rank == 0) return 0;
00050     for(i=odom->rank-1;i>=0;i--) {
00051         odom->index[i] += (size_t)odom->stride[i];
00052         if(odom->index[i] < odom->stop[i]) break;
00053         if(i == 0) return 0; /* leave the 0th entry if it overflows*/
00054         odom->index[i] = odom->start[i]; /* reset this position*/
00055     }
00056     return 1;
00057 }
00058 #endif
00059 
00063 static int
00064 NC_put_vara(int ncid, int varid, const size_t *start, 
00065             const size_t *edges, const void *value, nc_type memtype)
00066 {
00067    NC* ncp;
00068    int stat = NC_check_id(ncid, &ncp);
00069    if(stat != NC_NOERR) return stat;
00070    if(edges == NULL) {
00071       size_t shape[NC_MAX_VAR_DIMS];
00072       int ndims;
00073       stat = nc_inq_varndims(ncid, varid, &ndims); 
00074       if(stat != NC_NOERR) return stat;
00075       stat = NC_getshape(ncid, varid, ndims, shape);
00076       if(stat != NC_NOERR) return stat;
00077       return ncp->dispatch->put_vara(ncid, varid, start, shape, value, memtype);
00078    } else
00079       return ncp->dispatch->put_vara(ncid, varid, start, edges, value, memtype);
00080 }
00081 
00085 static int
00086 NC_put_var(int ncid, int varid, const void *value, nc_type memtype)
00087 {
00088    int ndims;
00089    size_t shape[NC_MAX_VAR_DIMS];
00090    int stat = nc_inq_varndims(ncid,varid, &ndims);
00091    if(stat) return stat;
00092    stat = NC_getshape(ncid,varid, ndims, shape);
00093    if(stat) return stat;
00094    return NC_put_vara(ncid, varid, NC_coord_zero, shape, value, memtype);
00095 }
00096 
00100 static int
00101 NC_put_var1(int ncid, int varid, const size_t *coord, const void* value, 
00102             nc_type memtype)
00103 {
00104    return NC_put_vara(ncid, varid, coord, NC_coord_one, value, memtype);
00105 }
00106 
00110 int
00111 NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
00112             const size_t * edges, const ptrdiff_t * stride,
00113             const void *value0, nc_type memtype)
00114 {
00115 #ifdef VARS_USES_VARM
00116    NC* ncp;
00117    int stat = NC_check_id(ncid, &ncp);
00118 
00119    if(stat != NC_NOERR) return stat;
00120    return ncp->dispatch->put_varm(ncid,varid,start,edges,stride,NULL,value0,memtype);
00121 #else
00122   /* Rebuilt put_vars code to simplify and avoid use of put_varm */
00123   
00124    int status = NC_NOERR;
00125    int i,simplestride,isrecvar;
00126    int rank;
00127    struct PUTodometer odom;
00128    nc_type vartype = NC_NAT;
00129    NC* ncp;
00130    size_t vartypelen;
00131    int memtypelen;
00132    const char* value = (const char*)value0;
00133    size_t numrecs;
00134    size_t varshape[NC_MAX_VAR_DIMS];
00135    size_t mystart[NC_MAX_VAR_DIMS];
00136    size_t myedges[NC_MAX_VAR_DIMS];
00137    ptrdiff_t mystride[NC_MAX_VAR_DIMS];
00138 
00139    const char* memptr = value;
00140 
00141    status = NC_check_id (ncid, &ncp);
00142    if(status != NC_NOERR) return status;
00143 
00144    status = nc_inq_vartype(ncid, varid, &vartype); 
00145    if(status != NC_NOERR) return status;
00146 
00147    if(memtype == NC_NAT) memtype = vartype;
00148 
00149    /* compute the variable type size */
00150    status = nc_inq_type(ncid,vartype,NULL,&vartypelen);
00151    if(status != NC_NOERR) return status;
00152 
00153    if(memtype > NC_MAX_ATOMIC_TYPE)
00154         memtypelen = (int)vartypelen;
00155     else
00156         memtypelen = nctypelen(memtype);
00157 
00158    /* Check gross internal/external type compatibility */
00159    if(vartype != memtype) {
00160       /* If !atomic, the two types must be the same */
00161       if(vartype > NC_MAX_ATOMIC_TYPE
00162          || memtype > NC_MAX_ATOMIC_TYPE)
00163          return NC_EBADTYPE;
00164       /* ok, the types differ but both are atomic */
00165       if(memtype == NC_CHAR || vartype == NC_CHAR)
00166          return NC_ECHAR;
00167    }
00168 
00169    /* Get the variable rank */
00170    status = nc_inq_varndims(ncid, varid, &rank); 
00171    if(status != NC_NOERR) return status;
00172 
00173    /* Get variable dimension sizes */
00174    isrecvar = NC_is_recvar(ncid,varid,&numrecs);
00175    NC_getshape(ncid,varid,rank,varshape);       
00176 
00177    /* Optimize out using various checks */
00178    if (rank == 0) {
00179       /*
00180        * The variable is a scalar; consequently,
00181        * there is only one thing to get and only one place to put it.
00182        * (Why was I called?)
00183        */
00184       size_t edge1[1] = {1};
00185       return NC_put_vara(ncid, varid, start, edge1, value0, memtype);
00186    }
00187 
00188    /* Do various checks and fixups on start/edges/stride */
00189    simplestride = 1; /* assume so */
00190    for(i=0;i<rank;i++) {
00191         size_t dimlen;
00192         mystart[i] = (start == NULL ? 0 : start[i]);
00193         if(edges == NULL) {
00194            if(i == 0 && isrecvar)
00195               myedges[i] = numrecs - start[i];
00196            else
00197               myedges[i] = varshape[i] - mystart[i];
00198         } else
00199             myedges[i] = edges[i];
00200         if(myedges[i] == 0)
00201             return NC_NOERR; /* cannot write anything */
00202         mystride[i] = (stride == NULL ? 1 : stride[i]);
00203         if(mystride[i] <= 0
00204            /* cast needed for braindead systems with signed size_t */
00205            || ((unsigned long) mystride[i] >= X_INT_MAX))
00206            return NC_ESTRIDE;
00207         if(mystride[i] != 1) simplestride = 0;  
00208         /* illegal value checks */
00209         dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
00210         if(i == 0 && isrecvar) {/*do nothing*/}
00211         else {
00212           /* mystart is unsigned, will never be < 0 */
00213           //if(mystart[i] < 0 || mystart[i] > dimlen)
00214           if(mystart[i] > dimlen)
00215             return NC_EINVALCOORDS;
00216           /* myediges is unsigned, will never be < 0 */ 
00217           //if(myedges[i] < 0 || (mystart[i] + myedges[i] > dimlen))
00218           if(mystart[i] + myedges[i] > dimlen)
00219             return NC_EEDGE;
00220        }
00221    }
00222    if(simplestride) {
00223       return NC_put_vara(ncid, varid, mystart, myedges, value, memtype);
00224    }
00225 
00226    /* Initial version uses and odometer to walk the variable
00227       and read each value one at a time. This can later be optimized
00228       to read larger chunks at a time.
00229     */
00230 
00231 
00232    odom_init(&odom,rank,mystart,myedges,mystride);
00233 
00234    /* walk the odometer to extract values */
00235    while(odom_more(&odom)) {
00236       int localstatus = NC_NOERR;
00237       /* Write a single value */
00238       localstatus = NC_put_vara(ncid,varid,odom.index,nc_sizevector1,memptr,memtype);
00239       /* So it turns out that when get_varm is used, all errors are
00240          delayed and ERANGE will be overwritten by more serious errors.
00241       */
00242       if(localstatus != NC_NOERR) {
00243             if(status == NC_NOERR || localstatus != NC_ERANGE)
00244                status = localstatus;
00245       }
00246       memptr += memtypelen;
00247       odom_next(&odom);
00248    }
00249    return status;
00250 #endif
00251 }
00252 
00256 int
00257 NCDEFAULT_put_varm(
00258    int ncid,
00259    int varid,
00260    const size_t * start,
00261    const size_t * edges,
00262    const ptrdiff_t * stride,
00263    const ptrdiff_t * imapp,
00264    const void *value0,
00265    nc_type memtype)
00266 {
00267    int status = NC_NOERR;
00268    nc_type vartype = NC_NAT;
00269    int varndims = 0;
00270    int maxidim = 0;
00271    NC* ncp;
00272    int memtypelen;
00273    ptrdiff_t cvtmap[NC_MAX_VAR_DIMS];
00274    const char* value = (char*)value0;
00275 
00276    status = NC_check_id (ncid, &ncp);
00277    if(status != NC_NOERR) return status;
00278 
00279 /*
00280   if(NC_indef(ncp)) return NC_EINDEFINE;
00281   if(NC_readonly (ncp)) return NC_EPERM;
00282 */
00283 
00284    /* mid body */
00285    status = nc_inq_vartype(ncid, varid, &vartype); 
00286    if(status != NC_NOERR) return status;
00287    /* Check that this is an atomic type */
00288    if(vartype > NC_MAX_ATOMIC_TYPE)
00289         return NC_EMAPTYPE;
00290 
00291    status = nc_inq_varndims(ncid, varid, &varndims); 
00292    if(status != NC_NOERR) return status;
00293 
00294    if(memtype == NC_NAT) {
00295       if(imapp != NULL && varndims != 0) {
00296          /*
00297           * convert map units from bytes to units of sizeof(type)
00298           */
00299          size_t ii;
00300          const ptrdiff_t szof = (ptrdiff_t) nctypelen(vartype);
00301          for(ii = 0; ii < varndims; ii++) {
00302             if(imapp[ii] % szof != 0) {
00303                /*free(cvtmap);*/
00304                return NC_EINVAL;
00305             }
00306             cvtmap[ii] = imapp[ii] / szof;
00307          }
00308          imapp = cvtmap;
00309       }
00310       memtype = vartype;
00311    }
00312 
00313    if(memtype == NC_CHAR && vartype != NC_CHAR)
00314       return NC_ECHAR;
00315    else if(memtype != NC_CHAR && vartype == NC_CHAR)  
00316       return NC_ECHAR;
00317 
00318    memtypelen = nctypelen(memtype);
00319 
00320    maxidim = (int) varndims - 1;
00321 
00322    if (maxidim < 0)
00323    {
00324       /*
00325        * The variable is a scalar; consequently,
00326        * there s only one thing to get and only one place to put it.
00327        * (Why was I called?)
00328        */
00329       size_t edge1[1] = {1};
00330       return NC_put_vara(ncid, varid, start, edge1, value, memtype);
00331    }
00332 
00333    /*
00334     * else
00335     * The variable is an array.
00336     */
00337    {
00338       int idim;
00339       size_t *mystart = NULL;
00340       size_t *myedges;
00341       size_t *iocount;    /* count vector */
00342       size_t *stop;   /* stop indexes */
00343       size_t *length; /* edge lengths in bytes */
00344       ptrdiff_t *mystride;
00345       ptrdiff_t *mymap;
00346       size_t varshape[NC_MAX_VAR_DIMS];
00347       int isrecvar;
00348       size_t numrecs;
00349       int stride1; /* is stride all ones? */
00350 
00351       /*
00352        * Verify stride argument.
00353        */
00354       stride1 = 1;              /*  assume ok; */
00355       if(stride != NULL) {
00356          for (idim = 0; idim <= maxidim; ++idim) {
00357             if ((stride[idim] == 0)
00358                 /* cast needed for braindead systems with signed size_t */
00359                 || ((unsigned long) stride[idim] >= X_INT_MAX))
00360             {
00361                return NC_ESTRIDE;
00362             }
00363             if(stride[idim] != 1) stride1 = 0;
00364          }
00365       }
00366 
00367       /* If stride1 is true, and there is no imap, then call get_vara
00368          directly
00369       */
00370       if(stride1 && imapp == NULL) {
00371          return NC_put_vara(ncid, varid, start, edges, value, memtype);
00372       }
00373 
00374       /* Compute some dimension related values */
00375       isrecvar = NC_is_recvar(ncid,varid,&numrecs);
00376       NC_getshape(ncid,varid,varndims,varshape);        
00377 
00378       /* assert(sizeof(ptrdiff_t) >= sizeof(size_t)); */
00379       mystart = (size_t *)calloc((size_t)(varndims * 7), sizeof(ptrdiff_t));
00380       if(mystart == NULL) return NC_ENOMEM;
00381       myedges = mystart + varndims;
00382       iocount = myedges + varndims;
00383       stop = iocount + varndims;
00384       length = stop + varndims;
00385       mystride = (ptrdiff_t *)(length + varndims);
00386       mymap = mystride + varndims;
00387 
00388       /*
00389        * Initialize I/O parameters.
00390        */
00391       for (idim = maxidim; idim >= 0; --idim)
00392       {
00393          mystart[idim] = start != NULL
00394             ? start[idim]
00395             : 0;
00396 
00397          if (edges != NULL && edges[idim] == 0)
00398          {
00399             status = NC_NOERR;    /* read/write no data */
00400             goto done;
00401          }
00402 
00403          myedges[idim] = edges != NULL
00404             ? edges[idim]
00405             : idim == 0 && isrecvar
00406                 ? numrecs - mystart[idim]
00407                 : varshape[idim] - mystart[idim];
00408          mystride[idim] = stride != NULL
00409             ? stride[idim]
00410             : 1;
00411          mymap[idim] = imapp != NULL
00412             ? imapp[idim]
00413             : idim == maxidim
00414                 ? 1
00415                 : mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1];
00416 
00417          iocount[idim] = 1;
00418          length[idim] = ((size_t)mymap[idim]) * myedges[idim];
00419          stop[idim] = mystart[idim] + myedges[idim] * (size_t)mystride[idim];
00420       }
00421 
00422       /*
00423        * Check start, edges
00424        */
00425       for (idim = isrecvar; idim < maxidim; ++idim)
00426       {
00427          if (mystart[idim] > varshape[idim])
00428          {
00429             status = NC_EINVALCOORDS;
00430             goto done;
00431          }
00432          if (mystart[idim] + myedges[idim] > varshape[idim])
00433          {
00434             status = NC_EEDGE;
00435             goto done;
00436          }
00437       }
00438 
00439       /* Lower body */
00440       /*
00441        * As an optimization, adjust I/O parameters when the fastest 
00442        * dimension has unity stride both externally and internally.
00443        * In this case, the user could have called a simpler routine
00444        * (i.e. ncvar$1()
00445        */
00446       if (mystride[maxidim] == 1
00447           && mymap[maxidim] == 1)
00448       {
00449          iocount[maxidim] = myedges[maxidim];
00450          mystride[maxidim] = (ptrdiff_t) myedges[maxidim];
00451          mymap[maxidim] = (ptrdiff_t) length[maxidim];
00452       }
00453 
00454       /*
00455        * Perform I/O.  Exit when done.
00456        */
00457       for (;;)
00458       {
00459          /* TODO: */
00460          int lstatus = NC_put_vara(ncid, varid, mystart, iocount,
00461                                    value, memtype);
00462          if (lstatus != NC_NOERR) {
00463             if(status == NC_NOERR || lstatus != NC_ERANGE)
00464                status = lstatus;
00465          }          
00466 
00467          /*
00468           * The following code permutes through the variable s
00469           * external start-index space and it s internal address
00470           * space.  At the UPC, this algorithm is commonly
00471           * called "odometer code".
00472           */
00473          idim = maxidim;
00474         carry:
00475          value += (mymap[idim] * memtypelen);
00476          mystart[idim] += (size_t)mystride[idim];
00477          if (mystart[idim] == stop[idim])
00478          {
00479             size_t l = (length[idim] * (size_t)memtypelen);
00480             value -= l;
00481             mystart[idim] = start[idim];
00482             if (--idim < 0)
00483                break; /* normal return */
00484             goto carry;
00485          }
00486       } /* I/O loop */
00487      done:
00488       free(mystart);
00489    } /* variable is array */
00490    return status;
00491 }
00492 
00496 static int
00497 NC_put_vars(int ncid, int varid, const size_t *start,
00498             const size_t *edges, const ptrdiff_t *stride,
00499             const void *value, nc_type memtype)
00500 {
00501    NC* ncp;
00502    int stat = NC_check_id(ncid, &ncp);
00503 
00504    if(stat != NC_NOERR) return stat;
00505 #ifdef USE_NETCDF4
00506    if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
00507 #endif
00508    return ncp->dispatch->put_vars(ncid,varid,start,edges,stride,value,memtype);
00509 }
00510 
00514 static int
00515 NC_put_varm(int ncid, int varid, const size_t *start, 
00516             const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t* map,
00517             const void *value, nc_type memtype)
00518 {
00519    NC* ncp;
00520    int stat = NC_check_id(ncid, &ncp);
00521 
00522    if(stat != NC_NOERR) return stat;
00523 #ifdef USE_NETCDF4
00524    if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
00525 #endif
00526    return ncp->dispatch->put_varm(ncid,varid,start,edges,stride,map,value,memtype);
00527 }
00528  /* All these functions are part of this named group... */
00533 
00574 int
00575 nc_put_vara(int ncid, int varid, const size_t *startp, 
00576             const size_t *countp, const void *op)
00577 {
00578    NC* ncp;
00579    int stat = NC_check_id(ncid, &ncp);
00580    nc_type xtype;
00581    if(stat != NC_NOERR) return stat;
00582    stat = nc_inq_vartype(ncid, varid, &xtype);
00583    if(stat != NC_NOERR) return stat;
00584    return NC_put_vara(ncid, varid, startp, countp, op, xtype);
00585 }
00586 
00587 int
00588 nc_put_vara_text(int ncid, int varid, const size_t *startp, 
00589                  const size_t *countp, const char *op)
00590 {
00591    return NC_put_vara(ncid, varid, startp, countp, 
00592                       (void*)op, NC_CHAR);
00593 }
00594 
00595 int
00596 nc_put_vara_schar(int ncid, int varid, const size_t *startp, 
00597                   const size_t *countp, const signed char *op)
00598 {
00599    NC* ncp;
00600    int stat = NC_check_id(ncid, &ncp);
00601    if(stat != NC_NOERR) return stat;
00602    return NC_put_vara(ncid, varid, startp, countp, (void *)op, 
00603                       NC_BYTE);
00604 }
00605 
00606 int
00607 nc_put_vara_uchar(int ncid, int varid, const size_t *startp, 
00608                   const size_t *countp, const unsigned char *op)
00609 {
00610    NC* ncp;
00611    int stat = NC_check_id(ncid, &ncp);
00612    if(stat != NC_NOERR) return stat;
00613    return NC_put_vara(ncid, varid, startp, countp, (void *)op, 
00614                       T_uchar);
00615 }
00616 
00617 int
00618 nc_put_vara_short(int ncid, int varid, const size_t *startp, 
00619                   const size_t *countp, const short *op)
00620 {
00621    NC* ncp;
00622    int stat = NC_check_id(ncid, &ncp);
00623    if(stat != NC_NOERR) return stat;
00624    return NC_put_vara(ncid, varid, startp, countp, (void *)op, 
00625                       NC_SHORT);
00626 }
00627 
00628 int
00629 nc_put_vara_int(int ncid, int varid, const size_t *startp, 
00630                 const size_t *countp, const int *op)
00631 {
00632    NC* ncp;
00633    int stat = NC_check_id(ncid, &ncp);
00634    if(stat != NC_NOERR) return stat;
00635    return NC_put_vara(ncid, varid, startp, countp, (void *)op, 
00636                       NC_INT);
00637 }
00638 
00639 int
00640 nc_put_vara_long(int ncid, int varid, const size_t *startp, 
00641                  const size_t *countp, const long *op)
00642 {
00643    NC* ncp;
00644    int stat = NC_check_id(ncid, &ncp);
00645    if(stat != NC_NOERR) return stat;
00646    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00647                       T_long);
00648 }
00649 
00650 int
00651 nc_put_vara_float(int ncid, int varid, const size_t *startp, 
00652                   const size_t *countp, const float *op)
00653 {
00654    NC* ncp;
00655    int stat = NC_check_id(ncid, &ncp);
00656    if(stat != NC_NOERR) return stat;
00657    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00658                       T_float);
00659 }
00660 
00661 int
00662 nc_put_vara_double(int ncid, int varid, const size_t *startp, 
00663                    const size_t *countp, const double *op)
00664 {
00665    NC* ncp;
00666    int stat = NC_check_id(ncid, &ncp);
00667    if(stat != NC_NOERR) return stat;
00668    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00669                       T_double);
00670 }
00671 
00672 int
00673 nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, 
00674                   const size_t *countp, const unsigned char *op)
00675 {
00676    NC* ncp;
00677    int stat = NC_check_id(ncid, &ncp);
00678    if(stat != NC_NOERR) return stat;
00679    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00680                       T_ubyte);
00681 }
00682 
00683 int
00684 nc_put_vara_ushort(int ncid, int varid, const size_t *startp, 
00685                    const size_t *countp, const unsigned short *op)
00686 {
00687    NC* ncp;
00688    int stat = NC_check_id(ncid, &ncp);
00689    if(stat != NC_NOERR) return stat;
00690    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00691                       T_ushort);
00692 }
00693 
00694 int
00695 nc_put_vara_uint(int ncid, int varid, const size_t *startp, 
00696                  const size_t *countp, const unsigned int *op)
00697 {
00698    NC* ncp;
00699    int stat = NC_check_id(ncid, &ncp);
00700    if(stat != NC_NOERR) return stat;
00701    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00702                       T_uint);
00703 }
00704 
00705 int
00706 nc_put_vara_longlong(int ncid, int varid, const size_t *startp, 
00707                      const size_t *countp, const long long *op)
00708 {
00709    NC* ncp;
00710    int stat = NC_check_id(ncid, &ncp);
00711    if(stat != NC_NOERR) return stat;
00712    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00713                       T_longlong);
00714 }
00715 
00716 int
00717 nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, 
00718                       const size_t *countp, const unsigned long long *op)
00719 {
00720    NC* ncp;
00721    int stat = NC_check_id(ncid, &ncp);
00722    if(stat != NC_NOERR) return stat;
00723    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00724                       NC_UINT64);
00725 }
00726 
00727 #ifdef USE_NETCDF4
00728 int
00729 nc_put_vara_string(int ncid, int varid, const size_t *startp, 
00730                    const size_t *countp, const char* *op)
00731 {
00732    NC* ncp;
00733    int stat = NC_check_id(ncid, &ncp);
00734    if(stat != NC_NOERR) return stat;
00735    return NC_put_vara(ncid, varid, startp, countp, (void *)op,
00736                       NC_STRING);
00737 }
00738 
00739 #endif /*USE_NETCDF4*/
00740 
00764 int
00765 nc_put_var1(int ncid, int varid, const size_t *indexp, const void *op)
00766 {
00767    return NC_put_var1(ncid, varid, indexp, op, NC_NAT);
00768 }
00769 
00770 int
00771 nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op)
00772 {
00773    NC* ncp;
00774    int stat = NC_check_id(ncid, &ncp);
00775    if(stat != NC_NOERR) return stat;
00776    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_CHAR);
00777 }
00778 
00779 int
00780 nc_put_var1_schar(int ncid, int varid, const size_t *indexp, const signed char *op)
00781 {
00782    NC* ncp;
00783    int stat = NC_check_id(ncid, &ncp);
00784    if(stat != NC_NOERR) return stat;
00785    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_BYTE);
00786 }
00787 
00788 int
00789 nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, const unsigned char *op)
00790 {
00791    NC* ncp;
00792    int stat = NC_check_id(ncid, &ncp);
00793    if(stat != NC_NOERR) return stat;
00794    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UBYTE);
00795 }
00796 
00797 int
00798 nc_put_var1_short(int ncid, int varid, const size_t *indexp, const short *op)
00799 {
00800    NC* ncp;
00801    int stat = NC_check_id(ncid, &ncp);
00802    if(stat != NC_NOERR) return stat;
00803    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_SHORT);
00804 }
00805 
00806 int
00807 nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op)
00808 {
00809    NC* ncp;
00810    int stat = NC_check_id(ncid, &ncp);
00811    if(stat != NC_NOERR) return stat;
00812    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_INT);
00813 }
00814 
00815 int
00816 nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op)
00817 {
00818    NC* ncp;
00819    int stat = NC_check_id(ncid, &ncp);
00820    if(stat != NC_NOERR) return stat;
00821    return NC_put_var1(ncid, varid, indexp, (void*)op, longtype);
00822 }
00823 
00824 int
00825 nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op)
00826 {
00827    NC* ncp;
00828    int stat = NC_check_id(ncid, &ncp);
00829    if(stat != NC_NOERR) return stat;
00830    return NC_put_var1(ncid, varid, indexp, (void*)op, NC_FLOAT);
00831 }
00832 
00833 int
00834 nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op)
00835 {
00836    NC* ncp;
00837    int stat = NC_check_id(ncid, &ncp);
00838    if(stat != NC_NOERR) return stat;
00839    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_DOUBLE);
00840 }
00841 
00842 int
00843 nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, const unsigned char *op)
00844 {
00845    NC* ncp;
00846    int stat = NC_check_id(ncid, &ncp);
00847    if(stat != NC_NOERR) return stat;
00848    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UBYTE);
00849 }
00850 
00851 int
00852 nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, const unsigned short *op)
00853 {
00854    NC* ncp;
00855    int stat = NC_check_id(ncid, &ncp);
00856    if(stat != NC_NOERR) return stat;
00857    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_USHORT);
00858 }
00859 
00860 int
00861 nc_put_var1_uint(int ncid, int varid, const size_t *indexp, const unsigned int *op)
00862 {
00863    NC* ncp;
00864    int stat = NC_check_id(ncid, &ncp);
00865    if(stat != NC_NOERR) return stat;
00866    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UINT);
00867 }
00868 
00869 int
00870 nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, const long long *op)
00871 {
00872    NC* ncp;
00873    int stat = NC_check_id(ncid, &ncp);
00874    if(stat != NC_NOERR) return stat;
00875    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_INT64);
00876 }
00877 
00878 int
00879 nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, const unsigned long long *op)
00880 {
00881    NC* ncp;
00882    int stat = NC_check_id(ncid, &ncp);
00883    if(stat != NC_NOERR) return stat;
00884    return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UINT64);
00885 }
00886 
00887 #ifdef USE_NETCDF4
00888 int
00889 nc_put_var1_string(int ncid, int varid, const size_t *indexp, const char* *op)
00890 {
00891    NC* ncp;
00892    int stat = NC_check_id(ncid, &ncp);
00893    if(stat != NC_NOERR) return stat;
00894    return NC_put_var1(ncid, varid, indexp, (void*)op, NC_STRING);
00895 }
00896 #endif /*USE_NETCDF4*/
00897 
00945 int
00946 nc_put_var(int ncid, int varid, const void *op)
00947 {
00948    return NC_put_var(ncid, varid, op, NC_NAT);
00949 }
00950 
00951 int
00952 nc_put_var_text(int ncid, int varid, const char *op)
00953 {
00954    NC* ncp;
00955    int stat = NC_check_id(ncid, &ncp);
00956    if(stat != NC_NOERR) return stat;
00957    return NC_put_var(ncid,varid,(void*)op,NC_CHAR);
00958 }
00959 
00960 int
00961 nc_put_var_schar(int ncid, int varid, const signed char *op)
00962 {
00963    NC* ncp;
00964    int stat = NC_check_id(ncid, &ncp);
00965    if(stat != NC_NOERR) return stat;
00966    return NC_put_var(ncid,varid,(void*)op,NC_BYTE);
00967 }
00968 
00969 int
00970 nc_put_var_uchar(int ncid, int varid, const unsigned char *op)
00971 {
00972    NC* ncp;
00973    int stat = NC_check_id(ncid, &ncp);
00974    if(stat != NC_NOERR) return stat;
00975    return NC_put_var(ncid,varid,(void*)op,T_uchar);
00976 }
00977 
00978 int
00979 nc_put_var_short(int ncid, int varid, const short *op)
00980 {
00981    NC* ncp;
00982    int stat = NC_check_id(ncid, &ncp);
00983    if(stat != NC_NOERR) return stat;
00984    return NC_put_var(ncid,varid,(void*)op,NC_SHORT);
00985 }
00986 
00987 int
00988 nc_put_var_int(int ncid, int varid, const int *op)
00989 {
00990    NC* ncp;
00991    int stat = NC_check_id(ncid, &ncp);
00992    if(stat != NC_NOERR) return stat;
00993    return NC_put_var(ncid,varid,(void*)op,NC_INT);
00994 }
00995 
00996 int
00997 nc_put_var_long(int ncid, int varid, const long *op)
00998 {
00999    NC* ncp;
01000    int stat = NC_check_id(ncid, &ncp);
01001    if(stat != NC_NOERR) return stat;
01002    return NC_put_var(ncid,varid,(void*)op,T_long);
01003 }
01004 
01005 int
01006 nc_put_var_float(int ncid, int varid, const float *op)
01007 {
01008    NC* ncp;
01009    int stat = NC_check_id(ncid, &ncp);
01010    if(stat != NC_NOERR) return stat;
01011    return NC_put_var(ncid,varid,(void*)op,T_float);
01012 }
01013 
01014 int
01015 nc_put_var_double(int ncid, int varid, const double *op)
01016 {
01017    NC* ncp;
01018    int stat = NC_check_id(ncid, &ncp);
01019    if(stat != NC_NOERR) return stat;
01020    return NC_put_var(ncid,varid,(void*)op,T_double);
01021 }
01022 
01023 int
01024 nc_put_var_ubyte(int ncid, int varid, const unsigned char *op)
01025 {
01026    NC* ncp;
01027    int stat = NC_check_id(ncid, &ncp);
01028    if(stat != NC_NOERR) return stat;
01029    return NC_put_var(ncid,varid,(void*)op,T_ubyte);
01030 }
01031 
01032 int
01033 nc_put_var_ushort(int ncid, int varid, const unsigned short *op)
01034 {
01035    NC* ncp;
01036    int stat = NC_check_id(ncid, &ncp);
01037    if(stat != NC_NOERR) return stat;
01038    return NC_put_var(ncid,varid,(void*)op,T_ushort);
01039 }
01040 
01041 int
01042 nc_put_var_uint(int ncid, int varid, const unsigned int *op)
01043 {
01044    NC* ncp;
01045    int stat = NC_check_id(ncid, &ncp);
01046    if(stat != NC_NOERR) return stat;
01047    return NC_put_var(ncid,varid,(void*)op,T_uint);
01048 }
01049 
01050 int
01051 nc_put_var_longlong(int ncid, int varid, const long long *op)
01052 {
01053    NC* ncp;
01054    int stat = NC_check_id(ncid, &ncp);
01055    if(stat != NC_NOERR) return stat;
01056    return NC_put_var(ncid,varid,(void*)op,T_longlong);
01057 }
01058 
01059 int
01060 nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op)
01061 {
01062    NC* ncp;
01063    int stat = NC_check_id(ncid, &ncp);
01064    if(stat != NC_NOERR) return stat;
01065    return NC_put_var(ncid,varid,(void*)op,NC_UINT64);
01066 }
01067 
01068 #ifdef USE_NETCDF4
01069 int
01070 nc_put_var_string(int ncid, int varid, const char* *op)
01071 {
01072    NC* ncp;
01073    int stat = NC_check_id(ncid, &ncp);
01074    if(stat != NC_NOERR) return stat;
01075    return NC_put_var(ncid,varid,(void*)op,NC_STRING);
01076 }
01077 #endif /*USE_NETCDF4*/
01078 
01110 int
01111 nc_put_vars (int ncid, int varid, const size_t *startp,
01112              const size_t *countp, const ptrdiff_t *stridep,
01113              const void *op)
01114 {
01115    NC *ncp;
01116    int stat = NC_NOERR;
01117 
01118    if ((stat = NC_check_id(ncid, &ncp)))
01119        return stat;
01120    return ncp->dispatch->put_vars(ncid, varid, startp, countp, 
01121                                   stridep, op, NC_NAT);
01122 }
01123 
01124 int
01125 nc_put_vars_text(int ncid, int varid, const size_t *startp, 
01126                  const size_t *countp, const ptrdiff_t *stridep,
01127                  const char *op)
01128 {
01129    NC *ncp;
01130    int stat = NC_check_id(ncid, &ncp);
01131    if(stat != NC_NOERR) return stat;
01132    return NC_put_vars(ncid, varid, startp, countp,
01133                       stridep,(void*)op,NC_CHAR);
01134 }
01135 
01136 int
01137 nc_put_vars_schar(int ncid, int varid, const size_t *startp, 
01138                   const size_t *countp, const ptrdiff_t *stridep,
01139                   const signed char *op)
01140 {
01141    NC *ncp;
01142    int stat = NC_check_id(ncid, &ncp);
01143    if(stat != NC_NOERR) return stat;
01144    return NC_put_vars(ncid, varid, startp, countp, 
01145                       stridep,(void*)op,NC_BYTE);
01146 }
01147 
01148 int
01149 nc_put_vars_uchar(int ncid, int varid,
01150                   const size_t *startp, const size_t *countp,
01151                   const ptrdiff_t *stridep,
01152                   const unsigned char *op)
01153 {
01154    NC *ncp;
01155    int stat = NC_check_id(ncid, &ncp);
01156    if(stat != NC_NOERR) return stat;
01157    return NC_put_vars(ncid, varid, startp, countp,
01158                       stridep, (void *)op, T_uchar);
01159 }
01160 
01161 int
01162 nc_put_vars_short(int ncid, int varid,
01163                   const size_t *startp, const size_t *countp,
01164                   const ptrdiff_t *stridep,
01165                   const short *op)
01166 {
01167    NC *ncp;
01168    int stat = NC_check_id(ncid, &ncp);
01169    if(stat != NC_NOERR) return stat;
01170    return NC_put_vars(ncid, varid, startp, countp,
01171                       stridep, (void *)op, NC_SHORT);
01172 }
01173 
01174 int
01175 nc_put_vars_int(int ncid, int varid,
01176                 const size_t *startp, const size_t *countp,
01177                 const ptrdiff_t *stridep,
01178                 const int *op)
01179 {
01180    NC *ncp;
01181    int stat = NC_check_id(ncid, &ncp);
01182    if(stat != NC_NOERR) return stat;
01183    return NC_put_vars(ncid, varid, startp, countp,
01184                       stridep, (void *)op, NC_INT);
01185 }
01186 
01187 int
01188 nc_put_vars_long(int ncid, int varid,
01189                  const size_t *startp, const size_t *countp,
01190                  const ptrdiff_t *stridep,
01191                  const long *op)
01192 {
01193    NC *ncp;
01194    int stat = NC_check_id(ncid, &ncp);
01195    if(stat != NC_NOERR) return stat;
01196    return NC_put_vars(ncid, varid, startp, countp,
01197                       stridep, (void *)op, T_long);
01198 }
01199 
01200 int
01201 nc_put_vars_float(int ncid, int varid,
01202                   const size_t *startp, const size_t *countp,
01203                   const ptrdiff_t *stridep,
01204                   const float *op)
01205 {
01206    NC *ncp;
01207    int stat = NC_check_id(ncid, &ncp);
01208    if(stat != NC_NOERR) return stat;
01209    return NC_put_vars(ncid, varid, startp, countp,
01210                       stridep, (void *)op, T_float);
01211 }
01212 
01213 int
01214 nc_put_vars_double(int ncid, int varid,
01215                    const size_t *startp, const size_t *countp,
01216                    const ptrdiff_t *stridep,
01217                    const double *op)
01218 {
01219    NC *ncp;
01220    int stat = NC_check_id(ncid, &ncp);
01221    if(stat != NC_NOERR) return stat;
01222    return NC_put_vars(ncid, varid, startp, countp,
01223                       stridep, (void *)op, T_double);
01224 }
01225 
01226 int
01227 nc_put_vars_ubyte(int ncid, int varid,
01228                   const size_t *startp, const size_t *countp,
01229                   const ptrdiff_t *stridep,
01230                   const unsigned char *op)
01231 {
01232    NC *ncp;
01233    int stat = NC_check_id(ncid, &ncp);
01234    if(stat != NC_NOERR) return stat;
01235    return NC_put_vars(ncid, varid, startp, countp,
01236                       stridep, (void *)op, T_ubyte);
01237 }
01238 
01239 int
01240 nc_put_vars_ushort(int ncid, int varid,
01241                    const size_t *startp, const size_t *countp,
01242                    const ptrdiff_t *stridep,
01243                    const unsigned short *op)
01244 {
01245    NC *ncp;
01246    int stat = NC_check_id(ncid, &ncp);
01247    if(stat != NC_NOERR) return stat;
01248    return NC_put_vars(ncid, varid, startp, countp,
01249                       stridep, (void *)op, T_ushort);
01250 }
01251 
01252 int
01253 nc_put_vars_uint(int ncid, int varid,
01254                  const size_t *startp, const size_t *countp,
01255                  const ptrdiff_t *stridep,
01256                  const unsigned int *op)
01257 {
01258    NC *ncp;
01259    int stat = NC_check_id(ncid, &ncp);
01260    if(stat != NC_NOERR) return stat;
01261    return NC_put_vars(ncid, varid, startp, countp,
01262                       stridep, (void *)op, T_uint);
01263 }
01264 
01265 int
01266 nc_put_vars_longlong(int ncid, int varid,
01267                      const size_t *startp, const size_t *countp,
01268                      const ptrdiff_t *stridep,
01269                      const long long *op)
01270 {
01271    NC *ncp;
01272    int stat = NC_check_id(ncid, &ncp);
01273    if(stat != NC_NOERR) return stat;
01274    return NC_put_vars(ncid, varid, startp, countp,
01275                       stridep, (void *)op, T_longlong);
01276 }
01277 
01278 int
01279 nc_put_vars_ulonglong(int ncid, int varid,
01280                       const size_t *startp, const size_t *countp,
01281                       const ptrdiff_t *stridep,
01282                       const unsigned long long *op)
01283 {
01284    NC *ncp;
01285    int stat = NC_check_id(ncid, &ncp);
01286    if(stat != NC_NOERR) return stat;
01287    return NC_put_vars(ncid, varid, startp, countp,
01288                       stridep, (void *)op, NC_UINT64);
01289 }
01290 
01291 #ifdef USE_NETCDF4
01292 int
01293 nc_put_vars_string(int ncid, int varid,
01294                    const size_t *startp, const size_t *countp,
01295                    const ptrdiff_t *stridep,
01296                    const char**op)
01297 {
01298    NC *ncp;
01299    int stat = NC_check_id(ncid, &ncp);
01300    if(stat != NC_NOERR) return stat;
01301    return NC_put_vars(ncid, varid, startp, countp, stridep,
01302                       (void *)op, NC_STRING);
01303 }
01304 #endif /*USE_NETCDF4*/
01305 
01349 int
01350 nc_put_varm (int ncid, int varid, const size_t *startp,
01351              const size_t *countp, const ptrdiff_t *stridep,
01352              const ptrdiff_t *imapp, const void *op)
01353 {
01354    NC *ncp;
01355    int stat = NC_NOERR;
01356 
01357    if ((stat = NC_check_id(ncid, &ncp)))
01358        return stat;
01359    return ncp->dispatch->put_varm(ncid, varid, startp, countp, 
01360                                   stridep, imapp, op, NC_NAT);
01361 }
01362 
01363 int
01364 nc_put_varm_text(int ncid, int varid, const size_t *startp, 
01365                  const size_t *countp, const ptrdiff_t *stridep, 
01366                  const ptrdiff_t *imapp, const char *op)
01367 {
01368    NC *ncp;
01369    int stat = NC_check_id(ncid, &ncp);
01370    if(stat != NC_NOERR) return stat;
01371    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01372                       (void *)op, NC_CHAR);
01373 }
01374 
01375 int
01376 nc_put_varm_schar(int ncid, int varid,
01377                   const size_t *startp, const size_t *countp,
01378                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01379                   const signed char *op)
01380 {
01381    NC *ncp;
01382    int stat = NC_check_id(ncid, &ncp);
01383    if(stat != NC_NOERR) return stat;
01384    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01385                       (void *)op, NC_BYTE);
01386 }
01387 
01388 int
01389 nc_put_varm_uchar(int ncid, int varid,
01390                   const size_t *startp, const size_t *countp,
01391                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01392                   const unsigned char *op)
01393 {
01394    NC *ncp;
01395    int stat = NC_check_id(ncid, &ncp);
01396    if(stat != NC_NOERR) return stat;
01397    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01398                       (void *)op, T_uchar);
01399 }
01400 
01401 int
01402 nc_put_varm_short(int ncid, int varid,
01403                   const size_t *startp, const size_t *countp,
01404                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01405                   const short *op)
01406 {
01407    NC *ncp;
01408    int stat = NC_check_id(ncid, &ncp);
01409    if(stat != NC_NOERR) return stat;
01410    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01411                       (void *)op, NC_SHORT);
01412 }
01413 
01414 int
01415 nc_put_varm_int(int ncid, int varid,
01416                 const size_t *startp, const size_t *countp,
01417                 const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01418                 const int *op)
01419 {
01420    NC *ncp;
01421    int stat = NC_check_id(ncid, &ncp);
01422    if(stat != NC_NOERR) return stat;
01423    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01424                       (void *)op, NC_INT);
01425 }
01426 
01427 int
01428 nc_put_varm_long(int ncid, int varid,
01429                  const size_t *startp, const size_t *countp,
01430                  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01431                  const long *op)
01432 {
01433    NC *ncp;
01434    int stat = NC_check_id(ncid, &ncp);
01435    if(stat != NC_NOERR) return stat;
01436    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01437                       (void *)op, T_long);
01438 }
01439 
01440 int
01441 nc_put_varm_float(int ncid, int varid,
01442                   const size_t *startp, const size_t *countp,
01443                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01444                   const float *op)
01445 {
01446    NC *ncp;
01447    int stat = NC_check_id(ncid, &ncp);
01448    if(stat != NC_NOERR) return stat;
01449    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01450                       (void *)op, T_float);
01451 }
01452 
01453 int
01454 nc_put_varm_double(int ncid, int varid,
01455                    const size_t *startp, const size_t *countp,
01456                    const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01457                    const double *op)
01458 {
01459    NC *ncp;
01460    int stat = NC_check_id(ncid, &ncp);
01461    if(stat != NC_NOERR) return stat;
01462    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01463                       (void *)op, T_double);
01464 }
01465 
01466 int
01467 nc_put_varm_ubyte(int ncid, int varid,
01468                   const size_t *startp, const size_t *countp,
01469                   const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01470                   const unsigned char *op)
01471 {
01472    NC *ncp;
01473    int stat = NC_check_id(ncid, &ncp);
01474    if(stat != NC_NOERR) return stat;
01475    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01476                       (void *)op, T_ubyte);
01477 }
01478 
01479 int
01480 nc_put_varm_ushort(int ncid, int varid,
01481                    const size_t *startp, const size_t *countp,
01482                    const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01483                    const unsigned short *op)
01484 {
01485    NC *ncp;
01486    int stat = NC_check_id(ncid, &ncp);
01487    if(stat != NC_NOERR) return stat;
01488    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01489                       (void *)op, T_ushort);
01490 }
01491 
01492 int
01493 nc_put_varm_uint(int ncid, int varid,
01494                  const size_t *startp, const size_t *countp,
01495                  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01496                  const unsigned int *op)
01497 {
01498    NC *ncp;
01499    int stat = NC_check_id(ncid, &ncp);
01500    if(stat != NC_NOERR) return stat;
01501    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01502                       (void *)op, T_uint);
01503 }
01504 
01505 int
01506 nc_put_varm_longlong(int ncid, int varid,
01507                      const size_t *startp, const size_t *countp,
01508                      const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01509                      const long long *op)
01510 {
01511    NC *ncp;
01512    int stat = NC_check_id(ncid, &ncp);
01513    if(stat != NC_NOERR) return stat;
01514    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01515                       (void *)op, T_longlong);
01516 }
01517 
01518 int
01519 nc_put_varm_ulonglong(int ncid, int varid,
01520                       const size_t *startp, const size_t *countp,
01521                       const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01522                       const unsigned long long *op)
01523 {
01524    NC *ncp;
01525    int stat = NC_check_id(ncid, &ncp);
01526    if(stat != NC_NOERR) return stat;
01527    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01528                       (void *)op, NC_UINT64);
01529 }
01530 
01531 #ifdef USE_NETCDF4
01532 int
01533 nc_put_varm_string(int ncid, int varid,
01534                    const size_t *startp, const size_t *countp,
01535                    const ptrdiff_t *stridep, const ptrdiff_t *imapp,
01536                    const char**op)
01537 {
01538    NC *ncp;
01539    int stat = NC_check_id(ncid, &ncp);
01540    if(stat != NC_NOERR) return stat;
01541    return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
01542                       (void *)op, NC_STRING);
01543 }
01544 #endif /*USE_NETCDF4*/
01545  /*End of named group... */
01549 
 All Data Structures Files Functions Variables Typedefs Defines