From 984767479116137b879b0aac2ca8b0e2136000fe Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 18 Dec 2024 09:01:50 -0600 Subject: [PATCH] fix(collectives): for character - builds with flang - passes test suite with gfortran --- src/caffeine/collective_subroutines/co_max_s.f90 | 2 +- src/caffeine/collective_subroutines/co_min_s.f90 | 2 +- src/caffeine/collective_subroutines/co_reduce_s.f90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/caffeine/collective_subroutines/co_max_s.f90 b/src/caffeine/collective_subroutines/co_max_s.f90 index 1db4b8689..fc3e562df 100644 --- a/src/caffeine/collective_subroutines/co_max_s.f90 +++ b/src/caffeine/collective_subroutines/co_max_s.f90 @@ -23,7 +23,7 @@ function reverse_alphabetize(lhs, rhs) result(last_alphabetically) character(len=*), intent(in) :: lhs, rhs - character(len=:), allocatable :: last_alphabetically + character(len=len(lhs)) :: last_alphabetically call assert(len(lhs)==len(rhs), "caf_co_max: LHS/RHS length match", lhs//" , "//rhs) last_alphabetically = max(lhs,rhs) end function diff --git a/src/caffeine/collective_subroutines/co_min_s.f90 b/src/caffeine/collective_subroutines/co_min_s.f90 index 68383e304..c2b4361b3 100644 --- a/src/caffeine/collective_subroutines/co_min_s.f90 +++ b/src/caffeine/collective_subroutines/co_min_s.f90 @@ -23,7 +23,7 @@ function alphabetize(lhs, rhs) result(first_alphabetically) character(len=*), intent(in) :: lhs, rhs - character(len=:), allocatable :: first_alphabetically + character(len=len(lhs)) :: first_alphabetically call assert(len(lhs)==len(rhs), "prif_co_min: LHS/RHS length match", lhs//" , "//rhs) first_alphabetically = min(lhs,rhs) end function diff --git a/src/caffeine/collective_subroutines/co_reduce_s.f90 b/src/caffeine/collective_subroutines/co_reduce_s.f90 index a4356e57a..9f322da7f 100644 --- a/src/caffeine/collective_subroutines/co_reduce_s.f90 +++ b/src/caffeine/collective_subroutines/co_reduce_s.f90 @@ -50,7 +50,7 @@ function c_char_operation(lhs, rhs) result(lhs_op_rhs) import c_char implicit none character(kind=c_char,len=*), intent(in) :: lhs, rhs - character(kind=c_char,len=:), allocatable :: lhs_op_rhs + character(kind=c_char,len=len(lhs)) :: lhs_op_rhs end function pure function c_float_complex_operation(lhs, rhs) result(lhs_op_rhs)