Skip to content

Commit

Permalink
Remove old diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Nov 13, 2023
1 parent 4af30d2 commit 419dddb
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 3,028 deletions.
64 changes: 25 additions & 39 deletions examples/hybrid/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,11 @@ import OrderedCollections
using ClimaCoreTempestRemap
using ClimaCorePlots, Plots
using ClimaCoreMakie, CairoMakie
include(joinpath(pkgdir(CA), "post_processing", "common_utils.jl"))

include(joinpath(pkgdir(CA), "post_processing", "contours_and_profiles.jl"))
include(joinpath(pkgdir(CA), "post_processing", "post_processing_funcs.jl"))
include(
joinpath(pkgdir(CA), "post_processing", "define_tc_quicklook_profiles.jl"),
)
include(joinpath(pkgdir(CA), "post_processing", "make_plots.jl"))

ref_job_id = config.parsed_args["reference_job_id"]
reference_job_id = isnothing(ref_job_id) ? simulation.job_id : ref_job_id

is_edmfx =
atmos.turbconv_model isa CA.PrognosticEDMFX ||
atmos.turbconv_model isa CA.DiagnosticEDMFX
if is_edmfx && config.parsed_args["post_process"]
contours_and_profiles(simulation.output_dir, reference_job_id)
zip_and_cleanup_output(simulation.output_dir, "hdf5files.zip")
end

if sol_res.ret_code == :simulation_crashed
error(
"The ClimaAtmos simulation has crashed. See the stack trace for details.",
Expand All @@ -58,31 +44,31 @@ end
@assert last(sol.t) == simulation.t_end
CA.verify_callbacks(sol.t)

if CA.is_distributed(config.comms_ctx)
export_scaling_file(
sol,
simulation.output_dir,
walltime,
config.comms_ctx,
ClimaComms.nprocs(config.comms_ctx),
)
end
@info "Plotting"
make_plot(Val{Symbol(reference_job_id)}, simulation.output_dir)
@info "Plotting done"

if !CA.is_distributed(config.comms_ctx) &&
config.parsed_args["post_process"] &&
!is_edmfx &&
!(atmos.model_config isa CA.SphericalModel)
ENV["GKSwstype"] = "nul" # avoid displaying plots
if is_column_without_edmfx(config.parsed_args)
custom_postprocessing(sol, simulation.output_dir, p)
elseif is_solid_body(config.parsed_args)
postprocessing(sol, simulation.output_dir, config.parsed_args["fps"])
elseif atmos.model_config isa CA.BoxModel
postprocessing_box(sol, simulation.output_dir)
elseif atmos.model_config isa CA.PlaneModel
postprocessing_plane(sol, simulation.output_dir, p)
else
error("Uncaught case")
if CA.is_distributed(config.comms_ctx)
nprocs = ClimaComms.nprocs(config.comms_ctx)
comms_ctx = config.comms_ctx
output_dir = simulation.output_dir
# replace sol.u on the root processor with the global sol.u
if ClimaComms.iamroot(comms_ctx)
Y = sol.u[1]
center_space = axes(Y.c)
horz_space = Spaces.horizontal_space(center_space)
horz_topology = horz_space.topology
Nq = Spaces.Quadratures.degrees_of_freedom(horz_space.quadrature_style)
nlocalelems = Topologies.nlocalelems(horz_topology)
ncols_per_process = nlocalelems * Nq * Nq
scaling_file =
joinpath(output_dir, "scaling_data_$(nprocs)_processes.jld2")
@info(
"Writing scaling data",
"walltime (seconds)" = walltime,
scaling_file
)
JLD2.jldsave(scaling_file; nprocs, ncols_per_process, walltime)
end
end

Expand Down
46 changes: 0 additions & 46 deletions post_processing/common_utils.jl

This file was deleted.

11 changes: 0 additions & 11 deletions post_processing/compare_outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ function parse_commandline()
help = "A bool: compare the state between output_folder_1 and output_folder_2 [`true` [default], `false`]"
arg_type = Bool
default = true
"--compare_diagnostics"
help = "A bool: compare the diagnostics between output_folder_1 and output_folder_2 [`true` [default], `false`]"
arg_type = Bool
default = true
end
Expand All @@ -45,8 +43,6 @@ function get_data(folder, name)
end
Y_1 = get_data(parsed_args["output_folder_1"], "Y");
Y_2 = get_data(parsed_args["output_folder_2"], "Y");
D_1 = get_data(parsed_args["output_folder_1"], "diagnostics");
D_2 = get_data(parsed_args["output_folder_2"], "diagnostics");

compare(a::FV, b::FV, pn0 = "") where {FV <: Fields.FieldVector} =
compare(true, a, b, pn0)
Expand Down Expand Up @@ -83,11 +79,4 @@ end
else
@test_broken compare(Y_1, Y_2)
end

@info "Comparing diagnostics:"
if parsed_args["compare_diagnostics"]
@test compare(D_1, D_2)
else
@test_broken compare(D_1, D_2)
end
end
203 changes: 0 additions & 203 deletions post_processing/comparison_plots.jl

This file was deleted.

Loading

0 comments on commit 419dddb

Please sign in to comment.