diff --git a/config/benchmark_configs/amip_diagedmf.yml b/config/benchmark_configs/amip_diagedmf.yml index 961aac02b8..4fb08bf0d2 100644 --- a/config/benchmark_configs/amip_diagedmf.yml +++ b/config/benchmark_configs/amip_diagedmf.yml @@ -1,5 +1,6 @@ anim: false -atmos_config_file: "config/gpu_configs/gpu_aquaplanet_diagedmf.yml" +atmos_config_file: "config/benchmark_configs/climaatmos_diagedmf.yml" +atmos_config_repo: "ClimaCoupler" dt_cpl: 100 dt_save_state_to_disk: "Inf" dt_save_to_sol: "Inf" diff --git a/config/benchmark_configs/gpu_amip_diagedmf.yml b/config/benchmark_configs/gpu_amip_diagedmf.yml index d353dbb8db..005b38556b 100644 --- a/config/benchmark_configs/gpu_amip_diagedmf.yml +++ b/config/benchmark_configs/gpu_amip_diagedmf.yml @@ -1,5 +1,6 @@ anim: false -atmos_config_file: "config/gpu_configs/gpu_aquaplanet_diagedmf.yml" +atmos_config_file: "config/benchmark_configs/gpu_climaatmos_diagedmf.yml" +atmos_config_repo: "ClimaCoupler" dt_cpl: 100 dt_save_state_to_disk: "Inf" dt_save_to_sol: "Inf" diff --git a/experiments/AMIP/cli_options.jl b/experiments/AMIP/cli_options.jl index a533f6abd5..23138fe718 100644 --- a/experiments/AMIP/cli_options.jl +++ b/experiments/AMIP/cli_options.jl @@ -89,6 +89,10 @@ function argparse_settings() default = "PrescribedSurface" "--atmos_config_file" help = "A yaml file used to set the atmospheric model configuration. If nothing is specified, the default configuration is used." + "--atmos_config_repo" + help = "The repository containing the ClimaAtmos configuration file to use [`ClimaAtmos` (default), `ClimaCoupler`]" + arg_type = String + default = "ClimaAtmos" # ClimaLand specific "--land_albedo_type" help = "Access land surface albedo information from data file. [`function`, `map_static`, `map_temporal`]" diff --git a/experiments/AMIP/components/atmosphere/climaatmos.jl b/experiments/AMIP/components/atmosphere/climaatmos.jl index c5449875f9..c670be8b4f 100644 --- a/experiments/AMIP/components/atmosphere/climaatmos.jl +++ b/experiments/AMIP/components/atmosphere/climaatmos.jl @@ -238,21 +238,36 @@ FluxCalculator.get_surface_params(sim::ClimaAtmosSimulation) = CAP.surface_fluxe get_atmos_config(coupler_dict::Dict) Returns the specified atmospheric configuration (`atmos_config_dict`) overwitten by arguments -in the coupler dictionary (`config_dict`). +in the coupler dictionary (`config_dict`). The `atmos_config_repo` flag allows us to +use a configuration specified within the ClimaCoupler repo, which is useful for direct +coupled/atmos-only comparisons. """ function get_atmos_config(coupler_dict) atmos_config_file = coupler_dict["atmos_config_file"] + atmos_config_repo = coupler_dict["atmos_config_repo"] # override default or specified configs with coupler arguments, and set the correct atmos config_file - if isnothing(atmos_config_file) - @info "Using Atmos default configuration" - atmos_config = merge(CA.default_config_dict(), coupler_dict, Dict("config_file" => atmos_config_file)) - else - @info "Using Atmos configuration from $atmos_config_file" + if atmos_config_repo == "ClimaCoupler" + @assert !isnothing(atmos_config_file) "Must specify `atmos_config_file` within ClimaCoupler." + @info "Using Atmos configuration from ClimaCoupler in $atmos_config_file" atmos_config = merge( - CA.override_default_config(joinpath(pkgdir(CA), atmos_config_file)), + CA.override_default_config(joinpath(pkgdir(ClimaCoupler), atmos_config_file)), coupler_dict, Dict("config_file" => atmos_config_file), ) + elseif atmos_config_repo == "ClimaAtmos" + if isnothing(atmos_config_file) + @info "Using Atmos default configuration" + atmos_config = merge(CA.default_config_dict(), coupler_dict, Dict("config_file" => atmos_config_file)) + else + @info "Using Atmos configuration from $atmos_config_file" + atmos_config = merge( + CA.override_default_config(joinpath(pkgdir(CA), atmos_config_file)), + coupler_dict, + Dict("config_file" => atmos_config_file), + ) + end + else + error("Invalid `atmos_config_repo`; please use \"ClimaCoupler\" or \"ClimaAtmos\"") end # use coupler toml if atmos is not defined