Skip to content

Commit ccbb582

Browse files
committed
merging + fix viscous bug + reduce examples
1 parent 1c17ed5 commit ccbb582

File tree

81 files changed

+1311
-3713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1311
-3713
lines changed

examples/3D_rayleigh_taylor_muscl/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"p_y": 0.0,
9191
"g_y": -98.1,
9292
# Water Patch
93-
"patch_icpp(1)%geometry": 13,
93+
"patch_icpp(1)%geometry": 9,
9494
"patch_icpp(1)%hcid": 300,
9595
"patch_icpp(1)%x_centroid": 0,
9696
"patch_icpp(1)%y_centroid": h / 2,

src/common/m_helper_basic.fpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
!>
1+
22
!! @file m_helper_basic.f90
33
!! @brief Contains module m_helper_basic
44

@@ -128,8 +128,7 @@ contains
128128
else
129129
buff_size = 4
130130
end if
131-
else
132-
if (recon_type == WENO_TYPE) then
131+
elseif (recon_type == WENO_TYPE) then
133132
if (viscous) then
134133
buff_size = 2*weno_polyn + 2
135134
else

src/post_process/m_start_up.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impure subroutine s_read_input_file
8989
cfl_adap_dt, cfl_const_dt, t_save, t_stop, n_start, &
9090
cfl_target, surface_tension, bubbles_lagrange, &
9191
sim_data, hyperelasticity, Bx0, relativity, cont_damage, &
92-
num_bc_patches, igr, igr_order, recon_type, muscl_order
92+
num_bc_patches, igr, igr_order, recon_type, muscl_order
9393

9494
! Inquiring the status of the post_process.inp file
9595
file_loc = 'post_process.inp'

src/simulation/m_checker.fpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ contains
5050
call s_check_inputs_continuum_damage
5151
end if
5252

53-
call s_check_inputs_riemann_solver
5453
call s_check_inputs_time_stepping
5554
call s_check_inputs_stiffened_eos_viscosity
5655
call s_check_inputs_body_forces

src/simulation/m_mpi_proxy.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ contains
9999
& 'bc_y%beg', 'bc_y%end', 'bc_z%beg', 'bc_z%end', 'fd_order', &
100100
& 'num_probes', 'num_integrals', 'bubble_model', 'thermal', &
101101
& 'R0_type', 'num_source', 'relax_model', 'num_ibs', 'n_start', &
102-
& 'num_bc_patches', 'num_igr_iters', 'num_igr_warm_start_iters' ]
102+
& 'num_bc_patches', 'num_igr_iters', 'num_igr_warm_start_iters' ]
103103
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
104104
#:endfor
105105

src/simulation/m_muscl.fpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ module m_muscl
2020
s_finalize_muscl_module
2121

2222
integer :: v_size
23-
!$acc declare create(v_size)
23+
$:GPU_DECLARE(create='[v_size]')
2424

2525
type(int_bounds_info) :: is1_muscl, is2_muscl, is3_muscl
26-
!$acc declare create(is1_muscl, is2_muscl, is3_muscl)
26+
$:GPU_DECLARE(create='[is1_muscl,is2_muscl,is3_muscl]')
2727

2828
!> @name The cell-average variables that will be MUSCL-reconstructed. Formerly, they
2929
!! are stored in v_vf. However, they are transferred to v_rs_wsL and v_rs_wsR
@@ -35,7 +35,7 @@ module m_muscl
3535
!> @{
3636
real(wp), allocatable, dimension(:, :, :, :) :: v_rs_ws_x, v_rs_ws_y, v_rs_ws_z
3737
!> @}
38-
!$acc declare create (v_rs_ws_x, v_rs_ws_y, v_rs_ws_z)
38+
$:GPU_DECLARE(create='[v_rs_ws_x,v_rs_ws_y,v_rs_ws_z]')
3939

4040
contains
4141

@@ -109,15 +109,15 @@ contains
109109
is2_muscl = is2_muscl_d
110110
is3_muscl = is3_muscl_d
111111

112-
!$acc update device(is1_muscl, is2_muscl, is3_muscl)
112+
$:GPU_UPDATE(device='[is1_muscl,is2_muscl,is3_muscl]')
113113

114114
if (muscl_order /= 1) then
115115
call s_initialize_muscl(v_vf, muscl_dir)
116116
end if
117117

