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 @@
<port name="zSemis"/>&#xd;
</out>&#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>
<port name="ActionFerti"/>
<port name="ActionIrrig"/>
......@@ -95,6 +95,9 @@
<port name="NHT28_EF"/>
<port name="NHT28"/>
<port name="SGR_FM"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</out>&#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;
......@@ -142,6 +145,9 @@
<port name="MET_MH"/>
<port name="NHT28"/>
<port name="NHT28_EF"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</in>&#xd;
<out>
<port name="IRs"/>
......@@ -177,6 +183,9 @@
<port name="TDM"/>
<port name="TRPF"/>
<port name="TT_F1"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</in>&#xd;
<out>
<port name="IRs"/>
......@@ -184,6 +193,9 @@
<port name="JSF"/>
<port name="JSM"/>
<port name="RDT"/>
<port name="NET_EF"/>
<port name="NET_FM"/>
<port name="NET_MH"/>
</out>&#xd;
</model>&#xd;
</submodels>&#xd;
......@@ -252,6 +264,18 @@
<origin model="performances" port="NHT28_EF"/>
<destination model="elaboration_qualite" port="NHT28_EF"/>
</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;
</model>&#xd;
<model width="100" height="330" x="372" y="577" name="contraintes" type="coupled">&#xd;
......@@ -927,6 +951,18 @@
<origin model="diagnostic" port="NHT28"/>
<destination model="performances" port="NHT28"/>
</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;
</model>&#xd;
<model width="100" height="120" x="19" y="43" name="climat" type="coupled">&#xd;
......@@ -1825,6 +1861,15 @@
&#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;
&#xd;
<observable name="lecture_climat">&#xd;
......
......@@ -41,6 +41,10 @@ public :
/*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var Tmoy;
// Covariables to compute OC
/// # Jours entre maturation et récolte.
Var D_MH;
/// # Jours entre semis et germination.
......@@ -71,6 +75,21 @@ public :
// Sum of radiations during flowering
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 :
PhasePhenoPlante.init(this, "PhasePhenoPlante", 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 :
}
{
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
public :
ParametresVariete pv;
double densite;
bool first_compute;
// double densite;
// bool first_compute;
/*Sync*/ Var PhasePhenoPlante;
// /*Sync*/ Var Tx;
......@@ -92,8 +92,8 @@ public :
DiscreteTimeDyn(model, events)
{
pv.initialiser(events);
densite = events.getDouble("densite");
first_compute = true;
// densite = events.getDouble("densite");
// first_compute = true;
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
// Tx.init(this, "Tx", events);
// Eb.init(this, "Eb", events);
......@@ -132,9 +132,9 @@ public :
virtual void compute(const vle::devs::Time& /*time*/)
{
if (first_compute) {
first_compute = false;
TH = 0.0;
//if (first_compute) {
// first_compute = false;
// TH = 0.0;
// D_MH = 0.0;
/* SRUE_MH = 0.0;
SFTSW_FIM = 0.0;
......@@ -144,8 +144,8 @@ public :
NHT34_MH = 0.0;
LAD_MH = 0.0;
MRUE_MH = 0.0;*/
photo_TH_aFinMATURATION = 0.0;
} else {
// photo_TH_aFinMATURATION = 0.0;
//} else {
// calcul de D_MH
/*{
double ddt = 0.0;
......@@ -312,7 +312,7 @@ public :
photo_TH_aFinMATURATION = photo_TH_aFinMATURATION(-1);
}
}
}
//}
}
};
} // namespace sunflo
......
......@@ -57,6 +57,18 @@ public :
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,
const vle::devs::InitEventList& events) :
......@@ -83,6 +95,17 @@ public :
photo_IRs_aFinMATURATION.init(this, "photo_IRs_aFinMATURATION" , events);
photo_RDT_aFinMATURATION.init(this, "photo_RDT_aFinMATURATION" , events);
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() { }
......@@ -118,7 +141,7 @@ public :
}
photo_RDT_aFinMATURATION = 0.0;
} else {
{
/* {
double ddt = 0.0;
if ( ETRETM() > pr.SeuilETRETM ){
......@@ -135,9 +158,9 @@ public :
ddt = 1.0;
}
JSE = JSE(-1) + ddt;
}
} */
{
/* {
double ddt = 0.0;
if ( ETRETM() > pr.SeuilETRETM ){
......@@ -175,7 +198,7 @@ public :
ddt = 1.0;
}
JSM = JSM(-1) + ddt;
}
} */
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_CROISSANCEACTIVE) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_FLORAISON)){
......@@ -189,7 +212,7 @@ public :
photo_INN_CROISSANCEACTIVE_A_FLORAISON = photo_INN_CROISSANCEACTIVE_A_FLORAISON(-1);
}
{
/* {
double IRs_tmp = 0.0;
if ( ( PhasePhenoPlante() < PHASEPHENOPLANTE_FLORAISON)
......@@ -203,8 +226,22 @@ public :
+ 1.274e-04 * TT_F1() + 8.189e-01 * pv.IRg;
}
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
(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