Skip to content

Commit 5593b08

Browse files
committed
move update_firstdayofmonth! to Interfacer
1 parent 22b23a6 commit 5593b08

File tree

7 files changed

+16
-6
lines changed

7 files changed

+16
-6
lines changed

experiments/ClimaEarth/run_amip.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ checkpoint_cb = CallbackManager.HourlyCallback(
532532
) # 20 days
533533
update_firstdayofmonth!_cb = CallbackManager.MonthlyCallback(
534534
dt = FT(1),
535-
func = CallbackManager.update_firstdayofmonth!,
535+
func = Interfacer.update_firstdayofmonth!,
536536
ref_date = [dates.first_day_of_month[1]],
537537
active = true,
538538
)

experiments/ClimaEarth/run_cloudless_aquaplanet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ checkpoint_cb = CallbackManager.HourlyCallback(
225225
) # 20 days
226226
update_firstdayofmonth!_cb = CallbackManager.MonthlyCallback(
227227
dt = FT(1),
228-
func = CallbackManager.update_firstdayofmonth!,
228+
func = Interfacer.update_firstdayofmonth!,
229229
ref_date = [dates.first_day_of_month[1]],
230230
active = true,
231231
)

experiments/ClimaEarth/run_cloudy_aquaplanet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ checkpoint_cb = CallbackManager.HourlyCallback(
246246
) # 20 days
247247
update_firstdayofmonth!_cb = CallbackManager.MonthlyCallback(
248248
dt = FT(1),
249-
func = CallbackManager.update_firstdayofmonth!,
249+
func = Interfacer.update_firstdayofmonth!,
250250
ref_date = [dates.first_day_of_month[1]],
251251
active = true,
252252
)

experiments/ClimaEarth/run_cloudy_slabplanet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ checkpoint_cb = CallbackManager.HourlyCallback(
292292
) # 20 days
293293
update_firstdayofmonth!_cb = CallbackManager.MonthlyCallback(
294294
dt = FT(1),
295-
func = CallbackManager.update_firstdayofmonth!,
295+
func = Interfacer.update_firstdayofmonth!,
296296
ref_date = [dates.first_day_of_month[1]],
297297
active = true,
298298
)

experiments/ClimaEarth/run_dry_held_suarez.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ checkpoint_cb = CallbackManager.HourlyCallback(
187187
) # 20 days TODO: not GPU friendly
188188
update_firstdayofmonth!_cb = CallbackManager.MonthlyCallback(
189189
dt = FT(1),
190-
func = CallbackManager.update_firstdayofmonth!,
190+
func = Interfacer.update_firstdayofmonth!,
191191
ref_date = [dates.first_day_of_month[1]],
192192
active = true,
193193
)

experiments/ClimaEarth/run_moist_held_suarez.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ checkpoint_cb = CallbackManager.HourlyCallback(
232232
)
233233
update_firstdayofmonth!_cb = CallbackManager.MonthlyCallback(
234234
dt = FT(1),
235-
func = CallbackManager.update_firstdayofmonth!,
235+
func = Interfacer.update_firstdayofmonth!,
236236
ref_date = [dates.first_day_of_month[1]],
237237
active = true,
238238
)

src/Interfacer.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ Return the model date at the current timestep.
9696
"""
9797
current_date(cs::CoupledSimulation, t) = cs.dates.date0[1] + Dates.Second(t)
9898

99+
"""
100+
update_firstdayofmonth!(cs::Interfacer.CoupledSimulation, _)
101+
102+
This function updates the first of the month reference date.
103+
"""
104+
function update_firstdayofmonth!(cs, _)
105+
cs.dates.first_day_of_month[1] = cs.dates.first_day_of_month[1] + Dates.Month(1)
106+
@info("update_firstdayofmonth! at $(cs.dates.date)")
107+
end
108+
99109
"""
100110
ComponentModelSimulation
101111

0 commit comments

Comments
 (0)