Simple Unigrid Writer

Stores a sequence of multidimensional arrays including physical grid dimensions. It assumes the grid is spaced uniformly in each dimension.

Attribute Specification

The writer stores the dataset with dimensions and datatype (thats standard HDF practice). In addition, it stores the following NetCDF-style attributes to extend the description of the data.
origin
The floating-point origin of the dataset.
delta
The physical spacing between grid points in the dataset.
min_ext
The minimum coordinate of the dataset in physical space. This is actually identical to the origin.
max_ext
The maximum coordinate of the dataset in physical space.

The API


C++ Interface

constructor Writer::Writer(IObase &filehandle)
The filehandle is an already open IEEEIO or HDFIO file. This initializes the reader and attaches it to that datafile.
destructor ~Writer()
This flushes all of the necessary file buffer and destroys the Writer object. The filehandle that the writer was bound to must be closed separately though.
Writer::setRank(int rank)
Sets the rank (number of dimensions) of the datasets that will be written. The default is 3.
Writer::setType(int datatype)
Sets the data type datasets written to the file. The default is Float32 if you don't set this.
Writer::setDims(int *dims)
Sets the dimension sizes for data that will be written to the file. This assumes you have already set the rank. There is no default for this parameter.
Writer::setOrigin(double *origin)
This sets the real-valued origin of the dataset. It assumes the rank has been set. The default is a 0 origin.
Writer::setDelta(double *delta)
Sets the real-valued grid spacing in each dimension. Also assumes the rank has been set.
Writer::setParams(int rank,int *dims,int type, double *origin,double *delta)
Set all of the above parameters in a single call.
Writer::write(void *data)
Writes a dataset as defined by set parameters.
Writer::reserveChunk(WRFile wrfile)
Reserves a chunk of size defined by the set parameters.
Writer::writeChunk(int *dims,int *origin,void *data)
Write a chunk of data at the specified integer (logical) origin and of specified dimensions into the space that has been reserved in the datafile.

C Interface

WRFile WRbeginFile(IOFile filehandle)
The filehandle is an already open IEEEIO or HDFIO file. This initializes the reader and attaches it to that datafile. This also creates a WRFile pointer for use by the WRfile API.
WRendFile(IOFile filehandle)
This flushes all of the necessary file buffer and deallocates the WRFile pointer. The filehandle that the writer was bound to must be closed separately though.
WRsetRank(WRFile wrfile,int rank)
Sets the rank (number of dimensions) of the datasets that will be written. The default is 3.
WRsetType(WRFile wrfile,int datatype)
Sets the data type datasets written to the file. The default is Float32 if you don't set this.
WRsetDims(WRFile wrfile,int *dims)
Sets the dimension sizes for data that will be written to the file. This assumes you have already set the rank. There is no default for this parameter.
WRsetOrigin(WRFile wrfile,double *origin)
This sets the real-valued origin of the dataset. It assumes the rank has been set. The default is a 0 origin.
WRsetDelta(WRFile wrfile,double *delta)
Sets the real-valued grid spacing in each dimension. Also assumes the rank has been set.
WRsetParams(WRFile wrfile,int rank,int *dims,int type, double *origin,double *delta)
Set all of the above parameters in a single call.
WRwrite(WRFile wrfile,void *data)
Writes a dataset as defined by set parameters.
WRreserveChunk(WRFile wrfile)
Reserves a chunk of size defined by the set parameters.
WRwriteChunk(WRFile wrfile,int *dims,int *origin,void *data)
Write a chunk of data at the specified integer (logical) origin and of specified dimensions into the space that has been reserved in the datafile.

F77 Interface

INTEGER*8 wr_begin(INTEGER*8 filehandle)
The filehandle is an already open IEEEIO or HDFIO file. This initializes the reader and attaches it to that datafile. This also creates a INTEGER*8 pointer for use by the WRfile API.
wr_end(INTEGER*8 filehandle)
This flushes all of the necessary file buffer and deallocates the INTEGER*8 pointer. The filehandle that the writer was bound to must be closed separately though.
wr_setrank(INTEGER*8 wrfile,INTEGER rank)
Sets the rank (number of dimensions) of the datasets that will be written. The default is 3.
wr_settype(INTEGER*8 wrfile,INTEGER datatype)
Sets the data type datasets written to the file. The default is Float32 if you don't set this.
wr_setdims(INTEGER*8 wrfile,INTEGER dims(*))
Sets the dimension sizes for data that will be written to the file. This assumes you have already set the rank. There is no default for this parameter.
wr_setorigin(INTEGER*8 wrfile,REAL*8 origin(*))
This sets the real-valued origin of the dataset. It assumes the rank has been set. The default is a 0 origin.
wr_setdelta(INTEGER*8 wrfile,REAL*8 delta(*))
Sets the real-valued grid spacing in each dimension. Also assumes the rank has been set.
wr_setparams(INTEGER*8 wrfile,INTEGER rank,INTEGER *dims,INTEGER type, REAL*8 origin(*),REAL*8 delta(*))
Set all of the above parameters in a single call.
wr_write(INTEGER*8 wrfile,(sometype) data(*...))
Writes a dataset as defined by set parameters.
wr_reserveck(INTEGER*8 wrfile)
Reserves a chunk of size defined by the set parameters.
wr_writeck(INTEGER*8 wrfile,INTEGER dims(*),INTEGER origin(*),(sometype) data(*...))
Write a chunk of data at the specified integer (logical) origin and of specified dimensions into the space that has been reserved in the datafile.

John Shalf
Last modified: Wed May 7 16:31:19 MDT