Skip to content

Commit

Permalink
qualify Checkpointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Apr 11, 2024
1 parent a707187 commit 34abdf3
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions experiments/AMIP/components/land/climaland_bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ClimaParams
import Thermodynamics as TD
import ClimaLand as CL
import ClimaLand.Parameters as LP
import ClimaCoupler: FluxCalculator, Interfacer
import ClimaCoupler: Checkpointer, FluxCalculator, Interfacer

###
### Functions required by ClimaCoupler.jl for a SurfaceModelSimulation
Expand Down Expand Up @@ -231,11 +231,11 @@ function FluxCalculator.surface_thermo_state(
end

"""
get_model_prog_state(sim::BucketSimulation)
Checkpointer.get_model_prog_state(sim::BucketSimulation)
Extension of Checkpointer.get_model_prog_state to get the model state.
"""
function get_model_prog_state(sim::BucketSimulation)
function Checkpointer.get_model_prog_state(sim::BucketSimulation)
return sim.integrator.u.bucket
end

Expand Down
6 changes: 3 additions & 3 deletions experiments/AMIP/components/ocean/eisenman_seaice.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SciMLBase
import ClimaCore as CC
import ClimaTimeSteppers as CTS
import ClimaCoupler: FluxCalculator, Interfacer
import ClimaCoupler: Checkpointer, FluxCalculator, Interfacer

###
### Functions required by ClimaCoupler.jl for a SurfaceModelSimulation
Expand Down Expand Up @@ -165,11 +165,11 @@ function FluxCalculator.update_turbulent_fluxes_point!(
end

"""
get_model_prog_state(sim::EisenmanIceSimulation)
Checkpointer.get_model_prog_state(sim::EisenmanIceSimulation)
Extension of Checkpointer.get_model_prog_state to get the model state.
"""
function get_model_prog_state(sim::EisenmanIceSimulation)
function Checkpointer.get_model_prog_state(sim::EisenmanIceSimulation)
return sim.integrator.u
end

Expand Down
6 changes: 3 additions & 3 deletions experiments/AMIP/components/ocean/prescr_seaice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SciMLBase
import ClimaCore as CC
import ClimaTimeSteppers as CTS
import Thermodynamics as TD
import ClimaCoupler: BCReader, FluxCalculator, Interfacer, Regridder, Utilities
import ClimaCoupler: BCReader, Checkpointer, FluxCalculator, Interfacer, Regridder, Utilities

include("../slab_utils.jl")

Expand Down Expand Up @@ -141,11 +141,11 @@ function FluxCalculator.update_turbulent_fluxes_point!(
end

"""
get_model_prog_state(sim::PrescribedIceSimulation)
Checkpointer.get_model_prog_state(sim::PrescribedIceSimulation)
Extension of Checkpointer.get_model_prog_state to get the model state.
"""
function get_model_prog_state(sim::PrescribedIceSimulation)
function Checkpointer.get_model_prog_state(sim::PrescribedIceSimulation)
return sim.integrator.u
end

Expand Down
6 changes: 3 additions & 3 deletions experiments/AMIP/components/ocean/slab_ocean.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SciMLBase
import ClimaCore as CC
import ClimaTimeSteppers as CTS
import ClimaCoupler: BCReader, FluxCalculator, Interfacer, Utilities
import ClimaCoupler: BCReader, Checkpointer, FluxCalculator, Interfacer, Utilities

include("../slab_utils.jl")

Expand Down Expand Up @@ -153,11 +153,11 @@ function FluxCalculator.update_turbulent_fluxes_point!(
end

"""
get_model_prog_state(sim::SlabOceanSimulation)
Checkpointer.get_model_prog_state(sim::SlabOceanSimulation)
Extension of Checkpointer.get_model_prog_state to get the model state.
"""
function get_model_prog_state(sim::SlabOceanSimulation)
function Checkpointer.get_model_prog_state(sim::SlabOceanSimulation)
return sim.integrator.u
end

Expand Down
2 changes: 1 addition & 1 deletion experiments/AMIP/coupler_driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ is specified in the `config_dict` dictionary. The `restart_t` field specifies th

if restart_dir !== "unspecified"
for sim in cs.model_sims
if get_model_prog_state(sim) !== nothing
if Checkpointer.get_model_prog_state(sim) !== nothing
Checkpointer.restart_model_state!(sim, comms_ctx, restart_t; input_dir = restart_dir)
end
end
Expand Down
1 change: 1 addition & 0 deletions experiments/AMIP/user_io/amip_visualizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include("plot_helper.jl")
files_root = ".hdf5",
fig_name = "amip_paperplots",
)
Coordinates the postprocessing and plotting of sample fields (specified in `post_spec`)
of the last monthly mean file. Any specific plot customization should be done here.
"""
Expand Down
2 changes: 1 addition & 1 deletion experiments/AMIP/user_io/user_logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This is a callback function that checkpoints all simulations defined in the curr
"""
function checkpoint_sims(cs::Interfacer.CoupledSimulation, _)
for sim in cs.model_sims
if get_model_prog_state(sim) !== nothing
if Checkpointer.get_model_prog_state(sim) !== nothing
t = Dates.datetime2epochms(cs.dates.date[1])
t0 = Dates.datetime2epochms(cs.dates.date0[1])
Checkpointer.checkpoint_model_state(sim, cs.comms_ctx, Int((t - t0) / 1e3), output_dir = cs.dirs.artifacts)
Expand Down

0 comments on commit 34abdf3

Please sign in to comment.