From 2a4754b145a60cf0cb7577ac3998514c2ca2c450 Mon Sep 17 00:00:00 2001 From: akshaysridhar Date: Tue, 1 Oct 2024 14:44:59 -0700 Subject: [PATCH] modified: experiments/ClimaEarth/components/land/climaland_bucket.jl modified: experiments/ClimaEarth/run_amip.jl --- .../ClimaEarth/components/land/climaland_bucket.jl | 10 +++++++++- experiments/ClimaEarth/run_amip.jl | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/experiments/ClimaEarth/components/land/climaland_bucket.jl b/experiments/ClimaEarth/components/land/climaland_bucket.jl index bd176df3e..28a19da06 100644 --- a/experiments/ClimaEarth/components/land/climaland_bucket.jl +++ b/experiments/ClimaEarth/components/land/climaland_bucket.jl @@ -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( @@ -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 diff --git a/experiments/ClimaEarth/run_amip.jl b/experiments/ClimaEarth/run_amip.jl index de51dcec9..c8b4144d7 100644 --- a/experiments/ClimaEarth/run_amip.jl +++ b/experiments/ClimaEarth/run_amip.jl @@ -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 @@ -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, @@ -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 @@ -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)