Closed valeriabarra closed 2 years ago
Looks good! I would say the porting over would take 1 week, so if we want to investigate other Julia packages, I would allow more time (an additional week or so). Also, in the long term this should live wherever we compute diagnostics on the regridded data (ClimaDiagnostics.jl?) but, for the time being, I agree that ClimaCore/lib
seems most appropriate.
@jiahe23 and @akshaysridhar , you guys experimented with CM's Spectra
code recently. Would you have any pointers/branches/tips/preferences?
I have a very outdated branch in CA that I adopted the CM spectra calculation. It worked fine. I have generated KE spectra plots that looked reasonable by that time.
Thanks for the pointers!
Now that #979 is finally merged, I would propose opening a new SDI/issue for the enhanced interface and remaining enhancements (i.e., potential use of external packages). I prefer keep things organized and this was already a pretty long SDI/PR
What do you think, @charleskawczynski ?
I will mark this as complete and will open issues in the downstream repos (ClimaAtmos and ClimaCoupler) for the integration in them. I would also leave the 2 enhancement bullet points to a separate issue/SDI for the future revamping of the interface
.... What do you think, @charleskawczynski ?
That sounds good. If using features in this package require many lines of code (e.g., more than 20) in an existing script, then I suggest we break off a subtask of trying to make a good wrapper around the remapping pipeline.
Purpose
Spectra on the sphere via spherical harmonics are a feature needed for diagnostic purposes.
Link to any relevant PRs/issues: https://github.com/CliMA/ClimaDiagnostics/issues/1
Some of this diagnostic functionality existed in
ClimateMachine
but will need to be ported over to ClimaCore and adapted to use its API/objects, and potentially optimized using existing Julia packages.Cost/benefits/risks
Having spherical harmonics will allow us to calculate and plot the energy spectra to analyze turbulence or numerical dissipation (e.g., from hyperdiffusion).
Producers
Lead: @valeriabarra Potential collaborators: @LenkaNovak , @akshaysridhar , @jiahe23
Components
On the sphere we want both 1D and 2D spectra. For these we need:
fft
on latitude circles (as for the 1D spectrum) and associated Legendre polynomials for meridians, and calculate spectra.AssociatedLegendrePolynomials.jl
for the calulation of the associated normalized Legendre polynomials andQuadGK.jl
for Gaussian integrationInputs
References:
Spectra
module and references therein:Results and deliverables
lib
, e.g.,lib/ClimaCoreSpectra
, which will include both library code undersrc
and related tests undertest
, exercised through the usualruntests.jl
.Field
defined on the ClimaCore cubed-sphere to the regridding and specrta calculationIntegration in downstream repositories/packages:
Task breakdown
A preliminary list of PRs and a preliminary timeline of PRs, milestones, and key results.
lib/ClimaCoreSpectra
package [1 week?]The four tasks above are implemented in https://github.com/CliMA/ClimaCore.jl/pull/979
Additional tasks for follow-up PRs:
Fields
directly with internal calls to remapping infrastructure so to remove the burned from the user...
Details are subject to change as well as tasks/subtasks as things and plans are refined.
Working branch
valeria/spherical-harmonics
Reviewers
@charleskawczynski and possibly other folks who have worked on/with the prior implementation (e.g., @LenkaNovak , @akshaysridhar )