Skip to content

Conversation

@jjuyeonkim
Copy link
Collaborator

@jjuyeonkim jjuyeonkim commented Apr 22, 2025

Description
This is the first step in porting a Fortran shallow water test to pace. This PR will add DycoreState initialization for the Rossby-Haurwitz wave 4 test case found in tools/test_cases.F90 (shallow-water test 6) of the GFDL_atmos_cubed_sphere repo.

Additionally, there is an new sw_dynamics configuration flag added to the DynamicalCoreConfig that does nothing yet, but it will eventually be used to modify logic based on whether or not the test is for shallow water.

Fixes # (issue)
None.

How Has This Been Tested?
DycoreState initialization for the Rossby case was unit-tested in the pace repository. This related code will be added in a separate PR for that repo.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - I don't believe there is corresponding documentation for this change.
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules - Dependent changes will be merged eventually, but haven't been merged yet.
  • New check tests, if applicable, are included - Unit test will be added in a separate repository PR
  • Targeted model if this changed was triggered by a model need/shortcoming - Unsure. I don't think this is applicable.

@jjuyeonkim
Copy link
Collaborator Author

This PR is partially tested in a related PR: NOAA-GFDL/pace#112

Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

Small assert->try/catch but we are looking good.

- Use NamelistDefaults.sw_dynamics
- Replace assert with raised TypeError in analytic_init.py
oelbert
oelbert previously approved these changes May 19, 2025
Copy link
Collaborator

@oelbert oelbert left a comment

Choose a reason for hiding this comment

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

This looks good to me. Looks like the failing test is just because the NDSL version being pulled doesn't have sw_dynamics but thta's easy to fix

@jjuyeonkim
Copy link
Collaborator Author

This looks good to me. Looks like the failing test is just because the NDSL version being pulled doesn't have sw_dynamics but thta's easy to fix

For now, I've hard-coded the sw_dynamics flag to False, but I left a TODO to change it back to the NamelistDefaults once there is a new NDSL tag. The small change to add the flag to NDSL is in 'develop' currently.

fmalatino
fmalatino previously approved these changes May 19, 2025
@oelbert
Copy link
Collaborator

oelbert commented May 21, 2025

@FlorianDeconinck ready for re-review

Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

Looking good (sorry for delay).

One thing you want to add is a try/catch around sw_dynamics being True when we try to init the Rossby case so bad config are caught early.

@jjuyeonkim
Copy link
Collaborator Author

jjuyeonkim commented May 22, 2025

One thing you want to add is a try/catch around sw_dynamics being True when we try to init the Rossby case so bad config are caught early.

@FlorianDeconinck I think you're right. We should check that sw_dynamics is True. Is it possible to push this PR for now. Then, open a separate PR for this check?

The reason I ask is that I'm currently thinking of modifying the input parameters to init_analytic_state(...) to take in a config. This would likely require a coordinated change in pace. I was hoping to create a new PR for this part.

@jjuyeonkim jjuyeonkim dismissed stale reviews from FlorianDeconinck and fmalatino via 91d9ecb May 22, 2025 16:50
Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

LGTM

@FlorianDeconinck FlorianDeconinck merged commit b251b76 into NOAA-GFDL:develop May 22, 2025
4 checks passed
gmao-ckung pushed a commit to gmao-ckung/PyFV3 that referenced this pull request Jul 16, 2025
- Use NamelistDefaults.sw_dynamics
- Replace assert with raised TypeError in analytic_init.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants