Skip to content

Commit

Permalink
Add support for ClimaDiagnostics 0.2
Browse files Browse the repository at this point in the history
See breaking change:

CliMA/ClimaDiagnostics.jl#47
  • Loading branch information
Sbozzolo committed May 23, 2024
1 parent b55a70f commit b03e8c5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ AtmosphericProfilesLibrary = "0.1"
CPUSummary = "0.2"
ClimaComms = "0.5"
ClimaCore = "0.14"
ClimaDiagnostics = "0.1.6"
ClimaDiagnostics = "0.2"
ClimaParams = "0.10.4"
ClimaTimeSteppers = "0.7.18"
ClimaUtilities = "0.1.3"
Expand Down
4 changes: 2 additions & 2 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ weakdeps = ["CUDA", "Krylov"]

[[deps.ClimaDiagnostics]]
deps = ["Accessors", "ClimaComms", "ClimaCore", "Dates", "NCDatasets", "SciMLBase"]
git-tree-sha1 = "34b57fcad8bd3810f70fd131e6f36f2002bfe8e6"
git-tree-sha1 = "aff194804df0fcfcf69a80c58978b84777272619"
uuid = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f"
version = "0.1.7"
version = "0.2.2"

[[deps.ClimaParams]]
deps = ["DocStringExtensions", "TOML", "Test"]
Expand Down
4 changes: 2 additions & 2 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ version = "0.7.6"

[[deps.ClimaDiagnostics]]
deps = ["Accessors", "ClimaComms", "ClimaCore", "Dates", "NCDatasets", "SciMLBase"]
git-tree-sha1 = "34b57fcad8bd3810f70fd131e6f36f2002bfe8e6"
git-tree-sha1 = "aff194804df0fcfcf69a80c58978b84777272619"
uuid = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f"
version = "0.1.7"
version = "0.2.2"

[[deps.ClimaParams]]
deps = ["DocStringExtensions", "TOML", "Test"]
Expand Down
4 changes: 2 additions & 2 deletions perf/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ version = "0.7.6"

[[deps.ClimaDiagnostics]]
deps = ["Accessors", "ClimaComms", "ClimaCore", "Dates", "NCDatasets", "SciMLBase"]
git-tree-sha1 = "34b57fcad8bd3810f70fd131e6f36f2002bfe8e6"
git-tree-sha1 = "aff194804df0fcfcf69a80c58978b84777272619"
uuid = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f"
version = "0.1.7"
version = "0.2.2"

[[deps.ClimaParams]]
deps = ["DocStringExtensions", "TOML", "Test"]
Expand Down
8 changes: 6 additions & 2 deletions src/callbacks/get_callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ function get_diagnostics(parsed_args, atmos_model, Y, p, t_start, dt)
num_netcdf_points = (180, 90, 50)
end

z_sampling_method =
parsed_args["netcdf_output_at_levels"] ? CAD.LevelsMethod() :
CAD.FakePressureLevelsMethod()

netcdf_writer = CAD.NetCDFWriter(
axes(Y.c),
p.output_dir,
num_points = num_netcdf_points,
disable_vertical_interpolation = parsed_args["netcdf_output_at_levels"],
num_points = num_netcdf_points;
z_sampling_method,
)
writers = (hdf5_writer, netcdf_writer)

Expand Down
13 changes: 7 additions & 6 deletions src/diagnostics/Diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ import ..compute_gm_mixing_length!
include(joinpath("..", "utils", "abbreviations.jl"))

import ClimaDiagnostics:
DiagnosticVariable,
ScheduledDiagnostic,
average_pre_output_hook!,
DiagnosticsCallback
DiagnosticVariable, ScheduledDiagnostic, average_pre_output_hook!

import ClimaDiagnostics.DiagnosticVariables: descriptive_short_name

import ClimaDiagnostics.Schedules: EveryStepSchedule, EveryDtSchedule


import ClimaDiagnostics.Writers: HDF5Writer, NetCDFWriter, write_field!
import ClimaDiagnostics.Writers:
HDF5Writer,
NetCDFWriter,
write_field!,
LevelsMethod,
FakePressureLevelsMethod

include("diagnostic.jl")

Expand Down

0 comments on commit b03e8c5

Please sign in to comment.