Skip to content

Commit 7b42ba5

Browse files
committed
Bound the burn sub-step's per-fluid locals by num_fluids_max
Under case optimization num_fluids is a compile-time constant, and the Case Opt lanes build cases that set it to one, where the literal reactant and product indices are then out of bounds and the compile fails. num_fluids_max is a parameter and always covers both, so the arrays no longer need the case-optimization and AMD split either.
1 parent ed51f33 commit 7b42ba5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/simulation/m_reactive_burn.fpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ contains
113113
real(wp) :: dt_sub, e_int, gamma_mix, pi_inf_mix, qv_mix
114114
real(wp) :: rho_mix, dlambda, dmass
115115
116-
#:if not MFC_CASE_OPTIMIZATION and USING_AMD
117-
real(wp), dimension(3) :: alpha_rho, alpha
118-
#:else
119-
real(wp), dimension(num_fluids) :: alpha_rho, alpha
120-
#:endif
116+
! Bounded by num_fluids_max, not num_fluids: under case optimization num_fluids is a compile-time
117+
! constant that can be 1, and the reactant/product indices below are literal. The validator holds
118+
! reactive_burn to two fluids, so only the first two entries are ever used.
119+
real(wp), dimension(num_fluids_max) :: alpha_rho, alpha
121120
122121
dt_sub = dtime/real(rburn%substeps, wp)
123122

0 commit comments

Comments
 (0)