From 9a098efd6b82b4b70582e6f5dad085c52850d33d Mon Sep 17 00:00:00 2001 From: Maff Glover <78152252+mo-mglover@users.noreply.github.com> Date: Fri, 9 Jan 2026 13:46:00 +0000 Subject: [PATCH] Workaround for compiler bug: don't pass local_tag if not allocated. --- src/f/vernier_mod.F90 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/f/vernier_mod.F90 b/src/f/vernier_mod.F90 index db0d3302..ad217691 100644 --- a/src/f/vernier_mod.F90 +++ b/src/f/vernier_mod.F90 @@ -109,13 +109,18 @@ subroutine vernier_init(client_comm_handle, tag) !Local variables character(len=:), allocatable :: local_tag + ! NB: Dual calls to interface_vernier_init() ought to be unnecessary, + ! since unallocated actual arguments passed to optional dummy arguments + ! count as not present in downstream code. We separate the calls here + ! (with and without local_tag) to accommodate a compiler bug. if (present(tag)) then allocate(character(len=len_trim(tag)+1) :: local_tag) call append_null_char(tag, local_tag, len_trim(tag)) + call interface_vernier_init(client_comm_handle, local_tag) + else + call interface_vernier_init(client_comm_handle) end if - call interface_vernier_init(client_comm_handle, local_tag) - end subroutine vernier_init !> @brief Start profiling a code region.