Introduce optional arguments in ccpp schemes and metadata#189
Introduce optional arguments in ccpp schemes and metadata#189grantfirl merged 43 commits intoufs-community:ufs/devfrom
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.
| 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.
Note: ccw should always be active (i.e., not optional)
| type = real | ||
| kind = kind_phys | ||
| intent = inout | ||
| optional = True |
There was a problem hiding this comment.
@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 |
AnningCheng-NOAA
left a comment
There was a problem hiding this comment.
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
optionalattribute 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 asoptionalvariable 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 (
-O1instead of-O2with Intel in release mode) to work around what seems to be bugs in the Intel compiler:gcycle.F90andmynnedmf_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/ufsatm#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)