Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

1D and 2D energy spectra for GCM #1559

Merged
merged 2 commits into from
Oct 21, 2020
Merged

1D and 2D energy spectra for GCM #1559

merged 2 commits into from
Oct 21, 2020

Conversation

LenkaNovak
Copy link
Contributor

@LenkaNovak LenkaNovak commented Sep 16, 2020

Description

Co-authored by @jiahe23 , @kpamnany

This code calculates 1d spectra (Fourier transform at each latitude and height) and 2d spectra (spherical harmonic transformation at each height) for the GCM on the fly, or it can be ported to analysis scripts for offline calculations.

It is currently set up to be interpolated using the same output timestep and Gaussian grid as the atmos_default_diagnostics group, but these can be set separately (e.g. for less severe wavenumber truncations).

Energy spectra are currently calculated using the meridional wind only.

Output is a separate NetCDF file, containing:
"spectrum_1d"[zonal wavenumber, latitude, height, time]
"spectrum_2d"[truncated zonal wavenumber, total wavenumber, height, time]

TODO in a separate PR

  • add mass weighting and vertical integration

The code structure follows Yassine’s 3d turbulence LES spectra, and the spherical harmonic transformation is based on Daniel’s Julian FMS code.

I have

  • Written and run all necessary tests with CLIMA by including tests/runtests.jl
  • Followed all necessary style guidelines and run julia .dev/climaformat.jl .
  • Updated the documentation to reflect changes from this PR.

For review by CLIMA developers

  • There are no open pull requests for this already
  • CLIMA developers with relevant expertise have been assigned to review this submission
  • The code conforms to the style guidelines and has consistent naming conventions. julia .dev/format.jl has been run in a separate commit.
  • This code does what it is technically intended to do (all numerics make sense physically and/or computationally)

src/Common/Spectra/spherical_helper.jl Outdated Show resolved Hide resolved
src/Diagnostics/Diagnostics.jl Outdated Show resolved Hide resolved
src/Driver/diagnostics_configs.jl Outdated Show resolved Hide resolved
# Setup dimensions
interpol_dims = dimensions(interpol)
lat = interpol_dims["lat"][1]
level = interpol_dims["level"][1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the distance from the Earth center. Earth radius should be removed to get the altitude heights.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- as done here for example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LenkaNovak: I added a fix for this here, please verify?

@LenkaNovak LenkaNovak force-pushed the ln/gcm-spectra branch 2 times, most recently from fa2d679 to cb65214 Compare October 19, 2020 17:21
@kpamnany kpamnany force-pushed the ln/gcm-spectra branch 3 times, most recently from 718387c to 01f36e6 Compare October 20, 2020 20:45
@kpamnany kpamnany marked this pull request as ready for review October 20, 2020 20:45
@kpamnany
Copy link
Contributor

@LenkaNovak: I think this is good to go. Please take a look and if you're happy, we can merge it.

bors try

bors bot added a commit that referenced this pull request Oct 20, 2020
@bors
Copy link
Contributor

bors bot commented Oct 20, 2020

kpamnany and others added 2 commits October 21, 2020 11:08
Along with test cases and a diagnostics group. Refactor old spectra
diagnostics group for Atmos LES.

Co-authored-by: Jia <jiahe.gatech@gmail.com>
Co-authored-by: K Pamnany <kpamnany@gmail.com>
@kpamnany
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 21, 2020

@bors bors bot merged commit 0e9f0b9 into master Oct 21, 2020
@bors bors bot deleted the ln/gcm-spectra branch October 21, 2020 19:38
@kpamnany kpamnany mentioned this pull request Oct 23, 2020
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants