NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 63 forks source link

Bug results in over-counting some schemes in new ccpp_track_variables.py script #450

Closed mkavulich closed 2 years ago

mkavulich commented 2 years ago

Description

The initial version of the ccpp_track_variables.py tool incorrectly lists some schemes multiple times if those schemes are described in a .meta file that contains info for more than one scheme.

Steps to Reproduce

The top of main will exhibit this behavior.

To reproduce, simply execute the scheme with this example:

framework/scripts/ccpp_track_variables.py --config=config/ccpp_prebuild_config.py -s=suites/suite_FV3_GFS_v16_noahmp.xml -v air_temperature_of_new_state -m ./physics/physics/

In the output, several schemes appear multiple times in the list despite the fact that they are only called once in CCPP execution. This is because GFS_suite_interstitial.meta contains info for several GFS interstitial schemes, and so every time one of the schemes described in that file is called, every scheme in that file will be double-counted in the output of the track variables script.

This is just one example; there are likely multiple instances of physics suite and variable combinations that will exhibit this issue.

Additional Context

This will occur on any platform.

Output

This is an example of the incorrect output, with the incorrect duplicates highlighted

framework/scripts/ccpp_track_variables.py --config=config/ccpp_prebuild_config.py -s=suites/suite_FV3_GFS_v16_noahmp.xml -v air_temperature_of_new_state -m ./physics/physics/
WARNING:root:Encountered closing statement "end type" without type name; assume type_name is ty_gas_optics_rrtmgp
WARNING:root:Encountered closing statement "end type" without type name; assume type_name is ty_optical_props
WARNING:root:Encountered closing statement "end type" without type name; assume type_name is ty_optical_props_arry
WARNING:root:Encountered closing statement "end type" without type name; assume type_name is ty_optical_props_1scl
WARNING:root:Encountered closing statement "end type" without type name; assume type_name is ty_optical_props_2str
WARNING:root:Encountered closing statement "end type" without type name; assume type_name is ty_optical_props_nstr
For suite suites/suite_FV3_GFS_v16_noahmp.xml, the following schemes (in order) use the variable air_temperature_of_new_state:
GFS_suite_stateout_reset_run (intent out)
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
get_phi_fv3_run (intent in)                      <<<<INCORRECT
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
dcyc2t3_run (intent in)
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
ozphys_2015_run (intent in)
get_phi_fv3_run (intent in)
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)
GFS_DCNV_generic_pre_run (intent in)
GFS_DCNV_generic_post_run (intent in)            <<<<INCORRECT
samfdeepcnv_run (intent inout)
GFS_DCNV_generic_pre_run (intent in)             <<<<INCORRECT
GFS_DCNV_generic_post_run (intent in)
GFS_SCNV_generic_pre_run (intent in)
GFS_SCNV_generic_post_run (intent in)            <<<<INCORRECT
samfshalcnv_run (intent inout)
GFS_SCNV_generic_pre_run (intent in)             <<<<INCORRECT
GFS_SCNV_generic_post_run (intent in)
GFS_suite_stateout_reset_run (intent out)        <<<<INCORRECT
GFS_suite_stateout_update_run (intent out)       <<<<INCORRECT
GFS_suite_interstitial_3_run (intent in)         <<<<INCORRECT
GFS_MP_generic_pre_run (intent in)
GFS_MP_generic_post_run (intent in)              <<<<INCORRECT
gfdl_cloud_microphys_run (intent inout)
GFS_MP_generic_pre_run (intent in)               <<<<INCORRECT
GFS_MP_generic_post_run (intent in)
maximum_hourly_diagnostics_run (intent in)
GFS_stochastics_run (intent inout)