예제 #1
0
파일: Common.cpp 프로젝트: SmileEric/SEIMS
Common::Common()
{	
	//get coefficients, Zhiqiang, 2011-8-10

	//N uptake shape coefficient, Line 287-298, readplant.f
	getNPShapeParameter(&(m_biomassNFraction1),&(m_biomassNFraction2),&(m_biomassNFraction3),
		&(m_biomassNShapeCoefficient1),&(m_biomassNShapeCoefficient2));

	//P uptake shape coefficient, Line 303-314, readplant.f
	getNPShapeParameter(&(m_biomassPFraction1),&(m_biomassPFraction2),&(m_biomassPFraction3),
		&(m_biomassPShapeCoefficient1),&(m_biomassPShapeCoefficient2));

	//CO2 radiation-use efficiency adjust shape coefficient, Line 270-279, readplant.f
	if(m_secondCO2Concentration == 330.0f) m_secondCO2Concentration = 660.0f;
	getScurveShapeParameter(
		m_radiationUseEfficiency * 0.01f,
		m_secondBiomassEnergyRatio * 0.01f,
		330.0f,
		m_secondCO2Concentration,
		&(m_CO2ShapeCoefficient1),
		&(m_CO2ShapeCoefficient2));

	//optimal leaf area development curve shape coefficient, Line 264, readplant.f
	getScurveShapeParameter(
		m_x1,m_x2,
		m_y1,m_y2,
		&(m_LAIShapeCoefficient1),
		&(m_LAIShapeCoefficient2));
}
예제 #2
0
void PGCommon::getNPShapeParameter(float fr1, float fr2, float fr3, float *shape1, float *shape2)
{
    if (fr1 - fr2 < 0.0001f) fr2 = fr1 - 0.0001f;
    if (fr2 - fr3 < 0.0001f) fr3 *= 0.75f;

    float t = fr1 - fr3;
    float xMid = 1.0f - (fr2 - fr3) / t;
    float xEnd = 1.0f - 0.00001f / t;

    getScurveShapeParameter(xMid, xEnd, 0.5f, 1.0f, shape1, shape2);
}