Open simonbyrne opened 2 years ago
@LenkaNovak @jiahe23 @szy21 any thoughts on this?
ClimateMachine.jl
has something written already. I think we could clean up and port over easily.
The way being done in ClimateMachine is:
m
(the zonal wavenumber) and l
(the total wavenumber) are computed as in here
u
and v
are projected to the Fourier (or the spherical) space separately as scalars, and then the power spectra (Fourier or sperical) are computed in the frequency domain. The KE spectra vs wavenumber (frequency) are returned and plotted.
I don't know the answer to the second question here.
The ClimateMachine.jl approach first interpolates to a lat-long grid, which I was hoping to avoid.
What are the maximum values of l
and m
that one would typically be interested in?
Also, what normalization should be used? https://www2.atmos.umd.edu/~dkleist/docs/shtns/doc/html/spec.html
Since l
and m
represent the wavenumber, they should reply on the minimal length scale of motion that could be resolved. The typical way is to compute from the number of meridians. I am not sure what would be an equivalent way if using the current grid.
@LenkaNovak Any thoughts here?
E3SM: https://acme-climate.atlassian.net/wiki/spaces/DOC/pages/1572504944/KE+Spectra+-+best+practices looks like they do the lat/lon interpolation first
Hi Simon, is this for diagnosing the classical power spectrum? If so, interpolating to a lat-lon grid before transforming to the spherical harmonics should be sufficient.
The max number of spherical harmonics is determined by the grid resolution, e.g. here
If we need to transform the full velocity vector, it may be best to first convert it into the rotating+nonrotating components (i.e. vorticity+divergence), but for basic power spectra diagnostics, this should not be necessary. (also alluded to on Mark Taylor's page mentioned above)
As for normalization, Daniel and I followed appendix B of this book (gimme a shout if you need a copy of this or if it's easier to chat).
Okay, that makes sense. I'll focus on the RLL interpolation, and we can build the spherical harmonics on top of that.
Okay, that makes sense. I'll focus on the RLL interpolation, and we can build the spherical harmonics on top of that.
Do you need to compute it on the fly? If not, I suggest we run the simulation, save the data at some frequency, and output it into netcdf using the Tempest remapping functionality. By doing this, we could save the time of re-do the remapping and focus on computing the KE spectra?
What do you think? @simonbyrne @LenkaNovak
That makes sense @jiahe23 and probably? you can re-use almost exactly the steps in https://acme-climate.atlassian.net/wiki/spaces/DOC/pages/1572504944/KE+Spectra+-+best+practices#Software-needed with a few tweaks. It would be good to try at least once to see if it works end to end as that would be the fastest thing to get some output.
You can see the normalization used in the linked ncl script: https://github.com/mt5555/nclscript/blob/master/spectra/ke.ncl#L13-L15
We can compute spherical harmonics directly from the nodal points on the cubed sphere mesh. The easiest way is probably to compute the dot product with the different basis functions.
Questions:
l
andm
are required?