Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix evaporation with beta factor #735

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .buildkite/longruns_gpu/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ steps:
artifact_paths: "land_longrun_gpu/*png"
agents:
slurm_gpus: 1
slurm_time: 01:00:00
slurm_time: 03:00:00
env:
CLIMACOMMS_DEVICE: "CUDA"

Expand All @@ -47,6 +47,6 @@ steps:
artifact_paths: "soil_longrun_gpu/*png"
agents:
slurm_gpus: 1
slurm_time: 01:00:00
slurm_time: 03:00:00
env:
CLIMACOMMS_DEVICE: "CUDA"
3 changes: 2 additions & 1 deletion experiments/long_runs/soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
t0,
ref_time;
output_writer = nc_writer,
average_period = :monthly
)

diagnostic_handler =
Expand All @@ -439,7 +440,7 @@ end
function setup_and_solve_problem(; greet = false)

t0 = 0.0
tf = 60 * 60.0 * 24 * 60 # keep short until it runs! * 365
tf = 60 * 60.0 * 24 * 340
Δt = 900.0
nelements = (101, 15)
if greet
Expand Down
4 changes: 4 additions & 0 deletions src/shared_utilities/drivers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ function turbulent_fluxes_at_a_point(
SVector{2, FT}(u, 0),
ts_in,
)
q_in::FT = Thermodynamics.total_specific_humidity(thermo_params, ts_in);

# State containers
sc = SurfaceFluxes.ValuesOnly(
Expand Down Expand Up @@ -366,6 +367,9 @@ function turbulent_fluxes_at_a_point(

E0::FT = SurfaceFluxes.evaporation(surface_flux_params, sc, conditions.Ch)
E = E0 * r_ae / (r_sfc + r_ae)
if q_sfc < q_in # condensation breaks things
E *= 0
end
Ẽ = E / _ρ_liq
H = -ρ_air * cp_m * ΔT / r_ae
LH = _LH_v0 * E
Expand Down
1 change: 1 addition & 0 deletions src/standalone/Soil/Soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ import ClimaLand:
surface_emissivity,
surface_height,
surface_resistance,
surface_evaporative_scaling,
get_drivers
export RichardsModel,
RichardsParameters,
Expand Down
31 changes: 24 additions & 7 deletions src/standalone/Soil/energy_hydrology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,23 @@ function ClimaLand.surface_temperature(
return ClimaLand.Domains.top_center_to_surface(p.soil.T)
end

"""
"""
function ClimaLand.surface_evaporative_scaling(model::EnergyHydrology{FT}, Y, p) where {FT}
(; ν, θ_r, d_ds, earth_param_set, hydrology_cm) = model.parameters
θ_l_sfc = p.soil.sfc_scratch
ClimaLand.Domains.linear_interpolation_to_surface!(
θ_l_sfc,
p.soil.θ_l,
model.domain.fields.z,
model.domain.fields.Δz_top,
)
θ_i_sfc = ClimaLand.Domains.top_center_to_surface(Y.soil.θ_i)
hydrology_cm_sfc = ClimaLand.Domains.top_center_to_surface(hydrology_cm)
ν_sfc = ClimaLand.Domains.top_center_to_surface(ν)
θ_r_sfc = ClimaLand.Domains.top_center_to_surface(θ_r)
return @. 1 - exp(-effective_saturation(ν_sfc,θ_i_sfc + θ_l_sfc, θ_r_sfc)/FT(5e-2))
end
"""
ClimaLand.surface_resistance(
model::EnergyHydrology{FT},
Expand Down Expand Up @@ -825,13 +842,13 @@ function ClimaLand.surface_specific_humidity(
M_w = LP.molar_mass_water(model.parameters.earth_param_set)
thermo_params =
LP.thermodynamic_parameters(model.parameters.earth_param_set)
ψ_sfc = p.soil.sfc_scratch
ClimaLand.Domains.linear_interpolation_to_surface!(
ψ_sfc,
p.soil.ψ,
model.domain.fields.z,
model.domain.fields.Δz_top,
)
ψ_sfc = ClimaLand.Domains.top_center_to_surface(p.soil.ψ)#p.soil.sfc_scratch
#ClimaLand.Domains.linear_interpolation_to_surface!(
# ψ_sfc,
# p.soil.ψ,
# model.domain.fields.z,
# model.domain.fields.Δz_top,
#)
q_over_ice =
Thermodynamics.q_vap_saturation_generic.(
thermo_params,
Expand Down
Loading