clOutput Class Reference

OUTPUT - Version 1.0. More...

#include <Output.h>

Inheritance diagram for clOutput:

clBehaviorBase clWorkerBase List of all members.

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::stcGridOutputInfomp_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...

Detailed Description

OUTPUT - Version 1.0.

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.

Author:
Lora E. Murphy

Changes:
-----------------
April 28, 2004 - Submitted as beta (LEM)
October 24, 2005 - Changed the way we search for trees; the results should be the same.


Constructor & Destructor Documentation

clOutput::clOutput clSimManager p_oSimManager  ) 
 

Constructor.

Parameters:
p_oSimManager Sim Manager object.


Member Function Documentation

void clOutput::Action  )  [virtual]
 

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.

void clOutput::AddToBuffer char *  cBuf,
char *  cToAdd,
FILE *  out,
int  iBufferSize
[inline, protected]
 

Adds a string to a buffer string.

If the buffer is full, it is flushed to file before the new string is added.

Parameters:
cBuf Buffer string.
cToAdd String to add to buffer.
out File to flush buffer to.
iBufferSize Size of the buffer.

void clOutput::ExtractGridInfo xercesc::DOMDocument *  p_oDoc  )  [protected]
 

Extracts the output data relating to grid saving.

Parameters:
p_oDoc DOM tree of parsed input file.

void clOutput::ExtractTreeInfo xercesc::DOMDocument *  p_oDoc  )  [protected]
 

Extracts the output data relating to tree saving.

Parameters:
p_oDoc DOM tree of parsed input file.

void clOutput::GetData xercesc::DOMDocument *  p_oDoc  )  [protected, virtual]
 

Reads in the parameter file values.

Parameters:
p_oDoc DOM tree of parsed input file.

Implements clWorkerBase.

void clOutput::GetDetailedOutputFilename char *  cReturnFile  )  [inline]
 

Gets the detailed output filename.

Parameters:
cReturnFile Address to place the filename. The filename will not be longer than MAX_FILENAME_SIZE.

void clOutput::GetTimestepFilename int  iTimestep,
char *  cFilename
 

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.

Parameters:
iTimestep Timestep.
cFilename Place to put the completed filename.

void clOutput::WriteGridData const char *  cFilename  )  [protected]
 

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.

Parameters:
cFilename to write to.

void clOutput::WriteTimestepFooter const char *  cFilename  )  [protected]
 

Writes the closing tag for the timestep file.

Parameters:
cFilename to write to.

void clOutput::WriteTimestepHeader const char *  cFilename  )  [protected]
 

Sets up the timestep file and writes the header data.

Parameters:
cFilename to write to.

void clOutput::WriteTreeData const char *  cFilename  )  [protected]
 

Appends the tree data to the file.

Parameters:
cFilename to write to.


The documentation for this class was generated from the following file:
Generated on Mon Mar 27 12:51:18 2006 for SORTIE Core C++ Documentation by  doxygen 1.4.6-NO