@@ -89,6 +89,8 @@ function ocean_init(
89
89
thermo_params = thermo_params,
90
90
# add dss_buffer to cache to avoid runtime dss allocation
91
91
dss_buffer = CC. Spaces. create_dss_buffer (CC. Fields. zeros (space)),
92
+ α_direct = CC. Fields. ones (space) .* params. α,
93
+ α_diffuse = CC. Fields. ones (space) .* params. α,
92
94
)
93
95
94
96
ode_algo = CTS. ExplicitAlgorithm (stepper)
@@ -110,8 +112,8 @@ Interfacer.get_field(sim::SlabOceanSimulation, ::Val{:area_fraction}) = sim.inte
110
112
Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:beta} ) = convert (eltype (sim. integrator. u), 1.0 )
111
113
Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:roughness_buoyancy} ) = sim. integrator. p. params. z0b
112
114
Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:roughness_momentum} ) = sim. integrator. p. params. z0m
113
- Interfacer. get_field (sim:: SlabOceanSimulation , :: Union{ Val{:surface_direct_albedo}, Val{:surface_diffuse_albedo}} ) =
114
- sim. integrator. p. params . α
115
+ Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:surface_direct_albedo} ) = sim . integrator . p . α_direct
116
+ Interfacer . get_field (sim :: SlabOceanSimulation , :: Val{:surface_diffuse_albedo} ) = sim. integrator. p. α_diffuse
115
117
Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:surface_humidity} ) = sim. integrator. p. q_sfc
116
118
Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:surface_temperature} ) = sim. integrator. u. T_sfc
117
119
Interfacer. get_field (sim:: SlabOceanSimulation , :: Val{:water} ) = nothing
137
139
function Interfacer. update_field! (sim:: SlabOceanSimulation , :: Val{:turbulent_energy_flux} , field)
138
140
parent (sim. integrator. p. F_turb_energy) .= parent (field)
139
141
end
142
+ function Interfacer. update_field! (sim:: SlabOceanSimulation , :: Val{:surface_direct_albedo} , field:: CC.Fields.Field )
143
+ sim. integrator. p. α_direct .= field
144
+ end
145
+ function Interfacer. update_field! (sim:: SlabOceanSimulation , :: Val{:surface_diffuse_albedo} , field:: CC.Fields.Field )
146
+ sim. integrator. p. α_diffuse .= field
147
+ end
140
148
141
149
# extensions required by FieldExchanger
142
150
Interfacer. step! (sim:: SlabOceanSimulation , t) = Interfacer. step! (sim. integrator, t - sim. integrator. t, true )
0 commit comments