Hi, the following code successfully compiles with nvfortran 22.7 but causes a compiler error with nvfortran 22.9. Tested with: nvfortran -acc=gpu -o stopar -c stopar.f90
.
module stopar
implicit none
real(kind=8), allocatable, dimension(:,:,:), public :: sto2d
public :: sto_par
contains
subroutine sto_par()
real(kind=8) :: stomax
!$acc kernels
sto2d(:,:,1) = SIGN_ARRAY_2D_A(MIN(stomax, sto2d(:,:,1)), sto2d(:,:,1))
!$acc end kernels
end subroutine sto_par
function SIGN_ARRAY_2D_A(pa, pb)
real(kind=8), dimension(:,:) :: pa
real(kind=8), dimension(:,:) :: pb
REAL(KIND = 8) :: SIGN_ARRAY_2D_A(SIZE(pb, 1), SIZE(pb, 2))
!$acc routine
WHERE (pb >= 0.E0)
sign_array_2d_a = ABS(pa)
ELSEWHERE
sign_array_2d_a = - ABS(pa)
END WHERE
end function SIGN_ARRAY_2D_A
end module stopar
Cheers,
-Nuno