Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dry Held-Suarez run script #798

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .buildkite/hierarchies/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
agents:
queue: new-central
slurm_time: 24:00:00
modules: climacommon/2024_03_18

env:
JULIA_LOAD_PATH: "${JULIA_LOAD_PATH}:${BUILDKITE_BUILD_CHECKOUT_PATH}/.buildkite"
OPENBLAS_NUM_THREADS: 1
JULIA_NVTX_CALLBACKS: gc
OMPI_MCA_opal_warn_on_missing_libcuda: 0
JULIA_MAX_NUM_PRECOMPILE_FILES: 100
GKSwstype: 100
SLURM_KILL_BAD_EXIT: 1

CONFIG_PATH: "config/longrun_configs"
PERF_CONFIG_PATH: "config/perf_configs"

timeout_in_minutes: 1440

steps:
- label: "init clima :computer:"
key: "init_cpu_env_clima"
command:
- "echo $$JULIA_DEPOT_PATH"

- echo "--- Instantiate AMIP env"
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'"
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'"

- echo "--- Download artifacts"
- "julia --project=artifacts -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
- "julia --project=artifacts -e 'using Pkg; Pkg.precompile()'"
- "julia --project=artifacts -e 'using Pkg; Pkg.status()'"
- "julia --project=artifacts artifacts/download_artifacts.jl"

agents:
queue: clima
modules: common
env:
JULIA_NUM_PRECOMPILE_TASKS: 8
JULIA_MAX_NUM_PRECOMPILE_FILES: 50


- wait

- group: "Coupler integration and conservation tests"

steps:

- label: "Clima: GPU ClimaCoupler dry HS"
command:
- "echo $$JULIA_DEPOT_PATH"

- echo "--- Instantiate AMIP env"
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'"
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'"

- echo "--- Download artifacts"
- "julia --project=artifacts -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
- "julia --project=artifacts -e 'using Pkg; Pkg.precompile()'"
- "julia --project=artifacts -e 'using Pkg; Pkg.status()'"
- "julia --project=artifacts artifacts/download_artifacts.jl"

- echo "--- Run simulation"
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez.jl"
artifact_paths: "dry_held_suarez/dry_held_suarez/clima_atmos/*"
agents:
queue: clima
slurm_mem: 20GB
slurm_gpus: 1
modules: common
11 changes: 11 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,17 @@ steps:
agents:
slurm_mem: 20GB

- group: "Hierarchy tests (1d)"
steps:
- label: "Dry Held Suarez"
key: "dry_held_suarez"
command:
- sed 's/t_end = "1000days"/t_end = "1days"/' experiments/ClimaEarth/run_dry_held_suarez.jl > experiments/ClimaEarth/run_dry_held_suarez_modified.jl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this line of the command doing?

- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez_modified.jl"
artifact_paths: "dry_held_suarez/dry_held_suarez/clima_atmos/*"
agents:
slurm_mem: 20GB

- group: "GPU integration tests"
steps:
# GPU RUNS: slabplanet
Expand Down
13 changes: 6 additions & 7 deletions experiments/ClimaEarth/components/atmosphere/climaatmos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ function hasmoisture(integrator)
return !(integrator.p.atmos.moisture_model isa CA.DryModel)
end

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

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

col_integrated_rain(::CA.DryModel, integrator) = [eltype(integrator.u)(0)]
col_integrated_rain(::CA.DryModel, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
col_integrated_rain(::Union{CA.EquilMoistModel, CA.NonEquilMoistModel}, integrator) =
integrator.p.precipitation.col_integrated_rain

col_integrated_snow(::CA.DryModel, integrator) = [eltype(integrator.u)(0)]
col_integrated_snow(::CA.DryModel, integrator) = StaticArrays.SVector(eltype(integrator.u)(0))
col_integrated_snow(::Union{CA.EquilMoistModel, CA.NonEquilMoistModel}, integrator) =
integrator.p.precipitation.col_integrated_snow

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

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

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

# extensions required by the Interfacer
Expand Down
3 changes: 2 additions & 1 deletion experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ config_dict = merge(parsed_args, config_dict)

## get component model dictionaries (if applicable)
config_dict_atmos = get_atmos_config_dict(config_dict)
atmos_config_object = CA.AtmosConfig(config_dict_atmos)

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

## init atmos model component
atmos_sim = atmos_init(FT, config_dict_atmos);
atmos_sim = atmos_init(FT, atmos_config_object);
Utilities.show_memory_usage(comms_ctx)

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