Conversation
…onto model levels.
…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
…ines (instead use from module canopy_mask)
Feature/aqm canopy vdf updates
…arl/ccpp-physics into feature/aqm_canopy_vdf
…eginning of canopy_driver.F.
…st (RT) and to allow compile&build in DEBUG mode.
Feature/mynn sfc submodule
…run RT test in debug mode. Bug fix to diagnostic heigh calculation.
climbfuji
approved these changes
Apr 15, 2026
Collaborator
climbfuji
left a comment
There was a problem hiding this comment.
Reviewed the changes here and in ufs-community/ufs-weather-model#3060 & Co
grantfirl
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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