118118
if (muscl_order == 1) then
119119
if (muscl_dir == 1) then
120-
!$acc parallel loop collapse(4) default(present)
120+
$:GPU_PARALLEL_LOOP(collapse=4)
121121
do i = 1, ubound(v_vf, 1)
122122
do l = is3_muscl%beg, is3_muscl%end
123123
do k = is2_muscl%beg, is2_muscl%end
@@ -129,7 +129,7 @@ contains
129129
end do
130130
end do
131131
else if (muscl_dir == 2) then
132-
!$acc parallel loop collapse(4) default(present)
132+
$:GPU_PARALLEL_LOOP(collapse=4)
133133
do i = 1, ubound(v_vf, 1)
134134
do l = is3_muscl%beg, is3_muscl%end
135135
do k = is2_muscl%beg, is2_muscl%end
@@ -141,7 +141,7 @@ contains
141141
end do
142142
end do
143143
else if (muscl_dir == 3) then
144-
!$acc parallel loop collapse(4) default(present)
144+
$:GPU_PARALLEL_LOOP(collapse=4)
145145
do i = 1, ubound(v_vf, 1)
146146
do l = is3_muscl%beg, is3_muscl%end
147147
do k = is2_muscl%beg, is2_muscl%end
@@ -158,7 +158,7 @@ contains
158158
! MUSCL Reconstruction
159159
#:for MUSCL_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')]
160160
if (muscl_dir == ${MUSCL_DIR}$) then
161-
!$acc parallel loop gang collapse(4) default(present) private(slopeL, slopeR, slope)
161+
$:GPU_PARALLEL_LOOP(collapse=4,private='[slopeL,slopeR,slope]')
162162
do l = is3_muscl%beg, is3_muscl%end
163163
do k = is2_muscl%beg, is2_muscl%end
164164
do j = is1_muscl%beg, is1_muscl%end
@@ -208,7 +208,6 @@ contains
208208
end do
209209
end do
210210
end do
211-
!$acc end parallel loop
212211
end if
213212
#:endfor
214213
end if
@@ -239,7 +238,7 @@ contains
239238
#:for MUSCL_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')]
240239
if (muscl_dir == ${MUSCL_DIR}$) then
241240

242-
!$acc parallel loop collapse(3) gang vector default(present) private(aCL, aC, aCR, aTHINC, moncon, sign, qmin, qmax)
241+
$:GPU_PARALLEL_LOOP(collapse=3,private='[aCL,aC,aCR,aTHINC,moncon,sign,qmin,qmax]')
243242
do l = is3_muscl%beg, is3_muscl%end
244243
do k = is2_muscl%beg, is2_muscl%end
245244
do j = is1_muscl%beg, is1_muscl%end
@@ -310,10 +309,10 @@ contains
310309
! as to reshape the inputted data in the coordinate direction of
311310
! the muscl reconstruction
312311
v_size = ubound(v_vf, 1)
313-
!$acc update device(v_size)
312+
$:GPU_UPDATE(device='[v_size]')
314313

315314
if (muscl_dir == 1) then
316-
!$acc parallel loop collapse(4) gang vector default(present)
315+
$:GPU_PARALLEL_LOOP(collapse=4)
317316
do j = 1, v_size
318317
do q = is3_muscl%beg, is3_muscl%end
319318
do l = is2_muscl%beg, is2_muscl%end
@@ -323,14 +322,13 @@ contains
323322
end do
324323
end do
325324
end do
326-
!$acc end parallel loop
327325
end if
328326

329327
! Reshaping/Projecting onto Characteristic Fields in y-direction
330328
if (n == 0) return
331329

332330
if (muscl_dir == 2) then
333-
!$acc parallel loop collapse(4) gang vector default(present)
331+
$:GPU_PARALLEL_LOOP(collapse=4)
334332
do j = 1, v_size
335333
do q = is3_muscl%beg, is3_muscl%end
336334
do l = is2_muscl%beg, is2_muscl%end
@@ -340,13 +338,12 @@ contains
340338
end do
341339
end do
342340
end do
343-
!$acc end parallel loop
344341
end if
345342

