Skip to content

Commit 9bf117c

Browse files
committed
fix affect
1 parent bba26da commit 9bf117c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/shared_utilities/utils.jl

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ end
543543

544544
"""
545545
NaNCheckCallback(nancheck_frequency::Union{AbstractFloat, Dates.Period},
546-
output_dir, start_date, t_start; model, dt)
546+
start_date, t_start, dt)
547547
548548
Constructs a DiscreteCallback which counts the number of NaNs in the state
549549
and produces a warning if any are found.
@@ -556,12 +556,9 @@ and produces a warning if any are found.
556556
- `dt`: The timestep of the model (optional), used to check for consistency.
557557
558558
The callback uses `ClimaDiagnostics.EveryCalendarDtSchedule` to determine when
559-
to save checkpoints based on the `nancheck_frequency`. The schedule is
560-
initialized with the `start_date` and `t_start` to ensure that the first
561-
checkpoint is saved at the correct time.
562-
563-
The `save_checkpoint` function is called with the current state vector `u`, the
564-
current time `t`, and the `output_dir` to save the checkpoint to disk.
559+
to check for NaNs based on the `nancheck_frequency`. The schedule is
560+
initialized with the `start_date` and `t_start` to ensure that it is first
561+
called at the correct time.
565562
"""
566563
function NaNCheckCallback(
567564
nancheck_frequency::Union{AbstractFloat, Dates.Period},
@@ -597,9 +594,7 @@ function NaNCheckCallback(
597594
cond = let schedule = schedule
598595
(u, t, integrator) -> schedule(integrator)
599596
end
600-
affect! = let output_dir = output_dir, model = model
601-
(integrator) -> count_nans_state(integrator.u)
602-
end
597+
affect! = (integrator) -> count_nans_state(integrator.u)
603598

604599
SciMLBase.DiscreteCallback(cond, affect!)
605600
end

0 commit comments

Comments
 (0)