7#ifndef SEIMS_PLANTGROWTH_COMMON_H
8#define SEIMS_PLANTGROWTH_COMMON_H
22#define MAX_CROP_LAND_USE_ID 97
23#define BARE_SOIL_LAND_USE 98
24#define WATER_LAND_USE_ID 18
39 FLTPT* shape1, FLTPT* shape2);
53FLTPT
GetNPFraction(FLTPT fr1, FLTPT fr3, FLTPT shape1, FLTPT shape2, FLTPT fr_phu);
77inline bool IsTree(
const int classification) {
return classification == 7; }
83inline bool IsAnnual(
const int classification) {
84 return classification == CROP_IDC_WARM_SEASON_ANNUAL_LEGUME ||
85 classification == CROP_IDC_COLD_SEASON_ANNUAL_LEGUME ||
86 classification == CROP_IDC_WARM_SEASON_ANNUAL ||
87 classification == CROP_IDC_COLD_SEASON_ANNUAL;
93inline bool IsLegume(
const int classification) {
94 return classification <= CROP_IDC_PERENNIAL_LEGUME;
102 return classification == CROP_IDC_PERENNIAL_LEGUME ||
103 classification == CROP_IDC_PERENNIAL;
110 return classification == CROP_IDC_COLD_SEASON_ANNUAL_LEGUME ||
111 classification == CROP_IDC_COLD_SEASON_ANNUAL;
117inline bool IsGrain(
const int classification) {
118 return classification == CROP_IDC_WARM_SEASON_ANNUAL;
125 return lu_id <= MAX_CROP_LAND_USE_ID && lu_id != WATER_LAND_USE_ID;
BMP related const strings.
bool IsGrain(const int classification)
Is grain or not.
Definition: PlantGrowthCommon.h:117
bool IsCoolSeasonAnnual(const int classification)
Is cool seanon annual plant or not.
Definition: PlantGrowthCommon.h:109
FLTPT GetNPFraction(FLTPT fr1, FLTPT fr3, FLTPT shape1, FLTPT shape2, FLTPT fr_phu)
calculate the fraction of nitrogen/phosphorus in the plant biomass
FLTPT GetNormalization(FLTPT distribution)
Normalization.
FLTPT DoHeatUnitAccumulation(FLTPT potential_heat_unit, FLTPT t_min, FLTPT t_max, FLTPT t_base)
Heat unit accumulation.
bool IsAnnual(const int classification)
Is annual plant or not.
Definition: PlantGrowthCommon.h:83
bool IsTree(const int classification)
Is tree or not.
Definition: PlantGrowthCommon.h:77
bool IsPerennial(const int classification)
Is perennial plant or not.
Definition: PlantGrowthCommon.h:101
void GetScurveShapeParameter(FLTPT x_mid, FLTPT x_end, FLTPT y_mid, FLTPT y_end, FLTPT *shape1, FLTPT *shape2)
Computes shape parameters shape1 and shape2 for the S curve.
void CalPlantStressByLimitedNP(FLTPT u1, FLTPT u2, FLTPT *uu)
Calculates the plant stress factor caused by limited supply of nitrogen or phosphorus.
FLTPT NPBiomassFraction(FLTPT x1, FLTPT x2, FLTPT x3, FLTPT fr_phu)
Biomass fraction.
bool IsPlant(const int lu_id)
Is plant or not.
Definition: PlantGrowthCommon.h:124
void GetNPShapeParameter(FLTPT fr1, FLTPT fr2, FLTPT fr3, FLTPT *shape1, FLTPT *shape2)
Get N/P shape parameter, See readplant.f of SWAT.
bool IsLegume(const int classification)
Is legume or not.
Definition: PlantGrowthCommon.h:93
FLTPT RadiationUseEfficiencyAdjustByVPD(FLTPT vpd, FLTPT rad_use_eff_dec_rate_with_vpd)
the adjusted radiation-use efficiency by vapor pressure deficit
The SEIMS related definitions and utilities header.