Skip to content

Global literal & temporary precision (for int & float) extended to gt4py and centralized

Debugging the 32-bit GEOS model we figured out that the precision was not necessarily pass down to gt4py properly. We've added a `GT4PY_LITERAL

  • Move precision definition to ndsl.dsl.__init__
  • Detect bad order of imports, e.g., gt4py import before NDSL Adapt code to use the newly defined NDSL_GLOBAL_PRECISION - Set internal GT4Py literal precision definition

⚠️ This enforces order of import. Any file that starts with import gt4py.cartesian.gtscript... which is often the case WILL FAIL. ⚠️

The above points to a wider refactor: forward imports of gtscript to ndsl so user don't have to import gt4py ever

How Has This Been Tested? Should be transparent to 64-bit cases and in GEOS test. That said, I expect many failures in pyFV3/Pace because of the order of import.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

Merge request reports

Loading