From 4b480925e19d58daf722ac3dbfc2f316da48143b Mon Sep 17 00:00:00 2001 From: Julia Sloan Date: Tue, 19 Mar 2024 17:12:59 -0700 Subject: [PATCH] use Array(parent()) --- experiments/AMIP/user_io/debug_plots.jl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/experiments/AMIP/user_io/debug_plots.jl b/experiments/AMIP/user_io/debug_plots.jl index f09afabece..3489057e8c 100644 --- a/experiments/AMIP/user_io/debug_plots.jl +++ b/experiments/AMIP/user_io/debug_plots.jl @@ -65,7 +65,11 @@ function debug(cs_fields::NamedTuple, dir, cs_fields_ref = nothing) ) cpu_field = ClimaCore.Fields.ones(cpu_space) - parent(cpu_field) .= parent(field) + parent(cpu_field) .= Array(parent(field)) + # Check what we're doing is correct on CPU + if comms_ctx isa ClimaComms.SingletonCommsContext + @assert cpu_field == field + end push!(all_plots, Plots.plot(cpu_field, title = string(field_name) * print_extrema(field))) if (field_name == :T_S) && (@isdefined debug_csf0) @@ -90,6 +94,11 @@ function debug(cs_fields::NamedTuple, dir, cs_fields_ref = nothing) # Copy field onto cpu space parent(cpu_field) .= parent(field) + # Check what we're doing is correct on CPU + if comms_ctx isa ClimaComms.SingletonCommsContext + @assert cpu_field == field + end + push!( all_plots, Plots.plot( @@ -149,7 +158,7 @@ function debug(sim::ComponentModelSimulation, dir) nz = nz, ) cpu_field = ClimaCore.Fields.ones(cpu_space) - parent(cpu_field) .= parent(field) + parent(cpu_field) .= Array(parent(field)) push!(all_plots, Plots.plot(cpu_field, title = string(field_name) * print_extrema(field))) end