From 0be8968a916ab89fe5d7f32d2604b9b1a2974ce5 Mon Sep 17 00:00:00 2001 From: Julia Sloan Date: Fri, 9 Feb 2024 11:23:35 -0800 Subject: [PATCH] update deprecated functions --- experiments/AMIP/cli_options.jl | 2 +- experiments/AMIP/user_io/amip_visualizer.jl | 2 ++ src/Regridder.jl | 2 +- test/TestHelper.jl | 2 +- test/bcreader_tests.jl | 4 ++-- test/component_model_tests/bucket_tests.jl | 1 - test/experiment_tests/coupled_sims.jl | 4 +++- test/regridder_tests.jl | 2 +- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/experiments/AMIP/cli_options.jl b/experiments/AMIP/cli_options.jl index 622d8b39c3..adc69fbe6b 100644 --- a/experiments/AMIP/cli_options.jl +++ b/experiments/AMIP/cli_options.jl @@ -1,7 +1,7 @@ import ArgParse function argparse_settings() s = ArgParse.ArgParseSettings() - ArgParse.@add_arg_table s begin + ArgParse.@add_arg_table! s begin # ClimaCoupler flags "--run_name" help = "Name of this run." diff --git a/experiments/AMIP/user_io/amip_visualizer.jl b/experiments/AMIP/user_io/amip_visualizer.jl index 8b26f93480..88166bd29d 100644 --- a/experiments/AMIP/user_io/amip_visualizer.jl +++ b/experiments/AMIP/user_io/amip_visualizer.jl @@ -1,3 +1,4 @@ +import ClimaComms include("plot_helper.jl") """ @@ -77,6 +78,7 @@ function read_latest_model_data(name::Symbol, filedir::String, root::String) varfile_root = @sprintf "%s%s" string(name) root filename = glob("*" * varfile_root * "*", filedir)[end] + comms_ctx = ClimaComms.SingletonCommsContext() hdfreader = InputOutput.HDF5Reader(filename) var = InputOutput.read_field(hdfreader, string(name)) close(hdfreader) diff --git a/src/Regridder.jl b/src/Regridder.jl index e2480d19ef..1cdc880a35 100644 --- a/src/Regridder.jl +++ b/src/Regridder.jl @@ -175,7 +175,7 @@ function hdwrite_regridfile_rll_to_cgll( space2d_undistributed = Spaces.SpectralElementSpace2D(topology, Spaces.Quadratures.GLL{Nq}()) if space isa Spaces.ExtrudedFiniteDifferenceSpace - vert_center_space = Spaces.CenterFiniteDifferenceSpace(space.vertical_topology.mesh) + vert_center_space = Spaces.CenterFiniteDifferenceSpace(Spaces.vertical_topology(space).mesh) space_undistributed = Spaces.ExtrudedFiniteDifferenceSpace(space2d_undistributed, vert_center_space) else space_undistributed = space2d_undistributed diff --git a/test/TestHelper.jl b/test/TestHelper.jl index 1610d4fe7e..8f41eccab6 100644 --- a/test/TestHelper.jl +++ b/test/TestHelper.jl @@ -40,7 +40,7 @@ function create_space( mesh = Meshes.EquiangularCubedSphere(domain, ne) if comms_ctx isa ClimaComms.SingletonCommsContext - topology = Topologies.Topology2D(mesh, Topologies.spacefillingcurve(mesh)) + topology = Topologies.Topology2D(comms_ctx, mesh, Topologies.spacefillingcurve(mesh)) else topology = Topologies.DistributedTopology2D(comms_ctx, mesh, Topologies.spacefillingcurve(mesh)) end diff --git a/test/bcreader_tests.jl b/test/bcreader_tests.jl index 0540f1d073..aa311f8688 100644 --- a/test/bcreader_tests.jl +++ b/test/bcreader_tests.jl @@ -95,7 +95,7 @@ for FT in (Float32, Float64) Nq = 4 domain = Domains.SphereDomain(radius) mesh = Meshes.EquiangularCubedSphere(domain, 4) - topology = Topologies.Topology2D(mesh) + topology = Topologies.Topology2D(comms_ctx, mesh) quad = Spaces.Quadratures.GLL{Nq}() boundary_space_t = Spaces.SpectralElementSpace2D(topology, quad) monthly_fields = (zeros(boundary_space_t), ones(boundary_space_t)) @@ -349,7 +349,7 @@ for FT in (Float32, Float64) Nq = 4 domain = Domains.SphereDomain(radius) mesh = Meshes.EquiangularCubedSphere(domain, 4) - topology = Topologies.Topology2D(mesh) + topology = Topologies.Topology2D(comms_ctx, mesh) quad = Spaces.Quadratures.GLL{Nq}() boundary_space_t = Spaces.SpectralElementSpace2D(topology, quad) land_fraction_t = Fields.zeros(boundary_space_t) diff --git a/test/component_model_tests/bucket_tests.jl b/test/component_model_tests/bucket_tests.jl index 16782e6797..0791a8565a 100644 --- a/test/component_model_tests/bucket_tests.jl +++ b/test/component_model_tests/bucket_tests.jl @@ -4,7 +4,6 @@ using ClimaCoupler.TestHelper: create_space using ClimaCore: Fields, Spaces include(pkgdir(ClimaCoupler, "experiments/AMIP/components/land/bucket_init.jl")) -include(pkgdir(ClimaCoupler, "experiments/AMIP/components/land/bucket_utils.jl")) for FT in (Float32, Float64) @testset "dss_state! BucketSimulation for FT=$FT" begin diff --git a/test/experiment_tests/coupled_sims.jl b/test/experiment_tests/coupled_sims.jl index 4d38b05902..8e18821d56 100644 --- a/test/experiment_tests/coupled_sims.jl +++ b/test/experiment_tests/coupled_sims.jl @@ -3,6 +3,7 @@ using Random using ClimaCoupler, Dates, Unitful using IntervalSets using ClimaCore: Domains, Meshes, Geometry, Topologies, Spaces, Fields, Operators +using ClimaComms # Load file to test include("../../experiments/ClimaCore/CoupledSims/coupled_sim.jl") @@ -40,7 +41,8 @@ function spectral_space_2D(; n1 = 1, n2 = 1, Nij = 4) x2boundary = (:south, :north), ) mesh = Meshes.RectilinearMesh(domain, n1, n2) - grid_topology = Topologies.Topology2D(mesh) + comms_ctx = ClimaComms.SingletonCommsContext() + grid_topology = Topologies.Topology2D(comms_ctx, mesh) quad = Spaces.Quadratures.GLL{Nij}() space = Spaces.SpectralElementSpace2D(grid_topology, quad) diff --git a/test/regridder_tests.jl b/test/regridder_tests.jl index 8fa3fee27c..b804cb3b3a 100644 --- a/test/regridder_tests.jl +++ b/test/regridder_tests.jl @@ -286,7 +286,7 @@ for FT in (Float32, Float64) # read in data on CGLL grid from the last saved date date1 = TimeManager.strdate_to_datetime.(string(Int(time[end]))) cgll_path = joinpath(REGRID_DIR, "$(hd_outfile_root)_$date1.hdf5") - hdfreader = InputOutput.HDF5Reader(cgll_path) + hdfreader = InputOutput.HDF5Reader(cgll_path, comms_ctx) T_cgll = InputOutput.read_field(hdfreader, varname) Base.close(hdfreader)