📄 netcdf.3
字号:
(\fBNC_INT\fR corresponds to \fBNC_LONG\fR in version 2, to specify a32-bit integer)..TPint \fIdimids\fP[]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 therank (i.e. the number of dimensions) of the variable (\fIndims\fP).The vector shall be ordered by the speed with which a dimension varies:\fIdimids\fP[\fIndims\fP-1]shall be the dimension ID of the most rapidlyvarying dimension and\fIdimids\fP[0]shall be the dimension ID of the most slowlyvarying dimension.The maximum possible number ofdimensions for a variable is given by the symbolic constant\fBNC_MAX_VAR_DIMS\fR..TPint \fIdimid\fPis the ID of a netCDF dimension.netCDF dimension ID's are allocated sequentially from the non-negativeintegers beginning with 0..TPint \fIndims\fPis 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 \fBNC_MAX_VAR_DIMS\fR..TPint \fIvarid\fPis the ID of a netCDF variable or (for the attribute-access functions) the symbolic constant\fBNC_GLOBAL\fR,which is used to reference global attributes.netCDF variable ID's are allocated sequentially from the non-negativeintegers beginning with 0..TPint* \fInatts\fPis the number of global attributes in a netCDF dataset for the\fBnc_inquire(\|)\fRfunction or the numberof attributes associated with a netCDF variable for the\fBnc_varinq(\|)\fRfunction..TPconst size_t \fIindex\fP[]specifies the indicial coordinates of the netCDF data value to be accessed.The indices start at 0;thus, for example, the first data value of atwo-dimensional variable is (0,0).The size of the vector shall be at least the rank of the associatednetCDF variable and its elements shall correspond, in order, to thevariable's dimensions..TPconst size_t \fIstart\fP[]specifies the starting pointfor accessing a netCDF variable's data valuesin terms of the indicial coordinates of the corner of the array section.The indices start at 0;thus, the first datavalue of a variable is (0, 0, ..., 0).The size of the vector shall be at least the rank of the associatednetCDF variable and its elements shall correspond, in order, to thevariable's dimensions..TPconst size_t \fIcount\fP[]specifies the number of indices selected along each dimension of thearray section.Thus, to access a single value, for example, specify \fIcount\fP as(1, 1, ..., 1).Note that, for strided I/O, this argument must be adjustedto be compatible with the \fIstride\fP and \fIstart\fP arguments so that the interaction of thethree does not attempt to access an invalid data co-ordinate.The elements of the\fIcount\fP vector correspond, in order, to the variable's dimensions..TPconst size_t \fIstride\fP[]specifies the sampling interval along each dimension of the netCDFvariable. The elements of the stride vector correspond, in order,to the netCDF variable's dimensions (\fIstride\fP[0])gives the sampling interval along the most slowly varying dimension of the netCDF variable). Sampling intervals arespecified in type-independent units of elements (a value of 1 selectsconsecutive elements of the netCDF variable along the correspondingdimension, a value of 2 selects every other element, etc.).A \fBNULL\fR stride argument is treated as (1, 1, ... , 1)..TP\fIimap\fPspecifies the mapping between the dimensions of a netCDF variable andthe in-memory structure of the internal data array. The elements ofthe index mapping vector correspond, in order, to the netCDF variable'sdimensions (\fIimap\fP[0] gives the distancebetween elements of the internal array corresponding to the mostslowly varying dimension of the netCDF variable).Distances between elements are specified in type-independent units ofelements (the distance between internal elements that occupy adjacentmemory locations is 1 and not the element's byte-length as in netCDF 2).A \fBNULL\fR pointer means the memory-resident values havethe same structure as the associated netCDF variable..SH "VARIABLE PREFILLING".LPBy default, the netCDF interface sets the values ofall newly-defined variables of finite length (i.e. those that do not havean unlimited, dimension) to the type-dependent fill-value associated with each variable. This is done when \fBnc_enddef(\|)\fRis called. Thefill-value for a variable may be changed from the default value bydefining the attribute `\fB_FillValue\fR' for the variable. Thisattribute must have the same type as the variable and be of length one..LPVariables with an unlimited dimension are also prefilled, but onan `as needed' basis. For example, if the first write of such avariable is to position 5, thenpositions0 through 4(and no others)would be set to the fill-value at the same time..LPThis default prefilling of data values may be disabled byor'ing the\fBNC_NOFILL\fRflag into the mode parameter of \fBnc_open(\|)\fR or \fBnc_create(\|)\fR,or, by calling the function \fBnc_set_fill(\|)\fRwith the argument \fBNC_NOFILL\fR.For variables that do not use the unlimited dimension,this call mustbe made before\fBnc_enddef(\|)\fR.For variables thatuse the unlimited dimension, this callmay be made at any time..LPOne can obtain increased performance of the netCDF interface by using this feature, but only at the expense of requiring the application to setevery single data value. The performanceenhancing behavior of this function is dependent on the particulars ofthe implementation and dataset format.The flag value controlled by \fBnc_set_fill(\|)\fRis per netCDF ID,not per variable or per write. Allowing this to change affects the degree to whicha program can be effectively parallelized.Given all of this, we state that the useof this feature may not be available (or even needed) in futurereleases. Programmers are cautioned against heavy reliance upon thisfeature..HP\fBint nc_setfill(int \fIncid\fP, int \fIfillmode\fP, int* \fIold_fillemode\fP)\fR.sp(Corresponds to \fBncsetfill(\|)\fR in version 2).spDetermines whether or not variable prefilling will be done (see above).The netCDF dataset shall be writable.\fIfillmode\fP is either \fBNC_FILL\fRto enable prefilling (thedefault) or \fBNC_NOFILL\fRto disable prefilling.This function returns the previous setting in \fIold_fillmode\fP..SH "MPP FUNCTION DESCRIPTIONS".LPAdditional functions for use on SGI/Cray MPP machines (_CRAYMPP).These are used to set and inquire which PE is the base for MPPfor a particular netCDF. These are only relevant whenusing the SGI/Cray ``global''Flexible File I/O layer and desire to haveonly 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 ifonly processor available were processor 0..LPTo use this feature, you need to specify a communicator group and call\fBglio_group_mpi(\|)\fR or \fBglio_group_shmem(\|)\fR prior to the netCDF\fBnc_open(\|)\fR and \fBnc_create(\|)\fR calls..HP\fBint nc__create_mp(const char \fIpath\fP[], int \fIcmode\fP, size_t \fIinitialsize\fP, int \fIpe\fP, size_t* \fIchunksize\fP, int* \fIncid\fP)\fR.spLike \fBnc__create(\|)\fR but allows the base PE to be set..spThe argument \fIpe\fP sets the base PE at creation time. In the MPPenvironment, \fBnc__create(\|)\fR and \fBnc_create(\|)\fR set the base PE to processorzero by default..HP\fBint nc__open_mp(const char \fIpath\fP[], int \fImode\fP, int \fIpe\fP, size_t* \fIchunksize\fP, int* \fIncid\fP)\fR.spLike \fBnc__open(\|)\fR but allows the base PE to be set.The argument \fIpe\fP sets the base PE at creation time. In the MPPenvironment, \fBnc__open(\|)\fR and \fBnc_open(\|)\fR set the base PE to processorzero by default..HP\fBint nc_inq_base_pe(int \fIncid\fP, int* \fIpe\fP)\fR.spInquires of the netCDF dataset which PE is being used as the base for MPP use.This is safe to use at any time..HP\fBint nc_set_base_pe(int \fIncid\fP, int \fIpe\fP)\fR.spResets the base PE for the netCDF dataset.Only perform this operation when the affected communicator groupsynchronizes before and after the call.This operation is very risky and should only be contemplatedunder only the most extreme cases..SH "ENVIRONMENT VARIABLES".TP 4.B NETCDF_FFIOSPECSpecifies the Flexible File I/O buffers for netCDF I/O when executingunder the UNICOS operating system (the variable is ignored on otheroperating 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 \fBbufa:336:2\fP,unless a current FFIO specification is in operation,which will be honored.See UNICOS Flexible File I/O for more information..SH "MAILING-LISTS".LPBoth a mailing list and a digest are available fordiscussion of the netCDF interface and announcements about netCDF bugs,fixes, and enhancements.To begin or change your subscription to either the mailing-list or thedigest, send one of the following in the body (notthe subject line) of an email message to "majordomo@unidata.ucar.edu".Use your email address in place of \fIjdoe@host.inst.domain\fP..spTo subscribe to the netCDF mailing list:.RS\fBsubscribe netcdfgroup \fIjdoe@host.inst.domain\fR.RETo unsubscribe from the netCDF mailing list:.RS\fBunsubscribe netcdfgroup \fIjdoe@host.inst.domain\fR.RETo subscribe to the netCDF digest:.RS\fBsubscribe netcdfdigest \fIjdoe@host.inst.domain\fR.RETo unsubscribe from the netCDF digest:.RS\fBunsubscribe netcdfdigest \fIjdoe@host.inst.domain\fR.RETo retrieve the general introductory information for the mailing list:.RS\fBinfo netcdfgroup\fR.RETo get a synopsis of other majordomo commands:.RS\fBhelp\fR.RE.SH "SEE ALSO".LP.BR ncdump (1),.BR ncgen (1),.BR netcdf (3),.BR netcdf_f77 (3),.BR netcdf_f90 (3))..LP\fInetCDF User's Guide\fP, publishedby the Unidata Program Center, University Corporation for AtmosphericResearch, located in Boulder, Colorado.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -