Skip to content

Commit 180f866

Browse files
authored
fix: replace NULL() intrinsic with typed pointer in diag manager for Cray compiler bug (#1560)
1 parent bd9cbeb commit 180f866

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

diag_manager/fms_diag_object.F90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ integer function fms_register_diag_field_obj &
224224
integer, allocatable :: file_ids(:) !< The file IDs for this variable
225225
integer :: i !< For do loops
226226
integer, allocatable :: diag_field_indices(:) !< indices where the field was found in the yaml
227+
class(diagDomain_t), pointer :: null_diag_domain => NULL() !< Workaround for a Cray bug which will be fixed in CCE 19
227228
#endif
228229
#ifndef use_yaml
229230
fms_register_diag_field_obj = DIAG_FIELD_NOT_FOUND
@@ -267,7 +268,7 @@ integer function fms_register_diag_field_obj &
267268
call fileptr%add_field_and_yaml_id(fieldptr%get_id(), diag_field_indices(i))
268269
call fileptr%add_buffer_id(fieldptr%buffer_ids(i))
269270
if(fieldptr%get_type_of_domain() .eq. NO_DOMAIN) then
270-
call fileptr%set_file_domain(NULL(), fieldptr%get_type_of_domain())
271+
call fileptr%set_file_domain(null_diag_domain, fieldptr%get_type_of_domain())
271272
else
272273
call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain())
273274
endif
@@ -284,7 +285,7 @@ integer function fms_register_diag_field_obj &
284285
call fileptr%add_buffer_id(fieldptr%buffer_ids(i))
285286
call fileptr%init_diurnal_axis(this%diag_axis, this%registered_axis, diag_field_indices(i))
286287
if(fieldptr%get_type_of_domain() .eq. NO_DOMAIN) then
287-
call fileptr%set_file_domain(NULL(), fieldptr%get_type_of_domain())
288+
call fileptr%set_file_domain(null_diag_domain, fieldptr%get_type_of_domain())
288289
else
289290
call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain())
290291
endif

0 commit comments

Comments
 (0)