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.
Hi David, > How does one retrieve the dimension values from a NetCDF file using the > Fortran (or C) library interface. The netCDF Fortran 90 Interface guide > (http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90.pdf) > describes a function NF90_INQUIRE_DIMENSION but this only appears to > return the name and the length of the dimension. Right, a dimension only has a name and a length. The associated coordinate variable, which has the same name as the dimension, has the coordinate values, in the simple case when there is a 1D coordinate variable. > The R ncdf library manual > (http://cirrus.ucsd.edu/~pierce/ncdf/ncdf-manual.pdf) has methods > dim.def.ncdf for creating dimensions that have values. I am looking to > read these values in a Fortran program accessing this file. You should be able to read the values from the associated variable using the nf_get_var_TYPE or nf90_get_var interfaces, depending on whether you're using F77 or F90. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: EHY-348053 Department: Support netCDF Priority: Normal Status: Closed