Commit 47f423b2 authored by jouke's avatar jouke
Browse files

Making the resource section optional.

parent 1064f198
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -33,7 +33,10 @@ CinDryWeight::CinDryWeight(SimulaDynamic* const pSD):
	std::string plantType;
	pSD->getSibling("plantType")->get(plantType);
	//param
	SimulaBase* param(GETPLANTPARAMETERS(plantType)->getChild("resources")->existingChild("CtoDryWeightRatio","100%"));
	SimulaBase * r=GETPLANTPARAMETERS(plantType)->existingChild("resources"), * param;
	if(r){
		param=r->existingChild("carbonToDryWeightRatio","100%");
		if(!param) param=r->existingChild("CtoDryWeightRatio","100%");
		//value
		if(param){
			param->get(cdw);
@@ -42,6 +45,7 @@ CinDryWeight::CinDryWeight(SimulaDynamic* const pSD):
			msg::warning("CinDryWeight: CtoDryWeightRatio parameter not found in the resource section of plant "+plantType+". Using default of 0.42.", 1);
		}
	}
}
void CinDryWeight::calculate(const Time &t, double&r){
	r=cdw;
}