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

no data in netcdf file

Hello,

  I have a problem of creating a netcdf file correctly. I sent email to
support@xxxxxxxxxxxxxxxx, but get no response. I have to turn to this
mailing list, although it may be simple. 

Following is my source file, test.f90

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
program test

 implicit none
 include 'netcdf.inc'
integer :: ierr , ncid
integer :: timdmid, varid, il

ierr = nf_create('test.nc',nf_clobber, ncid)
ierr = nf_def_dim(ncid, 'time', nf_unlimited, timdmid)
ierr = nf_def_var(ncid, 'temp', nf_double, 1, timdmid, varid)
ierr = nf_enddef(ncid)

do il = 1, 10
ierr = nf_put_var_double(ncid, varid,1.0) 
enddo
ierr = nf_close(ncid)
end program

This program can be compiled and run successfully, however, the output
from ncdump shows that,

netcdf test {
dimensions:
time = UNLIMITED ; // (0 currently)
variables:
double temp(time) ;
data:
}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thanks


Yi, Shuhua
School of Geography and Geology
McMaster University
Hamilton, ON, CA L8S 4K1
--------------------------------
Office: GSB-221
Phone: 905-525-9140 Ext. 24776
--------------------------------

 
 
  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