[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



> Organization: NCAR/HAO
> Keywords: 199401311740.AA26141

Hi Ben,

> Sorry if this is a FAQ: in the netCDF User's Guide, v1.10
> (Dec 1990, I should probably get a newer one), the example
> on p.68 (NCVDEF) defines RHDIMS (vdims) as TIMDIM, LATDIM,
> LONDIM in that order. But on p.80 (NCVPT), where the hyperslab
> is written, COUNT is defined in the opposite order from RHDIMS
> (LONS,LATS,TIMES). If I do this in my (fortran) code, I get an
> "Invalid edge length" message from ncvarput.

I think that example was in error and was corrected in the User's Guide some
time ago.  The example now reads:

    Here is an example using NCVDEF to create a variable named rh of type
    long with three dimensions, time, lat, and lon in a new netCDF file
    named foo.nc:

          INCLUDE 'netcdf.inc'
             ...
          INTEGER  NCID, RCODE
          INTEGER  LATDIM, LONDIM, TIMDIM ! dimension IDs
          INTEGER  RHID                    ! variable ID
          INTEGER  RHDIMS(3)               ! variable shape
             ...
          NCID = NCCRE ('foo.nc', NC_CLOBBER, RCODE)
             ...
                                           ! define dimensions
          LATDIM = NCDDEF(NCID, 'lat', 5, RCODE)
          LONDIM = NCDDEF(NCID, 'lon', 10, RCODE)
          TIMDIM = NCDDEF(NCID, 'time', NCUNLIM, RCODE)
             ...
                                           ! define variable
          RHDIMS(1) = LONDIM
          RHDIMS(2) = LATDIM
          RHDIMS(3) = TIMDIM
          RHID = NCVDEF (NCID, 'rh', NCDOUBLE, 3, RHDIMS, RCODE)

__________________________________________________________________________
                      
Russ Rew                                              UCAR Unidata Program
address@hidden                                        P.O. Box 3000
(303)497-8645                                 Boulder, Colorado 80307-3000