Skip to content

Commit

Permalink
update document
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Aug 24, 2024
1 parent aeff33f commit 7e30a96
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 28 deletions.
38 changes: 19 additions & 19 deletions src/DataType/Soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,38 @@ abstract type AbstractSoil end
f_soilwater ::Cdouble = Cdouble(0)

dz ::Vector{Float64} = zeros(10)
f_root ::Vector{Float64} = zeros(10)
dt ::Vector{Float64} = zeros(10)
thermal_cond::Vector{Float64} = zeros(10)
theta_vfc ::Vector{Float64} = zeros(10)
θ_vwp ::Vector{Float64} = zeros(10)
θ_sat ::Vector{Float64} = zeros(10)
Ksat ::Vector{Float64} = zeros(10)
ψ_sat ::Vector{Float64} = zeros(10)
f_root ::Vector{Float64} = zeros(10) # root fraction
dt ::Vector{Float64} = zeros(10) # soil water stress factor
thermal_cond::Vector{Float64} = zeros(10) # thermal conductivity
theta_vfc ::Vector{Float64} = zeros(10) # volumetric field capacity
θ_vwp ::Vector{Float64} = zeros(10) # volumetric wilting point
θ_sat ::Vector{Float64} = zeros(10) # volumetric saturation
Ksat ::Vector{Float64} = zeros(10) # saturated hydraulic conductivity
ψ_sat ::Vector{Float64} = zeros(10) # soil matric potential at saturation
b ::Vector{Float64} = zeros(10) # Cambell parameter b
density_soil::Vector{Float64} = zeros(10)
density_soil::Vector{Float64} = zeros(10) # soil density
f_org ::Vector{Float64} = zeros(10) # organic matter
ice_ratio ::Vector{Float64} = zeros(10) # ice ratio
θ ::Vector{Float64} = zeros(10) # soil moisture
θ_prev ::Vector{Float64} = zeros(10) # soil moisture in previous time
Tsoil_p ::Vector{Float64} = zeros(10) # soil temperature in previous time
Tsoil_c ::Vector{Float64} = zeros(10) # soil temperature in current time

f_water ::Vector{Float64} = zeros(10)
ψ ::Vector{Float64} = zeros(10)
f_water ::Vector{Float64} = zeros(10) # not used
ψ ::Vector{Float64} = zeros(10) # soil matric potential
θb ::Vector{Float64} = zeros(10) # not used, θ at the bottom of each layer
ψb ::Vector{Float64} = zeros(10) # not used
r_waterflow ::Vector{Float64} = zeros(10)
km ::Vector{Float64} = zeros(10) # hydraulic conductivity
r_waterflow ::Vector{Float64} = zeros(10) # vertical water flow rate
km ::Vector{Float64} = zeros(10) # hydraulic conductivity at middle point
Kb ::Vector{Float64} = zeros(10) # not used
KK ::Vector{Float64} = zeros(10) # average conductivity of two soil layers
Cs ::Vector{Float64} = zeros(10)
lambda ::Vector{Float64} = zeros(10)
Ett ::Vector{Float64} = zeros(10)
G ::Vector{Float64} = zeros(10)
Cs ::Vector{Float64} = zeros(10)
lambda ::Vector{Float64} = zeros(10)
Ett ::Vector{Float64} = zeros(10) # ET in each layer. derived var
G ::Vector{Float64} = zeros(10)

# temporary variables in soil_water_factor_v2
ft ::Vector{Float64} = zeros(10)
dtt ::Vector{Float64} = zeros(10)
ft ::Vector{Float64} = zeros(10)
dtt ::Vector{Float64} = zeros(10)
fpsisr ::Vector{Float64} = zeros(10)
end
29 changes: 23 additions & 6 deletions src/Soil/Init_Soil_Parameters.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
"""
Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::Float64, p::Soil)
Initialize soil parameters
- `Ksat` : saturated hydraulic conductivity
- `porosity` : porosity
- `θ_vfc` : field capacity
- `θ_vwp` : wilt point
- `thermal_cond` : thermal conductivity
- `ψ_sat` : water potential at saturate
"""
function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::Float64, p::Soil)
p.n_layer = 5

Expand All @@ -9,7 +21,12 @@ function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::F
p.alpha = 0.4
end

p.dz[1:5] .= [0.05, 0.10, 0.20, 0.40, 1.25]
p.dz[1:5] .= [0.05, 0.10, 0.20, 0.40, 1.25] # BEPS V2023
# z = [0, 5, 15, 25, 35, 45, 55.0] ./ 100
# z_mid = (z[1:end-1] .+ z[2:end]) ./ 2
# dz = diff(z)
# n = length(z)
# p.dz[1:n-1] = dz

