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

[Support #MWB-826938]: NetCDF .cdl to .nc conversion using ncgen



Hi Chad,

> dimensions:
> station = 121 ; // number of stations
> id_len = 8; // length of station_id strings
  ...
> variables:
> char station_id(station, id_len) ;

I had no idea what your station IDs were, so I just guessed they might be
character
strings that were a maximum of 8 characters.  Feel free to change id_len to a
more
reasonable maximum.

Also, since tthis is netCDF-3, real strings aren't supported, only character
arrays
that can be understood by both C and Fortran.  So if your station IDs are of
lots
of different lengths, you will have to have a convention to indicate how long
each
station ID actually is.  For recommendations about how to do this, see the C or
Fortran Users Guide section on "Reading and Writing Character String Values":

http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c.html#Strings
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90.html#Reading-and-Writing-Character-String-Values

--Russ


Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: MWB-826938
Department: Support netCDF
Priority: Normal
Status: Closed