Skip to content

Commit

Permalink
use nothing for restart_dir default
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Nov 20, 2024
1 parent 94329a0 commit 5298e55
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion experiments/ClimaEarth/cli_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function argparse_settings()
"--restart_dir"
help = "Directory containing restart files"
arg_type = String
default = "unspecified"
default = nothing
"--restart_t"
help = "Integer time to use at `t_start` for restarted simulation [0 (default)]"
arg_type = Int
Expand Down
2 changes: 1 addition & 1 deletion experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ If a restart directory is specified and contains output files from the `checkpoi
is specified in the `config_dict` dictionary. The `restart_t` field specifies the time step at which the restart is performed.
=#

if restart_dir !== "unspecified"
if !isnothing(restart_dir)
for sim in cs.model_sims
if Checkpointer.get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
Expand Down
4 changes: 2 additions & 2 deletions experiments/ClimaEarth/run_cloudless_aquaplanet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ include("components/ocean/slab_ocean.jl")
job_id = "cloudless_aquaplanet"
coupler_output_dir = "$job_id"
const FT = Float64
restart_dir = "unspecified"
restart_dir = nothing
restart_t = Int(0)

## coupler simulation specific configuration
Expand Down Expand Up @@ -262,7 +262,7 @@ cs = Interfacer.CoupledSimulation{FT}(
## Restart component model states if specified in the config_dict
=#

if restart_dir !== "unspecified"
if !isnothing(restart_dir)
for sim in cs.model_sims
if Checkpointer.get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
Expand Down
4 changes: 2 additions & 2 deletions experiments/ClimaEarth/run_cloudy_aquaplanet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ include("components/ocean/slab_ocean.jl")
job_id = "cloudy_aquaplanet"
coupler_output_dir = "$job_id"
const FT = Float64
restart_dir = "unspecified"
restart_dir = nothing
restart_t = Int(0)

## coupler simulation specific configuration
Expand Down Expand Up @@ -277,7 +277,7 @@ cs = Interfacer.CoupledSimulation{FT}(
## Restart component model states if specified in the config_dict
=#

if restart_dir !== "unspecified"
if !isnothing(restart_dir)
for sim in cs.model_sims
if Checkpointer.get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
Expand Down
4 changes: 2 additions & 2 deletions experiments/ClimaEarth/run_cloudy_slabplanet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ include("components/land/climaland_bucket.jl")
job_id = "cloudy_slabplanet"
coupler_output_dir = "$job_id"
const FT = Float64
restart_dir = "unspecified"
restart_dir = nothing
restart_t = Int(0)

## coupler simulation specific configuration
Expand Down Expand Up @@ -328,7 +328,7 @@ cs = Interfacer.CoupledSimulation{FT}(
## Restart component model states if specified in the config_dict
=#

if restart_dir !== "unspecified"
if !isnothing(restart_dir)
for sim in cs.model_sims
if Checkpointer.get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
Expand Down
4 changes: 2 additions & 2 deletions experiments/ClimaEarth/run_dry_held_suarez.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Here we follow ClimaCore's dry Held-Suarez `held_suarez_rhoe` example.
job_id = "dry_held_suarez"
coupler_output_dir = "$job_id"
const FT = Float64
restart_dir = "unspecified"
restart_dir = nothing
restart_t = Int(0)

## coupler simulation specific configuration
Expand Down Expand Up @@ -207,7 +207,7 @@ cs = Interfacer.CoupledSimulation{FT}(
## Restart component model states if specified in the config_dict
=#

if restart_dir !== "unspecified"
if !isnothing(restart_dir)
for sim in cs.model_sims
if get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
Expand Down
4 changes: 2 additions & 2 deletions experiments/ClimaEarth/run_moist_held_suarez.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Here we follow Thatcher and Jablonowski (2016).
job_id = "moist_held_suarez"
coupler_output_dir = "$job_id"
const FT = Float64
restart_dir = "unspecified"
restart_dir = nothing
restart_t = Int(0)

## coupler simulation specific configuration
Expand Down Expand Up @@ -258,7 +258,7 @@ cs = Interfacer.CoupledSimulation{FT}(
## Restart component model states if specified in the config_dict
=#

if restart_dir !== "unspecified"
if !isnothing(restart_dir)
for sim in cs.model_sims
if Checkpointer.get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
Expand Down

0 comments on commit 5298e55

Please sign in to comment.