-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround for Cray compiler bug involving NULL()
intrinsic
#1560
Conversation
A workaround has been introduced for a bug in the Cray compiler, where the NULL() intrinsic fails to return a pointer of the correct type. Rather than using NULL() directly as a subroutine argument, it is assigned to a variable which is passed to the subroutines.
This bug should be fixed in the next CCE release in a few months, so perhaps this PR doesn't need to be merged. |
We should reopen this PR |
diag_manager/fms_diag_object.F90
Outdated
@@ -224,6 +224,7 @@ integer function fms_register_diag_field_obj & | |||
integer, allocatable :: file_ids(:) !< The file IDs for this variable | |||
integer :: i !< For do loops | |||
integer, allocatable :: diag_field_indices(:) !< indices where the field was found in the yaml | |||
class(diagDomain_t), pointer :: null_ptr => NULL() !< Workaround for a Cray compiler bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you rename this variable to like null_diag_domain
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in eb10e18.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will approve once the change requested by @uramirez8707 is addressed.
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 callingNULL()
directly as a subroutine argument.How Has This Been Tested?
Builds with Cray compiler 15.0.1 on C5.
Checklist:
make distcheck
passes