aboutsummaryrefslogtreecommitdiff
path: root/doc/html/Writer.html
blob: d9b04f1e4f3195c2af2e8f702f375dcce023b108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head>
    <title>Simple Unigrid Writer</title>
  </head>

  <body bgcolor="#F0F0F0">
      <h1>Simple Unigrid Writer</h1>

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

      <h2>Attribute Specification</h2>
      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.
      <dl><DD>
      <DL>
	<DT><b>origin</b>
	<DD>The floating-point origin of the dataset.
	<DT><b>delta</b>
	<DD>The physical spacing between grid points in the dataset.
	<DT><b>min_ext</b>
	<DD>The minimum coordinate of the dataset in physical space.  
	  This is actually identical to the <b>origin</b>.
	<DT><b>max_ext</b>
	<DD>The maximum coordinate of the dataset in physical space.
      </DL></dl><p>

      <h2>The API</h2>
      <UL>
	<LI><a href="#CPP">C++ Interface</a>
	<LI><a href="#C">C Interface</a>
	<LI><a href="#F77">F77/F90 Interface</a>
      </UL>
      <hr>
      <h3><a name="CPP">C++ Interface</a></h3>
            <DL>
	<DT><i>constructor</i> <b>Writer::Writer(IObase &filehandle)</b>
	<DD>The <i>filehandle</i> is an already open IEEEIO or HDFIO
	 file.  This initializes the reader and attaches it to that
	  datafile.
	<DT><i>destructor</i> <b>~Writer()</b>
	<DD>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.
	<DT><b>Writer::setRank(int rank)</b>
	<DD>Sets the rank (number of dimensions) of the datasets that
	  will be written.  The default is 3.
	<DT><b>Writer::setType(int datatype)</b>
	<DD>Sets the data type datasets written to the file.
	  The default is Float32 if you don't set this.
	<DT><b>Writer::setDims(int *dims)</b>
	<DD>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.
	<DT><b>Writer::setOrigin(double *origin)</b>
	<DD>This sets the real-valued origin of the dataset.  It
	  assumes the rank has been set. The default is a 0 origin.
	<DT><b>Writer::setDelta(double *delta)</b>
	<DD>Sets the real-valued grid spacing in each dimension.
	  Also assumes the rank has been set.
	<DT><b>Writer::setParams(int rank,int *dims,int type,
	    double *origin,double *delta)</b>
	<DD>Set all of the above parameters in a single call.
	<DT><b>Writer::write(void *data)</b>
	<DD>Writes a dataset as defined by set parameters.
	<DT><b>Writer::reserveChunk(WRFile wrfile)</b>
	<DD>Reserves a chunk of size defined by the set parameters.
	<DT><b>Writer::writeChunk(int *dims,int *origin,void
	    *data)</b>
	<DD>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.
      </DL>
      
      <hr>
      <h3><a name="C">C Interface</a></h3>
      <DL>
	<DT><b>WRFile WRbeginFile(IOFile filehandle)</b>
	<DD>The <i>filehandle</i> 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.
	<DT><b>WRendFile(IOFile filehandle)</b>
	<DD>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.
	<DT><b>WRsetRank(WRFile wrfile,int rank)</b>
	<DD>Sets the rank (number of dimensions) of the datasets that
	  will be written.  The default is 3.
	<DT><b>WRsetType(WRFile wrfile,int datatype)</b>
	<DD>Sets the data type datasets written to the file.
	  The default is Float32 if you don't set this.
	<DT><b>WRsetDims(WRFile wrfile,int *dims)</b>
	<DD>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.
	<DT><b>WRsetOrigin(WRFile wrfile,double *origin)</b>
	<DD>This sets the real-valued origin of the dataset.  It
	  assumes the rank has been set. The default is a 0 origin.
	<DT><b>WRsetDelta(WRFile wrfile,double *delta)</b>
	<DD>Sets the real-valued grid spacing in each dimension.
	  Also assumes the rank has been set.
	<DT><b>WRsetParams(WRFile wrfile,int rank,int *dims,int type,
	    double *origin,double *delta)</b>
	<DD>Set all of the above parameters in a single call.
	<DT><b>WRwrite(WRFile wrfile,void *data)</b>
	<DD>Writes a dataset as defined by set parameters.
	<DT><b>WRreserveChunk(WRFile wrfile)</b>
	<DD>Reserves a chunk of size defined by the set parameters.
	<DT><b>WRwriteChunk(WRFile wrfile,int *dims,int *origin,void
	    *data)</b>
	<DD>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.
      </DL>
      <hr>
      <h3><a name="F77">F77 Interface</a></h3>
      <DL>
	<DT><b>INTEGER*8 wr_begin(INTEGER*8 filehandle)</b>
	<DD>The <i>filehandle</i> 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.
	<DT><b>wr_end(INTEGER*8 filehandle)</b>
	<DD>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.
	<DT><b>wr_setrank(INTEGER*8 wrfile,INTEGER rank)</b>
	<DD>Sets the rank (number of dimensions) of the datasets that
	  will be written.  The default is 3.
	<DT><b>wr_settype(INTEGER*8 wrfile,INTEGER datatype)</b>
	<DD>Sets the data type datasets written to the file.
	  The default is Float32 if you don't set this.
	<DT><b>wr_setdims(INTEGER*8 wrfile,INTEGER dims(*))</b>
	<DD>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.
	<DT><b>wr_setorigin(INTEGER*8 wrfile,REAL*8 origin(*))</b>
	<DD>This sets the real-valued origin of the dataset.  It
	  assumes the rank has been set. The default is a 0 origin.
	<DT><b>wr_setdelta(INTEGER*8 wrfile,REAL*8 delta(*))</b>
	<DD>Sets the real-valued grid spacing in each dimension.
	  Also assumes the rank has been set.
	<DT><b>wr_setparams(INTEGER*8 wrfile,INTEGER rank,INTEGER
	    *dims,INTEGER type,
	    REAL*8 origin(*),REAL*8 delta(*))</b>
	<DD>Set all of the above parameters in a single call.
	<DT><b>wr_write(INTEGER*8 wrfile,(sometype) data(*...))</b>
	<DD>Writes a dataset as defined by set parameters.
	<DT><b>wr_reserveck(INTEGER*8 wrfile)</b>
	<DD>Reserves a chunk of size defined by the set parameters.
	<DT><b>wr_writeck(INTEGER*8 wrfile,INTEGER dims(*),INTEGER
	    origin(*),(sometype) data(*...))</b>
	<DD>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.
      </DL>
      <hr>
      <address><a href="mailto:jshalf@suttung.aei-potsdam.mpg.de">John Shalf</a></address>
<!-- Created: Wed May  7 12:38:45 MDT 1997 -->
<!-- hhmts start -->
Last modified: Wed May  7 16:31:19 MDT 
<!-- hhmts end -->
  </body>
</html>