@@ -177,9 +177,7 @@ run!(simulation)
177177
178178# Now we'll read the results and plot an animation
179179
180- using Rasters
181-
182- ds = RasterStack (simulation. output_writers[:nc ]. filepath)
180+ ds = NCDataset (simulation. output_writers[:nc ]. filepath)
183181
184182# We now use Makie to create the figure and its axes
185183
@@ -198,31 +196,31 @@ ax3 = Axis(fig[2, 3]; title = "PV", kwargs...);
198196
199197n = Observable (1 )
200198
201- x_caa = Array ( dims (ds, : x_caa))
202- x_faa = Array ( dims (ds, : x_faa))
203- z_aac = Array ( dims (ds, : z_aac))
204- z_aaf = Array ( dims (ds, : z_aaf))
199+ x_caa = ds[ " x_caa" ][:]
200+ x_faa = ds[ " x_faa" ][:]
201+ z_aac = ds[ " z_aac" ][:]
202+ z_aaf = ds[ " z_aaf" ][:]
205203
206- bₙ = @lift Array (ds . b[Ti = $ n, y_aca = Near ( 0 )])
204+ bₙ = @lift ds[ " b " ][:, :, $ n]
207205
208- Riₙ = @lift Array (ds . Ri[Ti = $ n, y_aca = Near ( 0 )])
206+ Riₙ = @lift ds[ " Ri " ][:, :, $ n]
209207hm1 = heatmap! (ax1, x_caa, z_aaf, Riₙ; colormap = :coolwarm , colorrange = (- 1 , + 1 ))
210208contour! (ax1, x_caa, z_aac, bₙ; levels= 10 , color= :white , linestyle= :dash , linewidth= 0.5 )
211209Colorbar (fig[3 , 1 ], hm1, vertical= false , height= 8 , ticklabelsize= 14 )
212210
213- Roₙ = @lift Array (ds . Ro[Ti = $ n, y_afa = Near ( 0 )])
211+ Roₙ = @lift ds[ " Ro " ][:, :, $ n]
214212hm2 = heatmap! (ax2, x_faa, z_aaf, Roₙ; colormap = :balance , colorrange = (- 10 , + 10 ))
215213contour! (ax2, x_caa, z_aac, bₙ; levels= 10 , color= :black , linestyle= :dash , linewidth= 0.5 )
216214Colorbar (fig[3 , 2 ], hm2, vertical= false , height= 8 , ticklabelsize= 14 )
217215
218- PVₙ = @lift Array (ds . PV[Ti = $ n, y_afa = Near ( 0 )])
216+ PVₙ = @lift ds[ " PV " ][:, :, $ n]
219217hm3 = heatmap! (ax3, x_faa, z_aaf, PVₙ; colormap = :coolwarm , colorrange = N²* f₀.* (- 1.5 , + 1.5 ))
220218contour! (ax3, x_caa, z_aac, bₙ; levels= 10 , color= :white , linestyle= :dash , linewidth= 0.5 )
221219Colorbar (fig[3 , 3 ], hm3, vertical= false , height= 8 , ticklabelsize= 14 );
222220
223221# Now we mark the time by placing a vertical line in the bottom panel and adding a helpful title
224222
225- times = dims (ds, :Ti )
223+ times = ds[ " time " ][:]
226224title = @lift " Time = " * string (prettytime (times[$ n]))
227225fig[1 , 1 : 3 ] = Label (fig, title, fontsize= 24 , tellwidth= false );
228226
@@ -235,6 +233,8 @@ record(fig, filename * ".mp4", 1:length(times), framerate=10) do i
235233 n[] = i
236234end
237235
236+ close (ds)
237+
238238# 
239239#
240240# The animation shows negative PV being produced at the bottom due to drag, which leads to the
0 commit comments