@@ -42,20 +42,6 @@ struct BucketSimulation{
42
42
end
43
43
Interfacer. name (:: BucketSimulation ) = " BucketSimulation"
44
44
45
- """
46
- get_new_cache(p, Y, energy_check)
47
- Returns a new `p` with an updated field to store e_per_area if energy conservation
48
- checks are turned on.
49
- """
50
- function get_new_cache (p, Y, energy_check)
51
- if energy_check
52
- e_per_area_field = CC. Fields. zeros (axes (Y. bucket. W))
53
- return merge (p, (; e_per_area = e_per_area_field))
54
- else
55
- return p
56
- end
57
- end
58
-
59
45
"""
60
46
bucket_init
61
47
@@ -76,7 +62,6 @@ function BucketSimulation(
76
62
stepper = CTS. RK4 (),
77
63
albedo_type:: String = " map_static" ,
78
64
land_initial_condition:: String = " " ,
79
- energy_check:: Bool = false ,
80
65
parameter_files = [],
81
66
) where {FT, TT <: Union{Float64, ITime} }
82
67
α_snow = FT (0.8 ) # snow albedo
@@ -134,9 +119,6 @@ function BucketSimulation(
134
119
# Initial conditions with no moisture
135
120
Y, p, coords = CL. initialize (model)
136
121
137
- # Add space in the cache for the energy if energy checks are enabled
138
- p = get_new_cache (p, Y, energy_check)
139
-
140
122
# Get temperature anomaly function
141
123
T_functions = Dict (" aquaplanet" => temp_anomaly_aquaplanet, " amip" => temp_anomaly_amip)
142
124
haskey (T_functions, land_temperature_anomaly) ||
@@ -254,23 +236,7 @@ Interfacer.get_field(sim::BucketSimulation, ::Val{:surface_humidity}) =
254
236
CL. surface_specific_humidity (nothing , sim. model, sim. integrator. u, sim. integrator. p, sim. integrator. t)
255
237
Interfacer. get_field (sim:: BucketSimulation , :: Val{:surface_temperature} ) =
256
238
CL. surface_temperature (sim. model, sim. integrator. u, sim. integrator. p, sim. integrator. t)
257
-
258
- """
259
- Interfacer.get_field(sim::BucketSimulation, ::Val{:energy})
260
-
261
- Extension of Interfacer.get_field that provides the total energy contained in the bucket, including the latent heat due to snow melt.
262
- """
263
- function Interfacer. get_field (sim:: BucketSimulation , :: Val{:energy} )
264
- # required by ConservationChecker
265
- e_per_area = sim. integrator. p. e_per_area .= 0
266
- CC. Operators. column_integral_definite! (e_per_area, sim. model. parameters. ρc_soil .* sim. integrator. u. bucket. T)
267
-
268
- e_per_area .+ =
269
- - LP. LH_f0 (sim. model. parameters. earth_param_set) .* LP. ρ_cloud_liq (sim. model. parameters. earth_param_set) .*
270
- sim. integrator. u. bucket. σS
271
-
272
- return e_per_area
273
- end
239
+ Interfacer. get_field (sim:: BucketSimulation , :: Val{:energy} ) = sim. integrator. p. e_per_area
274
240
275
241
"""
276
242
Interfacer.get_field(sim::BucketSimulation, ::Val{:water})
0 commit comments