Re: no data in netcdf file

S. Yi,

>Date: Mon, 08 Nov 2004 21:57:13 -0500
>From: "S. Yi" <yis2@xxxxxxxxxxxxxxxxxxxxxxxx>
>Organization: McMaster University
>To: netcdfgroup@xxxxxxxxxxxxxxxx
>Subject: no data in netcdf file

The above message contained the following:

>   I have a problem of creating a netcdf file correctly. I sent email to
> support@xxxxxxxxxxxxxxxx, but get no response.

Odd.  I recall responding to your email.

> I have to turn to this mailing list, although it may be simple. 

I believe the problem is easily fixed.  See below.

> 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)

Because netCDF variables can be multi-dimensional, the "timdmid"
argument in the above must be a vector instead of a scalar.  The value
of the first element of the vector must be "timdmid".

You should also check the return-code every time.

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

Regards,
Steve Emmerson


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