Help! NCUNLIM question

I am attempting to write a hyperslab with multiple values in the 
record dimension. No matter how big the hyperslab is, I only get
one value written in the array. I have written two little 
programs to illustrate my problem.  I'd really appreciate any
suggestions.  Thanks.

------------------ cut here -------------------------
THIS PIECE OF FORTRAN CODE IS NOT PRODUCING WHAT I EXPECT.
------------------ cut here -------------------------
      Include '/usr/local/include/netcdf.inc'
      Parameter (NDAT = 50)
      Integer cdfid,xdim,xid,dims(1),corner(1),edges(1)
      Real x(NDAT)
      CDFID=NCCRE('test.cdf',NCCLOB,IRET)
      xdim=NCDDEF(CDFID,'xdim',NCUNLIM,IRET)
      dims(1)=xdim
      xid=NCVDEF(CDFID,'level',NCFLOAT,1,dims,IRET)
      Call NCENDF(CDFID,IRET)
      do i=1,NDAT
        x(i)=float(i)
      end do
      corner(1)=1
      edges(1)=NDAT
      Call NCVPT(CDFID,XID,corner,edges,x,IRET)
      Call NCCLOS(CDFID,IRET)
      END
------------------ cut here -------------------------
THE OUTPUT
------------------ cut here -------------------------
netcdf test {
dimensions:
        xdim = UNLIMITED ; // (1 currently)

variables:
        float level(xdim) ;

data:

 level = 1 ;
}
------------------ cut here -------------------------
THIS PIECE OF FORTRAN CODE IS PRODUCING WHAT I EXPECT. 
I FIGURED THAT THE TWO CDL'S WOULD BE EQUIVALENT
------------------ cut here -------------------------
      Include '/usr/local/include/netcdf.inc'
      Parameter (NDAT = 50)
      Integer cdfid,xdim,xid,dims(1)
      CDFID=NCCRE('test.cdf',NCCLOB,IRET)
      xdim=NCDDEF(CDFID,'xdim',NCUNLIM,IRET)
      dims(1)=xdim
      xid=NCVDEF(CDFID,'level',NCFLOAT,1,dims,IRET)
      Call NCENDF(CDFID,IRET)
      do i=1,NDAT
        x=float(i)
        Call NCVPT1(CDFID,XID,i,x,IRET)
      end do
      Call NCCLOS(CDFID,IRET)
      END
------------------ cut here -------------------------
THE OUTPUT
------------------ cut here -------------------------
netcdf test {
dimensions:
        xdim = UNLIMITED ; // (50 currently)

variables:
        float level(xdim) ;

data:

 level = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
    20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 
    38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 ;
}
-- 
Harry L. Jenter                        hjenter@xxxxxxxxxxxxxxxxxx
U.S. Geological Survey                 COM: (703) 648-5890 FTS: 959-5890
Mailstop 430, National Center          "Sometimes you're the bug.
Reston, Virginia 22092                   Sometimes you're the windshield."


  • 1991 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: