From 7e30a96c43327bc8b796d4b02cd2cb7cbf36d5ed Mon Sep 17 00:00:00 2001 From: Dongdong Kong Date: Sat, 24 Aug 2024 15:42:10 +0800 Subject: [PATCH] update document --- src/DataType/Soil.jl | 38 ++++++++++++++++---------------- src/Soil/Init_Soil_Parameters.jl | 29 +++++++++++++++++++----- src/Soil/soil_water_factor_v2.jl | 2 +- src/evaporation_soil.jl | 5 +++-- 4 files changed, 46 insertions(+), 28 deletions(-) diff --git a/src/DataType/Soil.jl b/src/DataType/Soil.jl index a678c56..d6d23a8 100644 --- a/src/DataType/Soil.jl +++ b/src/DataType/Soil.jl @@ -17,16 +17,16 @@ 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 @@ -34,21 +34,21 @@ abstract type AbstractSoil end 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 diff --git a/src/Soil/Init_Soil_Parameters.jl b/src/Soil/Init_Soil_Parameters.jl index c1033e1..503a1be 100644 --- a/src/Soil/Init_Soil_Parameters.jl +++ b/src/Soil/Init_Soil_Parameters.jl @@ -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 @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/Soil/soil_water_factor_v2.jl b/src/Soil/soil_water_factor_v2.jl index 7b84b2c..c9e09ce 100644 --- a/src/Soil/soil_water_factor_v2.jl +++ b/src/Soil/soil_water_factor_v2.jl @@ -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 diff --git a/src/evaporation_soil.jl b/src/evaporation_soil.jl index ec6f34a..581ea43 100644 --- a/src/evaporation_soil.jl +++ b/src/evaporation_soil.jl @@ -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},