From 34abdf3a79847fa04270e984f00c923093101090 Mon Sep 17 00:00:00 2001 From: Julia Sloan Date: Wed, 10 Apr 2024 17:36:42 -0700 Subject: [PATCH] qualify Checkpointer. --- experiments/AMIP/components/land/climaland_bucket.jl | 6 +++--- experiments/AMIP/components/ocean/eisenman_seaice.jl | 6 +++--- experiments/AMIP/components/ocean/prescr_seaice.jl | 6 +++--- experiments/AMIP/components/ocean/slab_ocean.jl | 6 +++--- experiments/AMIP/coupler_driver.jl | 2 +- experiments/AMIP/user_io/amip_visualizer.jl | 1 + experiments/AMIP/user_io/user_logging.jl | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/experiments/AMIP/components/land/climaland_bucket.jl b/experiments/AMIP/components/land/climaland_bucket.jl index d4181cfd47..3d2f5897b1 100644 --- a/experiments/AMIP/components/land/climaland_bucket.jl +++ b/experiments/AMIP/components/land/climaland_bucket.jl @@ -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 @@ -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 diff --git a/experiments/AMIP/components/ocean/eisenman_seaice.jl b/experiments/AMIP/components/ocean/eisenman_seaice.jl index 17c62c44c0..4df68156f9 100644 --- a/experiments/AMIP/components/ocean/eisenman_seaice.jl +++ b/experiments/AMIP/components/ocean/eisenman_seaice.jl @@ -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 @@ -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 diff --git a/experiments/AMIP/components/ocean/prescr_seaice.jl b/experiments/AMIP/components/ocean/prescr_seaice.jl index eace4ddf70..103375cac8 100644 --- a/experiments/AMIP/components/ocean/prescr_seaice.jl +++ b/experiments/AMIP/components/ocean/prescr_seaice.jl @@ -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") @@ -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 diff --git a/experiments/AMIP/components/ocean/slab_ocean.jl b/experiments/AMIP/components/ocean/slab_ocean.jl index f53ad7cb62..5605e0c993 100644 --- a/experiments/AMIP/components/ocean/slab_ocean.jl +++ b/experiments/AMIP/components/ocean/slab_ocean.jl @@ -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") @@ -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 diff --git a/experiments/AMIP/coupler_driver.jl b/experiments/AMIP/coupler_driver.jl index 05715aec82..87184c08d3 100644 --- a/experiments/AMIP/coupler_driver.jl +++ b/experiments/AMIP/coupler_driver.jl @@ -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 diff --git a/experiments/AMIP/user_io/amip_visualizer.jl b/experiments/AMIP/user_io/amip_visualizer.jl index 97deb2682a..f1e7797e53 100644 --- a/experiments/AMIP/user_io/amip_visualizer.jl +++ b/experiments/AMIP/user_io/amip_visualizer.jl @@ -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. """ diff --git a/experiments/AMIP/user_io/user_logging.jl b/experiments/AMIP/user_io/user_logging.jl index f891822e93..a591b8600f 100644 --- a/experiments/AMIP/user_io/user_logging.jl +++ b/experiments/AMIP/user_io/user_logging.jl @@ -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)