Subversion Repositories public iLand

Rev

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

Rev 368 Rev 372
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
    laiThresholdForClosedStands = xml.valueDouble("laiThresholdForClosedStands", 3.);
20
    laiThresholdForClosedStands = xml.valueDouble("laiThresholdForClosedStands", 3.);
21
    boundaryLayerConductance = xml.valueDouble("boundaryLayerConductance", 0.02);
-
 
-
 
21
    boundaryLayerConductance = xml.valueDouble("boundaryLayerConductance", 0.2);
22
    XmlHelper world(GlobalSettings::instance()->settings().node("model.world"));
22
    XmlHelper world(GlobalSettings::instance()->settings().node("model.world"));
23
    latitude = RAD(world.valueDouble("latitude",48.));
23
    latitude = RAD(world.valueDouble("latitude",48.));
24
}
24
}
25
25
26
void ModelSettings::print()
26
void ModelSettings::print()
27
{
27
{
28
    QStringList set=QStringList() << "Settings:";
28
    QStringList set=QStringList() << "Settings:";
29
    set << QString("growthEnabled=%1").arg(growthEnabled);
29
    set << QString("growthEnabled=%1").arg(growthEnabled);
30
    set << QString("mortalityEnabled=%1").arg(mortalityEnabled);
30
    set << QString("mortalityEnabled=%1").arg(mortalityEnabled);
31
    set << QString("lightExtinctionCoefficient=%1").arg(lightExtinctionCoefficient);
31
    set << QString("lightExtinctionCoefficient=%1").arg(lightExtinctionCoefficient);
32
    set << QString("lightExtinctionCoefficientOpacity=%1").arg(lightExtinctionCoefficientOpacity);
32
    set << QString("lightExtinctionCoefficientOpacity=%1").arg(lightExtinctionCoefficientOpacity);
33
    set << QString("temperatureTau=%1").arg(temperatureTau);
33
    set << QString("temperatureTau=%1").arg(temperatureTau);
34
    set << QString("epsilon=%1").arg(epsilon);
34
    set << QString("epsilon=%1").arg(epsilon);
35
    set << QString("airDensity=%1").arg(airDensity);
35
    set << QString("airDensity=%1").arg(airDensity);
36
36
37
    set << QString("latitude=%1").arg(GRAD(latitude));
37
    set << QString("latitude=%1").arg(GRAD(latitude));
38
38
39
    qDebug() << set.join("\n");
39
    qDebug() << set.join("\n");
40
}
40
}
41
 
41