@@ -81,9 +81,6 @@ module m_variables_conversion
8181
8282 end interface ! ============================================================
8383
84- integer , public :: ixb, ixe, iyb, iye, izb, ize
85- !$acc declare create(ixb, ixe, iyb, iye, izb, ize)
86-
8784 !! In simulation, gammas, pi_infs, and qvs are already declared in m_global_variables
8885#ifndef MFC_SIMULATION
8986 real (kind (0d0 )), allocatable, public, dimension (:) :: gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps
@@ -628,26 +625,7 @@ contains
628625
629626 integer :: i, j
630627
631- #ifdef MFC_PRE_PROCESS
632- ixb = 0 ; iyb = 0 ; izb = 0 ;
633- ixe = m; iye = n; ize = p;
634- #else
635- ixb = - buff_size
636- ixe = m - ixb
637-
638- iyb = 0 ; iye = 0 ; izb = 0 ; ize = 0 ;
639- if (n > 0 ) then
640- iyb = - buff_size; iye = n - iyb
641-
642- if (p > 0 ) then
643- izb = - buff_size; ize = p - izb
644- end if
645- end if
646- #endif
647-
648- !$acc enter data copyin(ixb, ixe, iyb, iye, izb, ize)
649628!$acc enter data copyin(is1b, is1e, is2b, is2e, is3b, is3e)
650- !$acc update device(ixb, ixe, iyb, iye, izb, ize)
651629
652630#ifdef MFC_SIMULATION
653631 @:ALLOCATE_GLOBAL(gammas (1 :num_fluids))
@@ -784,15 +762,16 @@ contains
784762
785763 !Initialize mv at the quadrature nodes based on the initialized moments and sigma
786764 subroutine s_initialize_mv (qK_cons_vf , mv )
765+
787766 type(scalar_field), dimension (sys_size), intent (in ) :: qK_cons_vf
788- real (kind (0d0 )), dimension (ixb :, iyb :, izb :, 1 :, 1 :), intent (inout ) :: mv
767+ real (kind (0d0 )), dimension (idwbuff( 1 )%beg :, idwbuff( 2 )%beg :, idwbuff( 3 )%beg :, 1 :, 1 :), intent (inout ) :: mv
789768
790769 integer :: i, j, k, l
791770 real (kind (0d0 )) :: mu, sig, nbub_sc
792771
793- do l = izb, ize
794- do k = iyb, iye
795- do j = ixb, ixe
772+ do l = idwbuff( 3 )%beg, idwbuff( 3 )% end
773+ do k = idwbuff( 2 )%beg, idwbuff( 2 )%end
774+ do j = idwbuff( 1 )%beg, idwbuff( 1 )%end
796775
797776 nbub_sc = qK_cons_vf(bubxb)%sf(j, k, l)
798777
@@ -816,15 +795,15 @@ contains
816795 !Initialize pb at the quadrature nodes using isothermal relations (Preston model)
817796 subroutine s_initialize_pb (qK_cons_vf , mv , pb )
818797 type(scalar_field), dimension (sys_size), intent (in ) :: qK_cons_vf
819- real (kind (0d0 )), dimension (ixb :, iyb :, izb :, 1 :, 1 :), intent (in ) :: mv
820- real (kind (0d0 )), dimension (ixb :, iyb :, izb :, 1 :, 1 :), intent (inout ) :: pb
798+ real (kind (0d0 )), dimension (idwbuff( 1 )%beg :, idwbuff( 2 )%beg :, idwbuff( 3 )%beg :, 1 :, 1 :), intent (in ) :: mv
799+ real (kind (0d0 )), dimension (idwbuff( 1 )%beg :, idwbuff( 2 )%beg :, idwbuff( 3 )%beg :, 1 :, 1 :), intent (inout ) :: pb
821800
822801 integer :: i, j, k, l
823802 real (kind (0d0 )) :: mu, sig, nbub_sc
824803
825- do l = izb, ize
826- do k = iyb, iye
827- do j = ixb, ixe
804+ do l = idwbuff( 3 )%beg, idwbuff( 3 )% end
805+ do k = idwbuff( 2 )%beg, idwbuff( 2 )%end
806+ do j = idwbuff( 1 )%beg, idwbuff( 1 )%end
828807
829808 nbub_sc = qK_cons_vf(bubxb)%sf(j, k, l)
830809
@@ -855,19 +834,16 @@ contains
855834 !! @param iz Index bounds in third coordinate direction
856835 subroutine s_convert_conservative_to_primitive_variables (qK_cons_vf , &
857836 qK_prim_vf , &
858- gm_alphaK_vf , &
859- ix , iy , iz )
837+ ibounds , &
838+ gm_alphaK_vf )
860839
861840 type(scalar_field), dimension (sys_size), intent (in ) :: qK_cons_vf
862841 type(scalar_field), dimension (sys_size), intent (inout ) :: qK_prim_vf
842+ type(int_bounds_info), dimension (1 :3 ), intent (in ) :: ibounds
863843 type(scalar_field), &
864844 allocatable, optional, dimension (:), &
865845 intent (in ) :: gm_alphaK_vf
866846
867- type(int_bounds_info), optional, intent (in ) :: ix, iy, iz
868-
869- type(int_bounds_info) :: aix, aiy, aiz
870-
871847 real (kind (0d0 )), dimension (num_fluids) :: alpha_K, alpha_rho_K
872848 real (kind (0d0 )), dimension (2 ) :: Re_K
873849 real (kind (0d0 )) :: rho_K, gamma_K, pi_inf_K, qv_K, dyn_pres_K
@@ -910,14 +886,10 @@ contains
910886 end if
911887 #:endif
912888
913- if (present (ix)) then ; aix = ix; else ; aix%beg = ixb; aix%end = ixe; end if
914- if (present (iy)) then ; aiy = iy; else ; aiy%beg = iyb; aiy%end = iye; end if
915- if (present (iz)) then ; aiz = iz; else ; aiz%beg = izb; aiz%end = ize; end if
916-
917- !$acc parallel loop collapse(3 ) gang vector default(present) copyin(aix, aiy, aiz) private(alpha_K, alpha_rho_K, Re_K, nRtmp, rho_K, gamma_K, pi_inf_K, qv_K, dyn_pres_K, R3tmp, rhoyks)
918- do l = aiz%beg, aiz%end
919- do k = aiy%beg, aiy%end
920- do j = aix%beg, aix%end
889+ !$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, qv_K, dyn_pres_K, R3tmp, rhoyks)
890+ do l = ibounds(3 )%beg, ibounds(3 )%end
891+ do k = ibounds(2 )%beg, ibounds(2 )%end
892+ do j = ibounds(1 )%beg, ibounds(1 )%end
921893 dyn_pres_K = 0d0
922894
923895 !$acc loop seq
0 commit comments