Skip to content

Commit 4356e4c

Browse files
authored
Bug Fixes (#224)
1 parent 67779d5 commit 4356e4c

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

src/common/m_variables_conversion.fpp

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#:include 'macros.fpp'
66
#:include 'inline_conversions.fpp'
7+
#:include '../simulation/include/case.fpp'
78

89
!> @brief This module consists of subroutines used in the conversion of the
910
!! conservative variables into the primitive ones and vice versa. In
@@ -786,7 +787,16 @@ contains
786787
real(kind(0d0)), dimension(2) :: Re_K
787788
real(kind(0d0)) :: rho_K, gamma_K, pi_inf_K, dyn_pres_K
788789

789-
real(kind(0d0)), dimension(:), allocatable :: nRtmp
790+
#:if MFC_CASE_OPTIMIZATION
791+
#ifndef MFC_SIMULATION
792+
real(kind(0d0)), dimension(:), allocatable :: nRtmp
793+
#else
794+
real(kind(0d0)), dimension(nb) :: nRtmp
795+
#endif
796+
#:else
797+
real(kind(0d0)), dimension(:), allocatable :: nRtmp
798+
#:endif
799+
790800
real(kind(0d0)) :: vftmp, nR3, nbub_sc, R3tmp
791801

792802
real(kind(0d0)) :: G_K
@@ -797,11 +807,21 @@ contains
797807

798808
real(kind(0.d0)) :: ntmp
799809

800-
if (bubbles) then
801-
allocate(nRtmp(nb))
802-
else
803-
allocate(nRtmp(0))
804-
endif
810+
#:if MFC_CASE_OPTIMIZATION
811+
#ifndef MFC_SIMULATION
812+
if (bubbles) then
813+
allocate(nRtmp(nb))
814+
else
815+
allocate(nRtmp(0))
816+
endif
817+
#endif
818+
#:else
819+
if (bubbles) then
820+
allocate(nRtmp(nb))
821+
else
822+
allocate(nRtmp(0))
823+
endif
824+
#:endif
805825

806826
!$acc parallel loop collapse(3) gang vector default(present) private(alpha_K, alpha_rho_K, Re_K, nRtmp, rho_K, gamma_K, pi_inf_K, dyn_pres_K, R3tmp)
807827
do l = izb, ize

src/simulation/m_viscous.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ module m_viscous
527527
qL_prim_rsy_vf, qR_prim_rsy_vf, &
528528
qL_prim_rsz_vf, qR_prim_rsz_vf
529529

530-
type(vector_field), dimension(sys_size) :: qL_prim, qR_prim
530+
type(vector_field), dimension(1:num_dims) :: qL_prim, qR_prim
531531

532532
type(vector_field) :: q_prim_qp
533533

0 commit comments

Comments
 (0)