@@ -104,6 +104,16 @@ contains
104104 !< Generic loop iterators
105105 integer :: i, j, k, l
106106
107+ #ifdef _CRAYFTN
108+ #ifdef MFC_OpenACC
109+ ! CCE 19 IPA workaround: prevent bring_routine_resident SIGSEGV
110+ !DIR$ NOINLINE s_infinite_pt_relaxation_k
111+ !DIR$ NOINLINE s_infinite_ptg_relaxation_k
112+ !DIR$ NOINLINE s_correct_partial_densities
113+ !DIR$ NOINLINE s_TSat
114+ #endif
115+ #endif
116+
107117 ! starting equilibrium solver
108118 $:GPU_PARALLEL_LOOP(collapse= 3 , private= ' [i,j,k,l,p_infOV, p_infpT, p_infSL, sk, hk, gk, ek, rhok,pS, pSOV, pSSL, TS, TSOV, TSatOV, TSatSL, TSSL, rhoe, dynE, rhos, rho, rM, m1, m2, MCT, TvF]' )
109119 do j = 0 , m
@@ -296,7 +306,7 @@ contains
296306 !! @param TS equilibrium temperature at the interface
297307 subroutine s_infinite_pt_relaxation_k (j , k , l , MFL , pS , p_infpT , q_cons_vf , rhoe , TS )
298308 $:GPU_ROUTINE(function_name= ' s_infinite_pt_relaxation_k' , &
299- & parallelism= ' [seq]' , cray_inline = True)
309+ & parallelism= ' [seq]' , cray_noinline = True)
300310
301311 ! initializing variables
302312 integer , intent (in ) :: j, k, l, MFL
@@ -411,7 +421,7 @@ contains
411421 !! @param TS equilibrium temperature at the interface
412422 subroutine s_infinite_ptg_relaxation_k (j , k , l , pS , p_infpT , rhoe , q_cons_vf , TS )
413423 $:GPU_ROUTINE(function_name= ' s_infinite_ptg_relaxation_k' , &
414- & parallelism= ' [seq]' , cray_inline = True)
424+ & parallelism= ' [seq]' , cray_noinline = True)
415425
416426 integer , intent (in ) :: j, k, l
417427 real (wp), intent (inout ) :: pS
@@ -579,7 +589,8 @@ contains
579589 InvJac = InvJac/ (Jac(1 , 1 )* Jac(2 , 2 ) - Jac(1 , 2 )* Jac(2 , 1 ))
580590
581591 ! calculating correction array for Newton' s method
582- DeltamP = -1.0_wp*(matmul(InvJac, R2D))
592+ DeltamP(1) = -1.0_wp*(InvJac(1, 1)*R2D(1) + InvJac(1, 2)*R2D(2))
593+ DeltamP(2) = -1.0_wp*(InvJac(2, 1)*R2D(1) + InvJac(2, 2)*R2D(2))
583594
584595 ! updating two reacting ' masses' . Recall that inert ' masses' do not change during the phase change
585596 ! liquid
@@ -638,7 +649,7 @@ contains
638649 !! @param l generic loop iterator for z direction
639650 subroutine s_correct_partial_densities(MCT, q_cons_vf, rM, j, k, l)
640651 $:GPU_ROUTINE(function_name=' s_correct_partial_densities' , &
641- & parallelism=' [seq]' , cray_inline =True)
652+ & parallelism=' [seq]' , cray_noinline =True)
642653
643654 !> @name variables for the correction of the reacting partial densities
644655 !> @{
@@ -689,7 +700,7 @@ contains
689700 !! @param TSIn equilibrium Temperature
690701 elemental subroutine s_TSat(pSat, TSat, TSIn)
691702 $:GPU_ROUTINE(function_name=' s_TSat' ,parallelism=' [seq]' , &
692- & cray_inline =True)
703+ & cray_noinline =True)
693704
694705 real(wp), intent(in) :: pSat
695706 real(wp), intent(out) :: TSat
@@ -716,6 +727,12 @@ contains
716727
717728 ! underrelaxation factor
718729 Om = 1.0e-3_wp
730+
731+ ! FT must be initialized before the do while condition is evaluated.
732+ ! Fortran .or. is not short- circuit: abs (FT) is always evaluated even
733+ ! when ns == 0 , so FT must have a defined value here.
734+ FT = huge (1.0_wp )
735+
719736 do while ((abs (FT) > ptgalpha_eps) .or. (ns == 0 ))
720737 ! increasing counter
721738 ns = ns + 1
0 commit comments