[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20031204: error in create netcdf file



Boyin Huang,

>Date: Thu, 4 Dec 2003 05:42:45 -0800 (PST)
>From: Boyin Huang <address@hidden>
>Organization: The Center for Research on the Changing Earth System (CRCES)
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20031203: error in create netcdf file 

The above message contained the following:

> > Attached are two ncdump files:
> > (1) dump.35.30.4 for idim=35, jdim=30, and time=4
> > (2) dump.35.30.2 for idim=35, jdim=30, and time=2
> > 
> > In the first file, coordinates and part of variable
> > (uniformly 1) are right, but part of the variable is
> > wrong (filling value).
> > 
> > In the second file, all are wrong. But, during the
> > entire compiling and running the program, there is
> > no
> > error message.
> > 
> > Thank you very much.
> > 
> > Boyin
...

> netcdf idealized_sst_ann {
> dimensions:
>       longitude = 35 ;
>       latitude = 30 ;
>       time = 4 ;
> variables:
>       double longitude(longitude) ;
>               longitude:units = "Degree_East" ;
>       double latitude(latitude) ;
>               latitude:units = "Degree_North" ;
>       double time(time) ;
>               time:units = "year" ;
>       float tos(time, latitude, longitude) ;
>               tos:units = "C" ;

Be advised that the symbol "C" means "coulomb" and not "celsius".  If
you want degrees celsius, then you should use "celsius".

>               tos:missing_value = 1.e+20f ;
> 
> // global attributes:
>               :units = "Hadley Center SST" ;
> data:
> 
>  longitude = 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 
>     66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 
>     130, 134, 138 ;
> 
>  latitude = -58, -54, -50, -46, -42, -38, -34, -30, -26, -22, -18, -14, -10, 
>     -6, -2, 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58 ;
> 
>  time = 1, 2, 3, 4 ;
> 
>  tos =
>   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
>     1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
>     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
>   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
>     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
>   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
>     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
>   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
>     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
>   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _, _, _, _, _, _, _, 
>     _, _, _, _, _, _, _, _, _, _,
>   _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
>     _, _, _, _, _, _, _, _, _, _,

Offhand, I would say that your program isn't setting all the elements of
the "tos" netCDF variable.

The first 1803 elements of the first time-step of the "tos" variable are 
set.  Because this number is not a multiple of the number of longitudes 
(35) or the number of latitudes (30) I suspect that the code that is
writing the values is not putting them in the correct elements.  This
could occur if, for example, the code is incorrect in what it thinks is
the innermost dimension and what is the outermost dimension.

Unfortunately, we don't have the resources to debug user-code.

I suggest that you use the "-c" or "-f" options of the ncgen(1) utility
to create small test programs from CDL files to see what correct code
looks like.  Pay particular attention to how the dimensions are ordered
in the various netCDF arguments.

Good luck.

Regards,
Steve Emmerson