Commit 3c8adb33 authored by Ronan Trépos's avatar Ronan Trépos
Browse files

sunflo: add activate_WaterStress option

if false, there is no water stress, and FTSW = 1.0
parent 313e81ed
......@@ -1149,6 +1149,9 @@
<port name="Hini_C1">
<double>1</double>
</port>
<port name="activate_WaterStress">
<boolean>1</boolean>
</port>
</condition>
<condition name="CONFIG_Variete">
<port name="IRg">
......@@ -1613,7 +1616,9 @@
<attachedview name="viewDbg"/>
</port>
<port name="FTSW"/>
<port name="FTSW">
<attachedview name="viewDbg"/>
</port>
<port name="STOCKC1"/>
......@@ -1714,7 +1719,9 @@
</observable>
<observable name="lecture_climat">
<port name="Pluie"/>
<port name="Pluie">
<attachedview name="viewDbg"/>
</port>
<port name="Tmin"/>
......
......@@ -610,22 +610,14 @@ public :
// FTSW, EQ17 de la publi
{
double FTSW_tmp = 0.0;
if ( ( PhasePhenoPlante() <= PHASEPHENOPLANTE_NONSEMEE )
|| ( PhasePhenoPlante() >= PHASEPHENOPLANTE_RECOLTEE ) ){
// traduit condition t < jsemis or t > jrecolte
FTSW_tmp = 0.0;
FTSW = 0.0;
} else if (ps.activate_WaterStress){
FTSW = std::min(1.1, ATSW() / TTSW());
} else {
FTSW_tmp = ATSW() / TTSW();
if ( FTSW_tmp > 1.1 ){
FTSW_tmp = 1.1;
}
FTSW = 1;
}
FTSW = FTSW_tmp;
}
// FHLE, FHRUE, FHTR, EQ19 de la publi
......
......@@ -85,6 +85,10 @@ struct ParametresSol
// RUmmC2 = (Hcc_C2-Hpf_C2)/100 * da_C2 * (1-TC)
double RUmmC2;
// if false water stress is de-activated (ie FTSW is 1).
// default : true
bool activate_WaterStress;
void initialiser( const vle::devs::InitEventList& events ){
......@@ -145,6 +149,11 @@ struct ParametresSol
} else {
RUmmC2 = (Hcc_C2 - Hpf_C2 ) / 100.0 * da_C2 * ( 1.0 - TC );
}
if (events.exist("activate_WaterStress")) {
activate_WaterStress = events.getBoolean("activate_WaterStress");
} else {
activate_WaterStress = true;
}
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment