CliMA / ClimaCore.jl

CliMA model dycore
https://clima.github.io/ClimaCore.jl/dev
Apache License 2.0
86 stars 8 forks source link

Spectra for GCM configuration #967

Closed valeriabarra closed 2 years ago

valeriabarra commented 2 years ago

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:

Inputs

References:

Results and deliverables

Integration in downstream repositories/packages:

Task breakdown

A preliminary list of PRs and a preliminary timeline of PRs, milestones, and key results.

The four tasks above are implemented in https://github.com/CliMA/ClimaCore.jl/pull/979

Additional tasks for follow-up PRs:

...

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 )

LenkaNovak commented 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.

LenkaNovak commented 2 years ago

@jiahe23 and @akshaysridhar , you guys experimented with CM's Spectra code recently. Would you have any pointers/branches/tips/preferences?

jiahe23 commented 2 years ago

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.

valeriabarra commented 2 years ago

Thanks for the pointers!

valeriabarra commented 2 years ago

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 ?

valeriabarra commented 2 years ago

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

charleskawczynski commented 2 years ago

.... 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.