SORTIE Core C++ Documentation
Public Member Functions | Protected Attributes | List of all members
clSeasonalWaterDeficit Class Reference

Seasonal Water Deficit - version 1.0. More...

#include <SeasonalWaterDeficit.h>

Inheritance diagram for clSeasonalWaterDeficit:
clBehaviorBase clWorkerBase

Public Member Functions

 clSeasonalWaterDeficit (clSimManager *p_oSimManager)
 Constructor. More...
 
 ~clSeasonalWaterDeficit ()
 Destructor. More...
 
void GetData (xercesc::DOMDocument *p_oDoc)
 Reads in values from the parameter file. More...
 
void Action ()
 Updates the plot seasonal water deficit. More...
 
- Public Member Functions inherited from clBehaviorBase
virtual float GetBehaviorVersion ()
 Gets the behavior version number. More...
 
 clBehaviorBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clBehaviorBase ()
 Destructor. More...
 
virtual short int ValidateVersionNumber (float fTestVersion)
 Makes sure that the version number of a file passed is between the minimum and current version numbers. More...
 
virtual void RegisterTreeDataMembers ()
 Registers tree data members. More...
 
virtual void SetSpeciesTypeCombos (short int iNumCombos, stcSpeciesTypeCombo *p_whatCombos)
 Sets the species/type combos for a behavior. More...
 
virtual void SetNameData (std::string sNameString)
 Sets the string for the parameter file behavior. More...
 
virtual short int GetNewTreeInts ()
 Gets the number of new tree integer data members this behavior wants to register. More...
 
virtual short int GetNewTreeFloats ()
 Gets the number of new tree float data members this behavior wants to register. More...
 
virtual short int GetNewTreeChars ()
 Gets the number of new tree character data members this behavior wants to register. More...
 
virtual short int GetNewTreeBools ()
 Gets the number of new tree bool data members this behavior wants to register. More...
 
virtual short int GetNumSpeciesTypeCombos ()
 Gets the number of species/type combos to which this behavior applies. More...
 
virtual short int GetNumBehaviorSpecies ()
 Gets the number of unique tree species to which this behavior applies. More...
 
struct stcSpeciesTypeCombo GetSpeciesTypeCombo (short int iIndex)
 Gets one of this behavior's type/species combos. More...
 
virtual short int GetBehaviorSpecies (short int iIndex)
 Gets one of the behavior's species. More...
 
short int GetBehaviorListNumber ()
 Gets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More...
 
void SetBehaviorListNumber (short int iNumber)
 Sets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More...
 
std::string FormatSpeciesTypeQueryString ()
 Formats the string for species/types query. More...
 
virtual DOMElement * GetParentParametersElement (xercesc::DOMDocument *p_oDoc)
 This will get the correct set of parameters for this behavior based on the behavior list position number. More...
 
- Public Member Functions inherited from clWorkerBase
 clWorkerBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clWorkerBase ()
 Destructor. More...
 
std::string GetName ()
 Gets the object's namestring. More...
 
clSimManagerGetSimManager ()
 
void DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType)
 Triggers the setup process. More...
 
virtual void TimestepCleanup ()
 Performs any necessary cleanup operations at the end of a timestep. More...
 
virtual void EndOfRunCleanup ()
 Performs any necessary cleanup operations at the end of a run. More...
 

Protected Attributes

double * mp_fPropRainfall
 Proportion of rain that falls in each month. More...
 
double * mp_fRadiation
 Radiation for each month, cal/cm2. More...
 
double * mp_fRatioMonthlyAnnualTemp
 Ratio of monthly temp to annual. More...
 
double * mp_fMonthlyTemp
 Monthly temperature. More...
 
double * mp_fMonthlyPrecip
 Monthly precip. More...
 
double * mp_fMonthlyPET
 Monthly PET. More...
 
double * mp_fMonthlySMS
 Monthly soil moisture. More...
 
double * mp_fMonthlyAET
 Monthly AET. More...
 
double m_fAWS
 Available water storage. More...
 
- Protected Attributes inherited from clBehaviorBase
short int m_iNumSpeciesTypeCombos
 How many type/species combos a behavior will act on. More...
 
short int m_iNumBehaviorSpecies
 How many distinct species are in the combo list - important for filling species-specific values from parameter file. More...
 
short int * mp_iWhatSpecies
 List of distinct species - for filling species-specific values from parameter file. More...
 
stcSpeciesTypeCombomp_whatSpeciesTypeCombos
 Array of species/type combos that the behavior will act on. More...
 
short int m_iNewTreeInts
 The number of new tree integer data members this behavior wants to add. More...
 
short int m_iNewTreeFloats
 The number of new tree float data members this behavior wants to add. More...
 
short int m_iNewTreeChars
 The number of new tree character data members this behavior wants to add. More...
 
short int m_iNewTreeBools
 The number of new tree boolean data members this behavior wants to add. More...
 
