-
Notifications
You must be signed in to change notification settings - Fork 35
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
Introduce optional arguments in ccpp schemes and metadata #189
Introduce optional arguments in ccpp schemes and metadata #189
Conversation
5bac829
to
d1e97a1
Compare
…ariables but internally bend everything back to where it's expected (affects some, but not all variables)
…stitial_{2,3}.F90
…_SCM_NEPTUNE/GFS_suite_interstitial_2.F90
…oud_mp.F90 and physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90
…previous committ.
Add optional attribute to Fortran files.
@@ -68,12 +68,12 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & | |||
real(kind_phys), intent(inout) :: qi (:,:) !(1:ncol,1:nlev) | |||
real(kind_phys), intent(inout) :: qs (:,:) !(1:ncol,1:nlev) | |||
real(kind_phys), intent(inout) :: qh (:,:) !(1:ncol,1:nlev) graupel | |||
real(kind_phys), intent(inout) :: ccw(:,:) !(1:ncol,1:nlev) | |||
real(kind_phys), intent(inout), optional :: ccw(:,:) !(1:ncol,1:nlev) |
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.
Note: ccw should always be active (i.e., not optional)
@@ -320,6 +320,7 @@ | |||
type = real | |||
kind = kind_phys | |||
intent = inout | |||
optional = True |
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.
@climbfuji @dustinswales The majority of variables that you add optional to, are not optional. For example smois - it is a state soil moisture variable.
@tanyasmirnova @MicroTed |
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.
look fine with me.
I'm not sure I understand why the CCPP interface should care about the host model this way? What if different host models have different logic? I do like that the optional attribute is back after being removed. |
Testing for #2205 has completed successfully, please continue with merging this PR. |
Description
This PR makes necessary changes for supporting optional arguments in CCPP (see ufs-community/ufs-weather-model#2205 and PRs listed there). This involves adding the
optional
attribute tot he CCPP metadata for all variables that have matching host model variable with an active attribute other than the default value.true.
(i.e. it may not be allocated). In addition, each of these variables need to be declared asoptional
variable in the Fortran code.90% of all the changes in this PR were contributed by @dustinswales - kudos to him. The new and clean way to deal with optional arguments also allowed us to discover a few bugs/inconsistencies that we had to fix to get b4b identical results (and successful runs in the first place) with Intel and GNU on Hera.
Two source files need to be compiled with slightly lower optimization (
-O1
instead of-O2
with Intel in release mode) to work around what seems to be bugs in the Intel compiler:gcycle.F90
andmynnedmf_wrapper.F90
).This should have negligible effect on the runtime, and it does not affect the results (see below).
This is part of a large set of PRs:
NCAR/ccpp-framework#552
NOAA-EMC/fv3atm#807
https://github.com/ufs-community/ufs-weather-model/pull/2205
#189
NCAR/ccpp-framework#556 (can be scheduled and merged anytime beforehand)
NOAA-GFDL/GFDL_atmos_cubed_sphere#338
NOAA-PSL/stochastic_physics#79
Issue(s) addressed
Working towards NCAR/ccpp-framework#540
Testing
ufs-weather-model full regression testing on Hera (all tests b4b)