Skip to content

Commit

Permalink
remove more configs
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Oct 26, 2023
1 parent bc93117 commit 72d234d
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 148 deletions.
9 changes: 0 additions & 9 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,6 @@ steps:
agents:
slurm_mem: 20GB

- label: ":dart: Dycore Consistency test"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl
--config_file $CONFIG_PATH/dycore_consistency.yml
artifact_paths: "dycore_consistency/*"
soft_fail: true
agents:
slurm_mem: 20GB

- group: "EDMFX"
steps:

Expand Down
2 changes: 1 addition & 1 deletion config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ device:
value: "auto"
reference_job_id:
help: |-
Identifier of job to use as the "reference" solution in the quicklook plot; the current job's results get compared to the results of the quicklook job on the main branch (only used if `debugging_tc` is `true`)
Identifier of job to use as the "reference" solution in the quicklook plot; the current job's results get compared to the results of the quicklook job on the main branch
value: ~
post_process:
help: "Post process [`true` (default), `false`]"
Expand Down
6 changes: 0 additions & 6 deletions config/default_configs/default_edmf_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ edmf_coriolis:
edmfx_nh_pressure:
help: "If set to true, it switches on EDMFX pressure drag closure. [`true`, `false` (default)]"
value: false
turbconv_case:
help: "The case run by Turbulence convection scheme [`Bomex` (default), `Bomex`, `DYCOMS_RF01`, `TRMM_LBA`, `GABLS`]"
value: ~
edmfx_entr_model:
help: "EDMFX entrainment closure. [`nothing` (default), `PiGroups`, `Generalized`, `GeneralizedHarmonics`]"
value: ~
Expand All @@ -23,9 +20,6 @@ edmfx_detr_model:
edmfx_upwinding:
help: "EDMFX upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`]"
value: none
debugging_tc:
help: "Save most of the tc aux state to HDF5 file [`false` (default), `true`]"
value: false
edmfx_sgs_mass_flux:
help: "If set to true, it switches on EDMFX SGS mass flux. [`true`, `false` (default)]"
value: false
Expand Down
22 changes: 0 additions & 22 deletions config/model_configs/dycore_consistency.yml

This file was deleted.

47 changes: 28 additions & 19 deletions docs/src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,36 @@ To start the model with a custom configuration, run:
### Example
Below is the default Bomex configuration:
```
edmf_coriolis: Bomex
dt_save_to_disk: 5mins
hyperdiff: "false"
job_id: "prognostic_edmfx_bomex_box"
initial_condition: "Bomex"
subsidence: "Bomex"
edmf_coriolis: "Bomex"
ls_adv: "Bomex"
surface_setup: "Bomex"
turbconv: "prognostic_edmfx"
edmfx_upwinding: first_order
edmfx_entr_model: "Generalized"
edmfx_detr_model: "Generalized"
edmfx_sgs_mass_flux: true
edmfx_sgs_diffusive_flux: true
edmfx_nh_pressure: true
prognostic_tke: false
moist: "equil"
config: "box"
hyperdiff: "true"
kappa_4: 1.0e12
x_max: 1e5
y_max: 1e5
z_max: 3e3
x_elem: 2
y_elem: 2
z_elem: 60
dt: 20secs
debugging_tc: true
surface_setup: Bomex
turbconv_case: Bomex
t_end: 6hours
turbconv: edmf
z_stretch: false
config: column
subsidence: Bomex
FLOAT_TYPE: Float64
z_max: 3000.0
apply_limiter: false
regression_test: true
ls_adv: Bomex
dt_save_to_sol: 5mins
job_id: edmf_bomex
moist: equil
perturb_initstate: false
dt: "5secs"
t_end: "6hours"
dt_save_to_disk: "10mins"
toml: [toml/prognostic_edmfx_box.toml]
```

To add a new configuration argument/key, open `.buildkite/default_config.yml`.
Expand Down
45 changes: 0 additions & 45 deletions examples/hybrid/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,51 +46,6 @@ if is_edmfx && config.parsed_args["post_process"]
zip_and_cleanup_output(simulation.output_dir, "hdf5files.zip")
end

if config.parsed_args["debugging_tc"] && !is_edmfx
include(
joinpath(
@__DIR__,
"..",
"..",
"regression_tests",
"self_reference_or_path.jl",
),
)

