Skip to content

Commit 94ac09d

Browse files
committed
Give the surface species arrays the same bound as the ones they are combined with
W_species and Ys_s were declared dimension(num_species) outside the USING_AMD guard, while Ys_IP and Ys_g inside it carry the padded literal. Ys_g(:) = 2*Ys_s(:) - Ys_IP(:) is then a shape mismatch in any generic amdflang build, at any species count: with the literal at ten and a nine-species mechanism it is ten against nine and the compile fails. Both arrays now follow the guard, and the four whole-array assignments are pinned to 1:num_species so they do not depend on the padding happening to match. Separate from the ten-species ceiling itself, which this does not lift -- an eleven-species mechanism still needs case optimization on AMD, or #1848.
1 parent 6b2b60e commit 94ac09d

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src/simulation/m_ibm.fpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,25 @@ contains
165165
real(wp), dimension(3) :: r_IP, v_IP, pb_IP, mv_IP
166166
real(wp), dimension(18) :: nmom_IP
167167
real(wp), dimension(12) :: presb_IP, massv_IP
168-
real(wp), dimension(10) :: Ys_IP, Ys_g
168+
real(wp), dimension(10) :: Ys_IP, Ys_g, W_species
169169
#:else
170170
real(wp), dimension(num_fluids) :: Gs
171171
real(wp), dimension(num_fluids) :: alpha_rho_IP, alpha_IP
172172
real(wp), dimension(nb) :: r_IP, v_IP, pb_IP, mv_IP
173173
real(wp), dimension(nb*nmom) :: nmom_IP
174174
real(wp), dimension(nb*nnode) :: presb_IP, massv_IP
175-
real(wp), dimension(num_species) :: Ys_IP, Ys_g
175+
real(wp), dimension(num_species) :: Ys_IP, Ys_g, W_species
176176
#:endif
177-
real(wp), dimension(num_species) :: W_species
178177
real(wp) :: alpha_q, alpha_rho_q, e_q
179178
real(wp) :: T_IP, mw_IP, e_IP !< Image-point temperature, mixture MW, and mass-specific internal energy (chemistry)
180179
real(wp) :: v_blow_eff !< Effective surface blowing speed (after any pressure-coupled burn-rate scaling)
181-
real(wp), dimension(num_species) :: Ys_s
180+
#:if not MFC_CASE_OPTIMIZATION and USING_AMD
181+
real(wp), dimension(10) :: Ys_s
182+
#:else
183+
real(wp), dimension(num_species) :: Ys_s
184+
#:endif
182185
real(wp) :: T_s, T_g, mw_s, mw_g, rho_s, mdot_s, v_stefan, d
183-
logical :: surface_converged
186+
logical :: surface_converged
184187
! Primitive variables at the image point associated with a ghost point, interpolated from surrounding fluid cells.
185188

186189
real(wp), dimension(3) :: norm !< Normal vector from GP to IP
@@ -287,7 +290,7 @@ contains
287290

288291
if (patch_ib(patch_id)%surface_reaction == 0) then
289292
! Inert surface: zero species flux.
290-
Ys_g(:) = Ys_IP(:)
293+
Ys_g(1:num_species) = Ys_IP(1:num_species)
291294

292295
! thermal_bc = 0: zero normal temperature gradient thermal_bc = 1: prescribed surface temperature Twall
293296
T_g = T_IP + 2._wp*real(patch_ib(patch_id)%thermal_bc, kind=wp)*(patch_ib(patch_id)%Twall - T_IP)
@@ -298,7 +301,7 @@ contains
298301
! Heterogeneous reacting surface.
299302
d = abs(real(gp%levelset, kind=wp))
300303

301-
W_species(:) = molecular_weights(:)
304+
W_species(1:num_species) = molecular_weights(:)
302305

303306
call s_solve_surface(pres_IP, T_IP, patch_ib(patch_id)%Twall, d, Ys_IP, W_species, &
304307
& patch_ib(patch_id)%thermal_bc, Ys_s, T_s, mdot_s, surface_converged)
@@ -310,13 +313,13 @@ contains
310313
rho_s = pres_IP*mw_s/(gas_constant*T_s)
311314
if (rho_s > 0._wp) v_stefan = mdot_s/rho_s
312315

313-
Ys_g(:) = 2._wp*Ys_s(:) - Ys_IP(:)
316+
Ys_g(1:num_species) = 2._wp*Ys_s(1:num_species) - Ys_IP(1:num_species)
314317
T_g = 2._wp*T_s - T_IP
315318

316319
call get_mixture_molecular_weight(Ys_g, mw_g)
317320
alpha_rho_IP(1) = alpha_IP(1)*pres_IP*mw_g/(gas_constant*T_g)
318321
else
319-
Ys_g(:) = Ys_IP(:)
322+
Ys_g(1:num_species) = Ys_IP(1:num_species)
320323
T_g = T_IP
321324
end if
322325
end if

0 commit comments

Comments
 (0)