ccpp-framework icon indicating copy to clipboard operation
ccpp-framework copied to clipboard

Capgen inspection needs to provide more information

Open gold2718 opened this issue 5 years ago • 0 comments

The new ccpp_capgen run-time interface, ccpp_physics_suite_variables, returns the standard name of requested variables. This interface should be enhanced to include all the relevant information about a variable. The proposal is to have the framework create a Fortran derived type to communicate this information:

   type, public :: ccpp_suite_variable_t
      character(len=max_stdname_len) :: standard_name = ''     ! standard name
      character(len=5)               :: intent = ''            ! intent
      logical, private               :: advect = .false.       ! is advected
      logical, private               :: wet_scavange = .false. ! wet deposited
      logical, private               :: dry_scavange = .false. ! dry deposited
   contains
      procedure :: is_advected      => ccpp_var_is_advected
      procedure :: is_input         => ccpp_var_is_input       ! in or inout
      procedure :: is_output        => ccpp_var_is_output      ! out or inout
      procedure :: is_wet_scavanged => ccpp_var_is_wet_dep
      procedure :: is_dry_scavanged => ccpp_var_is_dry_dep
   end type ccpp_suite_variable_t

The ccpp_physics_suite_variables inspection routine would allocate and return an array of these structures. It will be easy to add new information to this type as the need arises. Modifications should be backwards compatible. Thoughts? @areinecke?

gold2718 avatar Apr 02 '20 17:04 gold2718