Skip to content

Ufs-dev sync PR350#1211

Merged
grantfirl merged 41 commits intoNCAR:mainfrom
hertneky:ufs-dev-PR350
May 5, 2026
Merged

Ufs-dev sync PR350#1211
grantfirl merged 41 commits intoNCAR:mainfrom
hertneky:ufs-dev-PR350

Conversation

@hertneky
Copy link
Copy Markdown
Collaborator

Description of Changes:

Bringing in UFS/dev PR350

Tests Conducted:

SCM RT's all passed

Dependencies:

ufs-community/ccpp-physics#350
NOAA-EMC/ufsatm#1056
NCAR/ccpp-scm#

Contributors (optional):

noaa-oar-arl

iri01 and others added 30 commits November 11, 2025 13:54
…d meteo fields.

Correct integration of canopy layers onto model layers (satmedmfvdifq.F).
…vities correction.

For consistency, turn OFF the 3-layer-canopy PBL humidity effect and turn on the integrated-canopy PBL met effects (temerature, humidity, winds, TKE).
This commit addresses several improvements in `canopy_levs.F90`:
1. Implemented CCPP-compliant error handling in `canopy_levs_run` by
   propagating `errmsg` and `errflg` via arguments and replacing silent
   returns.
2. Replaced `alog()` with the standard generic `log()` function.
3. Passed `nkc` and `nkt` through argument lists instead of module
   usage to ensure thread-safety and CCPP statelessness.
4. Fixed several typos in comments.

Updated the corresponding calls in `canopy_driver.F` to match the new
subroutine signatures and fixed typos in `canopy_driver.F` as well.

Co-authored-by: drnimbusrain <26631222+drnimbusrain@users.noreply.github.com>
This commit addresses several improvements across `canopy_levs.F90`,
`canopy_mask.F90`, and `canopy_transfer.F90`:
1. Implemented CCPP-compliant error handling by propagating `errmsg`
   and `errflg` through subroutine arguments and replacing silent
   returns.
2. Replaced `alog()` with the standard generic `log()` function in
   `canopy_levs.F90`.
3. Passed `nkc` and `nkt` through argument lists in `canopy_levs.F90`
   instead of module usage to ensure thread-safety and statelessness.
4. Removed `IF(.FALSE.)` blocks and extensive commented-out print
   statements to clean up the code.
5. Fixed numerous typos in comments (ancillary, thermodynamic layers,
   earlier, Horizontal, transferring, transfer, interpolated).

Updated the corresponding calls and added error checks in
`canopy_driver.F` to match the new subroutine signatures.

Co-authored-by: drnimbusrain <26631222+drnimbusrain@users.noreply.github.com>
This commit completes the modernization and cleanup of the SATMEDMF
canopy physics modules:
1. Implemented CCPP-compliant error handling in all canopy subroutines
   by propagating `errmsg` and `errflg` via arguments.
2. Improved safety in `satmedmfvdifq_can.F` by wrapping optional
   argument access with `present()` checks for `dku_can`, `dkt_can`,
   and `dtend`.
3. Removed legacy debug print statements and date-tagged comments
   throughout the canopy physics files for better maintainability.
4. Corrected multiple typos in comments across the modules.
5. Ensured thread-safety and statelessness by passing canopy dimensions
   as arguments where appropriate.

Updated all call sites in `canopy_driver.F` to match the improved
subroutine interfaces and added early-exit error checks.

Co-authored-by: drnimbusrain <26631222+drnimbusrain@users.noreply.github.com>
Addresses several modernization and code quality requirements:
1. Implemented CCPP-compliant error handling (errmsg/errflg) across all
   canopy subroutines.
2. Replaced `alog()` with generic `log()` in `canopy_levs.F90`.
3. Improved statelessness by passing `nkc` and `nkt` as arguments.
4. Added `present()` safety checks for optional arguments in
   `satmedmfvdifq_can.F`.
5. Removed unused wind direction degree/cardinal variables in
   `canopy_driver.F`.
6. Thoroughly cleaned up legacy debug prints and date-tagged comments.
7. Corrected numerous typos in comments.

Ensured consistency of interfaces and call sites across the package.

Co-authored-by: drnimbusrain <26631222+drnimbusrain@users.noreply.github.com>
Addresses several modernization, cleanup, and robustness requirements:
1. Implemented CCPP-compliant error handling (errmsg/errflg) across all
   canopy subroutines in `canopy_levs.F90`, `canopy_mask.F90`, and
   `canopy_transfer.F90`.
2. Mitigated division by zero risks by adding epsilon (1.e-10)
   protection to potential zero divisors (ustar, uspr, layer thickness,
   massair, etc.) in `canopy_levs.F90`, `canopy_transfer.F90`, and
   `canopy_driver.F`.
3. Simplified wind direction logic in `canopy_driver.F` by using
   `atan2(u, v)` instead of `atan2(u/ws, v/ws)` and removed unused
   wind direction variables.
4. Improved statelessness by passing `nkc` and `nkt` as arguments to
   `canopy_levs` subroutines.
5. Replaced Kind-specific `alog()` with generic `log()`.
6. Added `present()` safety checks for optional arguments in
   `satmedmfvdifq_can.F`.
7. Thoroughly cleaned up legacy debug prints and date-tagged comments.
8. Corrected numerous typos in comments.

Ensured consistency of interfaces and call sites in `canopy_driver.F`.

Co-authored-by: drnimbusrain <26631222+drnimbusrain@users.noreply.github.com>
…048139512731

Improve code quality, cleanup, and CCPP compliance for canopy codes.
This commit improves the SATMEDMF canopy physics modules by:
- Propagating CCPP error handling (errmsg/errflg) through argument lists.
- Ensuring thread-safety by passing nkc/nkt as arguments instead of using module state.
- Replacing alog() with the generic log() function for better real kind support.
- Fixing numerous typos in comments (e.g., ancilliary, thermodynamic layers, etc.).
- Adding numerical robustness by protecting divisors with epsilon (1.e-10).
- Adding present() checks for optional arguments in satmedmfvdifq_can.F.
- Cleaning up legacy debug prints, dead code, and date-tagged comments.
- Fixing illegal duplicate continuation characters in fixed-form Fortran files.

Co-authored-by: drnimbusrain <26631222+drnimbusrain@users.noreply.github.com>
…9724048139512731

Modernize SATMEDMF canopy physics suite for CCPP compliance
Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Reviewed the changes here and in ufs-community/ufs-weather-model#3060 & Co

This was referenced Apr 20, 2026
@grantfirl grantfirl merged commit 807064e into NCAR:main May 5, 2026
2 of 3 checks passed
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.

5 participants