| NETCDF(3f90) | UNIDATA LIBRARY FUNCTIONS | NETCDF(3f90) |
NAME¶
netcdf - Unidata Network Common Data Form (netCDF) library, version 3 interfaceSYNOPSIS¶
use netcdfMost Systems:¶
f90 ... -lnetcdfCRAY PVP Systems:¶
f90 -dp -i64 ... -lnetcdfLIBRARY VERSION¶
This document describes version 3 of Unidata netCDF data-access interface for the Fortran-90 programming language.character*80
nf90_inq_libvers()
character(len=80) :: nf90_inq_libvers
ROUTINE DESCRIPTIONS¶
All netCDF functions (except nf90_inq_libvers() and nf90_strerror()) return an integer status. This behavior replaces the rcode argument used in previous versions of the library. If this returned status value is not equal to nf90_noerr (zero), it indicates that an error occurred. The possible status values are defined in the module netcdf.function
nf90_strerror( ncerr)
integer, intent(in) :: ncerr character(len=80) :: nf90_strerror
function
nf90_create( path, cmode,
ncid)
character(len=*), intent(in) :: path integer, intent(in) :: cmode integer, optional, intent(in) :: initialsize integer, optional, intent(inout) :: chunksize integer, intent(out) :: ncid integer :: nf90_create
function
nf90_open( path, mode, ncid,
chunksize )
character(len=*), intent(in) :: path integer, intent(in) :: mode integer, intent(out) :: ncid integer, optional, intent(inout) :: chunksize integer :: nf90_open
function
nf90_set_fill( ncid, fillmode,
old_mode)
integer, intent(in) :: ncid, fillmode integer, intent(out) :: old_mode integer :: nf90_set_fill
function
nf90_redef( ncid)
integer, intent(in) :: ncid integer :: nf90_redef
function
nf90_enddef( ncid, h_minfree,
v_align, v_minfree,
r_align)
integer, intent(in) :: ncid integer, optional, intent(in) :: h_minfree, v_align integer, optional, intent(in) :: v_minfree, r_align integer :: nf90_enddef
function
nf90_sync( ncid)
integer, intent(in) :: ncid integer :: nf90_sync
function
nf90_abort( ncid)
integer, intent(in) :: ncid integer :: nf90_abort
function
nf90_close( ncid)
integer, intent(in) :: ncid integer :: nf90_close
function
nf90_inquire( ncid, ndims,
nvars, natts, unlimdimid,
nformat)
integer, intent(in) :: ncid integer, optional, intent(out) :: ndims, nvars integer, optional, intent(out) :: natts, unlimdimid integer, optional, intent(out) :: nformat integer :: nf90_inquire
function
nf90_def_dim( ncid, name, len,
dimid)
integer, intent(in) :: ncid character(len=*), intent(in) :: name integer, intent(in) :: len integer, intent(out) :: dimid integer :: nf90_def_dim
function
nf90_inq_dimid( ncid, name,
dimid)
integer, intent(in) :: ncid character(len=*), intent(in) :: name integer, intent(out) :: dimid integer :: nf90_inq_dimid
function
nf90_inquire_dimension( ncid, dimid,
name , len)
integer, intent(in) :: ncid, dimid character(len=*), optional, intent(out) :: name integer, optional, intent(out) :: len integer :: nf90_inquire_dimension
function
nf90_rename_dim( ncid, dimid,
name)
integer, intent(in) :: ncid character(len=*), intent(in) :: name integer, intent(in) :: dimid integer :: nf90_rename_dim
function
nf90_def_var( ncid, name, xtype,
dimids, varid)
integer, intent(in) :: ncid character(len=*), intent(in) :: name integer, intent(in) :: xtype integer, optional, dimension(:), intent(in) :: dimids integer :: nf90_def_var
function
nf90_inq_varid( ncid, name,
varid)
integer, intent(in) :: ncid character(len=*), intent(in) :: name integer, intent(out) :: varid integer :: nf90_inq_varid
function
nf90_inquire_variable( ncid, varid,
name , xtype, ndims,
dimids , natts)
integer, intent(in) :: ncid, varid character(len=*), optional, intent(out) :: name integer, optional, intent(out) :: xtype, ndims integer, dimension(*), optional, intent(out) :: dimids integer, optional, intent(out) :: natts integer :: nf90_inquire_variable
function
nf90_rename_var( ncid, varid,
name)
integer, intent9in) :: ncid, varid character(len=*), intent(in) :: newname integer :: nf90_rename_var
function
nf90_put_var( ncid, varid,
values, start, stride,
imap)
integer, intent(in) :: ncid, varid <<whatever>>, intent(in) :: values integer, dimension(:), optional, intent(in) :: start integer, dimension(:), optional, intent(in) :: stride integer, dimension(:), optional, intent(in) :: imap integer :: nf90_put_var
function
nf90_get_var( ncid, varid,
values, start, stride,
imap)
integer, intent(in) :: ncid, varid <<whatever>>, intent(out) :: values integer, dimension(:), optional, intent(in) :: start integer, dimension(:), optional, intent(in) :: stride integer, dimension(:), optional, intent(in) :: imap integer :: nf90_get_var
variable identified by ncid and varid; it may be a scalar or an array and must be of type character, integer(kind=OneByteInt), integer(kind=TwoByteInt), integer(kind=FourByteInt), integer(kind=EightByteInt), real(kind=FourByteReal), or real(kind=EightByteReal). All values are converted from the external type of the netCDF variable, if possible; otherwise, an nf90_erange error is returned. The optional argument start specifies the starting index in the netCDF variable for reading for each dimension of the netCDF variable. The optional argument stride specifies the sampling stride (the interval between accessed values in the netCDF variable) for each dimension of the netCDF variable (see COMMON ARGUMENT DESCRIPTIONS below). The optional argument imap specifies the in-memory arrangement of the data values (see COMMON ARGUMENT DESCRIPTIONS below).
function
nf90_inquire_attribute( ncid, varid,
name , xtype, len,
attnum )
integer, intent(in) :: ncid, varid character(len=*), intent(in) :: name integer, optional, intent(out) :: xtype, len, attnum integer :: nf90_inquire_attribute
function
nf90_inq_attname( ncid, varid,
attnum, name)
integer, intent(in) :: ncid, varid, attnum character(len=*), intent(out) :: name integer :: nf90_inq_attname
function
nf90_put_att( ncid, varid, name,
values)
integer, intent(in) :: ncid, varid character(len=*), intent(in) :: name <<whatever>>, intent(in) :: values integer :: nf90_put_att
function
nf90_get_att( ncid, varid, name,
fIvalues )
integer, intent(in) :: ncid, varid character(len=*), intent(in) :: name <<whatever>>, intent(out) :: values integer :: nf90_get_att
function
nf90_copy_att( ncid_in, varid_in,
name, ncid_out,
varid_out)
integer, intent(in) :: ncid_in, varid_in character(len=*), intent(in) :: name integer, intent(in) :: ncid_out, varid_out integer :: nf90_copy_att
function
nf90_rename_att( ncid, varid,
name, newname)
integer, intent(in) :: ncid, varid character(len=*), intent(in) :: name, newname integer :: nf90_rename_att
function
nf90_del_att( ncid, varid,
name)
integer, intent(in) :: ncid, varid character(len=*), intent(in) :: name integer :: nf90_del_att
COMMON ARGUMENT DESCRIPTIONS¶
In this section we define some common arguments which are used in the "FUNCTION DESCRIPTIONS" section.- integer ncid
- is the netCDF ID returned from a previous, successful call to nf90_open() or nf90_create()
- character(len=*) name
- is the name of a dimension, variable, or attribute. It shall begin with an alphabetic character, followed by zero or more alphanumeric characters including the underscore (`_') or hyphen (`-'). Case is significant. The maximum allowable number of characters is nf90_max_name. Names that begin with an underscore (`_') are reserved for use by the netCDF interface.
- integer xtype
- specifies the external data type of a netCDF variable or
attribute and is one of the following: nf90_byte, nf90_char,
nf90_short, nf90_int, nf90_float, or
nf90_double. These are used to specify 8-bit integers, characters,
16-bit integers, 32-bit integers, 32-bit IEEE floating point numbers, and
64-bit IEEE floating-point numbers, respectively.
- integer dimids
- is a vector of dimension ID's and defines the shape of a netCDF variable. The size of the vector shall be greater than or equal to the rank (i.e. the number of dimensions) of the variable ( ndims). The vector shall be ordered by the speed with which a dimension varies: dimids(1) shall be the dimension ID of the most rapidly varying dimension and dimids(ndims) shall be the dimension ID of the most slowly varying dimension. The maximum possible number of dimensions for a variable is given by the symbolic constant nf90_max_var_dims.
- integer dimid
- is the ID of a netCDF dimension. netCDF dimension ID's are allocated sequentially from the positive integers beginning with 1.
- integer ndims
- is either the total number of dimensions in a netCDF dataset or the rank (i.e. the number of dimensions) of a netCDF variable. The value shall not be negative or greater than the symbolic constant nf90_max_var_dims.
- integer varid
- is the ID of a netCDF variable or (for the attribute-access functions) the symbolic constant nf90_global, which is used to reference global attributes. netCDF variable ID's are allocated sequentially from the positive integers beginning with 1.
- integer natts
- is the number of global attributes in a netCDF dataset for the nf90_inquire() function or the number of attributes associated with a netCDF variable for the nf90_varinq() function.
- integer start
- specifies the starting point for accessing a netCDF variable's data values in terms of the indicial coordinates of the corner of the array section. The indices start at 1; thus, the first data value of a variable is (1, 1, ..., 1). The size of the vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions.
- integer stride
- specifies the sampling interval along each dimension of the
netCDF variable. The elements of the stride vector correspond, in order,
to the netCDF variable's dimensions ( stride(1)) gives the sampling
interval along the most rapidly varying dimension of the netCDF variable).
Sampling intervals are specified in type-independent units of elements (a
value of 1 selects consecutive elements of the netCDF variable along the
corresponding dimension, a value of 2 selects every other element, etc.).
- imap
- specifies the mapping between the dimensions of a netCDF
variable and the in-memory structure of the internal data array. The
elements of the index mapping vector correspond, in order, to the netCDF
variable's dimensions ( imap(1) gives the distance between elements
of the internal array corresponding to the most rapidly varying dimension
of the netCDF variable). Distances between elements are specified in
type-independent units of elements (the distance between internal elements
that occupy adjacent memory locations is 1 and not the element's
byte-length as in netCDF 2).
VARIABLE PREFILLING¶
By default, the netCDF interface sets the values of all newly-defined variables of finite length (i.e. those that do not have an unlimited, dimension) to the type-dependent fill-value associated with each variable. This is done when nf90_enddef() is called. The fill-value for a variable may be changed from the default value by defining the attribute ` _FillValue' for the variable. This attribute must have the same type as the variable and be of length one. Variables with an unlimited dimension are also prefilled, but on an `as needed' basis. For example, if the first write of such a variable is to position 5, then positions 1 through 4 (and no others) would be set to the fill-value at the same time. This default prefilling of data values may be disabled by or'ing the nf90_nofill flag into the mode parameter of nf90_open() or nf90_create(), or, by calling the function nf90_set_fill() with the argument nf90_nofill. For variables that do not use the unlimited dimension, this call must be made before nf90_enddef(). For variables that use the unlimited dimension, this call may be made at any time. One can obtain increased performance of the netCDF interface by using this feature, but only at the expense of requiring the application to set every single data value. The performance enhancing behavior of this function is dependent on the particulars of the implementation and dataset format. The flag value controlled by nf90_set_fill() is per netCDF ID, not per variable or per write. Allowing this to change affects the degree to which a program can be effectively parallelized. Given all of this, we state that the use of this feature may not be available (or even needed) in future releases. Programmers are cautioned against heavy reliance upon this feature.MPP FUNCTION DESCRIPTIONS¶
Additional functions for use on SGI/Cray MPP machines (_CRAYMPP). These are used to set and inquire which PE is the base for MPP for a particular netCDF. These are only relevant when using the SGI/Cray ``global'' Flexible File I/O layer and desire to have only a subset of PEs to open the specific netCDF file. For technical reasons, these functions are available on all platforms. On a platform other than SGI/Cray MPP, it is as if only processor available were processor 0. To use this feature, you need to specify a communicator group and call glio_group_mpi() or glio_group_shmem() prior to the netCDF nf90_open() and nf90_create() calls. Note that the routines described below are Fortran-77 routines rather than Fortran-90 routines (they have an "nf_" prefix rather than an "nf90_" prefix).integer
function nf__create_mp(character*(*) path, integer
cmode , integer initialsize, integer
pe, integer chunksize, integer
ncid)
Like nf__create() but allows the base PE to be set.
The argument pe sets the base PE at creation time. In the MPP
environment, nf__create() and nf90_create() set the base PE to
processor zero by default.
integer
function nf__open_mp(character*(*) path, integer
mode , integer pe, integer
chunksize, integer ncid)
Like nf__open() but allows the base PE to be set. The argument pe
sets the base PE at creation time. In the MPP environment, nf__open()
and nf90_open() set the base PE to processor zero by default.
integer
function nf_inq_base_pe(integer ncid, integer
pe)
Inquires of the netCDF dataset which PE is being used as the base for MPP use.
This is safe to use at any time.
integer
function nf_set_base_pe(integer ncid, integer
pe)
Resets the base PE for the netCDF dataset. Only perform this operation when the
affected communicator group synchronizes before and after the call. This
operation is very risky and should only be contemplated under only the most
extreme cases.
ENVIRONMENT VARIABLES¶
- NETCDF_FFIOSPEC
- Specifies the Flexible File I/O buffers for netCDF I/O when executing under the UNICOS operating system (the variable is ignored on other operating systems). An appropriate specification can greatly increase the efficiency of netCDF I/O -- to the extent that it can actually surpass FORTRAN binary I/O. This environment variable has been made a little more generalized, such that other FFIO option specifications can now be added. The default specification is bufa:336:2, unless a current FFIO specification is in operation, which will be honored. See UNICOS Flexible File I/O for more information.
MAILING-LISTS¶
Both a mailing list and a digest are available for discussion of the netCDF interface and announcements about netCDF bugs, fixes, and enhancements. To begin or change your subscription to either the mailing-list or the digest, send one of the following in the body (not the subject line) of an email message to "majordomo@unidata.ucar.edu". Use your email address in place of jdoe@host.inst.domain.subscribe netcdfgroup
jdoe@host.inst.domain
To unsubscribe from the netCDF mailing list:
unsubscribe netcdfgroup
jdoe@host.inst.domain
To subscribe to the netCDF digest:
subscribe netcdfdigest
jdoe@host.inst.domain
To unsubscribe from the netCDF digest:
unsubscribe netcdfdigest
jdoe@host.inst.domain
To retrieve the general introductory information for the mailing list:
info netcdfgroup
To get a synopsis of other majordomo commands:
help
SEE ALSO¶
ncdump(1), ncgen(1), netcdf(3f). netCDF User's Guide, published by the Unidata Program Center, University Corporation for Atmospheric Research, located in Boulder, Colorado.| 2000-04-04 | Printed: 0.0.0 |