Skip to content

Commit

Permalink
modified: experiments/ClimaEarth/components/land/climaland_bucket.jl
Browse files Browse the repository at this point in the history
	modified:   experiments/ClimaEarth/run_amip.jl
  • Loading branch information
akshaysridhar committed Oct 2, 2024
1 parent eb01481 commit 2a4754b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion experiments/ClimaEarth/components/land/climaland_bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function bucket_init(
date_ref::Dates.DateTime,
t_start::Float64,
energy_check::Bool,
surface_elevation,
) where {FT}
if config != "sphere"
println(
Expand Down Expand Up @@ -121,8 +122,15 @@ function bucket_init(
temp_anomaly = T_functions[land_temperature_anomaly]

# Set temperature IC including anomaly, based on atmospheric setup
T_sfc_0 = FT(271.0)
# Bucket surface temperature is in `p.bucket.T_sfc` (ClimaLand.jl)
lapse_rate = FT(6.5e-3)
T_sfc_0 = FT(271)
@. Y.bucket.T = T_sfc_0 + temp_anomaly(coords.subsurface)
# `surface_elevation` is a ClimaCore.Fields.Field(`half` level)
orog_adjusted_T = CC.Fields.field_values(Y.bucket.T) .- lapse_rate .* CC.Fields.field_values(surface_elevation)
# Adjust T based on surface elevation (p.bucket.T_sfc is then set using the
# set_initial_cache! function)
parent(Y.bucket.T) .= parent(orog_adjusted_T)

Y.bucket.W .= 0.15
Y.bucket.Ws .= 0.0
Expand Down
7 changes: 7 additions & 0 deletions experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ Utilities.show_memory_usage()

## init atmos model component
atmos_sim = atmos_init(atmos_config_object);
# Get surface elevation from `atmos` coordinate field
surface_elevation = CC.Fields.level(CC.Fields.coordinate_field(atmos_sim.integrator.u.f).z, CC.Utilities.half)
Utilities.show_memory_usage()

thermo_params = get_thermo_params(atmos_sim) # TODO: this should be shared by all models #342
Expand Down Expand Up @@ -283,8 +285,11 @@ if mode_name == "amip"
date_ref = date0,
t_start = t_start,
energy_check = energy_check,
surface_elevation,
)

# Update land surface temperature to account for orography

## ocean stub
SST_timevaryinginput = TimeVaryingInput(
sst_data,
Expand Down Expand Up @@ -369,6 +374,7 @@ elseif mode_name in ("slabplanet", "slabplanet_aqua", "slabplanet_terra")
date_ref = date0,
t_start = t_start,
energy_check = energy_check,
surface_elevation,
)

## ocean model
Expand Down Expand Up @@ -417,6 +423,7 @@ elseif mode_name == "slabplanet_eisenman"
date_ref = date0,
t_start = t_start,
energy_check = energy_check,
surface_elevation,
)

## ocean stub (here set to zero area coverage)
Expand Down

0 comments on commit 2a4754b

Please sign in to comment.