diff --git a/src/common/m_phase_change.fpp b/src/common/m_phase_change.fpp index f637232288..9ae303ff3f 100644 --- a/src/common/m_phase_change.fpp +++ b/src/common/m_phase_change.fpp @@ -298,7 +298,11 @@ contains !! @param rhoe mixture energy !! @param TS equilibrium temperature at the interface subroutine s_infinite_pt_relaxation_k(j, k, l, MFL, pS, p_infpT, rM, q_cons_vf, rhoe, TS) +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_compute_speed_of_sound +#else !$acc routine seq +#endif ! initializing variables integer, intent(in) :: j, k, l, MFL @@ -402,7 +406,11 @@ contains !! @param TS equilibrium temperature at the interface subroutine s_infinite_ptg_relaxation_k(j, k, l, pS, p_infpT, rhoe, q_cons_vf, TS) +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_infinite_ptg_relaxation_k +#else !$acc routine seq +#endif integer, intent(in) :: j, k, l real(kind(0.0d0)), intent(inout) :: pS @@ -522,7 +530,11 @@ contains !! @param k generic loop iterator for y direction !! @param l generic loop iterator for z direction subroutine s_correct_partial_densities(MCT, q_cons_vf, rM, j, k, l) +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_correct_partial_densities +#else !$acc routine seq +#endif !> @name variables for the correction of the reacting partial densities !> @{ @@ -580,7 +592,12 @@ contains !! @param q_cons_vf Cell-average conservative variables !! @param TJac Transpose of the Jacobian Matrix subroutine s_compute_jacobian_matrix(InvJac, j, Jac, k, l, mCPD, mCVGP, mCVGP2, pS, q_cons_vf, TJac) + +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_compute_jacobian_matrix +#else !$acc routine seq +#endif real(kind(0.0d0)), dimension(2, 2), intent(out) :: InvJac integer, intent(in) :: j @@ -682,7 +699,12 @@ contains !! @param rhoe mixture energy !! @param R2D (2D) residue array subroutine s_compute_pTg_residue(j, k, l, mCPD, mCVGP, mQD, q_cons_vf, pS, rhoe, R2D) + +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_compute_pTg_residue +#else !$acc routine seq +#endif integer, intent(in) :: j, k, l real(kind(0.0d0)), intent(in) :: mCPD, mCVGP, mQD @@ -728,7 +750,11 @@ contains !! @param TSat Saturation Temperature !! @param TSIn equilibrium Temperature subroutine s_TSat(pSat, TSat, TSIn) +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_compute_speed_of_sound +#else !$acc routine seq +#endif real(kind(0.0d0)), intent(in) :: pSat real(kind(0.0d0)), intent(out) :: TSat diff --git a/src/simulation/m_chemistry.fpp b/src/simulation/m_chemistry.fpp index b09df795ec..5cc5295ab9 100644 --- a/src/simulation/m_chemistry.fpp +++ b/src/simulation/m_chemistry.fpp @@ -117,16 +117,19 @@ contains #:if chemistry - !$acc parallel loop collapse(3) private(Ys) + !$acc parallel loop collapse(3) gang vector default(present) & + !$acc private(Ys, omega, enthalpies) do x = 0, m do y = 0, n do z = 0, p rho = 0d0 + !$acc loop seq do eqn = chemxb, chemxe rho = rho + q_cons_qp(eqn)%sf(x, y, z) end do + !$acc loop seq do eqn = chemxb, chemxe Ys(eqn - chemxb + 1) = q_prim_qp(eqn)%sf(x, y, z) end do @@ -143,7 +146,7 @@ contains call get_net_production_rates(rho, T, Ys, omega) - !$acc routine seq + !$acc loop seq do eqn = chemxb, chemxe omega_m = mol_weights(eqn - chemxb + 1)*omega(eqn - chemxb + 1) diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index e408ca6b38..c4767df708 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -1006,7 +1006,7 @@ contains call s_compute_chemistry_reaction_flux(rhs_vf, q_cons_qp%vf, q_prim_qp%vf) call nvtxEndRange else - !$acc parallel loop default(present) + !$acc parallel loop gang vector default(present) do i = chemxb, chemxe rhs_vf(i)%sf(:, :, :) = 0d0 end do diff --git a/src/simulation/m_riemann_solvers.fpp b/src/simulation/m_riemann_solvers.fpp index 2cdc1901ff..509110e74d 100644 --- a/src/simulation/m_riemann_solvers.fpp +++ b/src/simulation/m_riemann_solvers.fpp @@ -363,8 +363,11 @@ contains #:for NORM_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')] if (norm_dir == ${NORM_DIR}$) then - !$acc parallel loop collapse(3) gang vector default(present) private(alpha_rho_L, alpha_rho_R, vel_L, vel_R, alpha_L, alpha_R, vel_avg, tau_e_L, tau_e_R, G_L, G_R, Re_L, Re_R, & - !$acc rho_avg, h_avg, gamma_avg, s_L, s_R, s_S, Y_L, Ys_L, Y_R, Ys_R) + !$acc parallel loop collapse(3) gang vector default(present) & + !$acc private(alpha_rho_L, alpha_rho_R, vel_L, vel_R, alpha_L, & + !$acc alpha_R, vel_avg, tau_e_L, tau_e_R, G_L, G_R, Re_L, Re_R, & + !$acc rho_avg, h_avg, gamma_avg, s_L, s_R, s_S, Y_L, Ys_L, Y_R, & + !$acc Ys_R) do l = is3%beg, is3%end do k = is2%beg, is2%end do j = is1%beg, is1%end diff --git a/src/simulation/m_sim_helpers.f90 b/src/simulation/m_sim_helpers.f90 index eca90a32e7..9b1f1ce216 100644 --- a/src/simulation/m_sim_helpers.f90 +++ b/src/simulation/m_sim_helpers.f90 @@ -31,7 +31,12 @@ module m_sim_helpers !! @param k y index !! @param l z index subroutine s_compute_enthalpy(q_prim_vf, pres, rho, gamma, pi_inf, Re, H, alpha, vel, vel_sum, j, k, l) +#ifdef CRAY_ACC_WAR + !DIR$ INLINEALWAYS s_compute_enthalpy +#else !$acc routine seq +#endif + type(scalar_field), dimension(sys_size) :: q_prim_vf real(kind(0d0)), dimension(num_fluids) :: alpha_rho real(kind(0d0)), dimension(num_fluids) :: alpha diff --git a/toolchain/pyproject.toml b/toolchain/pyproject.toml index 0150398355..8b0d2c1d8a 100644 --- a/toolchain/pyproject.toml +++ b/toolchain/pyproject.toml @@ -41,4 +41,4 @@ dependencies = [ ] [tool.hatch.metadata] -allow-direct-references = true \ No newline at end of file +allow-direct-references = true