Skip to content

Commit

Permalink
Merge #2149
Browse files Browse the repository at this point in the history
2149: Move parameter logging to `get_integrator` r=nefrathenrici a=nefrathenrici

From `@Sbozzolo's` comment on #2087


Co-authored-by: nefrathenrici <nat.henrici@gmail.com>
  • Loading branch information
bors[bot] and nefrathenrici authored Sep 27, 2023
2 parents ec03d4e + f8d2c59 commit bac0b76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/parameters/create_parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import SurfaceFluxes.UniversalFunctions as UF
import Insolation.Parameters as IP
import Thermodynamics as TD
import CloudMicrophysics as CM
# TODO: Remove these imports?
import ClimaCore
import ClimaCore as CC

function create_parameter_set(config::AtmosConfig)
# Helper function that creates a parameter struct. If a struct has nested
Expand Down Expand Up @@ -70,7 +67,7 @@ function create_parameter_set(config::AtmosConfig)
TCP.TurbulenceConvectionParameters;
subparam_structs = (; microphys_params, surf_flux_params),
)
param_set = create_parameter_struct(
return create_parameter_struct(
CAP.ClimaAtmosParameters;
subparam_structs = (;
thermodynamics_params = thermo_params,
Expand All @@ -81,9 +78,4 @@ function create_parameter_set(config::AtmosConfig)
turbconv_params,
),
)
if parsed_args["log_params"]
logfilepath = joinpath(@__DIR__, "$(parsed_args["job_id"])_$FT.toml")
CP.log_parameter_information(toml_dict, logfilepath)
end
return param_set
end
4 changes: 4 additions & 0 deletions src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ function get_integrator(config::AtmosConfig)
atmos = get_atmos(config, params)
numerics = get_numerics(config.parsed_args)
simulation = get_simulation(config, config.comms_ctx)
if config.parsed_args["log_params"]
filepath = joinpath(simulation.output_dir, "$(job_id)_parameters.toml")
CP.log_parameter_information(config.toml_dict, filepath)
end
initial_condition = get_initial_condition(config.parsed_args)
surface_setup = get_surface_setup(config.parsed_args)

Expand Down

0 comments on commit bac0b76

Please sign in to comment.