Open AndrewILWilliams opened 2 years ago
Hi Andrew,
I'm about to sign off for the break but in case this helps quickly, I think what would work on my system is something like
nt = 504 nx = 128 ny = 64 forecast_1d = np.fromfile("forecast.dat", dtype='float32') forecast = np.reshape(forecast_1d, (nt, ny, nx))
plt.contour(forecast[-1, :, :])
although I'm not sure off the top of my head if that's the right nt. Since it's a binary file, there may also be endian issues depending on what your os is (data was written on a mac).
If you're still stuck when I get back online after the holiday, I'll whip up a quick python program to plot it.
Happy Holidays! Matt
Thanks Matt, I'll give this a go soon.
Enjoy the time off :)
A
Hi Matthew!
Just trying out your
lbve_sbr_1.0.f
routine, and I can get it to run and it outputsforecast.dat
andsummary.dat
.I can open these files in python with:
and I get a 1d vector of output (of length
ntime*nlat*nlon
, in some order...).I was just wondering how to reshape this 1d output into something sensible and plot it in python? I'm a bit new to fortran so it's a bit confusing to me. My goal is to reproduce your excellent gif of Rossby waves propagating from the tropical Pacific into the extratropics. :)
Cheers, and enjoy Christmas! Andrew