Commit 9862f73f authored by jouke's avatar jouke
Browse files

Making carbon cost of nitrogen uptake optional

parent 5a1bb130
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -139,7 +139,8 @@ CarbonCostOfNutrientUptake::CarbonCostOfNutrientUptake(SimulaDynamic* pSD): Deri
		pSD->getSibling("plantType")->get(plantType);
		SimulaBase* p=GETPLANTPARAMETERS(plantType);
		//cost ratio from parameter setting
		factor=p->getChild("resources")->getChild("carbonCostOfNitrateUptake",pSD->getUnit()/max->getUnit());
		factor=p->getChild("resources")->existingChild("carbonCostOfNitrateUptake",pSD->getUnit()/max->getUnit());
		if(!factor) msg::warning("CarbonCostOfNutrientUptake: "+p->getPath()+"/resources/carbonCostOfNitrateUptake not found. Using default value of 0.00001392 g C/umol N");
	}else{
		msg::warning("CarbonCostOfNutrientUptake: cost not simulated for nitrate uptake is not simulated");
	}
@@ -156,7 +157,8 @@ void CarbonCostOfNutrientUptake::calculate(const Time &t,double &cost){
		}else{
			max->getRate(t,cost);
		}
		factor->get(t,f);
		f=0.00001392;
		if(factor) factor->get(t,f);
		cost*=f;
	}else{
		cost=0;