Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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/


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690