@@ -473,10 +473,10 @@ end
473473# ## ClimaAtmos.jl model-specific functions (not explicitly required by ClimaCoupler.jl)
474474# ##
475475"""
476- get_atmos_config_dict(coupler_dict ::Dict, atmos_output_dir)
476+ get_atmos_config_dict(coupler_config ::Dict, atmos_output_dir)
477477
478478Returns the specified atmospheric configuration (`atmos_config`) overwitten by arguments
479- in the coupler dictionary (`config_dict `).
479+ in the coupler dictionary (`coupler_config `).
480480The returned `atmos_config` dictionary will then be used to set up the atmosphere simulation.
481481
482482In this function, parameters are overwritten in a specific order, from lowest to highest priority:
@@ -489,20 +489,11 @@ The TOML parameter file to use is chosen using the following priority:
489489If a coupler TOML file is provided, it is used. Otherwise we use an atmos TOML
490490file if it's provided. If neither is provided, we use a default coupler TOML file.
491491"""
492- function get_atmos_config_dict (coupler_dict:: Dict , atmos_output_dir)
493- atmos_config_file = coupler_dict[" atmos_config_file" ]
494- # override default or specified configs with coupler arguments, and set the correct atmos config_file
495- if isnothing (atmos_config_file)
496- @info " Using Atmos default configuration"
497- atmos_config = merge (CA. default_config_dict (), coupler_dict, Dict (" config_file" => atmos_config_file))
498- else
499- @info " Using Atmos configuration from ClimaCoupler in $atmos_config_file "
500- atmos_config = merge (
501- CA. override_default_config (joinpath (pkgdir (ClimaCoupler), atmos_config_file)),
502- coupler_dict,
503- Dict (" config_file" => atmos_config_file),
504- )
505- end
492+ function get_atmos_config_dict (coupler_config:: Dict , atmos_output_dir)
493+ atmos_config = deepcopy (coupler_config)
494+
495+ # Rename atmosphere config file from ClimaCoupler convention to ClimaAtmos convention
496+ atmos_config[" config_file" ] = coupler_config[" atmos_config_file" ]
506497
507498 # use atmos toml if coupler toml is not defined
508499 # If we can't find the file at the relative path, prepend pkgdir(ClimaAtmos)
@@ -523,25 +514,25 @@ function get_atmos_config_dict(coupler_dict::Dict, atmos_output_dir)
523514 # Ensure Atmos's own checkpoints are synced up with ClimaCoupler, so that we
524515 # can pick up from where we have left. NOTE: This should not be needed, but
525516 # there is no easy way to initialize ClimaAtmos with a different t_start
526- atmos_config[" dt_save_state_to_disk" ] = coupler_dict [" checkpoint_dt" ]
517+ atmos_config[" dt_save_state_to_disk" ] = coupler_config [" checkpoint_dt" ]
527518
528519 # Add all extra atmos diagnostic entries into the vector of atmos diagnostics
529520 atmos_config[" diagnostics" ] =
530521 haskey (atmos_config, " diagnostics" ) ?
531- vcat (atmos_config[" diagnostics" ], coupler_dict [" extra_atmos_diagnostics" ]) :
532- coupler_dict [" extra_atmos_diagnostics" ]
522+ vcat (atmos_config[" diagnostics" ], coupler_config [" extra_atmos_diagnostics" ]) :
523+ coupler_config [" extra_atmos_diagnostics" ]
533524
534525 # The Atmos `get_simulation` function expects the atmos config to contains its timestep size
535- # in the `dt` field. If there is a `dt_atmos` field in coupler_dict , we add it to the atmos config as `dt`
536- dt_atmos = haskey (coupler_dict , " dt_atmos" ) ? coupler_dict [" dt_atmos" ] : coupler_dict [" dt" ]
526+ # in the `dt` field. If there is a `dt_atmos` field in coupler_config , we add it to the atmos config as `dt`
527+ dt_atmos = haskey (coupler_config , " dt_atmos" ) ? coupler_config [" dt_atmos" ] : coupler_config [" dt" ]
537528 atmos_config[" dt" ] = dt_atmos
538529
539530 # set restart file to the initial file saved in this location if it is not nothing
540531 # TODO this is hardcoded and should be fixed once we have a better restart system
541532 if ! isnothing (atmos_config[" restart_file" ])
542533 atmos_config[" restart_file" ] = replace (atmos_config[" restart_file" ], " active" => " 0000" )
543534 end
544- return atmos_config
535+ return CA . AtmosConfig ( atmos_config)
545536end
546537
547538"""
0 commit comments