Skip to content

Conversation

@NickSzapiro-NOAA
Copy link

@NickSzapiro-NOAA NickSzapiro-NOAA commented Sep 10, 2025

Description of Changes:

Compiling ufs-weather-model cpld_debug_gfsv17 RT gives a number of warnings in sfcsub for these variables:

.../ufs-weather-model/UFSATM/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F(line): warning #8889: Explicit interface or EXTERNAL declaration is required.
HMSKRD FIXRDC ROF01 QCMXICE CLIMA SCALE ALBOCN LANDTYP ROF01_LEN QCSICE SETLSI QCSNOW SETZRO QCMXMN GETSCV SNOSFC GETSMC GETSTC MONITR FILANL ANALY ANOMINT TSFCOR SNODPTH2 FILFCS USESGT QCSLI QCBYFC NEWICE FIXRDG ABORT BAOPENR ABORT GETGBH GETGB FIXRDA SPLAT GA2LA FIXRDC_TILE NETCDF_ERR GETAREA SUBST SETRMSK BACLOSE LA2GA

Enclosing the whole file in the module resolves many of these, except BAOPENR ABORT GETGBH GETGB SPLAT W3MOVDAT W3DOXDAT BACLOSE as these come from elsewhere (like NCEPLIBS or compiler). So, I tried adding external declaration for the rest.

For W3MOVDAT, W3DOXDAT external doesn't resolve the warning, maybe since they have dimension(8) argument. I see some previous work to deal with w3emc NCAR#1070 but don't know if there were any decisions

Tests Conducted:

cpld_debug_gfsv17 is bit-for-bit on Ursa and most compiler warnings are resolved.
TODO: "See ufs-community/ufs-weather-model#<pr_number>"

Dependencies:

TODO: parent PRs. For example:

  • NCAR/ccpp-framework#<pr_number>
  • NOAA-EMC/fv3atm#<pr_number>
  • ufs-community/ufs-weather-model/#<pr_number>

Documentation:

N/A

Issue (optional):

Part of ufs-community/ufs-weather-model#2703 to reduce compiler warnings in GFS.v17 for operational implementation

Contributors (optional):

N/A


end module ugwp_common
contains
Copy link
Collaborator

@grantfirl grantfirl Oct 14, 2025

Choose a reason for hiding this comment

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

I'll let @mdtoyNOAA chime in, but I believe that the ugwp_common module was supposed to be used for physical constants only. I wonder if it would be preferable to have init_nazdir and init_global_gwdis put into a different module, one that already exists other than ugwp_common or a new one altogether.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@grantfirl The subroutines init_nazdir and init_global_gwdis are actually not contained within a module. I wasn't the original coder, so I don't know if this was intentional or not. Would containing these two subroutines inside a new module solve the problem?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, any module will do to provide an explicit interface. It doesn't have to be this one

Copy link
Collaborator

@grantfirl grantfirl Oct 15, 2025

Choose a reason for hiding this comment

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

It's probably OK just to leave them in ugwp_common if you've already done testing and it works, especially if no one knows of an existing module that they would fit better into.

Copy link
Collaborator

Choose a reason for hiding this comment

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

When I left my comment yesterday, I hadn't realized Nick had already moved the two subroutines within module ugwp_common. I'm OK with leaving them in ugwp_common.

Copy link
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

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

Looks OK, although I don't see supermodule PRs. What testing has been done? Just compiling UFS to see if the warnings disappear?

@NickSzapiro-NOAA
Copy link
Author

Thanks @grantfirl ! I'm finishing to re-run ufs-weather-model RT time-outs on Ursa right now and will soon open relevant PRs.

Tests are bit-for-bit and these compiler warnings are resolved

Note that there are still warnings about BAOPENR ABORT GETGBH GETGB SPLAT W3MOVDAT W3DOXDAT BACLOSE. In next round, hopefully I can make better solution than declaring as external

@gspetro-NOAA
Copy link

This PR is ready to merge. Testing is complete on WM parent PR #2935.

@rhaesung rhaesung merged commit 14f24db into ufs-community:ufs/dev Nov 4, 2025
3 checks passed
rhaesung pushed a commit that referenced this pull request Dec 22, 2025
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