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

20040526: syntax of declaring dimensions in CDL



Andy,

> To: address@hidden
> From: "Andy Wahr" <address@hidden>
> Subject: netCDF General - Linux - Dimension not declared error
> Organization: UNAVCO
> Keywords: 200405261911.i4QJB8pk005547 netCDF CDL

The above message contained the following:

> Institution: unavco
> Package Version: 3.5.0
> Operating System: Linux
> Hardware Information: Intel 4
> Inquiry: Hiya,
> 
> This netcdf cdl file:
> 
> netcdf hrChecker {
> dimensions : 
>       lat = 45, lon = 90, lay = 18;
> variables: 
> float vel (lay, lon, lat);
>       vel:field  = \"velocity, vector, series\";
>       vel:long_name = \"shear velocity perturbation\";
> float lat (lat);
>       lat:long_name = \"Latitude\";
>       lat:actual_range = -88, 88;
>       lat:units = \"degrees_north\";
> float   lon (lon);
>       lon:long_name = \"Longitude\";
>       lon:actual_range = 0, 360;
>       lon:units = \"degrees_east\";
> float lay (lay);
>       lay:long_name = \"Layer_Number\";
> data:
> lat =
>       -88,
>       -84,
>       -80,
> .... etc }
> 
> gets this error:
> ./ncgen -o check.nc check.cdl
> ncgen: check.cdl line 2: dimensions not declared as a variable, fatal error
> 
> Can you please tell me what is wrong with cdl?

Change the commas in

    dimensions : 
            lat = 45, lon = 90, lay = 18;

to semicolons:

    dimensions : 
            lat = 45; lon = 90; lay = 18;

Regards,
Steve Emmerson

> NOTE: All email exchanges with Unidata User Support are recorded in the
> Unidata inquiry tracking system and then made publically available
> through the web.  If you do not want to have your interactions made
> available in this way, you must let us know in each email you send to us.