#include <Output.h>
Inheritance diagram for clOutput:
Public Member Functions | |
clOutput (clSimManager *p_oSimManager) | |
Constructor. | |
~clOutput () | |
Destructor. | |
void | Action () |
Performs output data collection file writing. | |
void | GetDetailedOutputFilename (char *cReturnFile) |
Gets the detailed output filename. | |
void | GetTimestepFilename (int iTimestep, char *cFilename) |
Figures out the filename for the detailed output timestep file and places it in cFilename. | |
Protected Member Functions | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Reads in the parameter file values. | |
void | WriteDetailedOutputHeader () |
Writes the detailed output header file. | |
void | WriteTimestepHeader (const char *cFilename) |
Sets up the timestep file and writes the header data. | |
void | WriteTimestepFooter (const char *cFilename) |
Writes the closing tag for the timestep file. | |
void | WriteTreeData (const char *cFilename) |
Appends the tree data to the file. | |
void | WriteGridData (const char *cFilename) |
Appends the grid data to the file. | |
void | ExtractTreeInfo (xercesc::DOMDocument *p_oDoc) |
Extracts the output data relating to tree saving. | |
void | ExtractGridInfo (xercesc::DOMDocument *p_oDoc) |
Extracts the output data relating to grid saving. | |
void | AddToBuffer (char *cBuf, char *cToAdd, FILE *out, int iBufferSize) |
Adds a string to a buffer string. | |
Protected Attributes | |
char | m_cFileRoot [MAX_FILENAME_SIZE] |
Root name of the detailed output file with no file extension on it. | |
char | m_cTarball [MAX_FILENAME_SIZE] |
Root detailed output file name plus extension for /tarball (gzip'ed and tar'ed). | |
clOutput::stcTreeOutputInfo ** | mp_treeSettings |
Defines what tree output data to save Array of stcTreeOutputInfo's, number of species by number of types. | |
clOutput::stcGridOutputInfo * | mp_gridSettings |
Data structure for defining what grid output data to save array of stcGridOutputInfo's, one for each grid object that we're saving data for. | |
short int | m_iNumGridsToSave |
number of grid objects we're saving data for | |
short int | m_iNumSpecies |
Number of species. | |
short int | m_iNumTypes |
Number of types. | |
Classes | |
struct | stcGridOutputInfo |
Data structure for defining what grid output data to save. More... | |
struct | stcTreeOutputInfo |
Defines what tree output data to save. More... |
This is a behavior which saves output from the model run. It would normally be run last in a timestep.
This behavior supports saving tree data and generic grid data. Tree data is defined separately for each type (seed, seedling, sapling, adult, or dead).
For grids, a map can be saved at a specified resolution (which does not have to match the calculation resolution) at any given timestep interval.
Filenames must be specified for the detailed output file.
Note - all file writing is done using the old C library functions instead of the newer C++ functions (fstream and family). The code was originally written with C++ functions and ran unacceptably slow.
NEEDED: Support for different grid resolutions.
Copyright 2003 Charles D. Canham.
|
Constructor.
|
|
Performs output data collection file writing. It begins by examining all of the desired output types and seeing which ones are ready for updating for this timestep. Reimplemented from clBehaviorBase. |
|
Adds a string to a buffer string. If the buffer is full, it is flushed to file before the new string is added.
|
|
Extracts the output data relating to grid saving.
|
|
Extracts the output data relating to tree saving.
|
|
Reads in the parameter file values.
Implements clWorkerBase. |
|
Gets the detailed output filename.
|
|
Figures out the filename for the detailed output timestep file and places it in cFilename. cFilename should be big enough to hold the maximum filename size; this function will not check to make sure it is.
|
|
Appends the grid data to the file. Why is this here when grid reading is in the grid object? Because we don't necessarily want to save the whole grid. Output may have a subset of data members to save. Subset or no, all data members are always saved in the settings list so that the map can be used as input.
|
|
Writes the closing tag for the timestep file.
|
|
Sets up the timestep file and writes the header data.
|
|
Appends the tree data to the file.
|