diff --git a/src/common/include/shared_parallel_macros.fpp b/src/common/include/shared_parallel_macros.fpp index 9abaf26c1..0882db171 100644 --- a/src/common/include/shared_parallel_macros.fpp +++ b/src/common/include/shared_parallel_macros.fpp @@ -8,6 +8,13 @@ #:set USING_CCE = (MFC_COMPILER == CCE_COMPILER_ID) #:set USING_AMD = (MFC_COMPILER == AMD_COMPILER_ID) +#! Fallback extents the USING_AMD guards substitute for device-global array bounds when case +#! optimization is off. They are not independent: sys_size counts the species, so AMD_SYS_SIZE_MAX +#! must cover 3*num_fluids + num_vels + 1 + AMD_NUM_SPECIES_MAX. Keep them here rather than as +#! literals at each declaration, so raising one cannot silently outgrow the other. +#:set AMD_NUM_SPECIES_MAX = 60 +#:set AMD_SYS_SIZE_MAX = 70 + #:def ASSERT_LIST(data, datatype) #:assert data is not None #:assert isinstance(data, list) diff --git a/src/common/m_checker_common.fpp b/src/common/m_checker_common.fpp index f7b7b42d7..f1c96e915 100644 --- a/src/common/m_checker_common.fpp +++ b/src/common/m_checker_common.fpp @@ -54,7 +54,16 @@ contains #:if not MFC_CASE_OPTIMIZATION @:PROHIBIT(num_fluids > 3, "num_fluids <= 3 for AMDFLang when Case optimization is off") @:PROHIBIT((bubbles_euler .or. bubbles_lagrange) .and. nb > 3, "nb <= 3 for AMDFLang when Case optimization is off") - @:PROHIBIT(chemistry .and. num_species > 10, "num_species > 10 for AMDFLang when Case optimization is off") + @:PROHIBIT(chemistry .and. num_species > ${AMD_NUM_SPECIES_MAX}$, & + & "num_species <= ${AMD_NUM_SPECIES_MAX}$ for AMDFLang when Case optimization is off") + ! The sys_size bound is not independent of the one above it. Chemistry pins num_fluids to 1, so with + ! num_vels <= 3 the species terminate sys_size at 2*1 + 3 + 1 + 60 = 66 for five equations and + ! 3*1 + 3 + 1 + 60 = 67 for six; 70 covers both with room, and hypoelastic stresses would add up to six + ! more. It had no check of its own while the species cap was ten, because sys_size could not then reach + ! the dimension(20) the guard gives every sys_size array; HLLC's star states have no other bound, so + ! raising one cap without the other overruns them with nothing to say so. + @:PROHIBIT(sys_size > ${AMD_SYS_SIZE_MAX}$, & + & "sys_size <= ${AMD_SYS_SIZE_MAX}$ for AMDFLang when Case optimization is off") #:endif end subroutine s_check_amd diff --git a/src/common/m_chemistry.fpp b/src/common/m_chemistry.fpp index 0e4e6d49e..687b2a118 100644 --- a/src/common/m_chemistry.fpp +++ b/src/common/m_chemistry.fpp @@ -116,8 +116,8 @@ contains real(wp) :: rho, omega_m #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10) :: Ys - real(wp), dimension(10) :: omega + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: omega #:else real(wp), dimension(num_species) :: Ys real(wp), dimension(num_species) :: omega @@ -175,7 +175,7 @@ contains real(wp), parameter :: stiff_target = 0.5_wp #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10) :: Ys, cdot, ddot, y0, prod0, Lloss, alp + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys, cdot, ddot, y0, prod0, Lloss, alp #:else real(wp), dimension(num_species) :: Ys, cdot, ddot, y0, prod0, Lloss, alp #:endif @@ -327,10 +327,10 @@ contains type(scalar_field), intent(in) :: q_T_sf #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10) :: Xs_L, Xs_R, Xs_cell, Ys_L, Ys_R, Ys_cell - real(wp), dimension(10) :: mass_diffusivities_mixavg1, mass_diffusivities_mixavg2 - real(wp), dimension(10) :: mass_diffusivities_mixavg_Cell, dXk_dxi, h_l, h_r, h_k - real(wp), dimension(10) :: Mass_Diffu_Flux, dYk_dxi + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Xs_L, Xs_R, Xs_cell, Ys_L, Ys_R, Ys_cell + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: mass_diffusivities_mixavg1, mass_diffusivities_mixavg2 + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: mass_diffusivities_mixavg_Cell, dXk_dxi, h_l, h_r, h_k + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Mass_Diffu_Flux, dYk_dxi #:else real(wp), dimension(num_species) :: Xs_L, Xs_R, Xs_cell, Ys_L, Ys_R, Ys_cell real(wp), dimension(num_species) :: mass_diffusivities_mixavg1, mass_diffusivities_mixavg2 diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index a787a9727..6292c1d56 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -468,7 +468,7 @@ contains #:if USING_AMD and not MFC_CASE_OPTIMIZATION real(wp), dimension(3) :: alpha_K, alpha_rho_K real(wp), dimension(3) :: nRtmp - real(wp) :: rhoYks(1:10) + real(wp) :: rhoYks(1:${AMD_NUM_SPECIES_MAX}$) #:else real(wp), dimension(num_fluids) :: alpha_K, alpha_rho_K real(wp), dimension(nb) :: nRtmp @@ -1021,10 +1021,10 @@ contains ! functions, the shear and volume Reynolds numbers and the Weber numbers #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3) :: alpha_rho_K - real(wp), dimension(3) :: alpha_K - real(wp), dimension(3) :: vel_K - real(wp), dimension(10) :: Y_K + real(wp), dimension(3) :: alpha_rho_K + real(wp), dimension(3) :: alpha_K + real(wp), dimension(3) :: vel_K + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Y_K #:else real(wp), dimension(num_fluids) :: alpha_rho_K real(wp), dimension(num_fluids) :: alpha_K diff --git a/src/simulation/m_cbc.fpp b/src/simulation/m_cbc.fpp index f730a4960..0e1a4dc7b 100644 --- a/src/simulation/m_cbc.fpp +++ b/src/simulation/m_cbc.fpp @@ -475,18 +475,18 @@ contains real(wp) :: dpres_ds #:if USING_AMD - real(wp), dimension(20) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$) :: L #:else real(wp), dimension(sys_size) :: L #:endif #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3) :: alpha_rho, dalpha_rho_ds, mf - real(wp), dimension(3) :: vel, dvel_ds - real(wp), dimension(3) :: adv_local, dadv_ds - real(wp), dimension(3) :: dadv_dt - real(wp), dimension(3) :: dvel_dt - real(wp), dimension(3) :: dalpha_rho_dt - real(wp), dimension(10) :: Ys, h_k, dYs_dt, dYs_ds, Xs, Gamma_i, Cp_i + real(wp), dimension(3) :: alpha_rho, dalpha_rho_ds, mf + real(wp), dimension(3) :: vel, dvel_ds + real(wp), dimension(3) :: adv_local, dadv_ds + real(wp), dimension(3) :: dadv_dt + real(wp), dimension(3) :: dvel_dt + real(wp), dimension(3) :: dalpha_rho_dt + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys, h_k, dYs_dt, dYs_ds, Xs, Gamma_i, Cp_i #:else real(wp), dimension(num_fluids) :: alpha_rho, dalpha_rho_ds, mf real(wp), dimension(num_vels) :: vel, dvel_ds @@ -646,8 +646,8 @@ contains !> gamma_method = 1: Ref. Section 2.3.1 Formulation of doi:10.7907/ZKW8-ES97. call get_mole_fractions(Mw, Ys, Xs) call get_species_specific_heats_r(T, Cp_i) - Gamma_i = Cp_i/(Cp_i - 1.0_wp) - gamma = sum(Xs(:)/(Gamma_i(:) - 1.0_wp)) + Gamma_i(1:num_species) = Cp_i(1:num_species)/(Cp_i(1:num_species) - 1.0_wp) + gamma = sum(Xs(1:num_species)/(Gamma_i(1:num_species) - 1.0_wp)) else if (chem_params%gamma_method == 2) then !> gamma_method = 2: c_p / c_v where c_p, c_v are specific heats. call get_mixture_specific_heat_cv_mass(T, Ys, Cv) diff --git a/src/simulation/m_compute_cbc.fpp b/src/simulation/m_compute_cbc.fpp index a890130c3..792224e8a 100644 --- a/src/simulation/m_compute_cbc.fpp +++ b/src/simulation/m_compute_cbc.fpp @@ -38,7 +38,7 @@ contains $:GPU_ROUTINE(parallelism='[seq]') #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -62,7 +62,7 @@ contains $:GPU_ROUTINE(parallelism='[seq]') #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -85,7 +85,7 @@ contains $:GPU_ROUTINE(parallelism='[seq]') #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -108,12 +108,12 @@ contains $:GPU_ROUTINE(parallelism='[seq]') #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10), intent(in) :: dYs_ds + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$), intent(in) :: dYs_ds #:else real(wp), dimension(num_species), intent(in) :: dYs_ds #:endif @@ -135,7 +135,7 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -159,15 +159,15 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3), intent(in) :: mf, dalpha_rho_ds - real(wp), dimension(3), intent(in) :: dvel_ds - real(wp), dimension(3), intent(in) :: dadv_ds - real(wp), dimension(10), intent(in) :: dYs_ds + real(wp), dimension(3), intent(in) :: mf, dalpha_rho_ds + real(wp), dimension(3), intent(in) :: dvel_ds + real(wp), dimension(3), intent(in) :: dadv_ds + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$), intent(in) :: dYs_ds #:else real(wp), dimension(num_fluids), intent(in) :: mf, dalpha_rho_ds real(wp), dimension(num_dims), intent(in) :: dvel_ds @@ -199,7 +199,7 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -223,15 +223,15 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3), intent(in) :: mf, dalpha_rho_ds - real(wp), dimension(3), intent(in) :: dvel_ds - real(wp), dimension(3), intent(in) :: dadv_ds - real(wp), dimension(10), intent(in) :: dYs_ds + real(wp), dimension(3), intent(in) :: mf, dalpha_rho_ds + real(wp), dimension(3), intent(in) :: dvel_ds + real(wp), dimension(3), intent(in) :: dadv_ds + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$), intent(in) :: dYs_ds #:else real(wp), dimension(num_fluids), intent(in) :: mf, dalpha_rho_ds real(wp), dimension(num_dims), intent(in) :: dvel_ds @@ -257,7 +257,7 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -288,7 +288,7 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -317,7 +317,7 @@ contains $:GPU_ROUTINE(function_name='s_compute_supersonic_inflow_L', parallelism='[seq]', cray_inline=True) #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif @@ -333,15 +333,15 @@ contains real(wp), dimension(3), intent(in) :: lambda #:if USING_AMD - real(wp), dimension(20), intent(inout) :: L + real(wp), dimension(${AMD_SYS_SIZE_MAX}$), intent(inout) :: L #:else real(wp), dimension(sys_size), intent(inout) :: L #:endif #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3), intent(in) :: mf, dalpha_rho_ds - real(wp), dimension(3), intent(in) :: dvel_ds - real(wp), dimension(3), intent(in) :: dadv_ds - real(wp), dimension(10), intent(in) :: dYs_ds + real(wp), dimension(3), intent(in) :: mf, dalpha_rho_ds + real(wp), dimension(3), intent(in) :: dvel_ds + real(wp), dimension(3), intent(in) :: dadv_ds + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$), intent(in) :: dYs_ds #:else real(wp), dimension(num_fluids), intent(in) :: mf, dalpha_rho_ds real(wp), dimension(num_dims), intent(in) :: dvel_ds diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 99a212260..66690f25e 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -157,12 +157,12 @@ contains real(wp) :: c_IP #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3) :: Gs - real(wp), dimension(3) :: alpha_rho_IP, alpha_IP - real(wp), dimension(3) :: r_IP, v_IP, pb_IP, mv_IP - real(wp), dimension(18) :: nmom_IP - real(wp), dimension(12) :: presb_IP, massv_IP - real(wp), dimension(10) :: Ys_IP + real(wp), dimension(3) :: Gs + real(wp), dimension(3) :: alpha_rho_IP, alpha_IP + real(wp), dimension(3) :: r_IP, v_IP, pb_IP, mv_IP + real(wp), dimension(18) :: nmom_IP + real(wp), dimension(12) :: presb_IP, massv_IP + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys_IP #:else real(wp), dimension(num_fluids) :: Gs real(wp), dimension(num_fluids) :: alpha_rho_IP, alpha_IP diff --git a/src/simulation/m_riemann_solver_hll.fpp b/src/simulation/m_riemann_solver_hll.fpp index a5ffec343..563ee9faf 100644 --- a/src/simulation/m_riemann_solver_hll.fpp +++ b/src/simulation/m_riemann_solver_hll.fpp @@ -41,11 +41,11 @@ contains type(int_bounds_info), intent(in) :: ix, iy, iz #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3) :: alpha_rho_L, alpha_rho_R - real(wp), dimension(3) :: vel_L, vel_R - real(wp), dimension(3) :: alpha_L, alpha_R - real(wp), dimension(10) :: Ys_L, Ys_R, R_species, h_iL, h_iR - real(wp), dimension(10) :: Cp_iL, Cp_iR, Xs_L, Xs_R, Gamma_iL, Gamma_iR + real(wp), dimension(3) :: alpha_rho_L, alpha_rho_R + real(wp), dimension(3) :: vel_L, vel_R + real(wp), dimension(3) :: alpha_L, alpha_R + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys_L, Ys_R, R_species, h_iL, h_iR + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Cp_iL, Cp_iR, Xs_L, Xs_R, Gamma_iL, Gamma_iR #:else real(wp), dimension(num_fluids) :: alpha_rho_L, alpha_rho_R real(wp), dimension(num_vels) :: vel_L, vel_R diff --git a/src/simulation/m_riemann_solver_hllc.fpp b/src/simulation/m_riemann_solver_hllc.fpp index 621f00fff..b7e3b0a73 100644 --- a/src/simulation/m_riemann_solver_hllc.fpp +++ b/src/simulation/m_riemann_solver_hllc.fpp @@ -60,7 +60,8 @@ contains real(wp) :: E_L, E_R real(wp) :: H_L, H_R #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10) :: Ys_L, Ys_R, Xs_L, Xs_R, Gamma_iL, Gamma_iR, Cp_iL, Cp_iR, R_species, h_iL, h_iR + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys_L, Ys_R, Xs_L, Xs_R, Gamma_iL, Gamma_iR, Cp_iL, Cp_iR, R_species, & + & h_iL, h_iR #:else real(wp), dimension(num_species) :: Ys_L, Ys_R, Xs_L, Xs_R, Gamma_iL, Gamma_iR, Cp_iL, Cp_iR, R_species, h_iL, h_iR #:endif @@ -118,8 +119,8 @@ contains ! HLLC star-state helpers #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(20) :: U_L, U_R - real(wp), dimension(20) :: F_L, F_R, F_star_L, F_star_R, F_HLLC + real(wp), dimension(${AMD_SYS_SIZE_MAX}$) :: U_L, U_R + real(wp), dimension(${AMD_SYS_SIZE_MAX}$) :: F_L, F_R, F_star_L, F_star_R, F_HLLC #:else real(wp), dimension(sys_size) :: U_L, U_R real(wp), dimension(sys_size) :: F_L, F_R, F_star_L, F_star_R, F_HLLC @@ -140,7 +141,7 @@ contains ! ADC (HLL -> HLLC) #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(20) :: F_HLL + real(wp), dimension(${AMD_SYS_SIZE_MAX}$) :: F_HLL #:else real(wp), dimension(sys_size) :: F_HLL #:endif diff --git a/src/simulation/m_riemann_solver_lf.fpp b/src/simulation/m_riemann_solver_lf.fpp index c3012280f..82dd93059 100644 --- a/src/simulation/m_riemann_solver_lf.fpp +++ b/src/simulation/m_riemann_solver_lf.fpp @@ -37,11 +37,11 @@ contains type(int_bounds_info), intent(in) :: ix, iy, iz #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(3) :: alpha_rho_L, alpha_rho_R - real(wp), dimension(3) :: vel_L, vel_R - real(wp), dimension(3) :: alpha_L, alpha_R - real(wp), dimension(10) :: Ys_L, Ys_R - real(wp), dimension(10) :: Cp_iL, Cp_iR, Xs_L, Xs_R, Gamma_iL, Gamma_iR + real(wp), dimension(3) :: alpha_rho_L, alpha_rho_R + real(wp), dimension(3) :: vel_L, vel_R + real(wp), dimension(3) :: alpha_L, alpha_R + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Ys_L, Ys_R + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Cp_iL, Cp_iR, Xs_L, Xs_R, Gamma_iL, Gamma_iR real(wp), dimension(3, 3) :: vel_grad_L, vel_grad_R !< Averaged velocity gradient tensor `d(vel_i)/d(coord_j)`. #:else real(wp), dimension(num_fluids) :: alpha_rho_L, alpha_rho_R diff --git a/src/simulation/m_riemann_state.fpp b/src/simulation/m_riemann_state.fpp index ceca8239a..5cb4e00cc 100644 --- a/src/simulation/m_riemann_state.fpp +++ b/src/simulation/m_riemann_state.fpp @@ -228,7 +228,7 @@ contains !> Species enthalpies and heat capacities, evaluated by the caller. m_thermochem is called from the loop body rather than !! from here: CCE faults the GPU on that call one routine deeper. #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10), intent(in) :: Ys_L, Ys_R, R_species, h_iL, h_iR, Cp_iL, Cp_iR + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$), intent(in) :: Ys_L, Ys_R, R_species, h_iL, h_iR, Cp_iL, Cp_iR #:else real(wp), dimension(num_species), intent(in) :: Ys_L, Ys_R, R_species, h_iL, h_iR, Cp_iL, Cp_iR #:endif @@ -236,7 +236,7 @@ contains real(wp), intent(out) :: c_sum_Yi_Phi #:if not MFC_CASE_OPTIMIZATION and USING_AMD - real(wp), dimension(10) :: Yi_avg, Phi_avg, h_avg_2 + real(wp), dimension(${AMD_NUM_SPECIES_MAX}$) :: Yi_avg, Phi_avg, h_avg_2 #:else real(wp), dimension(num_species) :: Yi_avg, Phi_avg, h_avg_2 #:endif @@ -244,24 +244,26 @@ contains eps = 0.001_wp - h_avg_2 = (sqrt(rho_L)*h_iL + sqrt(rho_R)*h_iR)/(sqrt(rho_L) + sqrt(rho_R)) - Yi_avg = (sqrt(rho_L)*Ys_L + sqrt(rho_R)*Ys_R)/(sqrt(rho_L) + sqrt(rho_R)) + h_avg_2(1:num_species) = (sqrt(rho_L)*h_iL(1:num_species) + sqrt(rho_R)*h_iR(1:num_species))/(sqrt(rho_L) + sqrt(rho_R)) + Yi_avg(1:num_species) = (sqrt(rho_L)*Ys_L(1:num_species) + sqrt(rho_R)*Ys_R(1:num_species))/(sqrt(rho_L) + sqrt(rho_R)) T_avg = (sqrt(rho_L)*T_L + sqrt(rho_R)*T_R)/(sqrt(rho_L) + sqrt(rho_R)) if (abs(T_L - T_R) < eps) then ! Case when T_L and T_R are very close - Cp_avg = sum(Yi_avg(:)*(0.5_wp*Cp_iL(:) + 0.5_wp*Cp_iR(:))*R_species(:)) - Cv_avg = sum(Yi_avg(:)*((0.5_wp*Cp_iL(:) + 0.5_wp*Cp_iR(:))*R_species(:) - R_species(:))) + Cp_avg = sum(Yi_avg(1:num_species)*(0.5_wp*Cp_iL(1:num_species) + 0.5_wp*Cp_iR(1:num_species))*R_species(1:num_species)) + Cv_avg = sum(Yi_avg(1:num_species)*((0.5_wp*Cp_iL(1:num_species) + 0.5_wp*Cp_iR(1:num_species)) & + & *R_species(1:num_species) - R_species(1:num_species))) else ! Normal calculation when T_L and T_R are sufficiently different - Cp_avg = sum(Yi_avg(:)*(h_iR(:) - h_iL(:))/(T_R - T_L)) - Cv_avg = sum(Yi_avg(:)*((h_iR(:) - h_iL(:))/(T_R - T_L) - R_species(:))) + Cp_avg = sum(Yi_avg(1:num_species)*(h_iR(1:num_species) - h_iL(1:num_species))/(T_R - T_L)) + Cv_avg = sum(Yi_avg(1:num_species)*((h_iR(1:num_species) - h_iL(1:num_species))/(T_R - T_L) - R_species(1:num_species))) end if gamma_avg = Cp_avg/Cv_avg - Phi_avg(:) = (gamma_avg - 1._wp)*(vel_avg_rms/2.0_wp - h_avg_2(:)) + gamma_avg*R_species(:)*T_avg - c_sum_Yi_Phi = sum(Yi_avg(:)*Phi_avg(:)) + Phi_avg(1:num_species) = (gamma_avg - 1._wp)*(vel_avg_rms/2.0_wp - h_avg_2(1:num_species)) & + & + gamma_avg*R_species(1:num_species)*T_avg + c_sum_Yi_Phi = sum(Yi_avg(1:num_species)*Phi_avg(1:num_species)) end subroutine s_compute_chemistry_average_state diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index 6a5434f5b..4a9a6d231 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -824,11 +824,11 @@ contains #:if USING_AMD #:for BC in [-5, -6, -7, -8, -9, -10, -11, -12, -13] @:PROHIBIT(any((/bc_x%beg, bc_x%end, bc_y%beg, bc_y%end, bc_z%beg, & - & bc_z%end/) == ${BC}$) .and. eqn_idx%adv%end > 20 .and. (.not. chemistry), & - & "CBC module with AMD compiler requires eqn_idx%adv%end <= 20 when case optimization is turned off") + & bc_z%end/) == ${BC}$) .and. eqn_idx%adv%end > 70 .and. (.not. chemistry), & + & "CBC module with AMD compiler requires eqn_idx%adv%end <= 70 when case optimization is turned off") @:PROHIBIT(any((/bc_x%beg, bc_x%end, bc_y%beg, bc_y%end, bc_z%beg, & - & bc_z%end/) == ${BC}$) .and. sys_size > 20 .and. (chemistry), & - & "CBC module with AMD compiler and chemistry requires sys_size <= 20 when case optimization is turned off") + & bc_z%end/) == ${BC}$) .and. sys_size > 70 .and. (chemistry), & + & "CBC module with AMD compiler and chemistry requires sys_size <= 70 when case optimization is turned off") #:endfor #:endif if (bubbles_euler .or. bubbles_lagrange) then