Skip to content

Commit ab243e2

Browse files
authored
Merge pull request #798 from CliMA/ln/dry-hs
Add dry Held-Suarez run script
2 parents 96ed2f0 + 88351e5 commit ab243e2

File tree

7 files changed

+363
-10
lines changed

7 files changed

+363
-10
lines changed

.buildkite/hierarchies/pipeline.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
agents:
2+
queue: new-central
3+
slurm_time: 24:00:00
4+
modules: climacommon/2024_03_18
5+
6+
env:
7+
JULIA_LOAD_PATH: "${JULIA_LOAD_PATH}:${BUILDKITE_BUILD_CHECKOUT_PATH}/.buildkite"
8+
OPENBLAS_NUM_THREADS: 1
9+
JULIA_NVTX_CALLBACKS: gc
10+
OMPI_MCA_opal_warn_on_missing_libcuda: 0
11+
JULIA_MAX_NUM_PRECOMPILE_FILES: 100
12+
GKSwstype: 100
13+
SLURM_KILL_BAD_EXIT: 1
14+
15+
CONFIG_PATH: "config/longrun_configs"
16+
PERF_CONFIG_PATH: "config/perf_configs"
17+
18+
timeout_in_minutes: 1440
19+
20+
steps:
21+
- label: "init clima :computer:"
22+
key: "init_cpu_env_clima"
23+
command:
24+
- "echo $$JULIA_DEPOT_PATH"
25+
26+
- echo "--- Instantiate AMIP env"
27+
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
28+
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'"
29+
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'"
30+
31+
- echo "--- Download artifacts"
32+
- "julia --project=artifacts -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
33+
- "julia --project=artifacts -e 'using Pkg; Pkg.precompile()'"
34+
- "julia --project=artifacts -e 'using Pkg; Pkg.status()'"
35+
- "julia --project=artifacts artifacts/download_artifacts.jl"
36+
37+
agents:
38+
queue: clima
39+
modules: common
40+
env:
41+
JULIA_NUM_PRECOMPILE_TASKS: 8
42+
JULIA_MAX_NUM_PRECOMPILE_FILES: 50
43+
44+
45+
- wait
46+
47+
- group: "Coupler integration and conservation tests"
48+
49+
steps:
50+
51+
- label: "Clima: GPU ClimaCoupler dry HS"
52+
command:
53+
- "echo $$JULIA_DEPOT_PATH"
54+
55+
- echo "--- Instantiate AMIP env"
56+
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
57+
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'"
58+
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'"
59+
60+
- echo "--- Download artifacts"
61+
- "julia --project=artifacts -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
62+
- "julia --project=artifacts -e 'using Pkg; Pkg.precompile()'"
63+
- "julia --project=artifacts -e 'using Pkg; Pkg.status()'"
64+
- "julia --project=artifacts artifacts/download_artifacts.jl"
65+
66+
- echo "--- Run simulation"
67+
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez.jl"
68+
artifact_paths: "dry_held_suarez/dry_held_suarez/clima_atmos/*"
69+
agents:
70+
queue: clima
71+
slurm_mem: 20GB
72+
slurm_gpus: 1
73+
modules: common

.buildkite/pipeline.yml

+11
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,17 @@ steps:
376376
agents:
377377
slurm_mem: 20GB
378378

379+
- group: "Hierarchy tests (1d)"
380+
steps:
381+
- label: "Dry Held Suarez"
382+
key: "dry_held_suarez"
383+
command:
384+
- sed 's/t_end = "1000days"/t_end = "1days"/' experiments/ClimaEarth/run_dry_held_suarez.jl > experiments/ClimaEarth/run_dry_held_suarez_modified.jl
385+
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez_modified.jl"
386+
artifact_paths: "dry_held_suarez/dry_held_suarez/clima_atmos/*"
387+
agents:
388+
slurm_mem: 20GB
389+
379390
- group: "GPU integration tests"
380391
steps:
381392
# GPU RUNS: slabplanet

experiments/ClimaEarth/components/atmosphere/climaatmos.jl

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ function hasmoisture(integrator)
2929
return !(integrator.p.atmos.moisture_model isa CA.DryModel)
3030
end
3131

32-
function atmos_init(::Type{FT}, atmos_config_dict::Dict) where {FT}
32+
function atmos_init(::Type{FT}, atmos_config) where {FT}
3333
# By passing `parsed_args` to `AtmosConfig`, `parsed_args` overwrites the default atmos config
34-
atmos_config = CA.AtmosConfig(atmos_config_dict)
3534
simulation = CA.get_simulation(atmos_config)
3635
(; integrator) = simulation
3736
Y = integrator.u
@@ -151,23 +150,23 @@ end
151150

152151
# helpers for get_field extensions, dipatchable on different moisture model options and radiation modes
153152

154-
col_integrated_rain(::CA.DryModel, integrator) = [eltype(integrator.u)(0)]
153+
col_integrated_rain(::CA.DryModel, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
155154
col_integrated_rain(::Union{CA.EquilMoistModel, CA.NonEquilMoistModel}, integrator) =
156155
integrator.p.precipitation.col_integrated_rain
157156

158-
col_integrated_snow(::CA.DryModel, integrator) = [eltype(integrator.u)(0)]
157+
col_integrated_snow(::CA.DryModel, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
159158
col_integrated_snow(::Union{CA.EquilMoistModel, CA.NonEquilMoistModel}, integrator) =
160159
integrator.p.precipitation.col_integrated_snow
161160

162-
surface_radiation_flux(::Nothing, integrator) = [eltype(integrator.u)(0)]
161+
surface_radiation_flux(::Nothing, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
163162
surface_radiation_flux(::CA.RRTMGPI.AbstractRRTMGPMode, integrator) =
164163
CC.Fields.level(integrator.p.radiation.ᶠradiation_flux, CC.Utilities.half)
165164

166-
moisture_flux(::CA.DryModel, integrator) = [eltype(integrator.u)(0)]
165+
moisture_flux(::CA.DryModel, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
167166
moisture_flux(::Union{CA.EquilMoistModel, CA.NonEquilMoistModel}, integrator) =
168167
CC.Geometry.WVector.(integrator.p.precomputed.sfc_conditions.ρ_flux_q_tot)
169168

170-
ρq_tot(::CA.DryModel, integrator) = [eltype(integrator.u)(0)]
169+
ρq_tot(::CA.DryModel, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
171170
ρq_tot(::Union{CA.EquilMoistModel, CA.NonEquilMoistModel}, integrator) = integrator.u.c.ρq_tot
172171

173172
# extensions required by the Interfacer

experiments/ClimaEarth/run_amip.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ config_dict = merge(parsed_args, config_dict)
105105

106106
## get component model dictionaries (if applicable)
107107
config_dict_atmos = get_atmos_config_dict(config_dict)
108+
atmos_config_object = CA.AtmosConfig(config_dict_atmos)
108109

109110
## merge dictionaries of command line arguments, coupler dictionary and component model dictionaries
110111
## (if there are common keys, the last dictionary in the `merge` arguments takes precedence)
@@ -182,7 +183,7 @@ This uses the `ClimaAtmos.jl` model, with parameterization options specified in
182183
Utilities.show_memory_usage(comms_ctx)
183184

184185
## init atmos model component
185-
atmos_sim = atmos_init(FT, config_dict_atmos);
186+
atmos_sim = atmos_init(FT, atmos_config_object);
186187
Utilities.show_memory_usage(comms_ctx)
187188

188189
thermo_params = get_thermo_params(atmos_sim) # TODO: this should be shared by all models #610

0 commit comments

Comments
 (0)