Skip to content

Commit f65abdf

Browse files
Spencer Bryngelsonclaude
andcommitted
Fix CCE VLA ICE in m_chemistry.fpp + restore Python 3.9 support
Extend AMD-only VLA guards to also cover CCE 19.0.0 in all four locations in m_chemistry.fpp: - s_compute_q_T_sf: add USING_CCE guard for Ys array - s_compute_T_from_primitives: add USING_CCE guard for Ys array - s_compute_chemistry_reaction_flux: extend AMD guard to include CCE - s_compute_chemistry_diffusion_flux: extend AMD guard to include CCE CCE 19.0.0 LLVM InstCombine (foldIntegerTypedPHI) crashes on VLAs (dimension(num_species)) when num_species is not a compile-time constant (e.g., case-optimized pre_process for non-chemistry cases). Fixed by using dimension(10) when USING_CCE. Also restore MFC_PYTHON_MIN_MINOR=9 in python.sh (was accidentally set to 10 in 3d8cf31; PR #1287 merged to master adds Python 3.9 support). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3d8cf31 commit f65abdf

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/common/m_chemistry.fpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ contains
6363

6464
integer :: x, y, z, eqn
6565
real(wp) :: energy, T_in
66-
real(wp), dimension(num_species) :: Ys
66+
#:if USING_CCE
67+
real(wp), dimension(10) :: Ys
68+
#:else
69+
real(wp), dimension(num_species) :: Ys
70+
#:endif
6771

6872
do z = bounds(3)%beg, bounds(3)%end
6973
do y = bounds(2)%beg, bounds(2)%end
@@ -101,7 +105,11 @@ contains
101105
type(int_bounds_info), dimension(1:3), intent(in) :: bounds
102106

103107
integer :: x, y, z, i
104-
real(wp), dimension(num_species) :: Ys
108+
#:if USING_CCE
109+
real(wp), dimension(10) :: Ys
110+
#:else
111+
real(wp), dimension(num_species) :: Ys
112+
#:endif
105113
real(wp) :: mix_mol_weight
106114

107115
do z = bounds(3)%beg, bounds(3)%end
@@ -131,7 +139,7 @@ contains
131139
integer :: eqn
132140
real(wp) :: T
133141
real(wp) :: rho, omega_m
134-
#:if not MFC_CASE_OPTIMIZATION and USING_AMD
142+
#:if (not MFC_CASE_OPTIMIZATION and USING_AMD) or USING_CCE
135143
real(wp), dimension(10) :: Ys
136144
real(wp), dimension(10) :: omega
137145
#:else
@@ -180,7 +188,7 @@ contains
180188
type(int_bounds_info), intent(in) :: irx, iry, irz
181189

182190
integer, intent(in) :: idir
183-
#:if not MFC_CASE_OPTIMIZATION and USING_AMD
191+
#:if (not MFC_CASE_OPTIMIZATION and USING_AMD) or USING_CCE
184192
real(wp), dimension(10) :: Xs_L, Xs_R, Xs_cell, Ys_L, Ys_R, Ys_cell
185193
real(wp), dimension(10) :: mass_diffusivities_mixavg1, mass_diffusivities_mixavg2
186194
real(wp), dimension(10) :: mass_diffusivities_mixavg_Cell, dXk_dxi, h_l, h_r, h_k

toolchain/bootstrap/python.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
MFC_PYTHON_MIN_MAJOR=3
4-
MFC_PYTHON_MIN_MINOR=10
4+
MFC_PYTHON_MIN_MINOR=9
55
MFC_PYTHON_MIN_STR="$MFC_PYTHON_MIN_MAJOR.$MFC_PYTHON_MIN_MINOR"
66

77
is_python_compatible() {

0 commit comments

Comments
 (0)