-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
129 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
using DocStringExtensions: TYPEDFIELDS | ||
using DataFrames: DataFrame | ||
|
||
include("Ipaper.jl") | ||
include("helpers.jl") | ||
include("s_coszs.jl") | ||
include("lai2.jl") | ||
include("aerodynamic_conductance.jl") | ||
|
||
include("AirLayer.jl") | ||
include("fill_meteo.jl") | ||
|
||
include("lai2.jl") | ||
include("aerodynamic_conductance.jl") | ||
|
||
export s_coszs, lai2, aerodynamic_conductance_jl | ||
export s_coszs, lai2, aerodynamic_conductance_jl, fill_meteo! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using DataFrames: DataFrame | ||
|
||
|
||
function q2RH(hum::FT, tem::FT)::FT | ||
# Vapour pressure in mbar | ||
ea = 0.46 * hum * (tem + 273.16) / 100 | ||
es = 6.1078 * exp((17.269 * tem) / (237.3 + tem)) | ||
clamp(ea / es * 100, 0.0, 100.0) | ||
end | ||
|
||
""" | ||
Srad: W m-2 | ||
temp: degC | ||
rain: m | ||
wind: m/s | ||
hum: specific humidity, q | ||
""" | ||
function fill_meteo!(meteo::ClimateData, | ||
rad::FT, tem::FT, pre::FT, wind::FT, hum::FT) | ||
|
||
meteo.Srad = rad | ||
meteo.temp = tem | ||
meteo.rain = pre / 1000 # m to mm | ||
meteo.wind = wind | ||
meteo.LR = -200.0 # -200.0 means no measured long-wave radiation, the value will be | ||
meteo.rh = q2RH(hum, tem) | ||
end | ||
|
||
function fill_meteo!(meteo::ClimateData, d::DataFrame, k::Int=1) | ||
fill_meteo!(meteo, d.rad[k], d.tem[k], d.pre[k], d.wind[k], d.hum[k]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
|
||
|
||
|
||
function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::Float64, p::Soil) | ||
p.n_layer = 5 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function Init_Soil_var_o(p_soil::AbstractSoil, var_o::Vector, | ||
meteo::ClimateData, parameter::Vector, par::NamedTuple) | ||
# landcover::Int, soil_type::Int, Tsoil, soilwater, snowdepth | ||
# /***** initialize soil conditions, read soil parameters and set depth *****/ | ||
Init_Soil_Parameters(par.landcover, par.soil_type, parameter[28], p_soil) | ||
p_soil.r_drainage = parameter[27] | ||
Init_Soil_Status(p_soil, par.Tsoil, meteo.temp, par.soilwater, par.snowdepth) # LHE | ||
|
||
# Initialize intermediate variables array | ||
var_o .= 0 | ||
for i = 4:9 | ||
var_o[i] = meteo.temp | ||
end | ||
for i = 10:15 | ||
var_o[i] = p_soil.Tsoil_p[i-9] | ||
end | ||
for i = 22:27 | ||
var_o[i] = p_soil.θ_prev[i-21] | ||
end | ||
for i = 28:33 | ||
var_o[i] = p_soil.ice_ratio[i-27] | ||
end | ||
# for (i=0;i<=40;i++) var_o[i] = 0; | ||
# for (i=3;i<=8;i++) var_o[i] = tem; | ||
# for(i=9;i<=14;i++) var_o[i] = p_soil->Tsoil_p[i-9]; | ||
# for(i=21;i<=26;i++) var_o[i] = p_soil->θ_prev[i-21]; | ||
# for(i=27;i<=32;i++) var_o[i] = p_soil->ice_ratio[i-27]; | ||
nothing | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.