1#ifndef M1D_MOD_MICROCLIMATE_SOIL_OSU_H
2#define M1D_MOD_MICROCLIMATE_SOIL_OSU_H
4#include "microclimatemodule.h"
7class MicroClimateOSU :
public MicroClimateModule {
11 MicroClimateOSU(ModelCore & modelCore,
unsigned int timeInterval) : MicroClimateModule(modelCore,timeInterval),
12 modelCore_(modelCore),
13 time_(modelCore.getLandscape().getTime()),
14 si_(modelCore.getInput().getSite()),
15 sppar_(modelCore.getInput().getParameter().getSpeciesPar()),
16 mc_(const_cast<MicroClimate &>(modelCore.getSubstates().getMc())),
17 sc_(modelCore.getSubstates().getSc()),
18 wc_(modelCore.getSubstates().getWc()),
19 ph_(modelCore.getSubstates().getPh()),
20 vs_(modelCore.getSubstates().getVs())
22 this->setName(
"MicroClimateOSU");
23 mois_sl_OSU =
new double[slMaxOSU+1];
24 temp_sl_OSU =
new double[slMaxOSU+1];
25 h_sl_OSU =
new double[slMaxOSU+1];
26 poro_sl_OSU =
new double[slMaxOSU+1];
42 void solve() { this->run_( ); }
45 ModelCore & modelCore_;
50 SoilChemistry
const & sc_;
51 WaterCycle
const & wc_;
52 Physiology
const & ph_;
53 VegStructure
const & vs_;
75 static const int IITERMAX;
76 static const int slMaxOSU;
77 static const double HBASE;
78 static const double DTMIN0;
79 static const double CVSOIL;
80 static const double SALBF;
110 double h_fl1,tempK_fl1,slrad_fl1,vpd_fl1,win_fl1,hum_fl1;
111 double slrad,lrad,tempK,tempK_l,tempK_bd,press,vps;
112 double hslcum,hslOSUcum,hslOSUcumOld,hslrest;
113 double hLim,hx,hy,dhsl,fhsl;
124 inline double Max(
double x,
double y){
125 return (x > y) ? x : y;
128 inline double Min(
double x,
double y){
129 return (x > y) ? y : x;
150 inline double Sqr(
double x){
154 inline double Power(
double x,
double y){
165 inline double Abs(
double x){
166 return ( x < 0.0) ? -x : x;
169 inline double Sum(
double *array,
int iMax){
171 for (
int i = 1; i <= iMax; i++){
172 val = val + array[i];