This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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>