Skip to content

Commit

Permalink
adjust roughness
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LenkaNovak committed Feb 10, 2024
1 parent a003ba3 commit 9a553a7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions experiments/AMIP/components/land/bucket_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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

Expand Down
23 changes: 12 additions & 11 deletions experiments/AMIP/components/ocean/prescr_seaice_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = (;
Expand Down
22 changes: 11 additions & 11 deletions experiments/AMIP/components/ocean/slab_ocean_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"

"""
Expand Down Expand Up @@ -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 = (
Expand Down
12 changes: 1 addition & 11 deletions test/component_model_tests/prescr_seaice_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9a553a7

Please sign in to comment.