Skip to content

Commit bd29644

Browse files
committed
Revert "frontier changes"
This reverts commit 45da453.
1 parent 45da453 commit bd29644

File tree

2 files changed

+23
-48
lines changed

2 files changed

+23
-48
lines changed

src/simulation/m_bubbles_EL.fpp

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ module m_bubbles_EL
7474
7575
!$acc declare create(nBubs, Rmax_glb, Rmin_glb, q_beta, q_beta_idx)
7676
77-
integer :: remove_id !< Module variable for s_update_tmp_rkck
78-
!$acc declare create(remove_id)
79-
80-
! Module variables for s_write_void_evol
81-
real(kind(0d0)) :: lag_voidmax, lag_voidavg, lag_vol
82-
!$acc declare create(lag_voidmax, lag_voidavg, lag_vol)
83-
8477
contains
8578
8679
!> Initializes the lagrangian subgrid bubble solver
@@ -1168,16 +1161,13 @@ contains
11681161

11691162
integer :: i, j, k, l, q
11701163
real(kind(0d0)) :: radiusOld, velOld, aux_glb
1164+
integer :: remove_id
11711165

11721166
call s_transfer_data_to_tmp()
11731167

11741168
lag_largestep = 0d0
11751169
remove_id = 0
1176-
1177-
!$acc update device(lag_largestep, remove_id)
1178-
1179-
!$acc parallel loop gang vector default(present) reduction(+:lag_largestep) &
1180-
!%acc reduction(MAX: remove_id) private(k) copyin(RKstep) copy(largstep, remove_id)
1170+
!$acc parallel loop gang vector default(present) reduction(+: lag_largestep) reduction(MAX: remove_id) private(k) copyin(RKstep)
11811171
do k = 1, nBubs
11821172

11831173
radiusOld = intfc_rad(k, 2)
@@ -1204,8 +1194,6 @@ contains
12041194

12051195
end do
12061196

1207-
!$acc update host(lag_largestep, remove_id)
1208-
12091197
if (remove_id /= 0) call s_remove_lag_bubble(remove_id)
12101198

12111199
#ifdef MFC_MPI
@@ -1251,11 +1239,7 @@ contains
12511239
integer :: i, j, k
12521240

12531241
rkck_errmax = 0d0
1254-
1255-
!$acc update device(rkck_errmax)
1256-
1257-
!$acc parallel loop gang vector default(present) reduction(MAX: rkck_errmax) &
1258-
!$acc private(k) copy(rkck_errmax)
1242+
!$acc parallel loop gang vector default(present) reduction(MAX: rkck_errmax) private(k)
12591243
do k = 1, nBubs
12601244
errb = 0d0
12611245

@@ -1288,8 +1272,6 @@ contains
12881272
rkck_errmax = max(rkck_errmax, errb)
12891273
end do
12901274

1291-
!$acc update host(rkck_errmax)
1292-
12931275
end subroutine s_calculate_rkck_truncation_error
12941276

12951277
!> This subroutine updates the conservative fields and the lagrangian variables after accepting the performed time step.
@@ -1312,10 +1294,10 @@ contains
13121294
end do
13131295

13141296
!$acc parallel loop collapse(4) gang vector default(present)
1315-
do l = 1, sys_size
1316-
do k = 0, p
1317-
do j = 0, n
1318-
do i = 0, m
1297+
do i = 0, m
1298+
do j = 0, n
1299+
do k = 0, p
1300+
do l = 1, sys_size
13191301
q_cons_ts(1)%vf(l)%sf(i, j, k) = q_cons_ts(2)%vf(l)%sf(i, j, k)
13201302
end do
13211303
end do
@@ -1646,9 +1628,11 @@ contains
16461628
subroutine s_write_void_evol(qtime)
16471629

16481630
real(kind(0d0)) :: qtime, volcell, voltot
1631+
real(kind(0d0)) :: lag_voidmax, lag_voidavg, lag_vol
16491632
real(kind(0d0)) :: voidmax_glb, voidavg_glb, vol_glb
16501633

16511634
integer :: i, j, k
1635+
integer, dimension(3) :: cell
16521636

16531637
character(LEN=path_len + 2*name_len) :: file_loc
16541638

