1.3.82
 
Loading...
Searching...
No Matches
PhotosynthesisModel Class Reference

Public Member Functions

 PhotosynthesisModel (helios::Context *a_context)
 Default constructor.
 
void setModelType_Empirical ()
 Sets photosynthesis to be calculated according to the empirical model.
 
void setModelType_Farquhar ()
 Sets photosynthesis to be calculated according to the Farquhar-von Caemmerer-Berry model.
 
void setModelType_C4 ()
 Sets photosynthesis to be calculated according to the von Caemmerer (2021) steady-state C4 model.
 
void setModelCoefficients (const EmpiricalModelCoefficients &modelcoefficients)
 Set the empirical model coefficients for all primitives.
 
void setModelCoefficients (const EmpiricalModelCoefficients &modelcoefficients, const std::vector< uint > &UUIDs)
 Set the empirical model coefficients for a subset of primitives based on their UUIDs.
 
void setModelCoefficients (const FarquharModelCoefficients &modelcoefficients)
 Set the Farquhar-von Caemmerer-Berry model coefficients for all primitives.
 
void setModelCoefficients (const FarquharModelCoefficients &modelcoefficients, const std::vector< uint > &UUIDs)
 Set the Farquhar-von Caemmerer-Berry model coefficients for a subset of primitives based on their UUIDs.
 
void setModelCoefficients (const std::vector< FarquharModelCoefficients > &modelcoefficients, const std::vector< uint > &UUIDs)
 Set the Farquhar-von Caemmerer-Berry model coefficients for a subset of primitives, where coefficients differ between primitives.
 
void setFarquharCoefficientsFromLibrary (const std::string &species)
 Set the Farquhar-von Caemmerer-Berry model coefficients for all primitives based on a species from the library.
 
void setFarquharCoefficientsFromLibrary (const std::string &species, const std::vector< uint > &UUIDs)
 Set the Farquhar-von Caemmerer-Berry model coefficients for a subset of primitives based on a species from the library.
 
FarquharModelCoefficients getFarquharCoefficientsFromLibrary (const std::string &species)
 Get Farquhar-von Caemmerer-Berry model coefficients for a species from the library.
 
void setModelCoefficients (const std::string &material_label, const EmpiricalModelCoefficients &coeffs)
 Set empirical model coefficients for a material by label.
 
void setModelCoefficients (const std::string &material_label, const FarquharModelCoefficients &coeffs)
 Set Farquhar model coefficients for a material by label.
 
void setFarquharCoefficientsFromLibrary (const std::string &species, const std::string &material_label)
 Set Farquhar model coefficients from species library for a material.
 
void setModelCoefficients (const C4ModelCoefficients &modelcoefficients)
 Set the von Caemmerer (2021) C4 model coefficients for all primitives.
 
void setModelCoefficients (const C4ModelCoefficients &modelcoefficients, const std::vector< uint > &UUIDs)
 Set the von Caemmerer (2021) C4 model coefficients for a subset of primitives based on their UUIDs.
 
void setModelCoefficients (const std::string &material_label, const C4ModelCoefficients &coeffs)
 Set C4 model coefficients for a material by label.
 
void setC4CoefficientsFromLibrary (const std::string &species)
 Set the von Caemmerer (2021) C4 model coefficients for all primitives based on a species from the C4 library.
 
void setC4CoefficientsFromLibrary (const std::string &species, const std::vector< uint > &UUIDs)
 Set the von Caemmerer (2021) C4 model coefficients for a subset of primitives based on a species from the C4 library.
 
void setC4CoefficientsFromLibrary (const std::string &species, const std::string &material_label)
 Set the von Caemmerer (2021) C4 model coefficients from the species library for a material.
 
C4ModelCoefficients getC4CoefficientsFromLibrary (const std::string &species)
 Get von Caemmerer (2021) C4 model coefficients for a species from the C4 library.
 
void run ()
 Run the model for all UUIDs in the Context.
 
void run (const std::vector< uint > &lUUIDs)
 Run the model for a select sub-set of UUIDs.
 
