Skip to content

Commit 864d36e

Browse files
authored
Pre_Proccess, Added Intent, Comments, and Formatting (#483)
1 parent 1fb1fd3 commit 864d36e

12 files changed

+455
-363
lines changed

src/pre_process/m_assign_variables.f90

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,30 @@ module m_assign_variables
3535
!! @param j (x) cell index in which the mixture or species primitive variables from the indicated patch areassigned
3636
!! @param k (y,th) cell index in which the mixture or species primitive variables from the indicated patch areassigned
3737
!! @param l (z) cell index in which the mixture or species primitive variables from the indicated patch areassigned
38+
!! @param eta pseudo volume fraction
39+
!! @param q_prim_vf Primitive variables
40+
!! @param patch_id_fp Array to track patch ids
3841
subroutine s_assign_patch_xxxxx_primitive_variables(patch_id, j, k, l, &
3942
eta, q_prim_vf, patch_id_fp)
4043

4144
import :: scalar_field, sys_size, n, m, p
4245

43-
integer, intent(IN) :: patch_id
44-
integer, intent(IN) :: j, k, l
45-
integer, intent(INOUT), dimension(0:m, 0:n, 0:p) :: patch_id_fp
46-
type(scalar_field), dimension(1:sys_size) :: q_prim_vf
47-
real(kind(0d0)) :: eta !<
46+
integer, intent(in) :: patch_id
47+
integer, intent(in) :: j, k, l
48+
real(kind(0d0)), intent(in) :: eta
49+
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
50+
integer, dimension(0:m, 0:n, 0:p), intent(inout) :: patch_id_fp
4851

4952
end subroutine s_assign_patch_xxxxx_primitive_variables
5053

5154
end interface
5255

53-
private; public :: s_initialize_assign_variables_module, &
54-
s_assign_patch_primitive_variables, &
55-
s_assign_patch_mixture_primitive_variables, &
56-
s_assign_patch_species_primitive_variables, &
57-
s_finalize_assign_variables_module
56+
private;
57+
public :: s_initialize_assign_variables_module, &
58+
s_assign_patch_primitive_variables, &
59+
s_assign_patch_mixture_primitive_variables, &
60+
s_assign_patch_species_primitive_variables, &
61+
s_finalize_assign_variables_module
5862

5963
contains
6064

@@ -87,19 +91,21 @@ end subroutine s_initialize_assign_variables_module
8791
!! with those of the smoothing patch. The specific details
8892
!! of the combination may be found in Shyue's work (1998).
8993
!! @param patch_id the patch identifier
90-
!! @param j the x-dir node index
91-
!! @param k the y-dir node index
92-
!! @param l the z-dir node index
94+
!! @param j the x-dir node index
95+
!! @param k the y-dir node index
96+
!! @param l the z-dir node index
97+
!! @param eta pseudo volume fraction
98+
!! @param q_prim_vf Primitive variables
99+
!! @param patch_id_fp Array to track patch ids
93100
subroutine s_assign_patch_mixture_primitive_variables(patch_id, j, k, l, &
94101
eta, q_prim_vf, patch_id_fp)
95-
96102
!$acc routine seq
97-
integer, intent(IN) :: patch_id
98-
integer, intent(INOUT), dimension(0:m, 0:n, 0:p) :: patch_id_fp
99-
type(scalar_field), dimension(1:sys_size) :: q_prim_vf
100-
real(kind(0d0)) :: eta !<
101103

102-
integer, intent(IN) :: j, k, l
104+
integer, intent(in) :: patch_id
105+
integer, intent(in) :: j, k, l
106+
real(kind(0d0)), intent(in) :: eta
107+
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
108+
integer, dimension(0:m, 0:n, 0:p), intent(inout) :: patch_id_fp
103109

104110
real(kind(0d0)) :: rho !< density
105111
real(kind(0d0)), dimension(int(E_idx - mom_idx%beg)) :: vel !< velocity
@@ -155,10 +161,14 @@ subroutine s_assign_patch_mixture_primitive_variables(patch_id, j, k, l, &
155161
end subroutine s_assign_patch_mixture_primitive_variables ! ------------
156162

157163
!Stable perturbation in pressure (Ando)
164+
!! @param j the x-dir node index
165+
!! @param k the y-dir node index
166+
!! @param l the z-dir node index
167+
!! @param q_prim_vf Primitive variables
158168
subroutine s_perturb_primitive(j, k, l, q_prim_vf)
159169

160-
type(scalar_field), dimension(1:sys_size), intent(INOUT) :: q_prim_vf
161-
integer, intent(IN) :: j, k, l
170+
integer, intent(in) :: j, k, l
171+
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
162172

163173
integer :: i
164174
real(kind(0d0)) :: pres_mag, loc, n_tait, B_tait, p0
@@ -233,27 +243,30 @@ end subroutine s_perturb_primitive
233243
!! s_assign_patch_species_primitive_variables with adaptation for
234244
!! ensemble-averaged bubble modeling
235245
!! @param patch_id the patch identifier
236-
!! @param j the x-dir node index
237-
!! @param k the y-dir node index
238-
!! @param l the z-dir node index
246+
!! @param j the x-dir node index
247+
!! @param k the y-dir node index
248+
!! @param l the z-dir node index
249+
!! @param eta pseudo volume fraction
250+
!! @param q_prim_vf Primitive variables
251+
!! @param patch_id_fp Array to track patch ids
239252
subroutine s_assign_patch_species_primitive_variables(patch_id, j, k, l, &
240253
eta, q_prim_vf, patch_id_fp)
241-
242254
!$acc routine seq
243-
integer, intent(IN) :: patch_id
244-
integer, intent(INOUT), dimension(0:m, 0:n, 0:p) :: patch_id_fp
245-
type(scalar_field), dimension(1:sys_size) :: q_prim_vf
246-
real(kind(0d0)) :: eta !<
247-
integer, intent(IN) :: j, k, l
255+
256+
integer, intent(in) :: patch_id
257+
integer, intent(in) :: j, k, l
258+
real(kind(0d0)), intent(in) :: eta
259+
integer, dimension(0:m, 0:n, 0:p), intent(inout) :: patch_id_fp
260+
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
248261

249262
! Density, the specific heat ratio function and the liquid stiffness
250263
! function, respectively, obtained from the combination of primitive
251264
! variables of the current and smoothing patches
252-
real(kind(0d0)) :: rho !< density
265+
real(kind(0d0)) :: rho !< density
253266
real(kind(0d0)) :: gamma
254-
real(kind(0d0)) :: lit_gamma !< specific heat ratio
255-
real(kind(0d0)) :: pi_inf !< stiffness from SEOS
256-
real(kind(0d0)) :: qv !< reference energy from SEOS
267+
real(kind(0d0)) :: lit_gamma !< specific heat ratio
268+
real(kind(0d0)) :: pi_inf !< stiffness from SEOS
269+
real(kind(0d0)) :: qv !< reference energy from SEOS
257270
real(kind(0d0)) :: orig_rho
258271
real(kind(0d0)) :: orig_gamma
259272
real(kind(0d0)) :: orig_pi_inf

src/pre_process/m_check_ib_patches.fpp

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ module m_check_ib_patches
2323

2424
implicit none
2525

26-
private; public :: s_check_ib_patches
26+
private;
27+
public :: s_check_ib_patches
2728

2829
character(len=10) :: iStr
2930

3031
contains
3132

32-
subroutine s_check_ib_patches()
33-
34-
! integer, intent(in) :: i
33+
subroutine s_check_ib_patches
3534

3635
integer :: i
3736

@@ -76,7 +75,8 @@ contains
7675
!! @param patch_id Patch identifier
7776
subroutine s_check_circle_ib_patch_geometry(patch_id) ! -------------------
7877

79-
integer, intent(IN) :: patch_id
78+
integer, intent(in) :: patch_id
79+
8080
call s_int_to_str(patch_id, iStr)
8181

8282
! Constraints on the geometric parameters of the circle patch
@@ -94,12 +94,17 @@ contains
9494

9595
end subroutine s_check_circle_ib_patch_geometry ! -------------------------
9696

97+
!> This subroutine verifies that the geometric parameters of
98+
!! the airfoil patch have consistently been inputted by the
99+
!! user.
100+
!! @param patch_id Patch identifier
97101
subroutine s_check_airfoil_ib_patch_geometry(patch_id) ! -------------------
98102

99-
integer, intent(IN) :: patch_id
103+
integer, intent(in) :: patch_id
104+
100105
call s_int_to_str(patch_id, iStr)
101106

102-
! Constraints on the geometric parameters of the circle patch
107+
! Constraints on the geometric parameters of the airfoil patch
103108
if (n == 0 .or. p > 0 .or. patch_ib(patch_id)%c <= 0d0 &
104109
.or. patch_ib(patch_id)%p <= 0d0 .or. patch_ib(patch_id)%t <= 0d0 &
105110
.or. patch_ib(patch_id)%m <= 0d0 .or. patch_ib(patch_id)%x_centroid == dflt_real &
@@ -113,12 +118,17 @@ contains
113118

114119
end subroutine s_check_airfoil_ib_patch_geometry ! -------------------------
115120

121+
!> This subroutine verifies that the geometric parameters of
122+
!! the 3d airfoil patch have consistently been inputted by the
123+
!! user.
124+
!! @param patch_id Patch identifier
116125
subroutine s_check_3d_airfoil_ib_patch_geometry(patch_id) ! -------------------
117126

118-
integer, intent(IN) :: patch_id
127+
integer, intent(in) :: patch_id
128+
119129
call s_int_to_str(patch_id, iStr)
120130

121-
! Constraints on the geometric parameters of the circle patch
131+
! Constraints on the geometric parameters of the 3d airfoil patch
122132
if (n == 0 .or. p == 0 .or. patch_ib(patch_id)%c <= 0d0 &
123133
.or. patch_ib(patch_id)%p <= 0d0 .or. patch_ib(patch_id)%t <= 0d0 &
124134
.or. patch_ib(patch_id)%m <= 0d0 .or. patch_ib(patch_id)%x_centroid == dflt_real &
@@ -139,7 +149,8 @@ contains
139149
!! @param patch_id Patch identifier
140150
subroutine s_check_rectangle_ib_patch_geometry(patch_id) ! ----------------
141151

142-
integer, intent(IN) :: patch_id
152+
integer, intent(in) :: patch_id
153+
143154
call s_int_to_str(patch_id, iStr)
144155

145156
! Constraints on the geometric parameters of the rectangle patch
@@ -167,10 +178,11 @@ contains
167178
!! @param patch_id Patch identifier
168179
subroutine s_check_sphere_ib_patch_geometry(patch_id) ! ----------------
169180

170-
integer, intent(IN) :: patch_id
181+
integer, intent(in) :: patch_id
182+
171183
call s_int_to_str(patch_id, iStr)
172184

173-
! Constraints on the geometric parameters of the rectangle patch
185+
! Constraints on the geometric parameters of the sphere patch
174186
if (n == 0 .or. p == 0 &
175187
.or. &
176188
patch_ib(patch_id)%x_centroid == dflt_real &
@@ -195,8 +207,8 @@ contains
195207
!! @param patch_id Patch identifier
196208
subroutine s_check_cylinder_ib_patch_geometry(patch_id) ! -----------------
197209

198-
! Patch identifier
199-
integer, intent(IN) :: patch_id
210+
integer, intent(in) :: patch_id
211+
200212
call s_int_to_str(patch_id, iStr)
201213

202214
! Constraints on the geometric parameters of the cylinder patch
@@ -239,7 +251,8 @@ contains
239251
!! @param patch_id Patch identifier
240252
subroutine s_check_inactive_ib_patch_geometry(patch_id) ! -----------------
241253

242-
integer, intent(IN) :: patch_id
254+
integer, intent(in) :: patch_id
255+
243256
call s_int_to_str(patch_id, iStr)
244257

245258
! Constraints on the geometric parameters of the inactive patch

0 commit comments

Comments
 (0)