@@ -128,7 +128,8 @@ contains
128128 real (kind (0d0 )), intent (in ) :: energy, alf
129129 real (kind (0d0 )), intent (in ) :: dyn_p
130130 real (kind (0d0 )), intent (in ) :: pi_inf, gamma, rho, qv
131- real (kind (0d0 )), intent (out ) :: pres, T
131+ real (kind (0d0 )), intent (out ) :: pres
132+ real (kind (0d0 )), intent (inout ) :: T
132133 real (kind (0d0 )), intent (in ), optional :: stress, mom, G
133134
134135 ! Chemistry
@@ -183,7 +184,7 @@ contains
183184 e_Per_Kg = energy/ rho
184185 Pdyn_Per_Kg = dyn_p/ rho
185186
186- call get_temperature(e_Per_Kg - Pdyn_Per_Kg, 1200d0 , Y_rs, .true. , T)
187+ call get_temperature(e_Per_Kg - Pdyn_Per_Kg, T , Y_rs, .true. , T)
187188 call get_pressure(rho, T, Y_rs, pres)
188189
189190 #:endif
@@ -814,11 +815,13 @@ contains
814815 !! @param iy Index bounds in second coordinate direction
815816 !! @param iz Index bounds in third coordinate direction
816817 subroutine s_convert_conservative_to_primitive_variables (qK_cons_vf , &
818+ q_T_sf , &
817819 qK_prim_vf , &
818820 ibounds , &
819821 gm_alphaK_vf )
820822
821823 type(scalar_field), dimension (sys_size), intent (in ) :: qK_cons_vf
824+ type(scalar_field), intent (inout ) :: q_T_sf
822825 type(scalar_field), dimension (sys_size), intent (inout ) :: qK_prim_vf
823826 type(int_bounds_info), dimension (1 :3 ), intent (in ) :: ibounds
824827 type(scalar_field), &
@@ -845,11 +848,11 @@ contains
845848
846849 real (kind (0d0 )) :: G_K
847850
848- real (kind (0d0 )) :: pres, Yksum, T
851+ real (kind (0d0 )) :: pres, Yksum
849852
850853 integer :: i, j, k, l, q !< Generic loop iterators
851854
852- real (kind (0.d0 )) :: ntmp
855+ real (kind (0.d0 )) :: ntmp, T
853856
854857 #:if MFC_CASE_OPTIMIZATION
855858#ifndef MFC_SIMULATION
@@ -922,8 +925,6 @@ contains
922925 do i = chemxb, chemxe
923926 qK_prim_vf(i)%sf(j, k, l) = max (0d0 , qK_cons_vf(i)%sf(j, k, l)/ rho_K)
924927 end do
925-
926- qK_prim_vf(T_idx)%sf(j, k, l) = qK_cons_vf(T_idx)%sf(j, k, l)
927928 else
928929 !$acc loop seq
929930 do i = 1 , contxe
@@ -953,15 +954,19 @@ contains
953954 do i = 1 , num_species
954955 rhoYks(i) = qK_cons_vf(chemxb + i - 1 )%sf(j, k, l)
955956 end do
957+
958+ T = q_T_sf%sf(j, k, l)
956959 end if
957960
958961 call s_compute_pressure(qK_cons_vf(E_idx)%sf(j, k, l), &
959962 qK_cons_vf(alf_idx)%sf(j, k, l), &
960- dyn_pres_K, pi_inf_K, gamma_K, rho_K, qv_K, rhoYks, pres, T)
963+ dyn_pres_K, pi_inf_K, gamma_K, rho_K, &
964+ qv_K, rhoYks, pres, T)
961965
962966 qK_prim_vf(E_idx)%sf(j, k, l) = pres
967+
963968 if (chemistry) then
964- qK_prim_vf(T_idx) %sf(j, k, l) = T
969+ q_T_sf %sf(j, k, l) = T
965970 end if
966971
967972 if (bubbles) then
@@ -1119,8 +1124,6 @@ contains
11191124
11201125 q_cons_vf(E_idx)%sf(j, k, l) = &
11211126 dyn_pres + rho* e_mix
1122-
1123- q_cons_vf(T_idx)%sf(j, k, l) = q_prim_vf(T_idx)%sf(j, k, l)
11241127 else
11251128 ! Computing the energy from the pressure
11261129 if ((model_eqns /= 4 ) .and. (bubbles .neqv. .true. )) then
0 commit comments