Skip to content

Commit 00a1a7a

Browse files
Update documentation
1 parent df1be68 commit 00a1a7a

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

Omega/_sources/devGuide/IOStreams.md.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ been defined and the relevant data arrays have been attached to Fields and
4040
are available to access. At the end of a simulation, IOStreams must be
4141
finalized using
4242
```c++
43-
int Err = IOStream::finalize(ModelClock);
43+
IOStream::finalize(ModelClock);
4444
```
4545
so that any final writes can take place for the OnShutdown streams and to
4646
deallocate all defined streams and arrays. If a stream needs to be removed
@@ -52,26 +52,29 @@ before that time, an erase function is provided:
5252
For most output streams, we provide a writeAll interface that should be placed
5353
at an appropriate time during the time step loop:
5454
```c++
55-
int Err = IOStream::writeAll(ModelClock);
55+
IOStream::writeAll(ModelClock);
5656
```
5757
This function checks each write stream and writes the file if it is time, based
5858
on a time manager alarm that is defined during initialization for each stream
5959
based on the time frequency in the streams configuration. After writing the
6060
file, the alarm is reset for the next write time. If a file must be written
6161
outside of this routine, a single-stream write can take place using:
6262
```c++
63-
int Err = IOStream::write(StreamName, ModelClock);
63+
IOStream::write(StreamName, ModelClock);
6464
```
6565

6666
Reading files (eg for initialization, restart or forcing) does not often
6767
take place all at once, so no readAll interface is provided. Instead, each
6868
input stream is read using:
6969
```c++
70-
int Err = IOStream::read(StreamName, ModelClock, ReqMetadata);
70+
Error Err = IOStream::read(StreamName, ModelClock, ReqMetadata);
7171
```
72-
where ReqMetadata is a variable of type Metadata (defined in Field but
72+
The returned error code typically means that a field in the stream could
73+
not be found in the input file - most other errors abort immediately. The
74+
calling routine is then responsible for deciding what action to take.
75+
The ReqMetadata argument is a variable of type Metadata (defined in Field but
7376
essentially a ``std::map<std::string, std::any>`` for the name/value pair).
74-
This variable should incude the names of global metadata that are desired
77+
This variable should include the names of global metadata that are desired
7578
from the input file. For example, if a time string is needed to verify the
7679
input file corresponds to a desired time, the required metadata can be
7780
initialized with

Omega/devGuide/IOStreams.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
been defined and the relevant data arrays have been attached to Fields and
208208
are available to access. At the end of a simulation, IOStreams must be
209209
finalized using</p>
210-
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">Err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">finalize</span><span class="p">(</span><span class="n">ModelClock</span><span class="p">);</span>
210+
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">finalize</span><span class="p">(</span><span class="n">ModelClock</span><span class="p">);</span>
211211
</pre></div>
212212
</div>
213213
<p>so that any final writes can take place for the OnShutdown streams and to
@@ -218,26 +218,29 @@
218218
</div>
219219
<p>For most output streams, we provide a writeAll interface that should be placed
220220
at an appropriate time during the time step loop:</p>
221-
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">Err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">writeAll</span><span class="p">(</span><span class="n">ModelClock</span><span class="p">);</span>
221+
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">writeAll</span><span class="p">(</span><span class="n">ModelClock</span><span class="p">);</span>
222222
</pre></div>
223223
</div>
224224
<p>This function checks each write stream and writes the file if it is time, based
225225
on a time manager alarm that is defined during initialization for each stream
226226
based on the time frequency in the streams configuration. After writing the
227227
file, the alarm is reset for the next write time. If a file must be written
228228
outside of this routine, a single-stream write can take place using:</p>
229-
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">Err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">write</span><span class="p">(</span><span class="n">StreamName</span><span class="p">,</span><span class="w"> </span><span class="n">ModelClock</span><span class="p">);</span>
229+
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">write</span><span class="p">(</span><span class="n">StreamName</span><span class="p">,</span><span class="w"> </span><span class="n">ModelClock</span><span class="p">);</span>
230230
</pre></div>
231231
</div>
232232
<p>Reading files (eg for initialization, restart or forcing) does not often
233233
take place all at once, so no readAll interface is provided. Instead, each
234234
input stream is read using:</p>
235-
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">Err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">read</span><span class="p">(</span><span class="n">StreamName</span><span class="p">,</span><span class="w"> </span><span class="n">ModelClock</span><span class="p">,</span><span class="w"> </span><span class="n">ReqMetadata</span><span class="p">);</span>
235+
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="n">Error</span><span class="w"> </span><span class="n">Err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">IOStream</span><span class="o">::</span><span class="n">read</span><span class="p">(</span><span class="n">StreamName</span><span class="p">,</span><span class="w"> </span><span class="n">ModelClock</span><span class="p">,</span><span class="w"> </span><span class="n">ReqMetadata</span><span class="p">);</span>
236236
</pre></div>
237237
</div>
238-
<p>where ReqMetadata is a variable of type Metadata (defined in Field but
238+
<p>The returned error code typically means that a field in the stream could
239+
not be found in the input file - most other errors abort immediately. The
240+
calling routine is then responsible for deciding what action to take.
241+
The ReqMetadata argument is a variable of type Metadata (defined in Field but
239242
essentially a <code class="docutils literal notranslate"><span class="pre">std::map&lt;std::string,</span> <span class="pre">std::any&gt;</span></code> for the name/value pair).
240-
This variable should incude the names of global metadata that are desired
243+
This variable should include the names of global metadata that are desired
241244
from the input file. For example, if a time string is needed to verify the
242245
input file corresponds to a desired time, the required metadata can be
243246
initialized with</p>

Omega/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)