Subversion Repositories public iLand

Rev

Rev 281 | Rev 372 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 281 Rev 368
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/modelsettings.cpp':
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/modelsettings.cpp':
2
#include "global.h"
2
#include "global.h"
3
#include "modelsettings.h"
3
#include "modelsettings.h"
4
#include "expression.h"
4
#include "expression.h"
5
5
6
ModelSettings::ModelSettings()
6
ModelSettings::ModelSettings()
7
{
7
{
8
}
8
}
9
9
10
void ModelSettings::loadModelSettings()
10
void ModelSettings::loadModelSettings()
11
{
11
{
12
    XmlHelper xml(GlobalSettings::instance()->settings().node("model.settings"));
12
    XmlHelper xml(GlobalSettings::instance()->settings().node("model.settings"));
13
    growthEnabled = xml.valueBool("growthEnabled", true);
13
    growthEnabled = xml.valueBool("growthEnabled", true);
14
    mortalityEnabled = xml.valueBool("mortalityEnabled", true);
14
    mortalityEnabled = xml.valueBool("mortalityEnabled", true);
15
    lightExtinctionCoefficient = xml.valueDouble("lightExtinctionCoefficient", 0.5);
15
    lightExtinctionCoefficient = xml.valueDouble("lightExtinctionCoefficient", 0.5);
16
    lightExtinctionCoefficientOpacity=xml.valueDouble("lightExtinctionCoefficientOpacity", 0.5);
16
    lightExtinctionCoefficientOpacity=xml.valueDouble("lightExtinctionCoefficientOpacity", 0.5);
17
    temperatureTau=xml.valueDouble("temperatureTau",5);
17
    temperatureTau=xml.valueDouble("temperatureTau",5);
18
    epsilon = xml.valueDouble("epsilon",1.8); // max light use efficiency (aka alpha_c)
18
    epsilon = xml.valueDouble("epsilon",1.8); // max light use efficiency (aka alpha_c)
19
    airDensity = xml.valueDouble("airDensity", 1.2);
19
    airDensity = xml.valueDouble("airDensity", 1.2);
20
    airPressure = xml.valueDouble("airPressure", 1013);
-
 
21
    heatCapacityAir = xml.valueDouble("heatCapacityAir", 1012);
-
 
22
-
 
23
-
 
-
 
20
    laiThresholdForClosedStands = xml.valueDouble("laiThresholdForClosedStands", 3.);
-
 
21
    boundaryLayerConductance = xml.valueDouble("boundaryLayerConductance", 0.02);
24
    XmlHelper world(GlobalSettings::instance()->settings().node("model.world"));
22
    XmlHelper world(GlobalSettings::instance()->settings().node("model.world"));
25
    latitude = RAD(world.valueDouble("latitude",48.));
23
    latitude = RAD(world.valueDouble("latitude",48.));
26
}
24
}
27
25
28
void ModelSettings::print()
26
void ModelSettings::print()
29
{
27
{
30
    QStringList set=QStringList() << "Settings:";
28
    QStringList set=QStringList() << "Settings:";
31
    set << QString("growthEnabled=%1").arg(growthEnabled);
29
    set << QString("growthEnabled=%1").arg(growthEnabled);
32
    set << QString("mortalityEnabled=%1").arg(mortalityEnabled);
30
    set << QString("mortalityEnabled=%1").arg(mortalityEnabled);
33
    set << QString("lightExtinctionCoefficient=%1").arg(lightExtinctionCoefficient);
31
    set << QString("lightExtinctionCoefficient=%1").arg(lightExtinctionCoefficient);
34
    set << QString("lightExtinctionCoefficientOpacity=%1").arg(lightExtinctionCoefficientOpacity);
32
    set << QString("lightExtinctionCoefficientOpacity=%1").arg(lightExtinctionCoefficientOpacity);
35
    set << QString("temperatureTau=%1").arg(temperatureTau);
33
    set << QString("temperatureTau=%1").arg(temperatureTau);
36
    set << QString("epsilon=%1").arg(epsilon);
34
    set << QString("epsilon=%1").arg(epsilon);
37
    set << QString("airDensity=%1").arg(airDensity);
35
    set << QString("airDensity=%1").arg(airDensity);
38
    set << QString("airPressure=%1").arg(airPressure);
-
 
39
    set << QString("heatCapacityAir=%1").arg(heatCapacityAir);
-
 
40
36
41
    set << QString("latitude=%1").arg(GRAD(latitude));
37
    set << QString("latitude=%1").arg(GRAD(latitude));
42
38
43
    qDebug() << set.join("\n");
39
    qDebug() << set.join("\n");
44
}
40
}
45
 
41