-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve various subroutine argument mismatches #160
Resolve various subroutine argument mismatches #160
Conversation
Switch from 'use mpi' to 'use mpi_f08'
…ccpp-physics into feature/depend_on_mpi
This looks fine to me, although it seems like CCPP framework code managers might like the MPI_f08 stuff modified? One question that I had was you've added |
Regarding the check of the netcdf status code (error code), I looked at other routines where netcdf calls are used. In some cases retrun code is simply ignored, for example: ccpp-physics/physics/Radiation/RRTMGP/rrtmgp_sw_cloud_optics.F90 Lines 119 to 121 in a492add
In some cases error code is checked and local subroutine ( ccpp-physics/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F Lines 8305 to 8306 in a492add
while in some other cases error code is checked, again local function ( ccpp-physics/physics/MP/Morrison_Gettelman/aerinterp.F90 Lines 95 to 98 in a492add
It's not obvious what method of netcdf error checking is preferable. Ideally there should be one method of checking and handling netcdf errors and it should be used everywhere. |
@GeorgeGayno-NOAA Can you please review the changes in |
UFS_UTILS only uses sfcsub.F (the global_cycle program). And these changes should not affect global_cycle. Thanks for asking. |
@DusanJovic-NOAA Now that we've established that MPI f08 is a mandatory dependency of CCPP, can you make the following change please?
Note my little comment in there (please remove ...). We should check if we need the C interface or not for the find_MPI call, and adjust the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks great. Thanks for making these changes.
(Just one comment on the CMakeLists, same as in the corresponding ccpp-framework PR).
CMakeLists.txt
Outdated
@@ -8,6 +8,13 @@ project(ccpp_physics | |||
set(PACKAGE "ccpp-physics") | |||
set(AUTHORS "Grant Firl" "Dustin Swales" "Man Zhang" "Mike Kavulich" ) | |||
|
|||
#------------------------------------------------------------------------------ | |||
# Set MPI flags for C/C++/Fortran with MPI F08 interface | |||
find_package(MPI REQUIRED C Fortran) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -385,7 +385,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, | |||
nthreads, blkno, errmsg, errflg) | |||
|
|||
#ifdef MPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CCPP framework developers decided to remove the remaining ifdef MPI
and associated build system logic to pass -DMPI
in a follow-up PR, since these changes would make your PR even larger.
Hi, @grantfirl . Testing is complete on ufs-wm PR #1147 . Please feel free to merge this PR. |
Starting with version 10 of GNU Fortran compiler, subroutine argument mismatches are flagged as errors, and must be silenced by using '-fallow-argument-mismatch' flag, which can potentially hide actual bugs, which is undesirable.
This PR fixes all such mismatches, mostly by switching to use mpi_f08 MPI module, which provides generic interfaces, using F90 version of various netcdf calls, or by passing correct type of arguments to w3lib calls.
The changes are tested by running full regression test of ufs-weather-model. See ufs-community/ufs-weather-model#1147