Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advection of arbitrary fields #668

Draft
wants to merge 126 commits into
base: develop
Choose a base branch
from
Draft

Conversation

timspainNERSC
Copy link
Collaborator

@timspainNERSC timspainNERSC commented Aug 28, 2024

Advection of arbitrary fields

Fixes #99 & fixes #337


Change Description

  • Adds advection of the two non-dynamical but prognostic fields, snow thickness and ice temperature.
  • Adds functions to advect an HField ModelArray for one advection time step. This is a wrapper around the IDynamics::advectField() function which will advect a 2D or 3D ModelArray, using the slicing infrastructure to reduce the 3D array to a series of 2D fields, advect them using the 2D advection functions provided by the kernel, and reconstruct the 3D field, again using ModelArraySlices.
  • Adds DynamicsKernel::advectField() which will interface with the dynamics code to advect a 2D ModelArray field by one advection time step.
  • Adds a AdvectionDynamicsKernel to the dynamics, which just advects ice fields according to the ocean velocity.
  • Initializes many fields to zero in the dynamics kernels to ensure there is no junk data in the higher DG components.
  • Does not zero out the higher DG components every time new DG0 data is copied into the dynamics from the thermodynamics.

Incorporates the slicing changes (#736).


Test Description

Adds two similar tests, testFieldAdvection in dynamics/test and testDynamics in core/test. These both set up a 51 x 51 domain, create a circular region of ice in the centre with solid body rotation as the velocity field. A snow depth field that is sinusoidal with angle around the centre is then advected and the field tested every time that the soldi body rotation field makes a quarter turn. The test is an 8 sample approximation to the Fourier transform for the degree 1 Fourier coefficients. That is, it extracts the amplitude of the sinusoidal and cosinusoidal variation around the disk. The two components are then compared to the original sinusoid field with appropriate phase shifts to ensure the field is rotating as a solid body.

In the case of the test in core/test a similar ice temperature 3D field is also advected and tested in the same manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Implementation fields for advection Advecting arbitrary fields
1 participant