Skip to content

Commit 25d12a9

Browse files
committed
debugging eisenman
1 parent a95ce1b commit 25d12a9

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

experiments/ClimaEarth/components/ocean/eisenman_seaice.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ function solve_eisenman_model!(Y, Ya, p, thermo_params, Δt)
270270

271271
# local
272272
F_atm = @. F_turb + F_rad
273-
F_atmo∂T_sfc = get_∂F_rad_energy∂T_sfc.(T_sfc, Ref(p_i)) .+ ∂F_turb_energy∂T_sfc
273+
F_atmos∂T_sfc = get_∂F_rad_energy∂T_sfc(T_sfc, p_i) .+ ∂F_turb_energy∂T_sfc
274274

275275
# ice thickness and mixed layer temperature changes due to atmosphereic and ocean fluxes
276276
ice_covered = parent(h_ice)[1] > 0
@@ -308,7 +308,7 @@ function solve_eisenman_model!(Y, Ya, p, thermo_params, Δt)
308308
h = @. h_ice + Δh_ice
309309
F_conductive = @. k_ice / h * (T_base - T_sfc)
310310
numerator = @. -F_atm + F_conductive
311-
denominator = @. k_ice / h +F_atmo∂T_sfc
311+
denominator = @. k_ice / h +F_atmos∂T_sfc
312312
ΔT_sfc = @. numerator / denominator
313313
surface_melting = (parent(T_sfc .+ ΔT_sfc)[1] > T_freeze)
314314
if surface_melting

test/component_model_tests/eisenman_seaice_tests.jl

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Test: @test, @testset
22
import ClimaCore as CC
3+
import ClimaParams as CP
34
import Thermodynamics as TD
4-
import Thermodynamics.Parameters as TP
5+
import Thermodynamics.Parameters as TDP
56
import ClimaCoupler
67
import ClimaCoupler: Interfacer, Regridder, TestHelper
78

@@ -19,7 +20,7 @@ for FT in (Float32, Float64)
1920
boundary_space = TestHelper.create_space(FT)
2021

2122
# thermodynamic parameter set
22-
thermo_params = TP.ThermodynamicsParameters(FT)
23+
thermo_params = TDP.ThermodynamicsParameters(FT)
2324

2425
@testset "No net fluxes for FT=$FT" begin
2526
Y, Ya = state_init(params_ice, boundary_space)
@@ -32,7 +33,7 @@ for FT in (Float32, Float64)
3233
Y.T_ml .= params_ice.T_base
3334

3435
# no atmos fluxes, F_a
35-
Ya.∂F_turb_energy∂T_sfc .= .-get_∂F_rad_energy∂T_sfc.(Y.T_sfc, Ref(params_ice)) # ∂F_turb_energy∂T_sfc + ∂F_rad_energy∂T_sfc = 0
36+
Ya.∂F_turb_energy∂T_sfc .= .-get_∂F_rad_energy∂T_sfc(Y.T_sfc, params_ice) # ∂F_turb_energy∂T_sfc + ∂F_rad_energy∂T_sfc = 0
3637
Ya.F_rad .= 0
3738
Ya.F_turb .= 0
3839

@@ -247,7 +248,7 @@ for FT in (Float32, Float64)
247248
Y.T_sfc .= params_ice.T_base
248249

249250
# zero atmos fluxes and their derivatives
250-
Ya.∂F_turb_energy∂T_sfc .= .-get_∂F_rad_energy∂T_sfc.(Y.T_sfc, Ref(params_ice)) # ∂F_turb_energy∂T_sfc + ∂F_rad_energy∂T_sfc = 0
251+
Ya.∂F_turb_energy∂T_sfc .= .-get_∂F_rad_energy∂T_sfc(Y.T_sfc, params_ice) # ∂F_turb_energy∂T_sfc + ∂F_rad_energy∂T_sfc = 0
251252
Ya.F_turb .= 0
252253
Ya.F_rad .= 0
253254

@@ -279,7 +280,7 @@ for FT in (Float32, Float64)
279280
T_ml_0 = deepcopy(Y.T_ml)
280281

281282
# no atmos fluxes or their derivatives
282-
Ya.∂F_turb_energy∂T_sfc .= .-get_∂F_rad_energy∂T_sfc.(Y.T_sfc, Ref(params_ice)) # ∂F_turb_energy∂T_sfc + ∂F_rad_energy∂T_sfc = 0
283+
Ya.∂F_turb_energy∂T_sfc .= .-get_∂F_rad_energy∂T_sfc(Y.T_sfc, params_ice) # ∂F_turb_energy∂T_sfc + ∂F_rad_energy∂T_sfc = 0
283284
Ya.F_turb .= 0
284285
Ya.F_rad .= 0
285286

test/runtests.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727
@safetestset "FieldExchanger tests" begin
2828
include("field_exchanger_tests.jl")
2929
end
30-
gpu_broken || @safetestset "FluxCalculator tests" begin
30+
@safetestset "FluxCalculator tests" begin
3131
include("flux_calculator_tests.jl")
3232
end
3333
gpu_broken || @safetestset "Diagnostics tests" begin
@@ -54,7 +54,7 @@ end
5454
@safetestset "component model test: prescr. sea ice" begin
5555
include("component_model_tests/prescr_seaice_tests.jl")
5656
end
57-
gpu_broken || @safetestset "component model test: eisenman sea ice" begin
57+
@safetestset "component model test: eisenman sea ice" begin
5858
include("component_model_tests/eisenman_seaice_tests.jl")
5959
end
6060
@safetestset "component model test: slab ocean" begin

0 commit comments

Comments
 (0)