From 1b8ba22b45b89cfee4567582cf165614d42d73ff Mon Sep 17 00:00:00 2001 From: Jesse Lentz Date: Fri, 26 Jul 2024 11:53:54 -0400 Subject: [PATCH 1/3] Workaround for Cray compiler bug 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. --- diag_manager/fms_diag_object.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/diag_manager/fms_diag_object.F90 b/diag_manager/fms_diag_object.F90 index c985a6c30..6a8f6c09e 100644 --- a/diag_manager/fms_diag_object.F90 +++ b/diag_manager/fms_diag_object.F90 @@ -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 #endif #ifndef use_yaml fms_register_diag_field_obj = DIAG_FIELD_NOT_FOUND @@ -267,7 +268,7 @@ integer function fms_register_diag_field_obj & call fileptr%add_field_and_yaml_id(fieldptr%get_id(), diag_field_indices(i)) call fileptr%add_buffer_id(fieldptr%buffer_ids(i)) if(fieldptr%get_type_of_domain() .eq. NO_DOMAIN) then - call fileptr%set_file_domain(NULL(), fieldptr%get_type_of_domain()) + call fileptr%set_file_domain(null_ptr, fieldptr%get_type_of_domain()) else call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain()) endif @@ -284,7 +285,7 @@ integer function fms_register_diag_field_obj & call fileptr%add_buffer_id(fieldptr%buffer_ids(i)) call fileptr%init_diurnal_axis(this%diag_axis, this%registered_axis, diag_field_indices(i)) if(fieldptr%get_type_of_domain() .eq. NO_DOMAIN) then - call fileptr%set_file_domain(NULL(), fieldptr%get_type_of_domain()) + call fileptr%set_file_domain(null_ptr, fieldptr%get_type_of_domain()) else call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain()) endif From 0974ccb6d6175575240606b284947a2d4b9bc9d5 Mon Sep 17 00:00:00 2001 From: rem1776 Date: Wed, 28 Aug 2024 15:43:24 -0400 Subject: [PATCH 2/3] empty commit to trigger ci workflow From eb10e1876246ec4636bbf2967e769146352a39fd Mon Sep 17 00:00:00 2001 From: Jesse Lentz Date: Fri, 25 Oct 2024 12:34:38 -0400 Subject: [PATCH 3/3] Rename `null_ptr` to `null_diag_domain` --- diag_manager/fms_diag_object.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diag_manager/fms_diag_object.F90 b/diag_manager/fms_diag_object.F90 index 6a8f6c09e..f4c892dec 100644 --- a/diag_manager/fms_diag_object.F90 +++ b/diag_manager/fms_diag_object.F90 @@ -224,7 +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 + class(diagDomain_t), pointer :: null_diag_domain => NULL() !< Workaround for a Cray bug which will be fixed in CCE 19 #endif #ifndef use_yaml fms_register_diag_field_obj = DIAG_FIELD_NOT_FOUND @@ -268,7 +268,7 @@ integer function fms_register_diag_field_obj & call fileptr%add_field_and_yaml_id(fieldptr%get_id(), diag_field_indices(i)) call fileptr%add_buffer_id(fieldptr%buffer_ids(i)) if(fieldptr%get_type_of_domain() .eq. NO_DOMAIN) then - call fileptr%set_file_domain(null_ptr, fieldptr%get_type_of_domain()) + call fileptr%set_file_domain(null_diag_domain, fieldptr%get_type_of_domain()) else call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain()) endif @@ -285,7 +285,7 @@ integer function fms_register_diag_field_obj & call fileptr%add_buffer_id(fieldptr%buffer_ids(i)) call fileptr%init_diurnal_axis(this%diag_axis, this%registered_axis, diag_field_indices(i)) if(fieldptr%get_type_of_domain() .eq. NO_DOMAIN) then - call fileptr%set_file_domain(null_ptr, fieldptr%get_type_of_domain()) + call fileptr%set_file_domain(null_diag_domain, fieldptr%get_type_of_domain()) else call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain()) endif