NCAR / ccpp-framework

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

ccpp_prebuild: bug fix needed to provide backward compatibility with blocked data structures #539

Closed climbfuji closed 8 months ago

climbfuji commented 8 months ago

Description

I discovered a bug in the recently introduced support for chunked arrays in ccpp_prebuild.py when I started implementing chunked arrays in the UFS on a DDT-per-DDT basis. In order for chunked arrays and blocked data structures to peacefully coexist, we need to check if the host model variable is a contiguous array (it's horizontal dimension is CCPP_HORIZONTAL_DIMENSION) or part of a blocked data structure (it's horizontal dimension is CCPP_HORIZONTAL_LOOP_EXTENT).

Steps to Reproduce

Not that easy. Start by converting one GFS DDTs from a blocked data structure to chunked arrays and you will hit the problem that the framework doesn't handle the two different types of DDTs correctly.

Additional Context

n/a