Skip to content

Commit 71d0c12

Browse files
committed
change the logic of detect_restart_file
1 parent 9759259 commit 71d0c12

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

NEWS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ ClimaCoupler.jl Release Notes
66

77
### ClimaCoupler features
88

9+
#### Change the behavior of `detect_restart_file` PR[#1515](https://github.com/CliMA/ClimaCoupler.jl/pull/1515)
10+
Users now only need to specify `restart_dir` and `restart_t` to restart a simulation from a specific file, and do
11+
not need to set `detect_restart_file` to true. `detect_restart_file` is used for detecting restart file automatically.
12+
913
#### Use `update_turbulent_fluxes!` instead of `update_field!` for atmosphere PR[#1511](https://github.com/CliMA/ClimaCoupler.jl/pull/1511)
1014
Instead of using an `update_field!` method that dispatches on `::Val{:turbulent_fluxes}`
1115
to update turbulent fluxes in the atmosphere, we switch to using a function `update_turbulent_fluxes!`.
@@ -50,8 +54,7 @@ in `make_land_domain`. Now we correctly use the provided `dz_tuple` and `n_eleme
5054

5155
#### Add option `detect_restart_files` PR[#1463](https://github.com/CliMA/ClimaCoupler.jl/pull/1463)
5256
Add a CLI option to signal whether restart files should be automatically used
53-
to restart a simulation. This is true by default, but can be set to false if a
54-
user wishes to run a simulation from the beginning, ignoring present restart files.
57+
to restart a simulation. This is false by default.
5558

5659
#### Remove ED/EDMF aquaplanet longruns PR[#1461](https://github.com/CliMA/ClimaCoupler.jl/pull/1461)
5760
Removes the ED-only and diag. EDMF aquaplanet longruns.

experiments/ClimaEarth/setup_run.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ function CoupledSimulation(config_dict::AbstractDict)
173173
Random.seed!(random_seed)
174174
@info "Random seed set to $(random_seed)"
175175

176-
isnothing(restart_t) &&
177-
(restart_t = Checkpointer.t_start_from_checkpoint(dir_paths.checkpoints))
178-
isnothing(restart_dir) && (restart_dir = dir_paths.checkpoints)
179-
should_restart =
180-
detect_restart_files && !isnothing(restart_t) && !isnothing(restart_dir)
176+
if detect_restart_files
177+
isnothing(restart_t) &&
178+
(restart_t = Checkpointer.t_start_from_checkpoint(dir_paths.checkpoints))
179+
isnothing(restart_dir) && (restart_dir = dir_paths.checkpoints)
180+
end
181+
should_restart = !isnothing(restart_t) && !isnothing(restart_dir)
181182
if should_restart
182183
if t_start isa ITime
183184
t_start, _ = promote(ITime(restart_t), t_start)

0 commit comments

Comments
 (0)