short int m_iBehaviorListNumber
 The number of this behavior in the behavior list, to differentiate between possible multiple copies of this behavior. More...
 
float m_fVersionNumber
 Version number - this will be rounded to 2 digits after the decimal place. More...
 
std::string m_sXMLRoot
 XML root that encloses the parameters for this behavior. More...
 
float m_fMinimumVersionNumber
 Minimum version number - this behavior will run parameter data for a file marked between this number and the current version number, inclusive. More...
 
- Protected Attributes inherited from clWorkerBase
std::string m_sNameString
 If a behavior has registered a command line command with the sim manager, this allows it to be called. More...
 
clSimManagermp_oSimManager
 Pointer to the simulation manager object. More...
 
int * mp_iAllowedFileTypes
 List of the input file types this object can handle. More...
 
int m_iNumAllowedTypes
 Number of input file types this object can handle. More...
 

Additional Inherited Members

- Protected Member Functions inherited from clWorkerBase
void AssembleFileCode (int iFileType, int iFileVersion, char *cCode)
 Creates the proper identifying filecode for an XML file. More...
 

Detailed Description

Seasonal Water Deficit - version 1.0.

This calculates seasonal water deficit based on current annual temperature and precipitation.

Annual precipitation is first partitioned by month, by multiplying the total by the fraction of precipitation that falls in each month (entered as a parameter). Then monthly temperature is calculated, by multiplying annual mean temperature by the ratio of the month's mean to annual mean (entered as a parameter).

Then PET (monthly potential evapotranspiration) is calculated as:

PETi = 0.013 * [T/(T+15)] * (Rs + 50)

Where

If T ≤ 0, PET = 0.

Then monthly soil moisture storage is calculated as:

smsi = 0 < smsi-1 + precipi - PETi < MaxAWS

where:

January's previous sms = MaxAWS.

Then monthly actual evapotranspiration (AET) is calculated as:

AETi = smsi + precipi if smsi+1 ≤ 0; or AETi = PETi if smsi+1 > 0.

Then annual AET is the sum of monthly AET, and annual PET is the sum of monthly PET; and Seasonal Water Deficit = PET - AET.

This value is then stored in clPlot.

This class's namestring is "SeasonalWaterDeficit". The parameter file call string is "SeasonalWaterDeficit".

Copyright 2014 Charles D. Canham.

Author
Lora E. Murphy


Edit history:
--------------—
January 22, 2014 - Created (LEM)

Constructor & Destructor Documentation

◆ clSeasonalWaterDeficit()

clSeasonalWaterDeficit::clSeasonalWaterDeficit ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerSim Manager object.

◆ ~clSeasonalWaterDeficit()

clSeasonalWaterDeficit::~clSeasonalWaterDeficit ( )

Destructor.

Member Function Documentation

◆ Action()

void clSeasonalWaterDeficit::Action ( )
virtual

Updates the plot seasonal water deficit.

Reimplemented from clBehaviorBase.

◆ GetData()

void clSeasonalWaterDeficit::GetData ( xercesc::DOMDocument *  p_oDoc)
virtual

Reads in values from the parameter file.

Parameters
p_oDocDOM tree of parsed input file.
Exceptions
modelErrif proportion of rain values don't add up to 1.

Implements clWorkerBase.

Member Data Documentation

◆ m_fAWS

double clSeasonalWaterDeficit::m_fAWS
protected

Available water storage.

◆ mp_fMonthlyAET

double* clSeasonalWaterDeficit::mp_fMonthlyAET
protected

Monthly AET.

Calculated each timestep. Array length is 12.

◆ mp_fMonthlyPET

double* clSeasonalWaterDeficit::mp_fMonthlyPET
protected

Monthly PET.

Calculated each timestep. Array length is 12.

◆ mp_fMonthlyPrecip

double* clSeasonalWaterDeficit::mp_fMonthlyPrecip
protected

Monthly precip.

Calculated each timestep. Array length is 12.

◆ mp_fMonthlySMS

double* clSeasonalWaterDeficit::mp_fMonthlySMS
protected

Monthly soil moisture.

Calculated each timestep. Array length is 12.

◆ mp_fMonthlyTemp

double* clSeasonalWaterDeficit::mp_fMonthlyTemp
protected

Monthly temperature.

Calculated each timestep. Array length is 12.

◆ mp_fPropRainfall

double* clSeasonalWaterDeficit::mp_fPropRainfall
protected

Proportion of rain that falls in each month.

Array length is 12.

◆ mp_fRadiation

double* clSeasonalWaterDeficit::mp_fRadiation
protected

Radiation for each month, cal/cm2.

Array length is 12.

◆ mp_fRatioMonthlyAnnualTemp

double* clSeasonalWaterDeficit::mp_fRatioMonthlyAnnualTemp
protected

Ratio of monthly temp to annual.

Array length is 12.


The documentation for this class was generated from the following file: