Skip to content

Commit 2a2d3d1

Browse files
authored
Simulation, Added Intent, and Formatting (#487)
1 parent fc85a76 commit 2a2d3d1

22 files changed

+471
-467
lines changed

src/simulation/m_body_forces.fpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ module m_body_forces
1919

2020
implicit none
2121

22-
private; public :: s_compute_body_forces_rhs, &
23-
s_initialize_body_forces_module, &
24-
s_finalize_body_forces_module
22+
private;
23+
public :: s_compute_body_forces_rhs, &
24+
s_initialize_body_forces_module, &
25+
s_finalize_body_forces_module
2526

2627
#ifdef CRAY_ACC_WAR
2728
@:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:, :, :), rhoM)
@@ -35,7 +36,7 @@ contains
3536

3637
!> This subroutine inializes the module global array of mixture
3738
!! densities in each grid cell
38-
subroutine s_initialize_body_forces_module()
39+
subroutine s_initialize_body_forces_module
3940

4041
! Simulation is at least 2D
4142
if (n > 0) then
@@ -62,7 +63,7 @@ contains
6263
!> This subroutine computes the acceleration at time t
6364
subroutine s_compute_acceleration(t)
6465

65-
real(kind(0d0)) :: t
66+
real(kind(0d0)), intent(in) :: t
6667

6768
if (m > 0) then
6869
accel_bf(1) = g_x + k_x*sin(w_x*t - p_x)
@@ -80,9 +81,10 @@ contains
8081

8182
!> This subroutine calculates the mixture density at each cell
8283
!! center
84+
!! param q_cons_vf Conservative variable
8385
subroutine s_compute_mixture_density(q_cons_vf)
8486

85-
type(scalar_field), dimension(sys_size), intent(IN) :: q_cons_vf
87+
type(scalar_field), dimension(sys_size), intent(in) :: q_cons_vf
8688
integer :: i, j, k, l !< standard iterators
8789

8890
!$acc parallel loop collapse(3) gang vector default(present)
@@ -102,11 +104,13 @@ contains
102104

103105
!> This subroutine calculates the source term due to body forces
104106
!! so the system can be advanced in time
107+
!! @param q_cons_vf Conservative variables
108+
!! @param q_prim_vf Primitive variables
105109
subroutine s_compute_body_forces_rhs(q_cons_vf, q_prim_vf, rhs_vf)
106110

107-
type(scalar_field), dimension(sys_size), intent(IN) :: q_prim_vf
108-
type(scalar_field), dimension(sys_size), intent(IN) :: q_cons_vf
109-
type(scalar_field), dimension(sys_size), intent(INOUT) :: rhs_vf
111+
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf
112+
type(scalar_field), dimension(sys_size), intent(in) :: q_cons_vf
113+
type(scalar_field), dimension(sys_size), intent(inout) :: rhs_vf
110114

111115
integer :: i, j, k, l !< Loop variables
112116

@@ -172,7 +176,7 @@ contains
172176

173177
end subroutine s_compute_body_forces_rhs
174178

175-
subroutine s_finalize_body_forces_module()
179+
subroutine s_finalize_body_forces_module
176180

177181
@:DEALLOCATE_GLOBAL(rhoM)
178182

src/simulation/m_boundary_conditions.fpp

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@ module m_boundary_conditions
1818

1919
implicit none
2020

21-
private; public :: s_populate_primitive_variables_buffers, &
22-
s_populate_capillary_buffers
21+
private;
22+
public :: s_populate_primitive_variables_buffers, &
23+
s_populate_capillary_buffers
2324

2425
contains
2526

2627
!> The purpose of this procedure is to populate the buffers
27-
!! of the conservative variables, depending on the selected
28+
!! of the primitive variables, depending on the selected
2829
!! boundary conditions.
30+
!! @param q_prim_vf Primitive variable
2931
subroutine s_populate_primitive_variables_buffers(q_prim_vf, pb, mv)
3032

31-
type(scalar_field), dimension(sys_size) :: q_prim_vf
32-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
33+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
34+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
35+
3336
integer :: bc_loc, bc_dir
3437

3538
! Population of Buffers in x-direction =============================
@@ -214,9 +217,9 @@ contains
214217

215218
subroutine s_ghost_cell_extrapolation(q_prim_vf, pb, mv, bc_dir, bc_loc)
216219

217-
type(scalar_field), dimension(sys_size) :: q_prim_vf
218-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
219-
integer :: bc_dir, bc_loc
220+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
221+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
222+
integer, intent(in) :: bc_dir, bc_loc
220223
integer :: j, k, l, q, i
221224

222225
!< x-direction =========================================================
@@ -325,9 +328,10 @@ contains
325328

326329
subroutine s_symmetry(q_prim_vf, pb, mv, bc_dir, bc_loc)
327330

328-
type(scalar_field), dimension(sys_size) :: q_prim_vf
329-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
330-
integer :: bc_dir, bc_loc
331+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
332+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
333+
integer, intent(in) :: bc_dir, bc_loc
334+
331335
integer :: j, k, l, q, i
332336

333337
!< x-direction =========================================================
@@ -606,9 +610,10 @@ contains
606610

607611
subroutine s_periodic(q_prim_vf, pb, mv, bc_dir, bc_loc)
608612

609-
type(scalar_field), dimension(sys_size) :: q_prim_vf
610-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
611-
integer :: bc_dir, bc_loc
613+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
614+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
615+
integer, intent(in) :: bc_dir, bc_loc
616+
612617
integer :: j, k, l, q, i
613618

614619
!< x-direction =========================================================
@@ -825,9 +830,10 @@ contains
825830

826831
subroutine s_axis(q_prim_vf, pb, mv, bc_dir, bc_loc)
827832

828-
type(scalar_field), dimension(sys_size) :: q_prim_vf
829-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
830-
integer :: bc_dir, bc_loc
833+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
834+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
835+
integer, intent(in) :: bc_dir, bc_loc
836+
831837
integer :: j, k, l, q, i
832838

833839
!$acc parallel loop collapse(3) gang vector default(present)
@@ -897,9 +903,10 @@ contains
897903

898904
subroutine s_slip_wall(q_prim_vf, pb, mv, bc_dir, bc_loc)
899905

900-
type(scalar_field), dimension(sys_size) :: q_prim_vf
901-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
902-
integer :: bc_dir, bc_loc
906+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
907+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
908+
integer, intent(in) :: bc_dir, bc_loc
909+
903910
integer :: j, k, l, q, i
904911

905912
!< x-direction =========================================================
@@ -1038,9 +1045,10 @@ contains
10381045

10391046
subroutine s_no_slip_wall(q_prim_vf, pb, mv, bc_dir, bc_loc)
10401047

1041-
type(scalar_field), dimension(sys_size) :: q_prim_vf
1042-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
1043-
integer :: bc_dir, bc_loc
1048+
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
1049+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
1050+
integer, intent(in) :: bc_dir, bc_loc
1051+
10441052
integer :: j, k, l, q, i
10451053

10461054
!< x-direction =========================================================
@@ -1215,8 +1223,9 @@ contains
12151223

12161224
subroutine s_qbmm_extrapolation(pb, mv, bc_dir, bc_loc)
12171225

1218-
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(INOUT) :: pb, mv
1219-
integer :: bc_dir, bc_loc
1226+
real(kind(0d0)), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, mv
1227+
integer, intent(in) :: bc_dir, bc_loc
1228+
12201229
integer :: j, k, l, q, i
12211230

12221231
!< x-direction =========================================================
@@ -1348,7 +1357,7 @@ contains
13481357

13491358
subroutine s_populate_capillary_buffers(c_divs)
13501359

1351-
type(scalar_field), dimension(num_dims + 1) :: c_divs
1360+
type(scalar_field), dimension(num_dims + 1), intent(inout) :: c_divs
13521361
integer :: i, j, k, l
13531362

13541363
! x - direction

0 commit comments

Comments
 (0)