@@ -67,6 +67,9 @@ function BucketSimulation(
6767 energy_check:: Bool = false ,
6868 parameter_files = [],
6969) where {FT, TT <: Union{Float64, ITime} }
70+ # Construct the parameter dictionary based on the float type and any parameter files
71+ toml_dict = LP. create_toml_dict (FT; override_files = parameter_files)
72+
7073 # Note that this does not take into account topography of the surface, which is OK for this land model.
7174 # But it must be taken into account when computing surface fluxes, for Δz.
7275 if isnothing (shared_surface_space)
@@ -89,10 +92,9 @@ function BucketSimulation(
8992 surface_elevation = Interfacer. remap (surface_elevation, surface_space)
9093 end
9194
92- α_snow = FT (0.8 ) # snow albedo
9395 if albedo_type == " map_static" # Read in albedo from static data file (default type)
9496 # By default, this uses a file containing bareground albedo without a time component. Snow albedo is specified separately.
95- albedo = CL. Bucket. PrescribedBaregroundAlbedo {FT} (α_snow , surface_space)
97+ albedo = CL. Bucket. PrescribedBaregroundAlbedo (toml_dict , surface_space)
9698 elseif albedo_type == " map_temporal" # Read in albedo from data file containing data over time
9799 # By default, this uses a file containing linearly-interpolated monthly data of clear-sky albedo, generated from CERES.
98100 albedo = CL. Bucket. PrescribedSurfaceAlbedo {FT} (
@@ -106,36 +108,18 @@ function BucketSimulation(
106108 (; lat, long) = coordinate_point
107109 return typeof (lat)(0.38 )
108110 end
111+ α_snow = toml_dict[" alpha_snow" ] # snow albedo
109112 albedo =
110113 CL. Bucket. PrescribedBaregroundAlbedo {FT} (α_snow, α_bareground, surface_space)
111114 else
112115 error (" invalid albedo type $albedo_type " )
113116 end
114117
115- z_0m = FT (1e-3 ) # roughness length for momentum over smooth bare soil
116- z_0b = FT (1e-3 ) # roughness length for tracers over smooth bare soil
117- τc = FT (float (dt)) # This is the timescale on which snow exponentially damps to zero, in the case where all
118+ # This is the timescale on which snow exponentially damps to zero, in the case where all
118119 # the snow would melt in time `τc`. It prevents us from having to specially time step in cases where
119120 # all the snow melts in a single timestep.
120- σS_c = FT (0.2 ) # critical snow water equivalent
121- W_f = FT (0.2 ) # bucket capacity
122- κ_soil = FT (1.5 ) # soil conductivity
123- ρc_soil = FT (2e6 ) # soil volumetric heat capacity
124-
125- params = if isempty (parameter_files)
126- CL. Bucket. BucketModelParameters (FT; albedo, z_0m, z_0b, τc, σS_c, W_f, κ_soil, ρc_soil)
127- else
128- # this is a temporary hack and should be updated properly
129- toml_dict = CP. create_toml_dict (
130- FT;
131- override_file = CP. merge_toml_files (
132- [CL. Parameters. DEFAULT_PARAMS_FILEPATH, parameter_files... ];
133- override = true ,
134- ),
135- )
136- # τc should be the only exception, it depends on `dt`
137- CL. Bucket. BucketModelParameters (toml_dict; z_0m, z_0b, albedo, τc)
138- end
121+ τc = FT (float (dt))
122+ params = CL. Bucket. BucketModelParameters (toml_dict; albedo, τc)
139123
140124 args = (params, CL. CoupledAtmosphere {FT} (), CL. CoupledRadiativeFluxes {FT} (), domain)
141125 model = CL. Bucket. BucketModel {FT, typeof.(args)...} (args... )
0 commit comments