543
543
544
544
"""
545
545
NaNCheckCallback(nancheck_frequency::Union{AbstractFloat, Dates.Period},
546
- output_dir, start_date, t_start; model , dt)
546
+ start_date, t_start, dt)
547
547
548
548
Constructs a DiscreteCallback which counts the number of NaNs in the state
549
549
and produces a warning if any are found.
@@ -556,12 +556,9 @@ and produces a warning if any are found.
556
556
- `dt`: The timestep of the model (optional), used to check for consistency.
557
557
558
558
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.
565
562
"""
566
563
function NaNCheckCallback (
567
564
nancheck_frequency:: Union{AbstractFloat, Dates.Period} ,
@@ -597,9 +594,7 @@ function NaNCheckCallback(
597
594
cond = let schedule = schedule
598
595
(u, t, integrator) -> schedule (integrator)
599
596
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)
603
598
604
599
SciMLBase. DiscreteCallback (cond, affect!)
605
600
end
0 commit comments