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

sunflo: split SimuInit in 2 sets of params

SeuilETERTM is only for Rendement and Diagnostic
parent c484d1ee
......@@ -73,7 +73,7 @@
<port name="Eb"/>
</out>
</model>
<model observables="diagnostic" conditions="CONFIG_Plante,CONFIG_SimuInit,CONFIG_Variete,diagnostic,EXPERT_Plante,EXPERT_SimuInit" width="100" dynamics="diagnostic" height="75" x="633" y="124" name="diagnostic" type="atomic">
<model observables="diagnostic" conditions="CONFIG_Variete,CONFIG_SimuInit,diagnostic,CONFIG_Plante,EXPERT_Rendement,EXPERT_Plante" width="100" dynamics="diagnostic" height="75" x="633" y="124" name="diagnostic" type="atomic">
<in>
<port name="ETRETM"/>
<port name="TT_A2"/>
......@@ -84,7 +84,7 @@
<port name="ISH3"/>
</out>
</model>
<model observables="phenologie" conditions="CONFIG_Variete,EXPERT_SimuInit,CONFIG_SimuInit,CONFIG_Plante,EXPERT_Plante,phenologie" width="100" dynamics="Phenologie" height="105" x="252" y="22" name="phenologie" type="atomic">
<model observables="phenologie" conditions="CONFIG_Variete,CONFIG_SimuInit,CONFIG_Plante,EXPERT_Plante,phenologie" width="100" dynamics="Phenologie" height="105" x="252" y="22" name="phenologie" type="atomic">
<in>
<port name="ActionRecolte"/>
<port name="ActionSemis"/>
......@@ -146,7 +146,7 @@
<port name="TH"/>
</out>
</model>
<model observables="elaboration_rendement" conditions="CONFIG_SimuInit,CONFIG_Variete,EXPERT_Plante,EXPERT_SimuInit,elaboration_rendement" width="100" dynamics="elaboration_rendement" height="135" x="320" y="33" name="elaboration_rendement" type="atomic">
<model observables="elaboration_rendement" conditions="CONFIG_Variete,elaboration_rendement,EXPERT_Rendement,EXPERT_Plante" width="100" dynamics="elaboration_rendement" height="135" x="320" y="33" name="elaboration_rendement" type="atomic">
<in>
<port name="ETRETM"/>
<port name="INN"/>
......@@ -269,7 +269,7 @@
<port name="vNabs"/>
</out>
<submodels>
<model observables="contrainte_azote" conditions="CONFIG_Plante,CONFIG_SimuInit,CONFIG_Sol,EXPERT_Plante,EXPERT_SimuInit,contrainte_azote" width="100" dynamics="croissance_azote" height="480" x="950" y="398" name="contrainte_azote" type="atomic">
<model observables="contrainte_azote" conditions="CONFIG_Sol,CONFIG_SimuInit,contrainte_azote,CONFIG_Plante,EXPERT_Rendement,EXPERT_Plante" width="100" dynamics="croissance_azote" height="480" x="950" y="398" name="contrainte_azote" type="atomic">
<in>
<port name="ActionFerti"/>
<port name="ActionIrrig"/>
......@@ -310,7 +310,7 @@
<port name="vNabs"/>
</out>
</model>
<model observables="contrainte_eau" conditions="CONFIG_Plante,CONFIG_SimuInit,CONFIG_Sol,CONFIG_Variete,contrainte_eau,EXPERT_Plante,EXPERT_SimuInit" width="100" dynamics="contrainte_eau" height="330" x="485" y="721" name="contrainte_eau" type="atomic">
<model observables="contrainte_eau" conditions="CONFIG_Variete,CONFIG_Sol,contrainte_eau,CONFIG_SimuInit,CONFIG_Plante,EXPERT_Rendement,EXPERT_Plante" width="100" dynamics="contrainte_eau" height="330" x="485" y="721" name="contrainte_eau" type="atomic">
<in>
<port name="ActionIrrig"/>
<port name="ActionSemis"/>
......@@ -1190,7 +1190,7 @@
<double>1.190000000000000</double>
</port>
</condition>
<condition name="EXPERT_SimuInit">
<condition name="EXPERT_Rendement">
<port name="SeuilETRETM">
<double>0.600000000000000</double>
</port>
......
......@@ -17,7 +17,7 @@
#include <Phenologie.hpp>
#include <ParametresPlante.hpp>
#include <ParametresVariete.hpp>
#include <ParametresSimuInit.hpp>
#include <ParametresRendement.hpp>
namespace sunflo {
......@@ -28,7 +28,7 @@ class Diagnostic : public DiscreteTimeDyn
public :
ParametresVariete pv;
ParametresPlante pp;
ParametresSimuInit psi;
ParametresRendement pr;
bool first_compute;
/*Sync*/ Var TT_A2;
......@@ -52,7 +52,7 @@ public :
DiscreteTimeDyn(model, events)
{
pv.initialiser(events);
psi.initialiser(events);
pr.initialiser(events);
pp.initialiser(events);
TT_A2.init(this, "TT_A2", events);
......@@ -76,7 +76,7 @@ public :
} else {
{
double ddt = 0.0;
if ( ETRETM() > psi.SeuilETRETM ){
if ( ETRETM() > pr.SeuilETRETM ){
ddt = 0.0;
} else if ( TT_A2() > pv.date_TT_F1 ){
ddt = 0.0;
......@@ -92,7 +92,7 @@ public :
{
double ddt = 0.0;
if ( ETRETM() > psi.SeuilETRETM ){
if ( ETRETM() > pr.SeuilETRETM ){
ddt = 0.0;
} else if ( TT_A2() > (pv.date_TT_F1 + pp.date_TT_F1M0) ){
ddt = 0.0;
......@@ -108,7 +108,7 @@ public :
{
double ddt = 0.0;
if ( ETRETM() > psi.SeuilETRETM ){
if ( ETRETM() > pr.SeuilETRETM ){
ddt = 0.0;
} else if ( TT_A2() > pv.date_TT_M3 ){
ddt = 0.0;
......
......@@ -16,7 +16,7 @@
#include <sunflo_utils.hpp>
#include <Phenologie.hpp>
#include <ParametresVariete.hpp>
#include <ParametresSimuInit.hpp>
#include <ParametresRendement.hpp>
namespace sunflo {
......@@ -26,7 +26,7 @@ using namespace vle::discrete_time;
class ElaborationRendement : public DiscreteTimeDyn
{
public :
ParametresSimuInit psi;
ParametresRendement pr;
ParametresVariete pv;
bool first_compute;
......@@ -60,7 +60,7 @@ public :
const vle::devs::InitEventList& events) :
DiscreteTimeDyn(model, events)
{
psi.initialiser( events );
pr.initialiser( events );
pv.initialiser( events );
......@@ -119,7 +119,7 @@ public :
{
double ddt = 0.0;
if ( ETRETM() > psi.SeuilETRETM ){
if ( ETRETM() > pr.SeuilETRETM ){
ddt = 0.0;
} else if ( ( PhasePhenoPlante() >= PHASEPHENOPLANTE_FLORAISON)
&& ( PhasePhenoPlante() < PHASEPHENOPLANTE_RECOLTEE) ){
......@@ -138,7 +138,7 @@ public :
{
double ddt = 0.0;
if ( ETRETM() > psi.SeuilETRETM ){
if ( ETRETM() > pr.SeuilETRETM ){
ddt = 0.0;
} else if ( ( PhasePhenoPlante() >= PHASEPHENOPLANTE_MATURATION)
......@@ -158,7 +158,7 @@ public :
{
double ddt = 0.0;
if ( ETRETM() > psi.SeuilETRETM ){
if ( ETRETM() > pr.SeuilETRETM ){
ddt = 0.0;
} else if ( ( PhasePhenoPlante() >= PHASEPHENOPLANTE_DESSICATION)
......
/**
*
* Copyright (C) 2009-2014 INRA.
* Copyright (C) 2009-2014 CETIOM.
*
*
* TODO licence
*/
#ifndef SUNFLO_PARAMETRESRENDEMENT_HPP
#define SUNFLO_PARAMETRESRENDEMENT_HPP
namespace sunflo {
//#define VALEURPARDEFAUT_SeuilETRETM 0.6 ///< valeur par defaut
struct ParametresRendement
{
/// Seuil ETR/ETM pour calcul jours de stress
double SeuilETRETM ;
void initialiser( const vle::devs::InitEventList& events ){
if ( events.exist("SeuilETRETM") ){
SeuilETRETM = events.getDouble("SeuilETRETM");
} else {
throw vle::utils::ModellingError("[ParametersSimuInit] missing 'SeuilETRETM'");
}
}
};
} // namespace
#endif
......@@ -27,8 +27,6 @@ struct ParametresSimuInit
// date_A2 est renomme dateLevee_casForcee
std::string dateLevee_casForcee ;
/// Seuil ETR/ETM pour calcul jours de stress
double SeuilETRETM ;
void initialiser( const vle::devs::InitEventList& events ){
if ( events.exist("dateLevee_casForcee") ){
......@@ -36,11 +34,6 @@ struct ParametresSimuInit
} else {
throw vle::utils::ModellingError("[ParametersSimuInit] missing 'dateLevee_casForcee'");
}
if ( events.exist("SeuilETRETM") ){
SeuilETRETM = events.getDouble("SeuilETRETM");
} else {
throw vle::utils::ModellingError("[ParametersSimuInit] missing 'SeuilETRETM'");
}
}
};
......
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