Commit cdba0c0a authored by RemiM's avatar RemiM Committed by Ronan Trepos
Browse files

Compute indicators for HI and modify HI computations

parent af8adbce
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<port name="zSemis"/>&#xd; <port name="zSemis"/>&#xd;
</out>&#xd; </out>&#xd;
</model>&#xd; </model>&#xd;
<model width="100" height="255" x="286" y="64" name="sunflo_bio" type="coupled">&#xd; <model width="100" height="255" x="287" y="63" name="sunflo_bio" type="coupled">&#xd;
<in> <in>
<port name="ActionFerti"/> <port name="ActionFerti"/>
<port name="ActionIrrig"/> <port name="ActionIrrig"/>
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
<port name="NHT28_EF"/> <port name="NHT28_EF"/>
<port name="NHT28"/> <port name="NHT28"/>
<port name="SGR_FM"/> <port name="SGR_FM"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</out>&#xd; </out>&#xd;
</model>&#xd; </model>&#xd;
<model observables="phenologie" conditions="itk,cBegin,CONFIG_SimuInit,CONFIG_Variete,phenologie,EXPERT_Plante,CONFIG_Plante,EXPERT_SimuInit" width="100" dynamics="Phenologie" height="105" x="252" y="22" name="phenologie" type="atomic">&#xd; <model observables="phenologie" conditions="itk,cBegin,CONFIG_SimuInit,CONFIG_Variete,phenologie,EXPERT_Plante,CONFIG_Plante,EXPERT_SimuInit" width="100" dynamics="Phenologie" height="105" x="252" y="22" name="phenologie" type="atomic">&#xd;
...@@ -142,6 +145,9 @@ ...@@ -142,6 +145,9 @@
<port name="MET_MH"/> <port name="MET_MH"/>
<port name="NHT28"/> <port name="NHT28"/>
<port name="NHT28_EF"/> <port name="NHT28_EF"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</in>&#xd; </in>&#xd;
<out> <out>
<port name="IRs"/> <port name="IRs"/>
...@@ -177,6 +183,9 @@ ...@@ -177,6 +183,9 @@
<port name="TDM"/> <port name="TDM"/>
<port name="TRPF"/> <port name="TRPF"/>
<port name="TT_F1"/> <port name="TT_F1"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</in>&#xd; </in>&#xd;
<out> <out>
<port name="IRs"/> <port name="IRs"/>
...@@ -184,6 +193,9 @@ ...@@ -184,6 +193,9 @@
<port name="JSF"/> <port name="JSF"/>
<port name="JSM"/> <port name="JSM"/>
<port name="RDT"/> <port name="RDT"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</out>&#xd; </out>&#xd;
</model>&#xd; </model>&#xd;
</submodels>&#xd; </submodels>&#xd;
...@@ -252,6 +264,18 @@ ...@@ -252,6 +264,18 @@
<origin model="performances" port="NHT28_EF"/> <origin model="performances" port="NHT28_EF"/>
<destination model="elaboration_qualite" port="NHT28_EF"/> <destination model="elaboration_qualite" port="NHT28_EF"/>
</connection> </connection>
<connection type="input">
<origin model="performances" port="NET_EF"/>
<destination model="elaboration_rendement" port="NET_EF"/>
</connection>
<connection type="input">
<origin model="performances" port="NET_FM"/>
<destination model="elaboration_rendement" port="NET_FM"/>
</connection>
<connection type="input">
<origin model="performances" port="NET_MH"/>
<destination model="elaboration_rendement" port="NET_MH"/>
</connection>
</connections>&#xd; </connections>&#xd;
</model>&#xd; </model>&#xd;
<model width="100" height="330" x="372" y="577" name="contraintes" type="coupled">&#xd; <model width="100" height="330" x="372" y="577" name="contraintes" type="coupled">&#xd;
...@@ -927,6 +951,18 @@ ...@@ -927,6 +951,18 @@
<origin model="diagnostic" port="NHT28"/> <origin model="diagnostic" port="NHT28"/>
<destination model="performances" port="NHT28"/> <destination model="performances" port="NHT28"/>
</connection> </connection>
<connection type="internal">
<origin model="diagnostic" port="NET_EF"/>
<destination model="performances" port="NET_EF"/>
</connection>
<connection type="internal">
<origin model="diagnostic" port="NET_FM"/>
<destination model="performances" port="NET_FM"/>
</connection>
<connection type="internal">
<origin model="diagnostic" port="NET_MH"/>
<destination model="performances" port="NET_MH"/>
</connection>
</connections>&#xd; </connections>&#xd;
</model>&#xd; </model>&#xd;
<model width="100" height="120" x="19" y="43" name="climat" type="coupled">&#xd; <model width="100" height="120" x="19" y="43" name="climat" type="coupled">&#xd;
...@@ -1825,6 +1861,15 @@ ...@@ -1825,6 +1861,15 @@
&#xd; &#xd;
</port>&#xd; </port>&#xd;
<port name="NET_EF">
<attachedview name="viewDbg"/>
</port>
<port name="NET_FM">
<attachedview name="viewDbg"/>
</port>
<port name="NET_MH">
<attachedview name="viewDbg"/>
</port>
</observable>&#xd; </observable>&#xd;
&#xd; &#xd;
<observable name="lecture_climat">&#xd; <observable name="lecture_climat">&#xd;
......
...@@ -41,6 +41,10 @@ public : ...@@ -41,6 +41,10 @@ public :
/*Sync*/ Var PhasePhenoPlante; /*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var Tmoy; /*Sync*/ Var Tmoy;
// Covariables to compute OC
/// # Jours entre maturation et récolte. /// # Jours entre maturation et récolte.
Var D_MH; Var D_MH;
/// # Jours entre semis et germination. /// # Jours entre semis et germination.
...@@ -71,6 +75,21 @@ public : ...@@ -71,6 +75,21 @@ public :
// Sum of radiations during flowering // Sum of radiations during flowering
Var SGR_FM; Var SGR_FM;
// Covariables to compute HI
// Jours de stress végétatifs (E1 - F1) (covariables statistiques)
Var NET_EF;
// Jours de stress végétatifs (F1 - M0) (covariables statistiques)
Var NET_FM;
// Jours de stress végétatifs (M0 - M3) (covariables statistiques)
Var NET_MH;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -106,6 +125,13 @@ public : ...@@ -106,6 +125,13 @@ public :
PhasePhenoPlante.init(this, "PhasePhenoPlante", events); PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
Tmoy.init(this, "Tmoy", events); Tmoy.init(this, "Tmoy", events);
////// Covariables HI
NET_EF.init(this, "NET_EF" , events);
NET_FM.init(this, "NET_FM" , events);
NET_MH.init(this, "NET_MH" , events);
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -224,7 +250,57 @@ public : ...@@ -224,7 +250,57 @@ public :
} }
{
if ( ETRETM() > pr.SeuilETRETM ){
NET_EF = NET_EF(-1);
} else if ( ( PhasePhenoPlante() >= PHASEPHENOPLANTE_FLORAISON)
&& ( PhasePhenoPlante() < PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 > date_TT_F1
NET_EF = NET_EF(-1);
} else if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_CROISSANCEACTIVE)
|| ( PhasePhenoPlante() >= PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 < date_TT_E1
NET_EF = NET_EF(-1);
} else {
NET_EF = NET_EF(-1) + 1;
}
}
{
if ( ETRETM() > pr.SeuilETRETM ){
NET_FM = NET_FM(-1);
} else if ( ( PhasePhenoPlante() >= PHASEPHENOPLANTE_MATURATION)
&& ( PhasePhenoPlante() < PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 > date_TT_M0
NET_FM = NET_FM(-1);
} else if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_FLORAISON)
|| ( PhasePhenoPlante() >= PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 < date_TT_F1
NET_FM = NET_FM(-1);
} else {
NET_FM = NET_FM(-1) + 1;
}
}
{
if ( ETRETM() > pr.SeuilETRETM ){
NET_MH = NET_MH(-1);
} else if ( ( PhasePhenoPlante() >= PHASEPHENOPLANTE_DESSICATION)
&& ( PhasePhenoPlante() < PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 > date_TT_M3
NET_MH = NET_MH(-1);
} else if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_MATURATION)
|| ( PhasePhenoPlante() >= PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 < date_TT_M0
NET_MH = NET_MH(-1);
} else {
NET_MH = NET_MH(-1) + 1;
}
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -26,8 +26,8 @@ class ElaborationQualite : public DiscreteTimeDyn ...@@ -26,8 +26,8 @@ class ElaborationQualite : public DiscreteTimeDyn
public : public :
ParametresVariete pv; ParametresVariete pv;
double densite; // double densite;
bool first_compute; // bool first_compute;
/*Sync*/ Var PhasePhenoPlante; /*Sync*/ Var PhasePhenoPlante;
// /*Sync*/ Var Tx; // /*Sync*/ Var Tx;
...@@ -92,8 +92,8 @@ public : ...@@ -92,8 +92,8 @@ public :
DiscreteTimeDyn(model, events) DiscreteTimeDyn(model, events)
{ {
pv.initialiser(events); pv.initialiser(events);
densite = events.getDouble("densite"); // densite = events.getDouble("densite");
first_compute = true; // first_compute = true;
PhasePhenoPlante.init(this, "PhasePhenoPlante", events); PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
// Tx.init(this, "Tx", events); // Tx.init(this, "Tx", events);
// Eb.init(this, "Eb", events); // Eb.init(this, "Eb", events);
...@@ -132,9 +132,9 @@ public : ...@@ -132,9 +132,9 @@ public :
virtual void compute(const vle::devs::Time& /*time*/) virtual void compute(const vle::devs::Time& /*time*/)
{ {
if (first_compute) { //if (first_compute) {
first_compute = false; // first_compute = false;
TH = 0.0; // TH = 0.0;
// D_MH = 0.0; // D_MH = 0.0;
/* SRUE_MH = 0.0; /* SRUE_MH = 0.0;
SFTSW_FIM = 0.0; SFTSW_FIM = 0.0;
...@@ -144,8 +144,8 @@ public : ...@@ -144,8 +144,8 @@ public :
NHT34_MH = 0.0; NHT34_MH = 0.0;
LAD_MH = 0.0; LAD_MH = 0.0;
MRUE_MH = 0.0;*/ MRUE_MH = 0.0;*/
photo_TH_aFinMATURATION = 0.0; // photo_TH_aFinMATURATION = 0.0;
} else { //} else {
// calcul de D_MH // calcul de D_MH
/*{ /*{
double ddt = 0.0; double ddt = 0.0;
...@@ -312,7 +312,7 @@ public : ...@@ -312,7 +312,7 @@ public :
photo_TH_aFinMATURATION = photo_TH_aFinMATURATION(-1); photo_TH_aFinMATURATION = photo_TH_aFinMATURATION(-1);
} }
} }
} //}
} }
}; };
} // namespace sunflo } // namespace sunflo
......
...@@ -57,6 +57,18 @@ public : ...@@ -57,6 +57,18 @@ public :
Var photo_RDT_aFinMATURATION; Var photo_RDT_aFinMATURATION;
////////////////////////////////////////////////////////////////////////
/////////////////////////////REMI ADDS//////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Jours de stress végétatifs (E1 - F1) (covariables statistiques)
Var NET_EF;
// Jours de stress végétatifs (F1 - M0) (covariables statistiques)
Var NET_FM;
// Jours de stress végétatifs (M0 - M3) (covariables statistiques)
Var NET_MH;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
ElaborationRendement(const vle::devs::DynamicsInit& model, ElaborationRendement(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) : const vle::devs::InitEventList& events) :
...@@ -83,6 +95,17 @@ public : ...@@ -83,6 +95,17 @@ public :
photo_IRs_aFinMATURATION.init(this, "photo_IRs_aFinMATURATION" , events); photo_IRs_aFinMATURATION.init(this, "photo_IRs_aFinMATURATION" , events);
photo_RDT_aFinMATURATION.init(this, "photo_RDT_aFinMATURATION" , events); photo_RDT_aFinMATURATION.init(this, "photo_RDT_aFinMATURATION" , events);
first_compute = true; first_compute = true;
////////////////////////////////////////////////////////////////////////
/////////////////////////////REMI ADDS//////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Jours de stress végétatifs (E1 - F1) (covariables statistiques)
NET_EF.init(this, "NET_EF", events);
NET_FM.init(this, "NET_FM", events);
NET_MH.init(this, "NET_MH", events);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} }
virtual ~ElaborationRendement() { } virtual ~ElaborationRendement() { }
...@@ -118,7 +141,7 @@ public : ...@@ -118,7 +141,7 @@ public :
} }
photo_RDT_aFinMATURATION = 0.0; photo_RDT_aFinMATURATION = 0.0;
} else { } else {
{ /* {
double ddt = 0.0; double ddt = 0.0;
if ( ETRETM() > pr.SeuilETRETM ){ if ( ETRETM() > pr.SeuilETRETM ){
...@@ -135,9 +158,9 @@ public : ...@@ -135,9 +158,9 @@ public :
ddt = 1.0; ddt = 1.0;
} }
JSE = JSE(-1) + ddt; JSE = JSE(-1) + ddt;
} } */
{ /* {
double ddt = 0.0; double ddt = 0.0;
if ( ETRETM() > pr.SeuilETRETM ){ if ( ETRETM() > pr.SeuilETRETM ){
...@@ -175,7 +198,7 @@ public : ...@@ -175,7 +198,7 @@ public :
ddt = 1.0; ddt = 1.0;
} }
JSM = JSM(-1) + ddt; JSM = JSM(-1) + ddt;
} } */
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_CROISSANCEACTIVE) and if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_CROISSANCEACTIVE) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_FLORAISON)){ (PhasePhenoPlante() == PHASEPHENOPLANTE_FLORAISON)){
...@@ -189,7 +212,7 @@ public : ...@@ -189,7 +212,7 @@ public :
photo_INN_CROISSANCEACTIVE_A_FLORAISON = photo_INN_CROISSANCEACTIVE_A_FLORAISON(-1); photo_INN_CROISSANCEACTIVE_A_FLORAISON = photo_INN_CROISSANCEACTIVE_A_FLORAISON(-1);
} }
{ /* {
double IRs_tmp = 0.0; double IRs_tmp = 0.0;
if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_FLORAISON) if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_FLORAISON)
...@@ -203,8 +226,22 @@ public : ...@@ -203,8 +226,22 @@ public :
+ 1.274e-04 * TT_F1() + 8.189e-01 * pv.IRg; + 1.274e-04 * TT_F1() + 8.189e-01 * pv.IRg;
} }
IRs = IRs_tmp; IRs = IRs_tmp;
} }*/
{
double IRs_tmp = 0.0;
if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_FLORAISON)
|| ( PhasePhenoPlante() >= PHASEPHENOPLANTE_RECOLTEE) ){
// traduit condition TT_A2 < date_TT_F1
IRs_tmp = 0.0;
} else {
IRs_tmp = 0.416 + (-1.42e-04) * photo_TDM_CROISSANCEACTIVE_A_FLORAISON()
+ (1.19e-03) * NET_EF() + (-8.45e-04) * NET_FM()
+ (-2.47e-04) * NET_MH()
+ 3.61e-04 * TT_F1() + 7.75e-01 * pv.IRg;
}
IRs = IRs_tmp;
}
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_DESSICATION)){ (PhasePhenoPlante() == PHASEPHENOPLANTE_DESSICATION)){
......
Markdown is supported
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