Skip to content

Commit 81e4e98

Browse files
committed
Fix comment typos, remove dead code, apply ffmt S102/S081 formatting
1 parent eb81d5c commit 81e4e98

63 files changed

Lines changed: 1621 additions & 1632 deletions

Some content is hidden

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

src/common/include/1dHardcodedIC.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#:def Hardcoded1D()
77
select case (patch_icpp(patch_id)%hcid)
8-
case (150) ! 1D Smooth Alfven Case for MHD
8+
case (150) ! 1D Smooth Alfven Case for MHD
99
! velocity
1010
q_prim_vf(momxb + 1)%sf(i, 0, 0) = 0.1_wp*sin(2._wp*pi*x_cc(i))
1111
q_prim_vf(momxb + 2)%sf(i, 0, 0) = 0.1_wp*cos(2._wp*pi*x_cc(i))

src/common/include/2dHardcodedIC.fpp

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@
1717
#:enddef
1818

1919
#:def Hardcoded2D()
20-
select case (patch_icpp(patch_id)%hcid) ! 2D_hardcoded_ic example case
20+
select case (patch_icpp(patch_id)%hcid) ! 2D_hardcoded_ic example case
2121
case (200)
2222
if (y_cc(j) <= (-x_cc(i)**3 + 1)**(1._wp/3._wp)) then
2323
! Volume Fractions
2424
q_prim_vf(advxb)%sf(i, j, 0) = eps
2525
q_prim_vf(advxe)%sf(i, j, 0) = 1._wp - eps
26-
! Densities
2726
q_prim_vf(contxb)%sf(i, j, 0) = eps*1000._wp
2827
q_prim_vf(contxe)%sf(i, j, 0) = (1._wp - eps)*1._wp
29-
! Pressure
3028
q_prim_vf(E_idx)%sf(i, j, 0) = 1000._wp
3129
end if
32-
case (202) ! Gresho vortex (Gouasmi et al 2022 JCP)
30+
case (202) ! Gresho vortex (Gouasmi et al 2022 JCP)
3331
r = ((x_cc(i) - 0.5_wp)**2 + (y_cc(j) - 0.5_wp)**2)**0.5_wp
3432
rmax = 0.2_wp
3533

@@ -50,7 +48,7 @@
5048
q_prim_vf(momxe)%sf(i, j, 0) = 0._wp
5149
q_prim_vf(E_idx)%sf(i, j, 0) = p0 + umax**2*(-2 + 4*log(2._wp))
5250
end if
53-
case (203) ! Gresho vortex (Gouasmi et al 2022 JCP) with density correction
51+
case (203) ! Gresho vortex (Gouasmi et al 2022 JCP) with density correction
5452
r = ((x_cc(i) - 0.5_wp)**2._wp + (y_cc(j) - 0.5_wp)**2)**0.5_wp
5553
rmax = 0.2_wp
5654

@@ -73,7 +71,7 @@
7371
end if
7472

7573
q_prim_vf(contxb)%sf(i, j, 0) = q_prim_vf(E_idx)%sf(i, j, 0)**(1._wp/gam)
76-
case (204) ! Rayleigh-Taylor instability
74+
case (204) ! Rayleigh-Taylor instability
7775
rhoH = 3._wp
7876
rhoL = 1._wp
7977
pRef = 1.e5_wp
@@ -104,10 +102,10 @@
104102
pInt = pref + rhoH*9.81_wp*(1.2_wp - intH)
105103
q_prim_vf(E_idx)%sf(i, j, 0) = pInt + rhoL*9.81_wp*(intH - y_cc(j))
106104
end if
107-
case (205) ! 2D lung wave interaction problem
108-
h = 0.0_wp ! non dim origin y
109-
lam = 1.0_wp ! non dim lambda
110-
amp = patch_icpp(patch_id)%a(2) ! to be changed later! !non dim amplitude
105+
case (205) ! 2D lung wave interaction problem
106+
h = 0.0_wp ! non dim origin y
107+
lam = 1.0_wp ! non dim lambda
108+
amp = patch_icpp(patch_id)%a(2) ! to be changed later! !non dim amplitude
111109

112110
intH = amp*sin(2*pi*x_cc(i)/lam - pi/2) + h
113111

@@ -118,26 +116,26 @@
118116
q_prim_vf(advxb)%sf(i, j, 0) = patch_icpp(1)%alpha(1)
119117
q_prim_vf(advxe)%sf(i, j, 0) = patch_icpp(1)%alpha(2)
120118
end if
121-
case (206) ! 2D lung wave interaction problem - horizontal domain
122-
h = 0.0_wp ! non dim origin y
123-
lam = 1.0_wp ! non dim lambda
119+
case (206) ! 2D lung wave interaction problem - horizontal domain
120+
h = 0.0_wp ! non dim origin y
121+
lam = 1.0_wp ! non dim lambda
124122
amp = patch_icpp(patch_id)%a(2)
125123

126124
intL = amp*sin(2*pi*y_cc(j)/lam - pi/2) + h
127125

128-
if (x_cc(i) > intL) then ! this is the liquid
126+
if (x_cc(i) > intL) then ! this is the liquid
129127
q_prim_vf(contxb)%sf(i, j, 0) = patch_icpp(1)%alpha_rho(1)
130128
q_prim_vf(contxe)%sf(i, j, 0) = patch_icpp(1)%alpha_rho(2)
131129
q_prim_vf(E_idx)%sf(i, j, 0) = patch_icpp(1)%pres
132130
q_prim_vf(advxb)%sf(i, j, 0) = patch_icpp(1)%alpha(1)
133131
q_prim_vf(advxe)%sf(i, j, 0) = patch_icpp(1)%alpha(2)
134132
end if
135-
case (207) ! Kelvin Helmholtz Instability
133+
case (207) ! Kelvin Helmholtz Instability
136134
sigma = 0.05_wp/sqrt(2.0_wp)
137135
gauss1 = exp(-(y_cc(j) - 0.75_wp)**2/(2.0_wp*sigma**2))
138136
gauss2 = exp(-(y_cc(j) - 0.25_wp)**2/(2.0_wp*sigma**2))
139137
q_prim_vf(momxb + 1)%sf(i, j, 0) = 0.1_wp*sin(4.0_wp*pi*x_cc(i))*(gauss1 + gauss2)
140-
case (208) ! Richtmeyer Meshkov Instability
138+
case (208) ! Richtmeyer Meshkov Instability
141139
lam = 1.0_wp
142140
eps = 1.0e-6_wp
143141
ei = 5.0_wp
@@ -152,7 +150,7 @@
152150
q_prim_vf(advxb)%sf(i, j, 0) = alpha_sf6
153151
q_prim_vf(advxe)%sf(i, j, 0) = alpha_air
154152
end if
155-
case (250) ! MHD Orszag-Tang vortex
153+
case (250) ! MHD Orszag-Tang vortex
156154
! gamma = 5/3 rho = 25/(36*pi) p = 5/(12*pi) v = (-sin(2*pi*y), sin(2*pi*x), 0) B = (-sin(2*pi*y)/sqrt(4*pi),
157155
! sin(4*pi*x)/sqrt(4*pi), 0)
158156

@@ -161,7 +159,7 @@
161159

162160
q_prim_vf(B_idx%beg)%sf(i, j, 0) = -sin(2._wp*pi*y_cc(j))/sqrt(4._wp*pi)
163161
q_prim_vf(B_idx%beg + 1)%sf(i, j, 0) = sin(4._wp*pi*x_cc(i))/sqrt(4._wp*pi)
164-
case (251) ! RMHD Cylindrical Blast Wave [Mignone, 2006: Section 4.3.1]
162+
case (251) ! RMHD Cylindrical Blast Wave [Mignone, 2006: Section 4.3.1]
165163
if (x_cc(i)**2 + y_cc(j)**2 < 0.08_wp**2) then
166164
q_prim_vf(contxb)%sf(i, j, 0) = 0.01
167165
q_prim_vf(E_idx)%sf(i, j, 0) = 1.0
@@ -176,7 +174,7 @@
176174
end if
177175

178176
! case 252 is for the 2D MHD Rotor problem
179-
case (252) ! 2D MHD Rotor Problem
177+
case (252) ! 2D MHD Rotor Problem
180178
! Ambient conditions are set in the JSON file. This case imposes the dense, rotating cylinder.
181179
!
182180
! gamma = 1.4 Ambient medium (r > 0.1): rho = 1, p = 1, v = 0, B = (1,0,0) Rotor (r <= 0.1): rho = 10, p = 1 v has angular
@@ -202,7 +200,7 @@
202200
q_prim_vf(momxb)%sf(i, j, 0) = -(2._wp/sqrt(r_sq))*(y_cc(j) - 0.5_wp)*(0.115_wp - sqrt(r_sq))/(0.015_wp)
203201
q_prim_vf(momxb + 1)%sf(i, j, 0) = (2._wp/sqrt(r_sq))*(x_cc(i) - 0.5_wp)*(0.115_wp - sqrt(r_sq))/(0.015_wp)
204202
end if
205-
case (253) ! MHD Smooth Magnetic Vortex
203+
case (253) ! MHD Smooth Magnetic Vortex
206204
! Section 5.2 of Implicit hybridized discontinuous Galerkin methods for compressible magnetohydrodynamics C. Ciuca, P.
207205
! Fernandez, A. Christophe, N.C. Nguyen, J. Peraire
208206

