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

970627: netCDF question on



Pavel,

> To: address@hidden
> From: Pavel Ivanov <address@hidden>
> Subject: netCDF question
> Organization: MSU Phys dep.
> Keywords: 199706270943.DAA07480

In the above message, you wrote:

>   I have a problem with matrix variables. Each variable have dimid shows
> it firs dimention and how can i know second?
> For example :
> netCDF tiny {
> dimentions:
>       dim1 = 2;
>       dim2 = 3;
>       dim3 = 4;
>       dim4 = 5;
> variables:
>       short vx (dim1,dim3);
> data:
>       vx = 1 ,2,3,4,5,6,7,8;
> } 
> In variable vx i have dimID = 3 points at dim3 and how can i know that
> second dimention is dim1 and not dim2 or dim5?

The C netCDF functions "nc_inq_var" or nc_inq_vardimid (or Fortran
functions NF_INQ_VAR or NF_INQ_VARDIMID) will return a *vector* that
contains all the dimension-IDs for the variable.  The first dimension ID
corresponds to the leftmost dimension; the last dimension ID corresponds
to the rightmost dimension (in C, the leftmost dimension is the "outer"
dimension; in Fortran, the leftmost dimension is the "inner" dimension).

--------
Steve Emmerson   <http://www.unidata.ucar.edu>