Skip to content

Commit 334720f

Browse files
mohdsaid497566Malmahrouqi3
authored andcommitted
refactored s_initialize_riemann_solver
1 parent 483d116 commit 334720f

File tree

1 file changed

+16
-68
lines changed

1 file changed

+16
-68
lines changed

src/simulation/m_riemann_solvers.fpp

Lines changed: 16 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,97 +3163,45 @@ contains
31633163
type(int_bounds_info), intent(in) :: ix, iy, iz
31643164

31653165
integer :: i, j, k, l ! Generic loop iterators
3166-
31673166
! Reshaping Inputted Data in x-direction
31683167

3169-
if (norm_dir == 1) then
3170-
3171-
if (viscous .or. (surface_tension)) then
3172-
3168+
if (viscous .or. (surface_tension)) then
31733169
!$acc parallel loop collapse(4) gang vector default(present)
31743170
do i = momxb, E_idx
31753171
do l = is3%beg, is3%end
31763172
do k = is2%beg, is2%end
31773173
do j = is1%beg, is1%end
3178-
flux_src_vf(i)%sf(j, k, l) = 0._wp
3179-
end do
3180-
end do
3181-
end do
3182-
end do
3183-
end if
3184-
3185-
if (qbmm) then
3186-
3187-
!$acc parallel loop collapse(4) gang vector default(present)
3188-
do i = 1, 4
3189-
do l = is3%beg, is3%end
3190-
do k = is2%beg, is2%end
3191-
do j = is1%beg, is1%end + 1
3192-
mom_sp_rsx_vf(j, k, l, i) = mom_sp(i)%sf(j, k, l)
3193-
end do
3194-
end do
3195-
end do
3196-
end do
3197-
end if
3198-
3199-
! Reshaping Inputted Data in y-direction
3200-
elseif (norm_dir == 2) then
3201-
3202-
if (viscous .or. (surface_tension)) then
3203-
!$acc parallel loop collapse(4) gang vector default(present)
3204-
do i = momxb, E_idx
3205-
do l = is3%beg, is3%end
3206-
do j = is1%beg, is1%end
3207-
do k = is2%beg, is2%end
3208-
flux_src_vf(i)%sf(k, j, l) = 0._wp
3209-
end do
3210-
end do
3211-
end do
3212-
end do
3213-
end if
3214-
3215-
if (qbmm) then
3216-
!$acc parallel loop collapse(4) gang vector default(present)
3217-
do i = 1, 4
3218-
do l = is3%beg, is3%end
3219-
do k = is2%beg, is2%end
3220-
do j = is1%beg, is1%end + 1
3221-
mom_sp_rsy_vf(j, k, l, i) = mom_sp(i)%sf(k, j, l)
3222-
end do
3223-
end do
3224-
end do
3225-
end do
3226-
end if
3227-
3228-
! Reshaping Inputted Data in z-direction
3229-
else
3230-
3231-
if (viscous .or. (surface_tension)) then
3232-
!$acc parallel loop collapse(4) gang vector default(present)
3233-
do i = momxb, E_idx
3234-
do j = is1%beg, is1%end
3235-
do k = is2%beg, is2%end
3236-
do l = is3%beg, is3%end
3237-
flux_src_vf(i)%sf(l, k, j) = 0._wp
3174+
if (norm_dir == 1) then
3175+
flux_src_vf(i)%sf(j, k, l) = 0._wp
3176+
else if (norm_dir == 2) then
3177+
flux_src_vf(i)%sf(k, j, l) = 0._wp
3178+
else if (norm_dir == 3) then
3179+
flux_src_vf(i)%sf(l, k, j) = 0._wp
3180+
end if
32383181
end do
32393182
end do
32403183
end do
32413184
end do
32423185
end if
32433186

3244-
if (qbmm) then
3187+
if (qbmm) then
32453188
!$acc parallel loop collapse(4) gang vector default(present)
32463189
do i = 1, 4
32473190
do l = is3%beg, is3%end
32483191
do k = is2%beg, is2%end
32493192
do j = is1%beg, is1%end + 1
3250-
mom_sp_rsz_vf(j, k, l, i) = mom_sp(i)%sf(l, k, j)
3193+
if (norm_dir == 1) then
3194+
mom_sp_rsx_vf(j, k, l, i) = mom_sp(i)%sf(j, k, l)
3195+
else if (norm_dir == 2) then
3196+
mom_sp_rsy_vf(j, k, l, i) = mom_sp(i)%sf(k, j, l)
3197+
else if (norm_dir == 3) then
3198+
mom_sp_rsz_vf(j, k, l, i) = mom_sp(i)%sf(l, k, j)
3199+
end if
32513200
end do
32523201
end do
32533202
end do
32543203
end do
32553204
end if
3256-
32573205
end if
32583206

32593207
end subroutine s_initialize_riemann_solver

0 commit comments

Comments
 (0)