@@ -1657,6 +1641,11 @@ contains
16571641
file_loc = trim(case_dir)//'/D/'//trim(file_loc)
16581642
if (qtime == 0d0) then
16591643
open (12, FILE=trim(file_loc), FORM='formatted', position='rewind')
1644+
!write (12, *) 'currentTime, averageVoidFraction, ', &
1645+
! 'maximumVoidFraction, totalParticlesVolume'
1646+
!write (12, *) 'The averageVoidFraction value does ', &
1647+
! 'not reflect the real void fraction in the cloud since the ', &
1648+
! 'cells which do not have bubbles are not accounted'
16601649
else
16611650
open (12, FILE=trim(file_loc), FORM='formatted', position='append')
16621651
end if
@@ -1665,16 +1654,16 @@ contains
16651654
lag_voidmax = 0d0
16661655
lag_voidavg = 0d0
16671656
lag_vol = 0d0
1668-
1669-
!$acc update device(lag_voidmax, lag_voidavg, lag_vol)
1670-
16711657
!$acc parallel loop collapse(3) gang vector default(present) reduction(+:lag_vol,lag_voidavg) &
1672-
!$acc reduction(MAX:lag_voidmax) copy(lag_voidmax,lag_voidavg, lag_vol)
1673-
do k = 0, p
1658+
!$acc reduction(MAX:lag_voidmax) private(cell)
1659+
do i = 0, m
16741660
do j = 0, n
1675-
do i = 0, p
1661+
do k = 0, p
16761662
lag_voidmax = max(lag_voidmax, 1d0 - q_beta%vf(1)%sf(i, j, k))
1677-
call s_get_char_vol(i, j, k, volcell)
1663+
cell(1) = i
1664+
cell(2) = j
1665+
cell(3) = k
1666+
call s_get_char_vol(cell(1), cell(2), cell(3), volcell)
16781667
if ((1d0 - q_beta%vf(1)%sf(i, j, k)) > 5.0d-11) then
16791668
lag_voidavg = lag_voidavg + (1d0 - q_beta%vf(1)%sf(i, j, k))*volcell
16801669
lag_vol = lag_vol + volcell
@@ -1683,8 +1672,6 @@ contains
16831672
end do
16841673
end do
16851674

1686-
!$acc update host(lag_voidmax, lag_voidavg, lag_vol)
1687-
16881675
#ifdef MFC_MPI
16891676
if (num_procs > 1) then
16901677
call s_mpi_allreduce_max(lag_voidmax, voidmax_glb)
@@ -1854,22 +1841,14 @@ contains
18541841

18551842
integer :: k
18561843

1857-
Rmax_glb = 0d0
1858-
Rmin_glb = 0d0
1859-
1860-
!$acc update device(Rmax_glb, Rmin_glb)
1861-
1862-
!$acc parallel loop gang vector default(present) reduction(MAX: Rmax_glb) reduction(MIN: Rmin_glb) &
1863-
!$acc private(k) copy(Rmax_glb, Rmin_glb)
1844+
!$acc parallel loop gang vector default(present) reduction(MAX: Rmax_glb) reduction(MIN: Rmin_glb) private(k)
18641845
do k = 1, nBubs
18651846
Rmax_glb = max(Rmax_glb, intfc_rad(k, 1)/bub_R0(k))
18661847
Rmin_glb = min(Rmin_glb, intfc_rad(k, 1)/bub_R0(k))
18671848
Rmax_stats(k) = max(Rmax_stats(k), intfc_rad(k, 1)/bub_R0(k))
18681849
Rmin_stats(k) = min(Rmin_stats(k), intfc_rad(k, 1)/bub_R0(k))
18691850
end do
18701851

1871-
!$acc update host(Rmax_glb, Rmin_glb)
1872-
18731852
end subroutine s_calculate_lag_bubble_stats
18741853

18751854
!> Subroutine that writes the maximum and minimum radius of each bubble.

src/simulation/m_time_steppers.fpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ module m_time_steppers
7373

7474
!$acc declare create(q_cons_ts,q_prim_vf,rhs_vf,rhs_ts_rkck,q_prim_ts, rhs_mv, rhs_pb, max_dt)
7575

76-
! Module variables for rkck timestepper
77-
real(kind(0d0)) :: lag_largestep, rkck_errmax
78-
!$acc declare create(lag_largestep, rkck_errmax)
79-
8076
contains
8177

8278
!> The computation of parameters, the allocation of memory,
@@ -1048,7 +1044,7 @@ contains
10481044
real(kind(0d0)), intent(out) :: time_avg
10491045

10501046
logical :: restart_rkck_step, start_rkck_step
1051-
real(kind(0.d0)) :: dt_did
1047+
real(kind(0.d0)) :: lag_largestep, rkck_errmax, dt_did
10521048
integer :: RKstep
10531049

10541050
mytime = mytime - dt

0 commit comments

Comments
 (0)