EmpiricalModelCoefficients getEmpiricalModelCoefficients (uint UUID)
 Get the current model coefficients for the empirical model.
 
FarquharModelCoefficients getFarquharModelCoefficients (uint UUID)
 Get the current model coefficients for the Farquhar-von Caemmerer-Berry model.
 
C4ModelCoefficients getC4ModelCoefficients (uint UUID)
 Get the current model coefficients for the von Caemmerer (2021) C4 model.
 
void disableMessages ()
 Disable output messages to the standard output.
 
void enableMessages ()
 Enable output messages to the standard output.
 
void optionalOutputPrimitiveData (const char *label)
 Add optional output primitive data values to the Context.
 
void setCi (float Ci, const std::vector< uint > &UUIDs)
 Manually set the intercellular CO2 concentration (Ci) for specified primitives, bypassing iterative calculation.
 
void setCm (float Cm, const std::vector< uint > &UUIDs)
 Manually set the mesophyll cytosolic CO2 partial pressure (Cm) for specified primitives (C4 model only)
 
void printDefaultValueReport () const
 Print a report detailing usage of default input values for all primitives in the Context.
 
void printDefaultValueReport (const std::vector< uint > &UUIDs) const
 Print a report detailing usage of default input values based on a subset of primitive UUIDs.
 

Static Public Member Functions

static int selfTest (int argc=0, char **argv=nullptr)
 

Detailed Description

Definition at line 722 of file PhotosynthesisModel.h.

Constructor & Destructor Documentation

◆ PhotosynthesisModel()

PhotosynthesisModel::PhotosynthesisModel ( helios::Context a_context)
explicit

Default constructor.

Parameters
[in]a_contextPointer to the helios context

Definition at line 116 of file PhotosynthesisModel.cpp.

Member Function Documentation

◆ disableMessages()

void PhotosynthesisModel::disableMessages ( )

Disable output messages to the standard output.

Definition at line 1677 of file PhotosynthesisModel.cpp.

◆ enableMessages()

void PhotosynthesisModel::enableMessages ( )

Enable output messages to the standard output.

Definition at line 1681 of file PhotosynthesisModel.cpp.

◆ getC4CoefficientsFromLibrary()

C4ModelCoefficients PhotosynthesisModel::getC4CoefficientsFromLibrary ( const std::string &  species)

Get von Caemmerer (2021) C4 model coefficients for a species from the C4 library.

Parameters
[in]speciesName of species from the C4 library.
Returns
C4 model coefficients for the species (fully populated — including complementary Kc/Ko/Kp and scalar parameters that were held fixed in the source study).
Note
Unknown species raises helios_runtime_error.

Definition at line 579 of file PhotosynthesisModel.cpp.

◆ getC4ModelCoefficients()

C4ModelCoefficients PhotosynthesisModel::getC4ModelCoefficients ( uint  UUID)

Get the current model coefficients for the von Caemmerer (2021) C4 model.

Parameters
[in]UUIDUniversal unique identifier for the primitive
Returns
C4 model coefficients for the primitive

Definition at line 193 of file PhotosynthesisModel.cpp.

◆ getEmpiricalModelCoefficients()

EmpiricalModelCoefficients PhotosynthesisModel::getEmpiricalModelCoefficients ( uint  UUID)

Get the current model coefficients for the empirical model.

Parameters
[in]UUIDUniversal unique identifier for the primitive
Returns
Empirical model coefficients for the primitive

Definition at line 1669 of file PhotosynthesisModel.cpp.

◆ getFarquharCoefficientsFromLibrary()

FarquharModelCoefficients PhotosynthesisModel::getFarquharCoefficientsFromLibrary ( const std::string &  species)

Get Farquhar-von Caemmerer-Berry model coefficients for a species from the library.

Parameters
[in]speciesName of species from the library.
Returns
Farquhar-von Caemmerer-Berry model coefficients for the species.

Definition at line 428 of file PhotosynthesisModel.cpp.

◆ getFarquharModelCoefficients()

FarquharModelCoefficients PhotosynthesisModel::getFarquharModelCoefficients ( uint  UUID)

Get the current model coefficients for the Farquhar-von Caemmerer-Berry model.

Parameters
[in]UUIDUniversal unique identifier for the primitive
Returns
Farquhar-von Caemmerer-Berry model coefficients for the primitive

Definition at line 1673 of file PhotosynthesisModel.cpp.

◆ optionalOutputPrimitiveData()

void PhotosynthesisModel::optionalOutputPrimitiveData ( const char *  label)

Add optional output primitive data values to the Context.

Parameters
[in]labelName of primitive data. Available labels for the Farquhar model: "Ci" (intercellular CO2), "limitation_state" (0=Rubisco-limited, 1=electron transport-limited), "Gamma_CO2" (CO2 compensation point), "electron_transport_ratio" (J/Jmax ratio, useful for fluorescence calculations). Additional labels for the C4 model: "Ci", "limitation_state" (1=enzyme-limited, 2=electron-transport-limited), "Cm" (mesophyll cytosolic CO2), "Vp" (PEP carboxylation rate).

Definition at line 1685 of file PhotosynthesisModel.cpp.

◆ printDefaultValueReport() [1/2]

void PhotosynthesisModel::printDefaultValueReport ( ) const

Print a report detailing usage of default input values for all primitives in the Context.

Definition at line 1700 of file PhotosynthesisModel.cpp.

◆ printDefaultValueReport() [2/2]

void PhotosynthesisModel::printDefaultValueReport ( const std::vector< uint > &  UUIDs) const

Print a report detailing usage of default input values based on a subset of primitive UUIDs.

Parameters
[in]UUIDsUniversal unique identifiers for report

Definition at line 1704 of file PhotosynthesisModel.cpp.

◆ run() [1/2]

void PhotosynthesisModel::run ( )

Run the model for all UUIDs in the Context.

Definition at line 910 of file PhotosynthesisModel.cpp.

◆ run() [2/2]

void PhotosynthesisModel::run ( const std::vector< uint > &  lUUIDs)

Run the model for a select sub-set of UUIDs.

Parameters
[in]lUUIDsUniversal unique identifiers for primitives to run the model on.

Definition at line 914 of file PhotosynthesisModel.cpp.

◆ selfTest()

int PhotosynthesisModel::selfTest ( int  argc = 0,
char **  argv = nullptr 
)
static

Definition at line 2204 of file selfTest.cpp.

◆ setC4CoefficientsFromLibrary() [1/3]

void PhotosynthesisModel::setC4CoefficientsFromLibrary ( const std::string &  species)

Set the von Caemmerer (2021) C4 model coefficients for all primitives based on a species from the C4 library.

Parameters
[in]speciesName of species from the C4 library (e.g. "SetariaViridis_vC2021", "GenericC4_vC2000", "Maize_Massad2007").
Note
Unknown species raises helios_runtime_error — lookup is case-insensitive but otherwise exact.

Definition at line 564 of file PhotosynthesisModel.cpp.

◆ setC4CoefficientsFromLibrary() [2/3]

void PhotosynthesisModel::setC4CoefficientsFromLibrary ( const std::string &  species,
const std::string &  material_label 
)

Set the von Caemmerer (2021) C4 model coefficients from the species library for a material.

Parameters
[in]speciesName of species from the C4 library.
[in]material_labelString identifier for the material.
Note
Unknown species raises helios_runtime_error, consistent with the other C4 library overloads.

Definition at line 574 of file PhotosynthesisModel.cpp.

◆ setC4CoefficientsFromLibrary() [3/3]

void PhotosynthesisModel::setC4CoefficientsFromLibrary ( const std::string &  species,
const std::vector< uint > &  UUIDs 
)

Set the von Caemmerer (2021) C4 model coefficients for a subset of primitives based on a species from the C4 library.

Parameters
[in]speciesName of species from the C4 library.
[in]UUIDsVector of universal unique identifiers for primitives to be set.

