NCAR / NCAR/DART

quad_util_mod rotations

Open
#453 19 comments 0 reactions 1 assignee View on GitHub

@hkershaw-brown is already working on this.

Since Jun 20, 2023.

interpolation mom6 quad_utils
Dominant language
Fortran
Stars
263
Forks
182
Avg merge
11d 12h
Merged PRs (30d)
7

Description

Reported in the standup that the quad_utils_mod may have problems when the quad is rotated at 45 degrees.

model_mods that would be affected by this:

  • cam-fv
  • mom6 (unreleased)
  • quad_utils is used by people with their own DART development for TIEGCM

Not confirmed (yet).

There is no record of the error (or fix) in the log:
https://github.com/NCAR/DART/commits/main/models/utilities/quad_utils_mod.f90

There is the namelist option do_rotate (default .false.)
https://github.com/NCAR/DART/blob/16595cad595b6349605c9bc8e021c7ecc2c2391a/models/utilities/quad_utils_mod.f90#L2179

The notes talk about the degenerate case where the grid is rotated 90 degrees:
https://github.com/NCAR/DART/blob/16595cad595b6349605c9bc8e021c7ecc2c2391a/models/utilities/quad_utils_mod.f90#L2201-L2202

Mentioned at the standup (note I might not be recalling this correctly): cam-se has a fix for this rotation problem. Is this it?
https://github.com/NCAR/DART/blob/16595cad595b6349605c9bc8e021c7ecc2c2391a/models/cam-se/model_mod.f90#L2531

Q. Why does cam-se not use quad_utils_mod?
Q. What is the goal of rotating?
Q. Why is the default do_rotate = .false.?

I think quad_interp_mod is a generalization (and replacement?) for the original POP model_mod interpolation code:
https://github.com/NCAR/DART/blob/16595cad595b6349605c9bc8e021c7ecc2c2391a/models/utilities/quad_utils_mod.f90#L894-L897
Q. Can we switch out the POP model_mod code?

There are 21 fixmes is the quad_util_mod module.

Other quad_util_mod issues:

  • see https://github.com/NCAR/DART/issues/249 for a note only only one of the quad_utils routines checking for missing values in the state.

  • Note from pull #247

    quad_utils_mod.f90 uses  invals(4, nitems)
    cam-fv/model_mod.f90 uses quad_vals(ens_size,4) !< array of interpolated values
    

    which seems ripe for bugs such as https://github.com/NCAR/DART/issues/246. I'm not sure why the change
    in order was made, maybe should be reverted.

⚠️ Note the rotation in quad_utils_mod does not match the comment, the rotation is clockwise rather than counterclockwise. https://github.com/NCAR/DART/issues/833#issuecomment-2730460445

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.