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 22, 2024
1 parent 68a2d59 commit f4bb432
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 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
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.Writers.LevelsMethod() :
CAD.Writers.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
3 changes: 1 addition & 2 deletions src/diagnostics/Diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ include(joinpath("..", "utils", "abbreviations.jl"))
import ClimaDiagnostics:
DiagnosticVariable,
ScheduledDiagnostic,
average_pre_output_hook!,
DiagnosticsCallback
average_pre_output_hook!

import ClimaDiagnostics.DiagnosticVariables: descriptive_short_name

Expand Down

0 comments on commit f4bb432

Please sign in to comment.