FMS icon indicating copy to clipboard operation
FMS copied to clipboard

Workaround for Cray compiler bug involving `NULL()` intrinsic

Open J-Lentz opened this issue 6 months ago • 3 comments

Description The Cray compiler contains a bug where the NULL() intrinsic fails to produce a pointer of the correct type when it is passed directly to a subroutine expecting a pointer to a derived type.

This PR implements a workaround where NULL() is assigned to a variable which is passed to the subroutine, rather than calling NULL() directly as a subroutine argument.

How Has This Been Tested? Builds with Cray compiler 15.0.1 on C5.

Checklist:

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

J-Lentz avatar Jul 26 '24 16:07 J-Lentz