Skip to content

Commit

Permalink
use gpu field for extrema
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Mar 19, 2024
1 parent aa50f3a commit e04be2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions experiments/AMIP/user_io/debug_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ function debug(cs_fields::NamedTuple, dir, cs_fields_ref = nothing)
# Convert field from GPU to CPU if necessary
cpu_field = Adapt.adapt(Array, field)

push!(all_plots, Plots.plot(cpu_field, title = string(field_name) * print_extrema(cpu_field)))
push!(all_plots, Plots.plot(cpu_field, title = string(field_name) * print_extrema(field)))
if (field_name == :T_S) && (@isdefined debug_csf0)
push!(
all_plots,
Plots.plot(
cpu_field .- debug_csf0.T_S,
title = string(field_name) * "_anom" * print_extrema(cpu_field),
title = string(field_name) * "_anom" * print_extrema(field),
color = :viridis,
),
)
Expand All @@ -78,7 +78,7 @@ function debug(cs_fields::NamedTuple, dir, cs_fields_ref = nothing)
all_plots,
Plots.plot(
cpu_field .- getproperty(cs_fields_ref, field_name),
title = string(field_name) * print_extrema(cpu_field),
title = string(field_name) * print_extrema(field),
),
)
end
Expand All @@ -102,7 +102,7 @@ function debug(sim::ComponentModelSimulation, dir)
# Convert field from GPU to CPU if necessary
cpu_field = Adapt.adapt(Array, field)

push!(all_plots, Plots.plot(cpu_field, title = string(field_name) * print_extrema(cpu_field)))
push!(all_plots, Plots.plot(cpu_field, title = string(field_name) * print_extrema(field)))
end
fig = Plots.plot(all_plots..., size = (1500, 800))
Plots.png(joinpath(dir, "debug_$(name(sim))"))
Expand Down

0 comments on commit e04be2d

Please sign in to comment.