Definition at line 569 of file PhotosynthesisModel.cpp.

◆ setCi()

void PhotosynthesisModel::setCi ( float  Ci,
const std::vector< uint > &  UUIDs 
)

Manually set the intercellular CO2 concentration (Ci) for specified primitives, bypassing iterative calculation.

Parameters
[in]CiIntercellular CO2 concentration in units of umol CO2/mol air
[in]UUIDsUniversal unique identifiers for primitives to set manual Ci
Note
This method is primarily intended for testing and validation purposes. For normal operation, Ci should be calculated from moisture_conductance.
Manual Ci values will persist across multiple run() calls until overwritten with another setCi() call.
Ci must be positive and should typically be between 50-800 umol/mol for C3 plants (typical range 0.3-0.9 times ambient CO2).

Definition at line 886 of file PhotosynthesisModel.cpp.

◆ setCm()

void PhotosynthesisModel::setCm ( float  Cm,
const std::vector< uint > &  UUIDs 
)

Manually set the mesophyll cytosolic CO2 partial pressure (Cm) for specified primitives (C4 model only)

Parameters
[in]CmMesophyll cytosolic CO2 partial pressure in units of ubar (equivalent to umol CO2/mol at 1 atm total pressure)
[in]UUIDsUniversal unique identifiers for primitives to set manual Cm
Note
Only applies to the C4 model. When set, the C4 solver uses the supplied Cm directly and skips the Cm = Ci - A/gm fixed-point iteration; the stomatal balance on Ci is also bypassed (Ci = Cm + A/gm is back-computed).
This method is primarily intended for testing and validation against published reference data (e.g., the von Caemmerer 2021 spreadsheet sweeps Cm directly).

Definition at line 871 of file PhotosynthesisModel.cpp.

◆ setFarquharCoefficientsFromLibrary() [1/3]

void PhotosynthesisModel::setFarquharCoefficientsFromLibrary ( const std::string &  species)

Set the Farquhar-von Caemmerer-Berry model coefficients for all primitives based on a species from the library.

Parameters
[in]speciesName of species from the library.

Definition at line 322 of file PhotosynthesisModel.cpp.

◆ setFarquharCoefficientsFromLibrary() [2/3]

void PhotosynthesisModel::setFarquharCoefficientsFromLibrary ( const std::string &  species,
const std::string &  material_label 
)

Set Farquhar model coefficients from species library for a material.

Parameters
[in]speciesName of species
[in]material_labelString identifier for the material

Definition at line 423 of file PhotosynthesisModel.cpp.

◆ setFarquharCoefficientsFromLibrary() [3/3]

void PhotosynthesisModel::setFarquharCoefficientsFromLibrary ( const std::string &  species,
const std::vector< uint > &  UUIDs 
)

Set the Farquhar-von Caemmerer-Berry model coefficients for a subset of primitives based on a species from the library.

Parameters
[in]speciesName of species from the library.
[in]UUIDsVector of universal unique identifiers for primitives to be set.

Definition at line 330 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [1/10]

void PhotosynthesisModel::setModelCoefficients ( const C4ModelCoefficients modelcoefficients)

Set the von Caemmerer (2021) C4 model coefficients for all primitives.

Parameters
[in]modelcoefficientsSet of C4 model coefficients, which will be applied to all primitives.
Note
The model type will be set based on the most recent call to setModelCoefficients().

Definition at line 180 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [2/10]

void PhotosynthesisModel::setModelCoefficients ( const C4ModelCoefficients modelcoefficients,
const std::vector< uint > &  UUIDs 
)

Set the von Caemmerer (2021) C4 model coefficients for a subset of primitives based on their UUIDs.

Parameters
[in]modelcoefficientsSet of C4 model coefficients.
[in]UUIDsUniversal unique identifiers for primitives to be set.
Note
The model type will be set based on the most recent call to setModelCoefficients().

Definition at line 186 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [3/10]

void PhotosynthesisModel::setModelCoefficients ( const EmpiricalModelCoefficients modelcoefficients)

