ccpp-framework
ccpp-framework copied to clipboard
Suite-level variables edge case for when variable is used only in run phases
Description
When you have a situation like this:
Group 1:
scheme_x_run:
real(kind_phys), intent(out) :: some_variable(:,:) ! some_variable_standard_name
Group 2:
scheme_y_run:
real(kind_phys), intent(in) :: some_variable(:,:) ! some_variable_standard_name
where some_variable_standard_name is not used in any other phase and is not a host variable:
- The framework will promote some_variable_standard_name to the suite level (which is the correct behavior)
- The framework will attempt to allocate that variable in the suite init phase, but will try to allocate it to horizontal_loop_begin:horizontal_loop_end (which are unavailable and disallowed to exist in the init phase).
Steps to Reproduce
- Modify an existing test to reflect the situation described above (variable must be in run phase of two different schemes in two different groups and must have dimension horizontal_loop_extent)
- The error you will see will look like this:
parse_source.CCPPError: Dimension variable, 'horizontal_loop_begin', not found, at <metadata file>
Additional Context
I'm not sure how/if it's currently working when the you have the same situation as above but with dimension horizontal_dimension.
Not sure how to fix yet; need to figure out to ensure we pass horizontal_dimension into the suite init phase and manually override the variable's dimensions to allocate to horizontal_dimension (rather than horizontal_loop_extent)
Problem not specific to horizontal_loop_extent - also appears if you use horizontal_dimension and horizontal_dimension is not already being passed in to an init phase.