Skip to content

Commit a5cbdbb

Browse files
committed
clean
1 parent 9c1fef7 commit a5cbdbb

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

experiments/ClimaEarth/components/atmosphere/climaatmos.jl

+6-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ FluxCalculator.get_surface_params(sim::ClimaAtmosSimulation) = CAP.surface_fluxe
298298
get_atmos_config_dict(coupler_dict::Dict)
299299
300300
Returns the specified atmospheric configuration (`atmos_config`) overwitten by arguments
301-
in the coupler dictionary (`config_dict`). The returned dictionary will then be passed to CA.AtmosConfig().
301+
in the coupler dictionary (`config_dict`). The returned `atmos_config` dictionary will then be passed to CA.AtmosConfig().
302302
The `atmos_config_repo` flag allows us to
303303
use a configuration specified within the ClimaCoupler repo, which is useful for direct
304304
coupled/atmos-only comparisons.
@@ -351,14 +351,18 @@ function get_atmos_config_dict(coupler_dict)
351351
joinpath(coupler_dict["mode_name"], coupler_dict["run_name"]),
352352
"clima_atmos",
353353
)
354+
355+
# merge configs
356+
# (if there are common keys, the last dictionary in the `merge` arguments takes precedence)
354357
atmos_config = merge(atmos_config, Dict("output_dir" => atmos_output_dir))
358+
coupler_config = merge(config_dict_atmos, config_dict)
355359

356360
# set restart file to the initial file saved in this location if it is not nothing
357361
# TODO this is hardcoded and should be fixed once we have a better restart system
358362
if !isnothing(atmos_config["restart_file"])
359363
atmos_config["restart_file"] = replace(atmos_config["restart_file"], "active" => "0000")
360364
end
361-
return atmos_config
365+
return atmos_config, coupler_config
362366
end
363367

364368

experiments/ClimaEarth/run_amip.jl

+3-6
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,13 @@ if isinteractive()
9999
parsed_args["config_file"]
100100
end
101101

102-
## read in config dictionary from file, overriding the coupler defaults
103-
## (if there are common keys, the last dictionary in the `merge` arguments takes precedence)
102+
## read in config dictionary from file, overriding the coupler defaults in `parsed_args`
104103
config_dict = YAML.load_file(parsed_args["config_file"])
105104
config_dict = merge(parsed_args, config_dict)
106105

107106
## get component model dictionaries (if applicable)
108-
config_dict = get_atmos_config_dict(config_dict)
109-
110-
## merge dictionaries of command line arguments, coupler dictionary and component model dictionaries
111-
atmos_config_object = CA.AtmosConfig(config_dict)
107+
atmos_config_dict, config_dict = get_atmos_config_dict(config_dict)
108+
atmos_config_object = CA.AtmosConfig(atmos_config_dict)
112109

113110
## read in some parsed command line arguments, required by this script
114111
mode_name = config_dict["mode_name"]

experiments/ClimaEarth/run_dry_held_suarez.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ config_dict = Dict(
118118
)
119119

120120
## merge dictionaries of command line arguments, coupler dictionary and component model dictionaries
121-
config_dict = get_atmos_config_dict(config_dict)
122-
atmos_config_object = CA.AtmosConfig(config_dict)
121+
atmos_config_dict, config_dict = get_atmos_config_dict(config_dict)
122+
atmos_config_object = CA.AtmosConfig(atmos_config_dict)
123123

124124
#=
125125
## Setup Communication Context

experiments/ClimaEarth/run_moist_held_suarez.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ config_dict = Dict(
135135
# TODO: need to change moist HS params?
136136

137137
## merge dictionaries of command line arguments, coupler dictionary and component model dictionaries
138-
config_dict = get_atmos_config_dict(config_dict)
139-
atmos_config_object = CA.AtmosConfig(config_dict)
138+
atmos_config_dict, config_dict = get_atmos_config_dict(config_dict)
139+
atmos_config_object = CA.AtmosConfig(atmos_config_dict)
140140

141141
#=
142142
## Setup Communication Context

0 commit comments

Comments
 (0)