Loading OpenSimRoot/src/modules/CarbonModule/CarbonBalance.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ PlantCarbonBalance::PlantCarbonBalance(SimulaDynamic* pSD) : } ///@todo fix storage and exudate modules #define RELATIVE 100/tinc #define RELATIVE 100/std::max(tinc,1e-1) void PlantCarbonBalance::calculate(const Time &t, double &balance) { //current cumulative income balance=0.; Loading Loading @@ -120,7 +120,8 @@ void PlantCarbonBalance::calculate(const Time &t, double &balance) { //balance balance = tinc - ((tdw * cdw) + tresp + texu + tstore + tstarch);//tinc - ((tdw * cdw) + tresp + texu + tstore); //relative error double terr(balance * RELATIVE); const double terr(balance * RELATIVE); //if(abs(terr)>0.5) std::cout<<std::endl<<"terr="<<terr<<", Cinc="<<tinc* RELATIVE<<", Ctdw="<<-tdw*cdw* RELATIVE<<", Cresp="<<-tresp* RELATIVE<<", Cexu="<<-texu* RELATIVE<<", Cstore="<<-tstore* RELATIVE<<", Cstarch="<<-tstarch* RELATIVE<<std::endl; //try to be more verbose about where the possible error is //dry weight of roots versus total allocated carbon double ra, rdw; Loading Loading
OpenSimRoot/src/modules/CarbonModule/CarbonBalance.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ PlantCarbonBalance::PlantCarbonBalance(SimulaDynamic* pSD) : } ///@todo fix storage and exudate modules #define RELATIVE 100/tinc #define RELATIVE 100/std::max(tinc,1e-1) void PlantCarbonBalance::calculate(const Time &t, double &balance) { //current cumulative income balance=0.; Loading Loading @@ -120,7 +120,8 @@ void PlantCarbonBalance::calculate(const Time &t, double &balance) { //balance balance = tinc - ((tdw * cdw) + tresp + texu + tstore + tstarch);//tinc - ((tdw * cdw) + tresp + texu + tstore); //relative error double terr(balance * RELATIVE); const double terr(balance * RELATIVE); //if(abs(terr)>0.5) std::cout<<std::endl<<"terr="<<terr<<", Cinc="<<tinc* RELATIVE<<", Ctdw="<<-tdw*cdw* RELATIVE<<", Cresp="<<-tresp* RELATIVE<<", Cexu="<<-texu* RELATIVE<<", Cstore="<<-tstore* RELATIVE<<", Cstarch="<<-tstarch* RELATIVE<<std::endl; //try to be more verbose about where the possible error is //dry weight of roots versus total allocated carbon double ra, rdw; Loading