@@ -217,7 +215,7 @@
217215
! pressure
218216
q_prim_vf(E_idx)%sf(i, j, &
219217
& 0) = 1._wp + (1 - 2._wp*(x_cc(i)**2 + y_cc(j)**2))*exp(1 - (x_cc(i)**2 + y_cc(j)**2))/((2._wp*pi)**3)
220-
case (260) ! Gaussian Divergence Pulse
218+
case (260) ! Gaussian Divergence Pulse
221219
! Bx(x) = 1 + C * erf((x-0.5)/\sigma) => \partialBx/\partialx = C * (2/\sqrt\pi) * exp[-((x-0.5)/\sigma)**2] * (1/\sigma)
222220
! Choose C = \epsilon * \sigma * \sqrt\pi / 2 => \partialBx/\partialx = \epsilon * exp[-((x-0.5)/\sigma)**2] \psi is
223221
! initialized to zero everywhere.
@@ -228,7 +226,7 @@
228226

229227
! B-field
230228
q_prim_vf(B_idx%beg)%sf(i, j, 0) = 1._wp + C_mhd*erf((x_cc(i) - 0.5_wp)/sigma)
231-
case (261) ! Blob
229+
case (261) ! Blob
232230
r0 = 1._wp/sqrt(8._wp)
233231
r2 = x_cc(i)**2 + y_cc(j)**2
234232
r = sqrt(r2)
@@ -239,7 +237,7 @@
239237
! q_prim_vf(B_idx%beg)%sf(i,j,0) = 1._wp/(4._wp*pi) * (alpha**8 - 2._wp*alpha**4 + 1._wp) q_prim_vf(E_idx)%sf(i,j,0) =
240238
! 6._wp - q_prim_vf(B_idx%beg)%sf(i,j,0)**2/2._wp
241239
end if
242-
case (262) ! Tilted 2D MHD shock‐tube at α = arctan2 (≈63.4°)
240+
case (262) ! Tilted 2D MHD shock‐tube at α = arctan2 (≈63.4°)
243241
! rotate by \alpha = atan(2)
244242
alpha = atan(2._wp)
245243
cosA = cos(alpha)

src/common/include/3dHardcodedIC.fpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
real(wp), dimension(:), allocatable :: y_th_arr, z_th_arr, r_th_arr
88
! Variables to describe initial condition of jet
99
real(wp) :: r, ux_th, ux_am, p_th, p_am, rho_th, rho_am, y_th, z_th, r_th, eps_smooth
10-
real(wp) :: rcut, xcut ! Intermediate variables for creating smooth initial condition
10+
real(wp) :: rcut, xcut ! Intermediate variables for creating smooth initial condition
1111
real(wp), dimension(0:n, 0:p) :: rcut_arr
12-
integer :: l, q, s ! Iterators for reading input files
13-
integer :: start, end ! Ints to keep track of position in file
14-
character(len=1000) :: line ! String to store line in file
15-
character(len=25) :: value ! String to store value in line
16-
integer :: NJet ! Number of jets
12+
integer :: l, q, s ! Iterators for reading input files
13+
integer :: start, end ! Ints to keep track of position in file
14+
character(len=1000) :: line ! String to store line in file
15+
character(len=25) :: value ! String to store value in line
16+
integer :: NJet ! Number of jets
1717

1818
eps = 1e-9_wp
1919

@@ -29,19 +29,19 @@
2929

3030
open (unit=10, file="jets.csv", status="old", action="read")
3131
do q = 0, NJet - 1
32-
read (10, '(A)') line ! Read a full line as a string
32+
read (10, '(A)') line ! Read a full line as a string
3333
start = 1
3434

3535
do l = 0, 2
36-
end = index(line(start:), ',') ! Find the next comma
36+
end = index(line(start:), ',') ! Find the next comma
3737
if (end == 0) then
38-
value = trim(adjustl(line(start:))) ! Last value in the line
38+
value = trim(adjustl(line(start:))) ! Last value in the line
3939
else
40-
value = trim(adjustl(line(start:start + end - 2))) ! Extract substring
41-
start = start + end ! Move to next value
40+
value = trim(adjustl(line(start:start + end - 2))) ! Extract substring
41+
start = start + end ! Move to next value
4242
end if
4343
if (l == 0) then
44-
read (value, *) y_th_arr(q) ! Convert string to numeric value
44+
read (value, *) y_th_arr(q) ! Convert string to numeric value
4545
else if (l == 1) then
4646
read (value, *) z_th_arr(q)
4747
else
@@ -66,7 +66,7 @@
6666