p.r_root_decay = r_root_decay
SoilRootFraction(p)
Expand All @@ -19,7 +36,7 @@ function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::F

if stxt == 1 # sand
b = [1.7, 1.9, 2.1, 2.3, 2.5]
Ksat = [0.000058, 0.000052, 0.000046, 0.000035, 0.000010] # saturated hydraulic conductivity
Ksat = [0.000058, 0.000052, 0.000046, 0.000035, 0.000010] #
porosity = [0.437, 0.437, 0.437, 0.437, 0.437]# porosity
θ_vfc = [0.09, 0.09, 0.09, 0.09, 0.09] # field capacity
θ_vwp = [0.03, 0.03, 0.03, 0.03, 0.03] # wilt point
Expand All @@ -28,7 +45,7 @@ function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::F

elseif stxt == 2 # loamy sand
b = [2.1, 2.3, 2.5, 2.7, 2.9]
Ksat = [0.000017, 0.000015, 0.000014, 0.000010, 0.000003] # saturated hydraulic conductivity
Ksat = [0.000017, 0.000015, 0.000014, 0.000010, 0.000003]
porosity = [0.437, 0.437, 0.437, 0.437, 0.437] # porosity
θ_vfc = [0.21, 0.21, 0.21, 0.21, 0.21] # field capacity
θ_vwp = [0.06, 0.06, 0.06, 0.06, 0.06] # wilt point
Expand All @@ -37,7 +54,7 @@ function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::F

elseif stxt == 3 # sandy loam
b = [3.1, 3.3, 3.5, 3.7, 3.9]
Ksat = [0.0000072, 0.00000648, 0.00000576, 0.00000432, 0.00000144] # saturated hydraulic conductivity
Ksat = [0.0000072, 0.00000648, 0.00000576, 0.00000432, 0.00000144]
porosity = [0.453, 0.453, 0.453, 0.453, 0.453] # porosity
θ_vfc = [0.21, 0.21, 0.21, 0.21, 0.21] # field capacity
θ_vwp = [0.10, 0.10, 0.10, 0.10, 0.10] # wilt point
Expand All @@ -46,7 +63,7 @@ function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::F

elseif stxt == 4 # loam
b = [4.5, 4.7, 4.9, 5.1, 5.3]
Ksat = [0.0000037, 0.0000033, 0.00000296, 0.00000222, 0.00000074] # saturated hydraulic conductivity
Ksat = [0.0000037, 0.0000033, 0.00000296, 0.00000222, 0.00000074]
porosity = [0.463, 0.463, 0.463, 0.463, 0.463] # porosity
θ_vfc = [0.27, 0.27, 0.27, 0.27, 0.27] # field capacity
θ_vwp = [0.12, 0.12, 0.12, 0.12, 0.12] # wilt point
Expand All @@ -55,7 +72,7 @@ function Init_Soil_Parameters(landcover::Integer, stxt::Integer, r_root_decay::F

elseif stxt == 5 # silty loam
b = [4.7, 4.9, 5.1, 5.3, 5.5]
Ksat = [0.0000019, 0.0000017, 0.00000152, 0.00000114, 0.00000038] # saturated hydraulic conductivity
Ksat = [0.0000019, 0.0000017, 0.00000152, 0.00000114, 0.00000038]
porosity = [0.501, 0.501, 0.501, 0.501, 0.501] # porosity
θ_vfc = [0.33, 0.33, 0.33, 0.33, 0.33] # field capacity
θ_vwp = [0.13, 0.13, 0.13, 0.13, 0.13] # wilt point
Expand Down
2 changes: 1 addition & 1 deletion src/Soil/soil_water_factor_v2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function soil_water_factor_v2(p::Soil)
for i in 1:n
p.dtt[i] = FW_VERSION == 1 ? p.f_root[i] * p.fpsisr[i] : p.f_root[i]
end
dtt_sum = sum(p.dtt)
dtt_sum = sum(p.dtt) # 每层的土壤水分限制因子

if dtt_sum < 0.000001
p.f_soilwater = 0.1
Expand Down
5 changes: 3 additions & 2 deletions src/evaporation_soil.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
# Return
Ewater: evaporation from water
Esoil: evaporation from soil
- `Ewater`: evaporation from water
- `Esoil`: evaporation from soil
- `Esoil_g`: evaporation from snow
"""
function evaporation_soil_jl(Tair::FT, Tg::FT, RH::FT, Rn_g::FT, Gheat_g::FT,
# perc_snow_g::Ref{FT},
Expand Down

0 comments on commit 7e30a96

Please sign in to comment.