Given a new filename, DFSDstartslab will create a new HDF file with the specified name. Given an existing filename, it will open the named file and append the new data set to the end of the file. Its only parameter is filename. DFSDendslab has no parameters and need only be called once per file. DFSDendslab will write any attributes defined immediately before the data set is created.
For more information on assigning attributes, see Section 11.7.3 on page 299.
TABLE 11I DFSDstartslab Parameter List
Routine Name (Fortran-77)
|
Parameter
|
Data Type
|
Description
| |
C
|
Fortran-77
| |||
DFSDstartslab (dssslab)
|
filename
|
char *
|
character* (*)
|
Name of the file containing the data set.
|
More specifically, the DFSD programming model for writing slabs to an SDS is as follows:
Although not specifically defined as a slab routine, in practice, the DFSDsetfillvalue routine is used to initialize array elements between non-contiguous slab write operations. Setting a fill value places the same value in every array location before the first slab is written. Any hole created by non-contiguous writes can then be recognized by identifying the known fill value. The fill value must have the same number type as the values in the data set. For more information on fill values refer to Section 11.7.1.2 on page 294.
To write a slab to a new data set, the calling program must include the following routine calls:
C: status = DFSDsetdims(rank, dimsizes); status = DFSDsetNT(num_type);status = DFSDstartslab(filename);
status = DFSDwriteslab(start, stride, count, data);
status = DFSDendslab( );
FORTRAN: status = dssnt(num_type) status = dssdims(rank, dim_sizes)
status = dssslab(filename)
status = dswslab(start, stride, edge, data)
status = dseslab( )
When writing slabs to an existing data set, it is impossible to change the number type, array boundaries, fill value, or calibration information. Consequently DFSDsetNT, DFSDsetdims, DFSDsetcal, and DFSDsetfillvalue will generate errors if called for an existing data set.
C: status = DFSDwriteref(filename, ref); status = DFSDstartslab(filename);status = DFSDwriteslab(start, stride, count, data);
status = DFSDendslab( );
FORTRAN: status = dswref(filename, ref) status = dssslab(filename)
status = dswslab(start, stride, edge, data)
status = dseslab( )
Because DFSDwriteslab offers no overwrite protection, the calling program is responsible for eliminating overlap when arranging slabs within the newly defined data set.
TABLE 11J DFSDwriteslab Parameter List
To read a slab, the calling program must include the following routine calls:
C: status = DFSDreadref(filename, ref); status = DFSDstartslab(filename);status = DFSDreadslab(start, stride, edge, data);
status = DFSDendslab( );
FORTRAN: status = dsrref(filename, ref) status = dssslab(filename)
status = dsrslab(start, stride, edge, data)
status = dseslab( )
In addition to DFSDreadref, DFSDgetdims may also be used to position the read pointer to the appropriate data set. When DFSDreadslab is used to read slabs, the coordinates of the start array must begin at 0 for each dimension (start={0,0, ... 0}) and the size of each dimension must equal the size of the array itself (edge={dim_size_1, dim_size_2, dim_size_n}). As with DFSDwriteslab, whatever is passed in as the stride parameter is ignored. Finally, the data buffer must allocate enough space to hold the data: excess data is truncated.
TABLE 11K DFSDreadslab Parameter List