Open navidcy opened 6 months ago
E.g., given you have GLMakie and GeoMakie in your environment,
using SpeedyWeather
using StochasticStir
# model components
spectral_grid = SpectralGrid(trunc=63, nlev=1)
forcing = StochasticStirring(spectral_grid, latitude=35, strength=7e-11)
drag = JetDrag(spectral_grid, time_scale=Day(6))
initial_conditions = StartFromRest()
# construct the model and initialize
model = BarotropicModel(; spectral_grid, initial_conditions, forcing,drag)
simulation = initialize!(model)
# now run and store output
run!(simulation,period=Day(100), output=true)
# load saved output
id = model.output.id
ds = NCDataset("run_$id/output.nc")
times = ds["time"][:]
lat, lon = ds["lat"][:], ds["lon"][:]
lon .-= 180 # convert lon to [-180, 180]
# animate
using GLMakie, GeoMakie
n = Observable(1)
fig = Figure()
ax = GeoAxis(fig[1, 1]; dest = "+proj=ortho +lon_0=0 +lat_0=40")
ax.xticklabelsvisible[] = false
ax.yticklabelsvisible[] = false
vorticity = @lift ds["vor"][:, :, 1, $n]
surface!(ax, lon, lat, vorticity;
colormap = :balance,
colorrange = (-1e-4, 1e-4))
title = @lift string(times[$n])
Label(fig[0, :], title, fontsize=24, tellwidth=false)
record(fig, "eddydrivenjet.mp4", 1:length(times), framerate=16) do i
n[] = i
end
produces
Awesome, I'll add that. Why is it so dark? It looks like there's a grey shade on top of it?
I was annoyed with that also... I try to fix it but couldn't. I'm not sure if it's the surface
or something else...
@SimonDanisch what are we doing wrong?
That will be helpful.