Skip to content

Commit 4b50837

Browse files
committed
Fixed bug when reading initial conditions from parameters (set defaults rather than read into output concentrations)
Updated BF::RC::KBs & BF::RC::KBl values & code to actually use them to match Zhu 2012. The constants were not used and had different values defined, the original values are still in the parameter file, but commented out Added option for running with Zhu 2012 parameters Set initial values for calculated variables in parameter files to allow for comparison Fix some typos identified in initCalc methods Use BF::RC::KBl in FIBF
1 parent ec97e4b commit 4b50837

37 files changed

+1697
-1540
lines changed

include/ValueSet.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3108,7 +3108,7 @@ namespace ePhotosynthesis {
31083108
EVAL(FOR_EACH_GENERIC(MOD2PT_PAIRS_DEFERED, \
31093109
CALL_WITH_SUFFIX_ARGS_DEFER, \
31103110
SEP_COMMA, (MOD2PT_COND), \
3111-
EXPAND VARS_INST_MODULES)), \
3111+
EXPAND VARS_INST_MODULES, FIBF)), \
31123112
EVAL(FOR_EACH_GENERIC(MOD2PT_PAIRS_DEFERED, \
31133113
CALL_WITH_SUFFIX_ARGS_DEFER, \
31143114
SEP_COMMA, (MOD2PT_NO_COND), \

include/Variables.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
711711
Variables::getVarCalculated or Variables::getCalculatedVars
712712
methods.
713713
*/
714-
EPHOTO_API const std::vector<std::string>&
714+
EPHOTO_API std::vector<std::string>
715715
getCalculatedVarNames() const;
716716
/**
717717
Populate a map with calculated variables.
@@ -837,16 +837,20 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
837837
static void _readParam(const std::string& fname,
838838
std::map<std::string, std::string>& inputs,
839839
Variables* theVars = nullptr,
840+
const bool init = false,
840841
const std::string& context="_readParam");
841842
public:
842843
/**
843844
Update the default parameters from a map.
844845
\param[in, out] inputs Map of parameters that should be added.
845846
\param[in] theVars Variable instance that should be updated.
847+
\param[in] init If true, condition parameters will be used to set
848+
defaults.
846849
\param[in] context String providing context for errors.
847850
*/
848851
EPHOTO_API static void updateParam(std::map<std::string, std::string>& inputs,
849852
Variables* theVars = nullptr,
853+
const bool init = false,
850854
const std::string& context="updateParam");
851855

852856
/**
@@ -865,16 +869,22 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
865869
/**
866870
Read parameters from a file.
867871
\param[in] fname File to read.
872+
\param[in] init If true, condition parameters will be used to set
873+
defaults.
868874
*/
869-
EPHOTO_API void readParam(const std::string& fname);
875+
EPHOTO_API void readParam(const std::string& fname,
876+
const bool init = false);
870877
/**
871878
Read parameters from a file, checking for duplicates
872879
\param[in] fname File to read.
873880
\param[in, out] inputs Map that read variables should be checked
874881
against for duplicates and copied into.
882+
\param[in] init If true, condition parameters will be used to set
883+
defaults.
875884
*/
876885
EPHOTO_API void readParam(const std::string& fname,
877-
std::map<std::string, std::string>& inputs);
886+
std::map<std::string, std::string>& inputs,
887+
const bool init = false);
878888
/**
879889
Read Enzyme activities from a file.
880890
\param[in] File to read.

include/enums/enums_helpers.hpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,7 @@ namespace ePhotosynthesis {
16391639
NONE , \
16401640
RC0 , \
16411641
RC , \
1642+
kdm0 , \
16421643
MAX
16431644
#ifdef EPHOTO_USE_SCOPED_ENUM
16441645
enum class ENUM_FIBF_RC : int {
@@ -1946,19 +1947,20 @@ namespace ePhotosynthesis {
19461947
}
19471948
namespace ePhotosynthesis {
19481949
#define MEMBERS_RuACTRC \
1949-
NONE , \
1950-
k1 , \
1951-
kn1 , \
1952-
km1 , \
1953-
Ke2 , \
1954-
Ke3 , \
1955-
k6 , \
1956-
kc , \
1957-
ko , \
1958-
k7 , \
1959-
kr , \
1960-
kn7 , \
1961-
RCA , \
1950+
NONE , \
1951+
k1 , \
1952+
kn1 , \
1953+
km1 , \
1954+
Ke2 , \
1955+
Ke3 , \
1956+
k6 , \
1957+
kc , \
1958+
ko , \
1959+
k7 , \
1960+
kr , \
1961+
factor_n7 , \
1962+
kn7 , \
1963+
RCA , \
19621964
MAX
19631965
#ifdef EPHOTO_USE_SCOPED_ENUM
19641966
enum class ENUM_RuACT_RC : int {

param/BF_RC.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ Kau 1.0e10 # The rate constant for exciton transfer from perpheral antenna to
1818
Kua 1.0e10 # The rate constant for exciton transfer from core antenna to peripheral antenna, SEE FI Unit: s-1
1919
Kf 6.3e6 # The rate constant for fluorescence emission, see the note in FI Unit: s-1
2020
Kd 2.0e8 # The rate constant for heat dissipation; see the note for FI Unit: s-1
21-
KE8 0.0 # [CALC] ISPHr + cytc1 --> ISPHox + cytc1-; Calculated from Em_IPS, Em_Cytf & Em_PG; Unit: s-1
22-
KE9 0.0 # [CALC] cytc1- + cytc2 --> cytc1 + cytc2-; Calculated from Em_IPS, Em_Cytf & Em_PG; Unit: s-1
21+
KE8 0.21 # [CALC] ISPHr + cytc1 --> ISPHox + cytc1-; Calculated from Em_IPS, Em_Cytf & Em_PG; Unit: s-1
22+
KE9 22.55 # [CALC] cytc1- + cytc2 --> cytc1 + cytc2-; Calculated from Em_IPS, Em_Cytf & Em_PG; Unit: s-1
2323
K15 1.0e10 # The rate constant for primary charge separation in PSI Unit: s-1
2424
K16 1.0e5 # The rate constant for electron tranfer from electron acceptor of PSI to Fd Unit: s-1
2525
Em_IPS 0.31 # [CONST] ISPHr + cytc1 --> ISPHox + cytc1-
2626
Em_Cytf 0.27 # [CONST] ISPHr + cytc1 --> ISPHox + cytc1-
2727
Em_PG 0.35 # [CONST] cytc1- + cytc2 --> cytc1 + cytc2-
2828
MemCap 0.6e-6 # The membrane capacity
2929
RVA 8.0e-10 # The ratio of lumen volume to thylakoid membrane area
30-
KBs 1.1e-8 # The buffer equilibrium constant in stroma
31-
KBl 5.1e-6 # The buffer equilibrium constant in lumen
30+
KBs 0.015 # The buffer equilibrium constant in stroma; mol l-1 (pH unit)-1
31+
KBl 0.015 # The buffer equilibrium constant in lumen; mol l-1 (pH unit)-1
32+
# KBs 1.1e-8 # The buffer equilibrium constant in stroma (this is the value that was stated, but the variable was never used and a hard coded value was used instead)
33+
# KBl 5.1e-6 # The buffer equilibrium constant in lumen
3234
KM1ATP 0.12 # The michaelis menton constant for ATP for ATP synthesis
3335
KM1ADP 0.014 # The michaelis menton constant for ATP for ADP synthesis
3436
KM1PI 0.3 # The michaelis menton constant for ATP for PI synthesis

param/FIBF_RC.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Name Value C3Value Docs
22
RC0 0.1 # Maximal relaxation constant for changes in the ‘rate constant’ of heat dissipation, which is one term borrowed from Laisk et al., 1997;
33
RC 0.1 # Maximal relaxation constant for changes in ‘rate constant’ of heat dissipation under a particular Xstate,Laisk et al. (1997)
4+
kdm0 5.0e8 # Maximum heat dissipation ‘rate constant’

param/RuACT_COND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
ER 0.20 # The concentration of inactive ER
33
Eaf 0.20 # The total concentration of E, EC, AND ECM
44
ECMR 0.8 # The concentration of ECMR
5-
RuBP 2.0 # The concentration of ECMR
5+
RuBP 2.0 # The concentration of RuBP

param/RuACT_RC.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ kc 0.016 # Michaelis menton constant for CO2
99
ko 0.448 # Michaelis menton constant for O2
1010
k7 10.0 # The rate constant for ecm to ecmr
1111
kr 20.0e-3 # The apparaent michaelis menton constant for RuBP
12-
kn7 1.0 # Rate constants for RuBP dissociation from ECMR
12+
factor_n7 1.0 # Scale factor for kn7
13+
kn7 0.5 # Rate constant for RuBP dissociation from ECMR
1314
RCA 0.0000768403258029814 # 1 / (60. * 216.9); The rate constant of the activation reaction which will be scaled by the concentration of Rubisco activase

param/SUCS_MOD.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Km602 0.0 1.66 # Nucleoside Diphosphate Kinase 2.7.4.6 60 NI Km602 ATP 1.66 R
5555
Km603 0.0 0.28 # Nucleoside Diphosphate Kinase 2.7.4.6 60 NI Km603 UDP 0.28 Saccharomyces cerevisiae {Jong, 1991 #2518}; Skipped w/o C3
5656
Km604 0.0 16. # Nucleoside Diphosphate Kinase 2.7.4.6 60 NI Km604 UTP 16 Rattus norvegicus {Fukuchi, 1994 #2519}; Skipped w/o C3
5757
KE60 0.0 16. # Nucleoside Diphosphate Kinase 2.7.4.6 60 NI KE60 16 1.04 {Lynn, 1978 #2520}; Skipped w/o C3
58+
# The version below seems to have been a typo where 10**7 was interpreted as 107
59+
# KE61 1.2e7 1.2e7 # Pyrophosphate hydrolysis KE61 1.2*107 {Flodgaard, 1974 #2521}; SUCSRatio 58
5860
KE61 128.4 128.4 # Pyrophosphate hydrolysis KE61 1.2*107 {Flodgaard, 1974 #2521}; SUCSRatio 58
5961
Km621 5.0 5.0 # Vsink Notice: pH dependent Km621 Sucrose 5 {Weschke, 2000 #2522}
6062
ATPc 0.4 0.35
@@ -79,7 +81,7 @@ SUCSV58 0.0 0.0 # Set by calculation for C3
7981
# Variables only set during calculations
8082
SUCS2PS_Pic 0.0 0.0 # [INIT_ONCE]
8183
KE5Ratio 0.0 0.0 # Calculated from KE541 & KE531
82-
ADPc 0.0 0.0 # Calculated from ATc & ATPc
84+
ADPc 0.6 0.65 # Calculated from ATc & ATPc
8385
Vmatpf 0.25 0.25 # [CONST] Previously stored as constant
8486
Q10_51 2.0 # [CONST] DHAP+GAP --FBP; unused w/o C3
8587
Q10_52 1.6 # [CONST] FBP --F6P + Pi; unused w/o C3

0 commit comments

Comments
 (0)