6767
#:def Hardcoded3D()
6868
select case (patch_icpp(patch_id)%hcid)
69-
case (300) ! Rayleigh-Taylor instability
69+
case (300) ! Rayleigh-Taylor instability
7070
rhoH = 3._wp
7171
rhoL = 1._wp
7272
pRef = 1.e5_wp
@@ -97,7 +97,7 @@
9797
pInt = pref + rhoH*9.81_wp*(1.2_wp - intH)
9898
q_prim_vf(E_idx)%sf(i, j, k) = pInt + rhoL*9.81_wp*(intH - y_cc(j))
9999
end if
100-
case (301) ! (3D lung geometry in X direction, |sin(*)+sin(*)|)
100+
case (301) ! (3D lung geometry in X direction, |sin(*)+sin(*)|)
101101
h = 0.0_wp
102102
lam = 1.0_wp
103103
amp = patch_icpp(patch_id)%a(2)
@@ -109,7 +109,7 @@
109109
q_prim_vf(advxb)%sf(i, j, k) = patch_icpp(1)%alpha(1)
110110
q_prim_vf(advxe)%sf(i, j, k) = patch_icpp(1)%alpha(2)
111111
end if
112-
case (302) ! 3D Jet with IGR
112+
case (302) ! 3D Jet with IGR
113113
ux_th = 10*sqrt(1.4*0.4)
114114
ux_am = 0.0*sqrt(1.4)
115115
p_th = 2.0_wp
@@ -139,7 +139,7 @@
139139
end if
140140

141141
q_prim_vf(E_idx)%sf(i, j, k) = p_th*rcut*xcut + p_am
142-
case (303) ! 3D Multijet
142+
case (303) ! 3D Multijet
143143
eps_smooth = 3.0_wp
144144
ux_th = 10*sqrt(1.4*0.4)
145145
ux_am = 2.5*sqrt(1.4*0.4)

src/common/include/ExtrusionHardcodedIC.fpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@
4040
integer :: f, iter, ios, ios2, unit, unit2, idx, idy, index_x, index_y, jump, line_count, ycount
4141
real(wp) :: x_len, x_step, y_len, y_step
4242
real(wp) :: dummy_x, dummy_y, dummy_z, x0, y0
43-
integer :: global_offset_x, global_offset_y ! MPI subdomain offset
43+
integer :: global_offset_x, global_offset_y ! MPI subdomain offset
4444
real(wp) :: delta_x, delta_y
45-
character(len=100), dimension(sys_size) :: fileNames ! Arrays to store all data from files
45+
character(len=100), dimension(sys_size) :: fileNames ! Arrays to store all data from files
4646
character(len=200) :: errmsg
4747
real(wp), allocatable :: stored_values(:,:,:)
4848
real(wp), allocatable :: x_coords(:), y_coords(:)
4949
logical :: files_loaded = .false.
5050
real(wp) :: domain_xstart, domain_xend, domain_ystart, domain_yend
51-
character(len=*), parameter :: init_dir = "/home/MFC/FilesDirectory" ! For example /home/MFC/examples/1D_Shock/D/
52-
character(len=20) :: file_num_str ! For storing the file number as a string
53-
character(len=20) :: zeros_part ! For the trailing zeros part
54-
character(len=6), parameter :: zeros_default = "000000" ! Default zeros (can be changed)
51+
character(len=*), parameter :: init_dir = "/home/MFC/FilesDirectory" ! For example /home/MFC/examples/1D_Shock/D/
52+
character(len=20) :: file_num_str ! For storing the file number as a string
53+
character(len=20) :: zeros_part ! For the trailing zeros part
54+
character(len=6), parameter :: zeros_default = "000000" ! Default zeros (can be changed)
5555
#:enddef
5656

5757
#:def HardcodedReadValues()
@@ -67,7 +67,7 @@
6767
if (ios2 /= 0) call s_mpi_abort("Error opening file: " // trim(fileNames(1)))
6868

6969
select case (num_dims)
70-
case (1, 2) ! 1D and 2D cases are similar
70+
case (1, 2) ! 1D and 2D cases are similar
7171
! Count lines
7272
line_count = 0
7373
do
@@ -100,7 +100,7 @@
100100
x_step = x_cc(1) - x_cc(0)
101101
delta_x = merge(x_cc(0) - domain_xstart + x_step/2.0, x_cc(index_x) - domain_xstart + x_step/2.0, num_dims == 1)
102102
global_offset_x = nint(abs(delta_x)/x_step)
103-
case (3) ! 3D case - determine grid structure
103+
case (3) ! 3D case - determine grid structure
104104
! Find yRows by counting rows with same x
105105
read (unit2, *, iostat=ios2) x0, y0, dummy_z
106106
if (ios2 /= 0) call s_mpi_abort("Error reading first line")

0 commit comments

Comments
 (0)