1+ ! >
2+ ! ! @file m_viscous.f90
3+ ! ! @brief Contains module m_viscous
4+
5+ ! > @brief The module contains the subroutines used to
6+
7+
18module m_viscous
29
310 ! Dependencies =============================================================
@@ -10,7 +17,8 @@ module m_viscous
1017
1118 private ; public s_get_viscous, &
1219 s_compute_viscous_stress_tensor, &
13- s_initialize_viscous_module
20+ s_initialize_viscous_module, &
21+ s_finalize_viscous_module
1422
1523 type (int_bounds_info) :: iv
1624
@@ -36,19 +44,14 @@ subroutine s_initialize_viscous_module()
3644 end do
3745! $acc update device(gammas, pi_infs)
3846
39- if (any (Re_size > 0 )) then
40- allocate (Res(1 :2 , 1 :maxval (Re_size)))
41- end if
47+ allocate (Res(1 :2 , 1 :maxval (Re_size)))
4248
43- if (any (Re_size > 0 )) then
44- do i = 1 , 2
45- do j = 1 , Re_size(i)
46- Res(i, j) = fluid_pp(Re_idx(i, j))% Re(i)
47- end do
49+ do i = 1 , 2
50+ do j = 1 , Re_size(i)
51+ Res(i, j) = fluid_pp(Re_idx(i, j))% Re(i)
4852 end do
53+ end do
4954! $acc update device(Res, Re_idx, Re_size)
50- end if
51-
5255
5356 momxb = mom_idx% beg
5457 momxe = mom_idx% end
@@ -85,27 +88,6 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
8588
8689 type (int_bounds_info) :: ix, iy, iz
8790
88- ! ix%beg = -buff_size; iy%beg = 0; iz%beg = 0
89- ! if (n > 0) iy%beg = -buff_size; if (p > 0) iz%beg = -buff_size
90- ! ix%end = m - ix%beg; iy%end = n - iy%beg; iz%end = p - iz%beg
91-
92- ! $acc update device(ix, iy, iz)
93-
94- do i = 1 , num_dims
95- allocate (tau_Re_vf(cont_idx% end + i)% sf(ix% beg:ix% end, &
96- iy% beg:iy% end, &
97- iz% beg:iz% end))
98- ! $acc enter data create(tau_Re_vf(cont_idx%end + i)%sf(ix%beg:ix%end, &
99- ! $acc iy%beg:iy%end, &
100- ! $acc iz%beg:iz%end))
101- end do
102- allocate (tau_Re_vf(E_idx)% sf(ix% beg:ix% end, &
103- iy% beg:iy% end, &
104- iz% beg:iz% end))
105- ! $acc enter data create (tau_Re_vf(E_idx)%sf(ix%beg:ix%end, &
106- ! $acc iy%beg:iy%end, &
107- ! $acc iz%beg:iz%end))
108-
10991 ! $acc parallel loop collapse(3) gang vector default(present)
11092 do l = iz% beg, iz% end
11193 do k = iy% beg, iy% end
@@ -1390,4 +1372,9 @@ subroutine s_reconstruct_cell_boundary_values_visc(v_vf, vL_x_flat, vL_y_flat, v
13901372
13911373 end subroutine s_reconstruct_cell_boundary_values_visc ! --------------------
13921374
1375+ subroutine s_finalize_viscous_module ()
1376+ deallocate (gammas, pi_infs)
1377+ allocate (Res(1 :2 , 1 :maxval (Re_size)))
1378+ end subroutine s_finalize_viscous_module
1379+
13931380end module m_viscous
0 commit comments