@@ -65,7 +65,11 @@ function debug(cs_fields::NamedTuple, dir, cs_fields_ref = nothing)
65
65
)
66
66
cpu_field = ClimaCore. Fields. ones (cpu_space)
67
67
68
- parent (cpu_field) .= parent (field)
68
+ parent (cpu_field) .= Array (parent (field))
69
+ # Check what we're doing is correct on CPU
70
+ if comms_ctx isa ClimaComms. SingletonCommsContext
71
+ @assert cpu_field == field
72
+ end
69
73
70
74
push! (all_plots, Plots. plot (cpu_field, title = string (field_name) * print_extrema (field)))
71
75
if (field_name == :T_S ) && (@isdefined debug_csf0)
@@ -90,6 +94,11 @@ function debug(cs_fields::NamedTuple, dir, cs_fields_ref = nothing)
90
94
# Copy field onto cpu space
91
95
parent (cpu_field) .= parent (field)
92
96
97
+ # Check what we're doing is correct on CPU
98
+ if comms_ctx isa ClimaComms. SingletonCommsContext
99
+ @assert cpu_field == field
100
+ end
101
+
93
102
push! (
94
103
all_plots,
95
104
Plots. plot (
@@ -149,7 +158,7 @@ function debug(sim::ComponentModelSimulation, dir)
149
158
nz = nz,
150
159
)
151
160
cpu_field = ClimaCore. Fields. ones (cpu_space)
152
- parent (cpu_field) .= parent (field)
161
+ parent (cpu_field) .= Array ( parent (field) )
153
162
154
163
push! (all_plots, Plots. plot (cpu_field, title = string (field_name) * print_extrema (field)))
155
164
end
0 commit comments