NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Question about 'ncvgt'

Dear netcdf users:
I am using netcdf function in fortran to read some data out from the netcdf file. In my netcdf file, my data type is short. So in my fortran program, I set the 'integer' type and use the function 'ncvgt' to read the data I want. I do not know why the output is much much biger than the real values. In other words, I can not output the correct data. The following is my script of fortran program and I could not find the problem.
******************************************
 program main
       parameter   (ndims=3)
       parameter   (nlat=67,nlon=65)
       integer      datain(nlon,nlat)
       integer      ncid,iv
       integer      rcode
       integer      start(3), edges(3)
       data start/1,1,1/
       data edges/nlon,nlat,1/
       include 'netcdf.inc'
       iv=5
       ncid  =  ncopn('../cal.ncep.1dom.nc',ncnowrit,rcode)
       DO k =1,124
       start(3)=1
       call ncvgt(ncid,iv,start,edges,datain,rcode)
       print *,datain(10,10)
       enddo
       end
******************************************************************
But when I tried to get a single value instead of a array, it is fine.

Can you give me some hint?
Thanks a lot

Hui

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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