These steps are performed for every data set written to a file. However, it is not always necessary to define data set options for every write operation as setting an option places information about the data set in a structure in primary memory. This information is retained until explicitly altered by another set call.
12.4.1 Creating a DFSD Scientific Data Set: DFSDadddata and DFSDputdata
To define and write a single SDS, the calling program must contain of of the following routines:C: status = DFSDadddata(filename, rank, dim_sizes, data);
FORTRAN: status = dsadata(filename, rank, dim_sizes, data)
OR
C: status = DFSDputdata(filename, rank, dim_sizes, data);
FORTRAN: status = dspdata(filename, rank, dim_sizes, data)
DFSDadddata appends data to a file when given an existing file name and creates a new file when given a unique file name. DFSDputdata replaces the contents of a file when given an existing file name and creates a new file when given a unique file name. To avoid accidentally overwriting data in a file, the use of DFSDadddata is recommended.filename
, rank
, dim_sizes
, and data
. In both routines, the data set is written to the file specified by the filename
parameter. The total number of dimensions in the array and the size of each dimension are passed in the rank
and dim_sizes
parameters. A pointer to the data or slab of data written to the named file is passed in the data
parameter.TABLE 12B - DFSDadddata and DFSDputdata Parameter List.
DFNT_FLOAT32
. To change the default setting, the calling program must contain calls to the following routines:
C: status = DFSDsetNT(number_type);
status = DFSDadddata(filename, rank, dim_sizes, data);
FORTRAN: status = dssnt(number_type)
status = dsadata(filename, rank, dim_sizes, data)DFSDsetNT defines the data type for all subsequent DFSDadddata and DFSDputdata calls until it is changed by a subsequent call to DFSDsetNT or reset to the default by DFSDclear. DFSDsetNT's only parameter is the data type.
C version
12.4.3 Overwriting Data for a Given Reference Number: DFSDwriteref
DFSDwriteref is a highly specialized function call that overwrites data referred to by the specified reference number.C: status = DFSDwriteref(filename, ref_number);
status = DFSDadddata(filename, rank, dim_sizes, data);
FORTRAN: status = dswref(filename, ref_number)
status = dsadata(filename, rank, dim_sizes, data)
If the filename passed to DFSDwriteref is different from the filename in the DFSDadddata or DFSDputdata routine calls, it will be ignored. The next scientific data set written, regardless of the filename, is assigned the reference number ref_number
. TABLE 12C - DFSDsetNT and DFSDwriteref Parameter List
Information stored in primary memory is retained by the HDF library until explicitly changed by a call to DFSDsetdims or reset to NULL
by calling DFSDclear. DFSDsetdims and DFSDclear are used to prevent assignments of attributes created for a group of data sets to data sets outside the group. For more information on assigning attributes see Section 12.7.1 on page 373 and Section 12.7.3 on page 377.
12.4.5 Preventing the Reassignment of DFSD Data Set Attributes: DFSDsetdims
Information stored in primary memory is retained by the HDF library until explicitly changed by a call to DFSDsetdims or reset to NULL
by calling DFSDclear. DFSDsetdims and DFSDclear are used to prevent assignments of attributes created for a group of data sets to data sets outside the group.C: status = DFSDsetdims(rank, dim_sizes);
FORTRAN: status = dssdims(rank, dim_sizes)
DFSDsetdims is not used here to define the rank and dimension sizes to be used in the next operation, but to alert the DFSD interface to stop the automatic assignment of attributes to the data sets to be written to file. DFSDsetdims has two parameters: rank
and dim_sizes
. The rank of an array is the total number of dimensions in the array and the dimension sizes are the length of each individual dimension. TABLE 12D - DFSDsetdims Parameter List
|
|
|
| |
|
| |||
|
|
|
Number of dimensions in the array.
| |
|
|
|
Size of each dimension in the array.
|
C: status = DFSDclear( );
FORTRAN: status = dsclear( )The DFSDclear routine clears all interface settings defined by any of the DFSDset* routines (DFSDsetNT, DFSDsetfillvalue, DFSDsetdims, DFSDsetdatastrs, DFSDsetdatalengths, DFSDsetrange, DFSDsetcal, DFSDsetdimscale and DFSDsetdimstrs). After the DFSDclear has been called, calls to any of the DFSDset* routines will result in the corresponding value not being written. To write new values, call the appropriate DFSDset routine again.
|
|
|
| |
|
| |||
|
|
|
Clears all DFSD interface settings.
|