From b1118b3985376ed02ac51e2299b464067d55101d Mon Sep 17 00:00:00 2001 From: LenkaNovak Date: Wed, 7 Feb 2024 15:55:01 -0800 Subject: [PATCH] adjust roughness bring back allskywithclear gridscale ocean 5e-5 decrease bucket init W ocean 1e-4 revert allsky ocean 5e-4 softfail for gpurun rev: clean slab params clean tests --- ...rse_single_ft64_hourly_checkpoints_co2.yml | 2 +- .../AMIP/components/land/bucket_init.jl | 6 ++--- .../components/ocean/prescr_seaice_init.jl | 23 ++++++++++--------- .../AMIP/components/ocean/slab_ocean_init.jl | 22 +++++++++--------- .../prescr_seaice_tests.jl | 12 +--------- 5 files changed, 28 insertions(+), 37 deletions(-) diff --git a/config/model_configs/coarse_single_ft64_hourly_checkpoints_co2.yml b/config/model_configs/coarse_single_ft64_hourly_checkpoints_co2.yml index 46b0d4ad3f..62a0e19fdc 100644 --- a/config/model_configs/coarse_single_ft64_hourly_checkpoints_co2.yml +++ b/config/model_configs/coarse_single_ft64_hourly_checkpoints_co2.yml @@ -15,4 +15,4 @@ precip_model: "0M" rad: "gray" run_name: "coarse_single_ft64_hourly_checkpoints_co2" t_end: "32days" -vert_diff: "true" +vert_diff: "true" \ No newline at end of file diff --git a/experiments/AMIP/components/land/bucket_init.jl b/experiments/AMIP/components/land/bucket_init.jl index f9059fdf93..e17fe83e19 100644 --- a/experiments/AMIP/components/land/bucket_init.jl +++ b/experiments/AMIP/components/land/bucket_init.jl @@ -128,8 +128,8 @@ function bucket_init( σS_c = FT(0.2) W_f = FT(10) d_soil = FT(3.5) # soil depth - z_0m = FT(1e-2) - z_0b = FT(1e-3) + z_0m = FT(1e-3) # roughness length for momentum over smooth bare soil + z_0b = FT(1e-3) # roughness length for tracers over smooth bare soil κ_soil = FT(0.7) ρc_soil = FT(2e8) t_crit = FT(dt) # This is the timescale on which snow exponentially damps to zero, in the case where all @@ -156,7 +156,7 @@ function bucket_init( T_sfc_0 = FT(271.0) @. Y.bucket.T = T_sfc_0 + temp_anomaly(coords.subsurface) - Y.bucket.W .= 10.0 + Y.bucket.W .= 6.5 Y.bucket.Ws .= 0.0 Y.bucket.σS .= 0.0 diff --git a/experiments/AMIP/components/ocean/prescr_seaice_init.jl b/experiments/AMIP/components/ocean/prescr_seaice_init.jl index 12c39571e8..926c92c1ea 100644 --- a/experiments/AMIP/components/ocean/prescr_seaice_init.jl +++ b/experiments/AMIP/components/ocean/prescr_seaice_init.jl @@ -35,17 +35,18 @@ end name(::PrescribedIceSimulation) = "PrescribedIceSimulation" # sea-ice parameters -struct IceSlabParameters{FT <: AbstractFloat} - h::FT # ice thickness [m] - ρ::FT # density of sea ice [kg / m3] - c::FT # specific heat of sea ice [J / kg / K] - T_base::FT # temperature of sea water at the ice base - z0m::FT # roughness length for momentum [m] - z0b::FT # roughness length for tracers [m] - T_freeze::FT # freezing point of sea water [K] - k_ice::FT # thermal condictivity of ice [W / m / K] (less in HM71) - α::FT # sea ice albedo +Base.@kwdef struct IceSlabParameters{FT <: AbstractFloat} + h::FT = 2 # ice thickness [m] + ρ::FT = 900 # density of sea ice [kg / m3] + c::FT = 2100 # specific heat of sea ice [J / kg / K] + T_base::FT = 271.2 # temperature of sea water at the ice base + z0m::FT = 1e-4 # roughness length for momentum [m] + z0b::FT = 1e-4 # roughness length for tracers [m] + T_freeze::FT = 271.2 # freezing temperature of sea water [K] + k_ice::FT = 2 # thermal conductivity of sea ice [W / m / K] (less in HM71) + α::FT = 0.8 # albedo of sea ice [0, 1] end + name(::IceSlabParameters) = "IceSlabParameters" # init simulation @@ -93,7 +94,7 @@ Initializes the `DiffEq` problem, and creates a Simulation-type object containin """ function ice_init(::Type{FT}; tspan, saveat, dt, space, area_fraction, thermo_params, stepper = CTS.RK4()) where {FT} - params = IceSlabParameters(FT(2), FT(900.0), FT(2100.0), FT(271.2), FT(1e-3), FT(1e-5), FT(271.2), FT(2.0), FT(0.8)) + params = IceSlabParameters{FT}() Y = slab_ice_space_init(FT, space, params) additional_cache = (; diff --git a/experiments/AMIP/components/ocean/slab_ocean_init.jl b/experiments/AMIP/components/ocean/slab_ocean_init.jl index de55c69b3c..1ab7dc66a7 100644 --- a/experiments/AMIP/components/ocean/slab_ocean_init.jl +++ b/experiments/AMIP/components/ocean/slab_ocean_init.jl @@ -24,16 +24,17 @@ end name(::SlabOceanSimulation) = "SlabOceanSimulation" # ocean parameters -struct OceanSlabParameters{FT <: AbstractFloat} - h::FT - ρ::FT - c::FT - T_init::FT - z0m::FT - z0b::FT - α::FT - evolving_switch::FT +Base.@kwdef struct OceanSlabParameters{FT <: AbstractFloat} + h::FT = 20 # depth of the ocean [m] + ρ::FT = 1500 # density of the ocean [kg / m3] + c::FT = 800 # specific heat of the ocean [J / kg / K] + T_init::FT = 271 # initial temperature of the ocean [K] + z0m::FT = 5e-4 # roughness length for momentum [m] + z0b::FT = 5e-4 # roughness length for heat [m] + α::FT = 0.38 # albedo of the ocean [0, 1] + evolving_switch::FT = 1 # switch to turn off the evolution of the ocean temperature [0 or 1] end + name(::SlabOceanSimulation) = "SlabOceanSimulation" """ @@ -95,8 +96,7 @@ function ocean_init( ) where {FT} evolving_switch = evolving ? FT(1) : FT(0) - params = - OceanSlabParameters(FT(20), FT(1500.0), FT(800.0), FT(271.0), FT(1e-5), FT(1e-5), FT(0.38), evolving_switch) + params = OceanSlabParameters{FT}(evolving_switch = evolving_switch) Y, space = slab_ocean_space_init(space, params) cache = ( diff --git a/test/component_model_tests/prescr_seaice_tests.jl b/test/component_model_tests/prescr_seaice_tests.jl index 4d57292d24..3c7ab7bf33 100644 --- a/test/component_model_tests/prescr_seaice_tests.jl +++ b/test/component_model_tests/prescr_seaice_tests.jl @@ -13,17 +13,7 @@ for FT in (Float32, Float64) @testset "test sea-ice energy slab for FT=$FT" begin function test_sea_ice_rhs(; F_radiative = 0.0, T_base = 271.2, global_mask = 1.0) space = create_space(FT) - params = IceSlabParameters( - FT(2), # ice thickness - FT(900.0), # density of sea ice - FT(2100.0), # specific heat of sea ice - FT(T_base), # temperature of sea water at the ice base - FT(1e-3), # roughness length for momentum - FT(1e-5), # roughness length for tracers - FT(271.2), # freezing point of sea water - FT(2.0),# thermal condictivity of ice - FT(0.8), # sea ice albedo - ) + params = IceSlabParameters{FT}(T_base = T_base) Y = slab_ice_space_init(FT, space, params) dY = slab_ice_space_init(FT, space, params) .* FT(0.0)