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

sunflo: remove ChgtPhasePhenoPlante

parent 3c8adb33
This diff is collapsed.
......@@ -36,7 +36,6 @@ public :
// provenant de phenologie
/*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var ChgtPhasePhenoPlante;
// provenant de temperature_efficace
/*Sync*/ Var Teff;
......@@ -174,7 +173,6 @@ public :
Teff.init(this, "Teff", events);
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
Ei.init(this, "Ei", events);
DBP.init(this, "DBP", events);
Ebp.init(this, "Ebp", events);
......
......@@ -44,7 +44,6 @@ public :
/*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var ChgtPhasePhenoPlante;
/*Nosync*/ Var Ei;
/*Sync*/ Var Pluie;
/*Sync*/ Var ETPP;
......@@ -148,7 +147,6 @@ public :
first_compute = true;
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
Ei.init(this, "Ei", events);
Pluie.init(this, "Pluie", events);
ETPP.init(this, "ETPP", events);
......
......@@ -56,7 +56,6 @@ public :
/*Sync*/ Var densite;
/*Sync*/ Var TT_A2;
/*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var ChgtPhasePhenoPlante;
Var Ei;
Var DBP;
......@@ -106,7 +105,6 @@ public :
densite.init(this, "densite" , events);
TT_A2.init(this, "TT_A2", events);
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
Ei.init(this, "Ei", events);
DBP.init(this, "DBP", events);
......@@ -346,7 +344,8 @@ public :
if ( memo_densite == (double)VALEURDOUBLENONSIGNIFIANTE ){
throw "erreur";
} else {
if(ChgtPhasePhenoPlante()==2){
if((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_GERMINATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_JUVENILE)){
if (SFp() == 0) {
LAI = 0;
} else {
......
......@@ -32,7 +32,6 @@ public :
bool first_compute;
/*Sync*/ Var TT_A2;
/*Sync*/ Var ChgtPhasePhenoPlante;
/*Sync*/ Var ETRETM;
......@@ -57,7 +56,6 @@ public :
pp.initialiser(events);
TT_A2.init(this, "TT_A2", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
ETRETM.init(this, "ETRETM", events);
ISH1.init(this, "ISH1" , events);
ISH2.init(this, "ISH2" , events);
......
......@@ -30,7 +30,6 @@ public :
bool first_compute;
/*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var ChgtPhasePhenoPlante;
/*Sync*/ Var Tx;
/*Sync*/ Var Eb;
/*Sync*/ Var LAI;
......@@ -73,7 +72,6 @@ public :
densite = events.getDouble("densite");
first_compute = true;
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
Tx.init(this, "Tx", events);
Eb.init(this, "Eb", events);
LAI.init(this, "LAI", events);
......@@ -259,9 +257,11 @@ public :
}
TH = TH_tmp;
if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_MATURATION_A_DESSICATION ){
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_DESSICATION)){
photo_TH_aFinMATURATION = TH(-1);
} else if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_MATURATION_A_RECOLTEE ){
} else if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_RECOLTEE)){
photo_TH_aFinMATURATION = TH(-1);
} else {
photo_TH_aFinMATURATION = photo_TH_aFinMATURATION(-1);
......
......@@ -31,7 +31,6 @@ public :
bool first_compute;
/*Sync*/ Var PhasePhenoPlante;
/*Sync*/ Var ChgtPhasePhenoPlante;
/*Sync*/ Var TT_F1;
/*Sync*/ Var TDM;
/*Sync*/ Var ETRETM;
......@@ -66,7 +65,6 @@ public :
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
TT_F1.init(this, "TT_F1", events);
TDM.init(this, "TDM", events);
ETRETM.init(this, "ETRETM", events);
......@@ -177,7 +175,8 @@ public :
JSM = JSM(-1) + ddt;
}
if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_CROISSANCEACTIVE_A_FLORAISON ){
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_CROISSANCEACTIVE) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_FLORAISON)){
photo_TDM_CROISSANCEACTIVE_A_FLORAISON = TDM(-1); // derniere valeur en CROISSANCEACTIVE
photo_INN_CROISSANCEACTIVE_A_FLORAISON = INN(-1); // derniere valeur en CROISSANCEACTIVE
} else if ( PhasePhenoPlante() >= PHASEPHENOPLANTE_FLORAISON ){
......@@ -204,10 +203,14 @@ public :
IRs = IRs_tmp;
}
if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_MATURATION_A_DESSICATION ){
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_DESSICATION)){
photo_IRs_aFinMATURATION = IRs(-1); // derniere valeur en MATURATION et non pas 1ere en DESSICATION
} else if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_MATURATION_A_RECOLTEE ){
} else if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_RECOLTEE)){
photo_IRs_aFinMATURATION = IRs(-1); // derniere valeur en MATURATION et non pas 1ere en RECOLTEE
} else if ( PhasePhenoPlante() >= PHASEPHENOPLANTE_DESSICATION ){
......@@ -231,10 +234,13 @@ public :
}
RDT = RDT_tmp;
if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_MATURATION_A_DESSICATION ){
if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_DESSICATION)){
photo_RDT_aFinMATURATION = RDT(-1); // derniere valeur en MATURATION et non pas 1ere en DESSICATION
} else if ( ChgtPhasePhenoPlante() == CHGTPHASEPHENOPLANTE_MATURATION_A_RECOLTEE ){
} else if ((PhasePhenoPlante(-1) == PHASEPHENOPLANTE_MATURATION) and
(PhasePhenoPlante() == PHASEPHENOPLANTE_RECOLTEE)){
photo_RDT_aFinMATURATION = RDT(-1); // derniere valeur en MATURATION et non pas 1ere en RECOLTEE
} else {
photo_RDT_aFinMATURATION = photo_RDT_aFinMATURATION(-1);
......
......@@ -55,7 +55,6 @@ public :
Var photo_DatePsgPhasePhenoPlante_DESSICATION_A_RECOLTEE;
Var TT_A2;
Var PhasePhenoPlante;
Var ChgtPhasePhenoPlante;
Var TT_F1;
Phenologie(const vle::devs::DynamicsInit& model,
......@@ -80,7 +79,6 @@ public :
/*Sync*/ ActionRecolte.init(this, "ActionRecolte", events);
TT_A2.init(this, "TT_A2", events);
PhasePhenoPlante.init(this, "PhasePhenoPlante", events);
ChgtPhasePhenoPlante.init(this, "ChgtPhasePhenoPlante", events);
TT_F1.init(this, "TT_F1", events);
TT_A0.init(this, "TT_A0", events);
......@@ -110,7 +108,6 @@ public :
TT_A2.init_value(0.0);
TT_F1.init_value(0.0);
PhasePhenoPlante.init_value((double)PHASEPHENOPLANTE_NONSEMEE);
ChgtPhasePhenoPlante.init_value((double)CHGTPHASEPHENOPLANTE_INACTIF);
AP.init_value(pp.AP_a * Teff() * ( 1 - FHTR_valeurInitiale ));
photo_DatePsgPhasePhenoPlante_NONSEMEE_A_GERMINATION.init_value(0.0);
......@@ -193,7 +190,6 @@ public :
}
{
double PhasePhenoPlante_tmp = PhasePhenoPlante(-1); // par defaut
double ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_INACTIF; // par defaut
switch ( (int)PhasePhenoPlante(-1) ){
......@@ -209,7 +205,6 @@ public :
if ((int)ActionSemis() == ACTIONCONDUITE_ACTIVE ){ // instant de semis
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_GERMINATION ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_NONSEMEE_A_GERMINATION;
photo_DatePsgPhasePhenoPlante_NONSEMEE_A_GERMINATION = time;
......@@ -240,12 +235,10 @@ public :
if ((int)ActionRecolte() == ACTIONCONDUITE_ACTIVE ){
photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE = photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE(-1);
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_RECOLTEE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_ACTIF_AUTRE;
throw vle::utils::ModellingError("[Phenologie] Error recolte en germination ");
} else if ( simulationPhaseSemisLevee ){
if ( TT_A0() >= estimationTTentreSemisEtLevee_casPhaseSemisLeveeSimulee ){
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_JUVENILE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_GERMINATION_A_JUVENILE;
photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE = time;
} else {
photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE = photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE(-1);
......@@ -254,7 +247,6 @@ public :
if ( utils::ordreChronologique( psi.dateLevee_casForcee, utils::dateJJMM(time) ) ){
// date levee (dateLevee_casForcee) atteinte
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_JUVENILE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_GERMINATION_A_JUVENILE;
photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE = time;
} else {
photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE = photo_DatePsgPhasePhenoPlante_GERMINATION_A_JUVENILE(-1);
......@@ -274,12 +266,10 @@ public :
if ((int)ActionRecolte() == ACTIONCONDUITE_ACTIVE ){
photo_DatePsgPhasePhenoPlante_JUVENILE_A_CROISSANCEACTIVE = photo_DatePsgPhasePhenoPlante_JUVENILE_A_CROISSANCEACTIVE(-1);
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_RECOLTEE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_ACTIF_AUTRE;
throw vle::utils::ModellingError("[Phenologie] Error recolte pendant juvenile");
} else if ( TT_A2() >= pv.date_TT_E1 ){ // date thermique du stade etoiles atteinte
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_CROISSANCEACTIVE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_JUVENILE_A_CROISSANCEACTIVE;
photo_DatePsgPhasePhenoPlante_JUVENILE_A_CROISSANCEACTIVE = time;
} else {
photo_DatePsgPhasePhenoPlante_JUVENILE_A_CROISSANCEACTIVE = photo_DatePsgPhasePhenoPlante_JUVENILE_A_CROISSANCEACTIVE(-1);
......@@ -298,11 +288,9 @@ public :
if ((int)ActionRecolte() == ACTIONCONDUITE_ACTIVE ){
photo_DatePsgPhasePhenoPlante_CROISSANCEACTIVE_A_FLORAISON = photo_DatePsgPhasePhenoPlante_CROISSANCEACTIVE_A_FLORAISON(-1);
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_RECOLTEE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_ACTIF_AUTRE;
throw vle::utils::ModellingError("[Phenologie] Error recolte pendant croissance active");
} else if ( TT_A2() >= pv.date_TT_F1 ){ // date thermique du stade floraison atteinte
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_FLORAISON ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_CROISSANCEACTIVE_A_FLORAISON;
photo_DatePsgPhasePhenoPlante_CROISSANCEACTIVE_A_FLORAISON = time;
} else {
photo_DatePsgPhasePhenoPlante_CROISSANCEACTIVE_A_FLORAISON = photo_DatePsgPhasePhenoPlante_CROISSANCEACTIVE_A_FLORAISON(-1);
......@@ -321,13 +309,11 @@ public :
if ((int)ActionRecolte() == ACTIONCONDUITE_ACTIVE ){
photo_DatePsgPhasePhenoPlante_FLORAISON_A_MATURATION = photo_DatePsgPhasePhenoPlante_FLORAISON_A_MATURATION(-1);
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_RECOLTEE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_ACTIF_AUTRE;
std::cout << "[Phenologie] Error recolte avant floraison" << "\n";
throw vle::utils::ModellingError("[Phenologie] Error recolte avant floraison");
} else if ( TT_A2() >= pv.date_TT_M0 ){ // date thermique du stade fin floraison atteinte
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_MATURATION ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_FLORAISON_A_MATURATION;
photo_DatePsgPhasePhenoPlante_FLORAISON_A_MATURATION = time;
} else {
photo_DatePsgPhasePhenoPlante_FLORAISON_A_MATURATION = photo_DatePsgPhasePhenoPlante_FLORAISON_A_MATURATION(-1);
......@@ -345,7 +331,6 @@ public :
if ((int)ActionRecolte() == ACTIONCONDUITE_ACTIVE ){
photo_DatePsgPhasePhenoPlante_MATURATION_A_DESSICATION = photo_DatePsgPhasePhenoPlante_MATURATION_A_DESSICATION(-1);
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_RECOLTEE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_MATURATION_A_RECOLTEE;
photo_DatePsgPhasePhenoPlante_MATURATION_A_RECOLTEE = time;
} else if ( TT_A2() >= pv.date_TT_M3 ){ // date
......@@ -356,7 +341,6 @@ public :
photo_DatePsgPhasePhenoPlante_MATURATION_A_RECOLTEE = photo_DatePsgPhasePhenoPlante_MATURATION_A_RECOLTEE(-1);
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_DESSICATION ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_MATURATION_A_DESSICATION;
photo_DatePsgPhasePhenoPlante_MATURATION_A_DESSICATION = time;
} else {
......@@ -376,7 +360,6 @@ public :
photo_DatePsgPhasePhenoPlante_MATURATION_A_DESSICATION = photo_DatePsgPhasePhenoPlante_MATURATION_A_DESSICATION(-1);
if ((int)ActionRecolte() == ACTIONCONDUITE_ACTIVE ){
PhasePhenoPlante_tmp = PHASEPHENOPLANTE_RECOLTEE ;
ChgtPhasePhenoPlante_tmp = (double)CHGTPHASEPHENOPLANTE_DESSICATION_A_RECOLTEE;
photo_DatePsgPhasePhenoPlante_DESSICATION_A_RECOLTEE = time;
} else {
......@@ -403,7 +386,6 @@ public :
break;
}
PhasePhenoPlante = PhasePhenoPlante_tmp;
ChgtPhasePhenoPlante = ChgtPhasePhenoPlante_tmp;
}
AP = pp.AP_a * Teff() * ( 1 - FHTR(-1) );
}
......
......@@ -24,19 +24,6 @@ enum ValeurPhasePhenoPlante {
PHASEPHENOPLANTE_RECOLTEE = 7
};
enum ValeurChgtPhasePhenoPlante {
CHGTPHASEPHENOPLANTE_INACTIF = 0,
CHGTPHASEPHENOPLANTE_NONSEMEE_A_GERMINATION = 1,
CHGTPHASEPHENOPLANTE_GERMINATION_A_JUVENILE = 2,
CHGTPHASEPHENOPLANTE_JUVENILE_A_CROISSANCEACTIVE = 3,
CHGTPHASEPHENOPLANTE_CROISSANCEACTIVE_A_FLORAISON = 4,
CHGTPHASEPHENOPLANTE_FLORAISON_A_MATURATION = 5,
CHGTPHASEPHENOPLANTE_MATURATION_A_DESSICATION = 6,
CHGTPHASEPHENOPLANTE_MATURATION_A_RECOLTEE = 7,
CHGTPHASEPHENOPLANTE_DESSICATION_A_RECOLTEE = 8,
CHGTPHASEPHENOPLANTE_ACTIF_AUTRE = 10
};
} // namespace
#endif
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