346343
! Reshaping/Projecting onto Characteristic Fields in z-direction
347344
if (p == 0) return
348345
if (muscl_dir == 3) then
349-
!$acc parallel loop collapse(4) gang vector default(present)
346+
$:GPU_PARALLEL_LOOP(collapse=4)
350347
do j = 1, v_size
351348
do q = is3_muscl%beg, is3_muscl%end
352349
do l = is2_muscl%beg, is2_muscl%end
@@ -356,7 +353,6 @@ contains
356353
end do
357354
end do
358355
end do
359-
!$acc end parallel loop
360356
end if
361357

362358
end subroutine s_initialize_muscl

src/simulation/m_start_up.fpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ contains
168168
nb, mapped_weno, wenoz, teno, wenoz_q, weno_order, &
169169
num_fluids, mhd, relativity, igr_order, viscous, &
170170
igr_iter_solver, igr, igr_pres_lim, &
171-
nb, mapped_weno, wenoz, teno, wenoz_q, weno_order, num_fluids, mhd, relativity, &
172171
recon_type, muscl_order, muscl_lim, &
173172
#:endif
174173
Ca, Web, Re_inv, &
@@ -189,7 +188,7 @@ contains
189188
cont_damage, tau_star, cont_damage_s, alpha_bar, &
190189
alf_factor, num_igr_iters, &
191190
num_igr_warm_start_iters, &
192-
ic_eps, ic_beta
191+
int_comp, ic_eps, ic_beta
193192
! Checking that an input file has been provided by the user. If it
194193
! has, then the input file is read in, otherwise, simulation exits.
195194
inquire (FILE=trim(file_path), EXIST=file_exist)

src/simulation/m_viscous.fpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,8 +1004,7 @@ contains
10041004

10051005
end if
10061006

1007-
1008-
$:GPU_UPDATE(device='[is1_viscous, is2_viscous, is3_viscous, iv]')
1007+
$:GPU_UPDATE(device='[is1_viscous, is2_viscous, is3_viscous, iv]')
10091008
if (n > 0) then
10101009
if (p > 0) then
10111010
call s_${SCHEME}$ (v_vf(iv%beg:iv%end), &
@@ -1045,8 +1044,8 @@ contains
10451044
do j = is1_viscous%beg, is1_viscous%end
10461045
do k = is2_viscous%beg, is2_viscous%end
10471046
do l = is3_viscous%beg, is3_viscous%end
1048-
vL_prim_vf(i)%sf(k, j, l) = vL_y(j, k, l, i)
1049-
vR_prim_vf(i)%sf(k, j, l) = vR_y(j, k, l, i)
1047+
vL_prim_vf(i)%sf(l, k, j) = vL_z(j, k, l, i)
1048+
vR_prim_vf(i)%sf(l, k, j) = vR_z(j, k, l, i)
10501049
end do
10511050
end do
10521051
end do
@@ -1057,8 +1056,9 @@ contains
10571056
do l = is3_viscous%beg, is3_viscous%end
10581057
do k = is2_viscous%beg, is2_viscous%end
10591058
do j = is1_viscous%beg, is1_viscous%end
1060-
vL_prim_vf(i)%sf(l, k, j) = vL_z(j, k, l, i)
1061-
vR_prim_vf(i)%sf(l, k, j) = vR_z(j, k, l, i)
1059+
print *, i, l, k, j
1060+
vL_prim_vf(i)%sf(j, k, l) = vL_x(j, k, l, i)
1061+
vR_prim_vf(i)%sf(j, k, l) = vR_x(j, k, l, i)
10621062
end do
10631063
end do
10641064
end do
@@ -1145,8 +1145,8 @@ contains
11451145
do j = is1_viscous%beg, is1_viscous%end
11461146
do k = is2_viscous%beg, is2_viscous%end
11471147
do l = is3_viscous%beg, is3_viscous%end
1148-
vL_prim_vf(i)%sf(k, j, l) = vL_y(j, k, l, i)
1149-
vR_prim_vf(i)%sf(k, j, l) = vR_y(j, k, l, i)
1148+
vL_prim_vf(i)%sf(l, k, j) = vL_z(j, k, l, i)
1149+
vR_prim_vf(i)%sf(l, k, j) = vR_z(j, k, l, i)
11501150
end do
11511151
end do
11521152
end do

tests/10DE58AA/golden-metadata.txt

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)