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

[netCDF #PPV-371725]: Inquire dimension length of variable



Hi Vladimir,

> Description of problem: Hello. I read in documentation, that if i need to 
> read current length of unlimited dimension, i should use INQUIRE_DIMENSION. 
> But documentation says it return maximum for all variables with this DIMID.
> Is this any way to inquire dimension length of specified variable? Or i 
> should invent tricks with length storage in attributes and so on?)

If you are using the netCDF-3 classic data model, there can only be one
unlimited dimension per netCDF file, and it has the same length for all
variables that use it.

In the netCDF-4 enhanced data model, you can define multiple unlimited 
dimensions, but each unlimited dimension still has one unique length, 
shared by all the variables defined with that dimension.  Extending one
of those variables along that dimension extends all of them along the 
axis of that dimension.

So if you want different variables to have different unlimited dimensions,
you must define multiple unlimited dimensions.  That's easy to do with
netCDF-4.  For example, you could have 

dimensions:
  time = unlimited ;  // currently 10
  station = unlimited ; // currently 20
  level = 5;
variables:
  float time(time) ;
  int id(station) ;
  float surface_temperature(time, station) ;
  float relative_humidity(time, station, level) ;

If you add a new time, it extends the variables time, surface_temperature,
and relative_humidity, but not id.  If you add a new station, it extends
id, surface_temperature, and relative_humidity, but not time.

--Russ

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



Ticket Details
===================
Ticket ID: PPV-371725
Department: Support netCDF
Priority: Normal
Status: Closed