Skip to content

Comments

Add MYNN surface layer scheme#340

Merged
kuanchihwang merged 24 commits intoESCOMP:developmentfrom
kuanchihwang:staging/mynn-sf-scheme
Feb 10, 2026
Merged

Add MYNN surface layer scheme#340
kuanchihwang merged 24 commits intoESCOMP:developmentfrom
kuanchihwang:staging/mynn-sf-scheme

Conversation

@kuanchihwang
Copy link
Collaborator

Originator(s):

kuanchihwang

Descriptions (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):

This PR adds the Mellor-Yamada-Nakanishi-Niino (MYNN) surface layer scheme to the experimental convection-permitting physics suite.

List all namelist files that were added or changed:

None

List all files eliminated and why:

None

List all files added and what they do:

A       .gitattributes
  * Make GitHub Linguist recognize `*.pf` files as Fortran source code
A       schemes/mmm/sf_mynn_compat.F90
A       schemes/mmm/sf_mynn_compat.meta
  * Implement MYNN surface layer scheme

List all existing files that have been modified, and describe the changes:

M       .github/workflows/unit-tests.yaml
  * Do not hard code path to working directory in GitHub Actions
M       .gitmodules
M       schemes/mmm/mmm_physics
  * Update git submodule of MMM physics
M       schemes/mmm/CMakeLists.txt
M       test/unit-test/tests/mmm/CMakeLists.txt
  * Synchronize `CMakeLists.txt` of MMM physics with MPAS dycore in CAM-SIMA
M       schemes/mmm/cu_ntiedtke_compat.F90
M       schemes/mmm/cu_ntiedtke_compat.meta
  * Fix incorrect standard name in new Tiedtke convection scheme
M       schemes/mmm/mmm_physics_compat.F90
M       schemes/mmm/mmm_physics_compat.meta
  * Implement interstitial schemes for MYNN surface layer scheme
M       test/test_suites/suite_convection_permitting.xml
  * Add MYNN surface layer scheme to convection-permitting suite
M       test/unit-test/tests/mmm/mmm_physics_compat_tests.pf
  * Implement unit tests

List all automated tests that failed, as well as an explanation for why they were not fixed:

None

Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?

Answer-changing for the convection-permitting physics suite due to a newly added physics scheme. Nothing is changed for the rest.

If yes to the above question, describe how this code was validated with the new/modified features:

The convection-permitting physics suite is considered an experimental feature. There is no baseline available to validate against because it has never been implemented in CAM-SIMA as well as CAM before.

@kuanchihwang kuanchihwang marked this pull request as ready for review December 10, 2025 00:05
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

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

Thanks for bringing in the first MYNN scheme @kuanchihwang! I do have some change requests, mostly related to the location of certain subroutines, the conversion of hard-coded variables to namelist variables, and a few other general requests. Of course if you have any questions or concerns with my requests just let me know. Thanks again!

However, this standard name change deviates from the ESM Standard Name Library.

In the ESM Standard Name Library, "ratio_of_height_to_monin_obukhov_length" is
defined. However, here "ratio_of_height_at_surface_adjacent_layer_to_monin_obukhov_length"
is used.
…ters

* To conform to the existing naming convention in state converters,
  `compute_ ...` has been renamed to `calc_ ...`.
* Fix incorrect units in a code comment in state converters.
@nusbaume nusbaume requested a review from cacraigucar January 23, 2026 17:02
Comment on lines 48 to 50
! This threshold is hardcoded to the same value as in MMM physics.
! It is named `xice_threshold` there.
real(kind_phys), parameter :: sea_ice_area_fraction_threshold = 0.02_kind_phys
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the comment indicates this is hardcoded to match the value in MMM physics, is it possible to somehow get xice_threshold into this routine? This would eliminate the possibility of it being changed in one location or not the other. Alternatively, could a check be performed somewhere during initialization to make sure they match? Perhaps a check_mmm_constanst routine whose scope is such that it has access to these routines as well as the MMM library ones and performs a one-time check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved the option definitions to the mmm_physics_compat_init subroutine in fe2728d. Some misleading code comments were also revised. All options are now set in one central place.

To add more clarity, these options are hardcoded in the physics driver of standalone MPAS (e.g., [1][2]). Therefore, it is not possible to reference them (either through use statements or procedure calls) from here.

Unit tests were adjusted accordingly in 1eac9d7.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@kuanchihwang - I agree that this can be postponed until a future date when namelists are introduced.

The definitions of `isfflx`, `isftcflx`, `iz0tlnd`, `spp_pbl`, and `xice_threshold`
have been moved to the `mmm_physics_compat_init` subroutine. This avoids duplicate
definitions in multiple places.

Also adjust misleading code comments.
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

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

Thanks for resolving my concerns @kuanchihwang! I had one last unit update that I missed in the first review, but otherwise everything else looks good to me.

intent = out
[ xice_threshold ]
standard_name = sea_ice_area_fraction_threshold_for_mmm_scheme
units = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Apologies for missing this in the first review, but I believe that the units for xice_threshold should be fraction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved in 0872abb.

@kuanchihwang kuanchihwang merged commit d8e279e into ESCOMP:development Feb 10, 2026
4 checks passed
peverwhee added a commit that referenced this pull request Feb 13, 2026
Tag name (The PR title should also include the tag name): n/a
Originator(s): kuanchihwang

Merge development to main. Includes:
* Kuan-Chih's Add MYNN surface layer scheme (#340) 
* Update CAM4 physics suite for SIMA aquaplanet configurations (#349)
[already on main, but commit was squashed]
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.

3 participants