Set the empirical model coefficients for all primitives.

Parameters
[in]modelcoefficientsSet of model coefficients, which will be applied to all primitives.
Note
The model type will be set based on the most recent call to setModelCoefficients().

Definition at line 143 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [4/10]

void PhotosynthesisModel::setModelCoefficients ( const EmpiricalModelCoefficients modelcoefficients,
const std::vector< uint > &  UUIDs 
)

Set the empirical model coefficients for a subset of primitives based on their UUIDs.

Parameters
[in]modelcoefficientsSet of model coefficients.
[in]UUIDsUniversal unique identifiers for primitives to be set.
Note
The model type will be set based on the most recent call to setModelCoefficients().

Definition at line 149 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [5/10]

void PhotosynthesisModel::setModelCoefficients ( const FarquharModelCoefficients modelcoefficients)

Set the Farquhar-von Caemmerer-Berry model coefficients for all primitives.

Parameters
[in]modelcoefficientsSet of model coefficients, which will be applied to all primitives.
Note
The model type will be set based on the most recent call to setModelCoefficients().

Definition at line 156 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [6/10]

void PhotosynthesisModel::setModelCoefficients ( const FarquharModelCoefficients modelcoefficients,
const std::vector< uint > &  UUIDs 
)

Set the Farquhar-von Caemmerer-Berry model coefficients for a subset of primitives based on their UUIDs.

Parameters
[in]modelcoefficientsSet of model coefficients.
[in]UUIDsUniversal unique identifiers for primitives to be set.
Note
The model type will be set based on the most recent call to setModelCoefficients().

Definition at line 162 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [7/10]

void PhotosynthesisModel::setModelCoefficients ( const std::string &  material_label,
const C4ModelCoefficients coeffs 
)

Set C4 model coefficients for a material by label.

Parameters
[in]material_labelString identifier for the material
[in]coeffsC4 model coefficient values
Note
All primitives with this material at run() time will use these coefficients (cached after first lookup).

Definition at line 197 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [8/10]

void PhotosynthesisModel::setModelCoefficients ( const std::string &  material_label,
const EmpiricalModelCoefficients coeffs 
)

Set empirical model coefficients for a material by label.

Parameters
[in]material_labelString identifier for the material
[in]coeffsModel coefficient values

Definition at line 341 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [9/10]

void PhotosynthesisModel::setModelCoefficients ( const std::string &  material_label,
const FarquharModelCoefficients coeffs 
)

Set Farquhar model coefficients for a material by label.

Parameters
[in]material_labelString identifier for the material
[in]coeffsModel coefficient values

Definition at line 360 of file PhotosynthesisModel.cpp.

◆ setModelCoefficients() [10/10]

void PhotosynthesisModel::setModelCoefficients ( const std::vector< FarquharModelCoefficients > &  modelcoefficients,
const std::vector< uint > &  UUIDs 
)

Set the Farquhar-von Caemmerer-Berry model coefficients for a subset of primitives, where coefficients differ between primitives.

Parameters
[in]modelcoefficientsFarquhar-von Caemmerer-Berry model coefficients for each primitive.
[in]UUIDsVector of universal unique identifiers for primitives to be set.
Note
The size of modelcoefficients and UUIDs must be equal.

Definition at line 169 of file PhotosynthesisModel.cpp.

◆ setModelType_C4()

void PhotosynthesisModel::setModelType_C4 ( )

Sets photosynthesis to be calculated according to the von Caemmerer (2021) steady-state C4 model.

Definition at line 138 of file PhotosynthesisModel.cpp.

◆ setModelType_Empirical()

void PhotosynthesisModel::setModelType_Empirical ( )

Sets photosynthesis to be calculated according to the empirical model.

Definition at line 130 of file PhotosynthesisModel.cpp.

◆ setModelType_Farquhar()

void PhotosynthesisModel::setModelType_Farquhar ( )

Sets photosynthesis to be calculated according to the Farquhar-von Caemmerer-Berry model.

Definition at line 134 of file PhotosynthesisModel.cpp.


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