main_branch_root = get_main_branch_buildkite_path()
main_branch_data_path = joinpath(main_branch_root, reference_job_id)

day = floor(Int, simulation.t_end / (60 * 60 * 24))
sec = floor(Int, simulation.t_end % (60 * 60 * 24))

zip_file = "hdf5files.zip"
mktempdir(
simulation.output_dir;
prefix = "temp_unzip_path_",
) do temp_main_branch_path
# Unzip files to temp directory, to avoid collisions with other jobs
unzip_file_in_path(
main_branch_data_path,
zip_file,
temp_main_branch_path,
)
# hdf5 files from the main branch are in `temp_dir`

plot_tc_contours(
simulation.output_dir;
main_branch_data_path = temp_main_branch_path,
)
plot_tc_profiles(
simulation.output_dir;
hdf5_filename = "day$day.$sec.hdf5",
main_branch_data_path = temp_main_branch_path,
)
end
if atmos.model_config isa CA.SingleColumnModel
zip_and_cleanup_output(simulation.output_dir, zip_file)
end
end

if sol_res.ret_code == :simulation_crashed
error(
"The ClimaAtmos simulation has crashed. See the stack trace for details.",
Expand Down
81 changes: 37 additions & 44 deletions src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,51 +290,44 @@ function get_state_restart(comms_ctx)
end

function get_initial_condition(parsed_args)
if isnothing(parsed_args["turbconv_case"])
if parsed_args["initial_condition"] in [
"DryBaroclinicWave",
"MoistBaroclinicWave",
"DecayingProfile",
"MoistBaroclinicWaveWithEDMF",
"MoistAdiabaticProfileEDMFX",
]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))(
parsed_args["perturb_initstate"],
)
elseif parsed_args["initial_condition"] in [
"Nieuwstadt",
"GABLS",
"GATE_III",
"Soares",
"Bomex",
"LifeCycleTan2018",
"ARM_SGP",
"DYCOMS_RF01",
"DYCOMS_RF02",
"Rico",
"TRMM_LBA",
]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))(
parsed_args["prognostic_tke"],
)
elseif parsed_args["initial_condition"] in [
"IsothermalProfile",
"AgnesiHProfile",
"DryDensityCurrentProfile",
"RisingThermalBubbleProfile",
"ScharProfile",
]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))()
else
error(
"Unknown `initial_condition`: $(parsed_args["initial_condition"])",
)
end
if parsed_args["initial_condition"] in [
"DryBaroclinicWave",
"MoistBaroclinicWave",
"DecayingProfile",
"MoistBaroclinicWaveWithEDMF",
"MoistAdiabaticProfileEDMFX",
]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))(
parsed_args["perturb_initstate"],
)
elseif parsed_args["initial_condition"] in [
"Nieuwstadt",
"GABLS",
"GATE_III",
"Soares",
"Bomex",
"LifeCycleTan2018",
"ARM_SGP",
"DYCOMS_RF01",
"DYCOMS_RF02",
"Rico",
"TRMM_LBA",
]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))(
parsed_args["prognostic_tke"],
)
elseif parsed_args["initial_condition"] in [
"IsothermalProfile",
"AgnesiHProfile",
"DryDensityCurrentProfile",
"RisingThermalBubbleProfile",
"ScharProfile",
]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))()
else
# turbconv_case is also used for surface fluxes for TRMM and ARM cases.
# I don't want to change that right now, so I'm leaving the
# EDMF logic as is. This should be obsolete soon.
return getproperty(ICs, Symbol(parsed_args["turbconv_case"]))()
error(
"Unknown `initial_condition`: $(parsed_args["initial_condition"])",
)
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ include(joinpath("..", "perf", "common.jl"))
@test config.parsed_args["regression_test"] == true

# Test that config_dict overrides `default_perf`
config_dict = Dict("dt" => "50secs", "turbconv_case" => "GABLS")
config_dict = Dict("dt" => "50secs", "initial_condition" => "Bomex")
config = AtmosCoveragePerfConfig(config_dict)
@test config.parsed_args["dt"] == "50secs"
@test config.parsed_args["turbconv_case"] == "GABLS"
@test config.parsed_args["initial_condition"] == "Bomex"
@test config.parsed_args["regression_test"] == false
end

0 comments on commit 72d234d

Please sign in to comment.