Subversion Repositories public iLand

Rev

Rev 281 | Rev 372 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
200 werner 2
#include "global.h"
3
#include "modelsettings.h"
205 werner 4
#include "expression.h"
200 werner 5
 
6
ModelSettings::ModelSettings()
7
{
8
}
9
 
10
void ModelSettings::loadModelSettings()
11
{
12
    XmlHelper xml(GlobalSettings::instance()->settings().node("model.settings"));
13
    growthEnabled = xml.valueBool("growthEnabled", true);
14
    mortalityEnabled = xml.valueBool("mortalityEnabled", true);
15
    lightExtinctionCoefficient = xml.valueDouble("lightExtinctionCoefficient", 0.5);
16
    lightExtinctionCoefficientOpacity=xml.valueDouble("lightExtinctionCoefficientOpacity", 0.5);
201 werner 17
    temperatureTau=xml.valueDouble("temperatureTau",5);
239 werner 18
    epsilon = xml.valueDouble("epsilon",1.8); // max light use efficiency (aka alpha_c)
19
    airDensity = xml.valueDouble("airDensity", 1.2);
368 werner 20
    laiThresholdForClosedStands = xml.valueDouble("laiThresholdForClosedStands", 3.);
21
    boundaryLayerConductance = xml.valueDouble("boundaryLayerConductance", 0.02);
269 werner 22
    XmlHelper world(GlobalSettings::instance()->settings().node("model.world"));
23
    latitude = RAD(world.valueDouble("latitude",48.));
200 werner 24
}
25
 
26
void ModelSettings::print()
27
{
204 werner 28
    QStringList set=QStringList() << "Settings:";
200 werner 29
    set << QString("growthEnabled=%1").arg(growthEnabled);
30
    set << QString("mortalityEnabled=%1").arg(mortalityEnabled);
31
    set << QString("lightExtinctionCoefficient=%1").arg(lightExtinctionCoefficient);
32
    set << QString("lightExtinctionCoefficientOpacity=%1").arg(lightExtinctionCoefficientOpacity);
201 werner 33
    set << QString("temperatureTau=%1").arg(temperatureTau);
226 werner 34
    set << QString("epsilon=%1").arg(epsilon);
239 werner 35
    set << QString("airDensity=%1").arg(airDensity);
226 werner 36
 
210 werner 37
    set << QString("latitude=%1").arg(GRAD(latitude));
38
 
200 werner 39
    qDebug() << set.join("\n");
40
}