Skip to content

Commit f362a79

Browse files
sbryngelsonclaude
andcommitted
Redo Fortran source doc fixes without comment mangling
Previous commit used an overly broad regex that stripped @param, @brief, and first words from comments across all .fpp files. Restore all source files from master and re-apply only: - Remove filename args from @file directives (58 files) - Convert raw $...$ math to \f$...\f$ in m_riemann_solvers.fpp - Add @cond/@endcond for #ifdef blocks with vendor attributes - Fix stale @param name in m_data_input.f90 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e04506b commit f362a79

78 files changed

Lines changed: 5149 additions & 5173 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: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
#:def Hardcoded1DVariables()
2-
! any declaration of intermediate variables here
2+
! Place any declaration of intermediate variables here
33
real(wp) :: x_mid_diffu, width_sq, profile_shape, temp, molar_mass_inv, y1, y2, y3, y4
44
#:enddef
55

66
#:def Hardcoded1D()
77
select case (patch_icpp(patch_id)%hcid)
88
case (150) ! 1D Smooth Alfven Case for MHD
9-
!
9+
! 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))
1212

13-
! field
13+
! magnetic field
1414
q_prim_vf(B_idx%end - 1)%sf(i, 0, 0) = 0.1_wp*sin(2._wp*pi*x_cc(i))
1515
q_prim_vf(B_idx%end)%sf(i, 0, 0) = 0.1_wp*cos(2._wp*pi*x_cc(i))
1616

1717
case (170)
18-
! hardcoded case can be used to start a simulation with initial conditions given from a known 1D profile (e.g. Cantera, SDtoolbox)
18+
! This hardcoded case can be used to start a simulation with initial conditions given from a known 1D profile (e.g. Cantera, SDtoolbox)
1919
@: HardcodedReadValues()
2020

2121
case (180)
22-
! is patch is hard-coded for test suite optimization used in the
23-
! cases: "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)"
22+
! This is patch is hard-coded for test suite optimization used in the
23+
! 1D_shuoser cases: "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)"
2424
if (patch_id == 2) then
2525
q_prim_vf(contxb + 0)%sf(i, 0, 0) = 1 + 0.2*sin(5*x_cc(i))
2626
end if
2727

2828
case (181)
29-
! is patch is hard-coded for test suite optimization used in the
30-
! cases: "patch_icpp(2)%alpha_rho(1)": "1 + 0.1*sin(20*x*pi)"
29+
! This is patch is hard-coded for test suite optimization used in the
30+
! 1D_titarevtorro cases: "patch_icpp(2)%alpha_rho(1)": "1 + 0.1*sin(20*x*pi)"
3131
q_prim_vf(contxb + 0)%sf(i, 0, 0) = 1 + 0.1*sin(20*x_cc(i)*pi)
3232

3333
case (182)
34-
! patch is a hard-coded for test suite optimization (multiple component diffusion)
34+
! This patch is a hard-coded for test suite optimization (multiple component diffusion)
3535
x_mid_diffu = 0.05_wp/2.0_wp
3636
width_sq = (2.5_wp*10.0_wp**(-3.0_wp))**2
3737
profile_shape = 1.0_wp - 0.5_wp*exp(-(x_cc(i) - x_mid_diffu)**2/width_sq)

src/common/include/2dHardcodedIC.fpp

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#:def Hardcoded2DVariables()
2-
! any declaration of intermediate variables here
2+
! Place any declaration of intermediate variables here
33
real(wp) :: eps, eps_mhd, C_mhd
44
real(wp) :: r, rmax, gam, umax, p0
55
real(wp) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH, intL, alph
@@ -9,9 +9,9 @@
99

1010
real(wp) :: r_sq
1111

12-
! 207
12+
! # 207
1313
real(wp) :: sigma, gauss1, gauss2
14-
! 208
14+
! # 208
1515
real(wp) :: ei, d, fsm, alpha_air, alpha_sf6
1616

1717
eps = 1.e-9_wp
@@ -23,13 +23,13 @@
2323

2424
case (200)
2525
if (y_cc(j) <= (-x_cc(i)**3 + 1)**(1._wp/3._wp)) then
26-
! Fractions
26+
! Volume Fractions
2727
q_prim_vf(advxb)%sf(i, j, 0) = eps
2828
q_prim_vf(advxe)%sf(i, j, 0) = 1._wp - eps
29-
!
29+
! Denssities
3030
q_prim_vf(contxb)%sf(i, j, 0) = eps*1000._wp
3131
q_prim_vf(contxe)%sf(i, j, 0) = (1._wp - eps)*1._wp
32-
!
32+
! Pressure
3333
q_prim_vf(E_idx)%sf(i, j, 0) = 1000._wp
3434
end if
3535
case (202) ! Gresho vortex (Gouasmi et al 2022 JCP)
@@ -149,7 +149,7 @@
149149
lam = 1.0_wp
150150
eps = 1.0e-6_wp
151151
ei = 5.0_wp
152-
! function to smooth out sharp discontinuity in the interface
152+
! Smoothening function to smooth out sharp discontinuity in the interface
153153
if (x_cc(i) <= 0.7_wp*lam) then
154154
d = x_cc(i) - lam*(0.4_wp - 0.1_wp*sin(2.0_wp*pi*(y_cc(j)/lam + 0.25_wp)))
155155
fsm = 0.5_wp*(1.0_wp + erf(d/(ei*sqrt(dx*dy))))
@@ -162,11 +162,11 @@
162162
end if
163163

164164
case (250) ! MHD Orszag-Tang vortex
165-
! = 5/3
166-
! = 25/(36*pi)
167-
! = 5/(12*pi)
168-
! = (-sin(2*pi*y), sin(2*pi*x), 0)
169-
! = (-sin(2*pi*y)/sqrt(4*pi), sin(4*pi*x)/sqrt(4*pi), 0)
165+
! gamma = 5/3
166+
! rho = 25/(36*pi)
167+
! p = 5/(12*pi)
168+
! v = (-sin(2*pi*y), sin(2*pi*x), 0)
169+
! B = (-sin(2*pi*y)/sqrt(4*pi), sin(4*pi*x)/sqrt(4*pi), 0)
170170

171171
q_prim_vf(momxb)%sf(i, j, 0) = -sin(2._wp*pi*y_cc(j))
172172
q_prim_vf(momxb + 1)%sf(i, j, 0) = sin(2._wp*pi*x_cc(i))
@@ -179,7 +179,7 @@
179179
q_prim_vf(contxb)%sf(i, j, 0) = 0.01
180180
q_prim_vf(E_idx)%sf(i, j, 0) = 1.0
181181
elseif (x_cc(i)**2 + y_cc(j)**2 <= 1._wp**2) then
182-
! interpolation between r=0.08 and r=1.0
182+
! Linear interpolation between r=0.08 and r=1.0
183183
factor = (1.0_wp - sqrt(x_cc(i)**2 + y_cc(j)**2))/(1.0_wp - 0.08_wp)
184184
q_prim_vf(contxb)%sf(i, j, 0) = 0.01_wp*factor + 1.e-4_wp*(1.0_wp - factor)
185185
q_prim_vf(E_idx)%sf(i, j, 0) = 1.0_wp*factor + 3.e-5_wp*(1.0_wp - factor)
@@ -188,69 +188,69 @@
188188
q_prim_vf(E_idx)%sf(i, j, 0) = 3.e-5_wp
189189
end if
190190

191-
! 252 is for the 2D MHD Rotor problem
191+
! case 252 is for the 2D MHD Rotor problem
192192
case (252) ! 2D MHD Rotor Problem
193-
! conditions are set in the JSON file.
194-
! case imposes the dense, rotating cylinder.
193+
! Ambient conditions are set in the JSON file.
194+
! This case imposes the dense, rotating cylinder.
195195
!
196-
! = 1.4
197-
! medium (r > 0.1):
198-
! = 1, p = 1, v = 0, B = (1,0,0)
199-
! (r <= 0.1):
200-
! = 10, p = 1
201-
! has angular velocity w=20, giving v_tan=2 at r=0.1
202-
203-
! distance squared from the center
196+
! gamma = 1.4
197+
! Ambient medium (r > 0.1):
198+
! rho = 1, p = 1, v = 0, B = (1,0,0)
199+
! Rotor (r <= 0.1):
200+
! rho = 10, p = 1
201+
! v has angular velocity w=20, giving v_tan=2 at r=0.1
202+
203+
! Calculate distance squared from the center
204204
r_sq = (x_cc(i) - 0.5_wp)**2 + (y_cc(j) - 0.5_wp)**2
205205

206-
! radius of 0.1
206+
! inner radius of 0.1
207207
if (r_sq <= 0.1**2) then
208-
! Inside the rotor --
209-
! density uniformly to 10
208+
! -- Inside the rotor --
209+
! Set density uniformly to 10
210210
q_prim_vf(contxb)%sf(i, j, 0) = 10._wp
211211

212-
! vup constant rotation of rate v=2
213-
! = -omega * (y - y_c)
214-
! = omega * (x - x_c)
212+
! Set vup constant rotation of rate v=2
213+
! v_x = -omega * (y - y_c)
214+
! v_y = omega * (x - x_c)
215215
q_prim_vf(momxb)%sf(i, j, 0) = -20._wp*(y_cc(j) - 0.5_wp)
216216
q_prim_vf(momxb + 1)%sf(i, j, 0) = 20._wp*(x_cc(i) - 0.5_wp)
217217

218-
! width of 0.015
218+
! taper width of 0.015
219219
else if (r_sq <= 0.115**2) then
220-
! smooth the function between r = 0.1 and 0.115
220+
! linearly smooth the function between r = 0.1 and 0.115
221221
q_prim_vf(contxb)%sf(i, j, 0) = 1._wp + 9._wp*(0.115_wp - sqrt(r_sq))/(0.015_wp)
222222

223223
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)
224224
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)
225225
end if
226226

227227
case (253) ! MHD Smooth Magnetic Vortex
228-
! 5.2 of
229-
! hybridized discontinuous Galerkin methods for compressible magnetohydrodynamics
230-
! Ciuca, P. Fernandez, A. Christophe, N.C. Nguyen, J. Peraire
228+
! Section 5.2 of
229+
! Implicit hybridized discontinuous Galerkin methods for compressible magnetohydrodynamics
230+
! C. Ciuca, P. Fernandez, A. Christophe, N.C. Nguyen, J. Peraire
231231

232-
!
232+
! velocity
233233
q_prim_vf(momxb)%sf(i, j, 0) = 1._wp - (y_cc(j)*exp(1 - (x_cc(i)**2 + y_cc(j)**2))/(2.*pi))
234234
q_prim_vf(momxb + 1)%sf(i, j, 0) = 1._wp + (x_cc(i)*exp(1 - (x_cc(i)**2 + y_cc(j)**2))/(2.*pi))
235235

236-
! field
236+
! magnetic field
237237
q_prim_vf(B_idx%beg)%sf(i, j, 0) = -y_cc(j)*exp(1 - (x_cc(i)**2 + y_cc(j)**2))/(2.*pi)
238238
q_prim_vf(B_idx%beg + 1)%sf(i, j, 0) = x_cc(i)*exp(1 - (x_cc(i)**2 + y_cc(j)**2))/(2.*pi)
239239

240-
!
240+
! pressure
241241
q_prim_vf(E_idx)%sf(i, j, 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)
242242

243243
case (260) ! Gaussian Divergence Pulse
244-
! = 1 + C * erf((x-0.5)/σ)
245-
! ∂Bx/∂x = C * (2/√π) * exp[-((x-0.5)/σ)**2] * (1/σ)
246-
! C = ε * σ * √π / 2 ⇒ ∂Bx/∂x = ε * exp[-((x-0.5)/σ)**2]
247-
! is initialized to zero everywhere.
244+
! Bx(x) = 1 + C * erf((x-0.5)/σ)
245+
! ∂Bx/∂x = C * (2/√π) * exp[-((x-0.5)/σ)**2] * (1/σ)
246+
! Choose C = ε * σ * √π / 2 ⇒ ∂Bx/∂x = ε * exp[-((x-0.5)/σ)**2]
247+
! ψ is initialized to zero everywhere.
248248

249249
eps_mhd = patch_icpp(patch_id)%a(2)
250250
sigma = patch_icpp(patch_id)%a(3)
251251
C_mhd = eps_mhd*sigma*sqrt(pi)*0.5_wp
252252

253-
!
253+
! B-field
254254
q_prim_vf(B_idx%beg)%sf(i, j, 0) = 1._wp + C_mhd*erf((x_cc(i) - 0.5_wp)/sigma)
255255

256256
case (261) ! Blob
@@ -260,21 +260,21 @@
260260
alpha = r/r0
261261
if (alpha < 1) then
262262
q_prim_vf(B_idx%beg)%sf(i, j, 0) = 1._wp/sqrt(4._wp*pi)*(alpha**8 - 2._wp*alpha**4 + 1._wp)
263-
! = 1._wp/sqrt(4000._wp*pi) * (4096._wp*r2**4 - 128._wp*r2**2 + 1._wp)
264-
! = 1._wp/(4._wp*pi) * (alpha**8 - 2._wp*alpha**4 + 1._wp)
265-
! = 6._wp - q_prim_vf(B_idx%beg)%sf(i,j,0)**2/2._wp
263+
! q_prim_vf(B_idx%beg)%sf(i,j,0) = 1._wp/sqrt(4000._wp*pi) * (4096._wp*r2**4 - 128._wp*r2**2 + 1._wp)
264+
! q_prim_vf(B_idx%beg)%sf(i,j,0) = 1._wp/(4._wp*pi) * (alpha**8 - 2._wp*alpha**4 + 1._wp)
265+
! q_prim_vf(E_idx)%sf(i,j,0) = 6._wp - q_prim_vf(B_idx%beg)%sf(i,j,0)**2/2._wp
266266
end if
267267

268268
case (262) ! Tilted 2D MHD shock‐tube at α = arctan2 (≈63.4°)
269-
! by α = atan(2)
269+
! rotate by α = atan(2)
270270
alpha = atan(2._wp)
271271
cosA = cos(alpha)
272272
sinA = sin(alpha)
273-
! along shock normal
273+
! projection along shock normal
274274
r = x_cc(i)*cosA + y_cc(j)*sinA
275275

276276
if (r <= 0.5_wp) then
277-
! state: ρ=1, v∥=+10, v⊥=0, p=20, B∥=B⊥=5/√(4π)
277+
! LEFT state: ρ=1, v∥=+10, v⊥=0, p=20, B∥=B⊥=5/√(4π)
278278
q_prim_vf(contxb)%sf(i, j, 0) = 1._wp
279279
q_prim_vf(momxb)%sf(i, j, 0) = 10._wp*cosA
280280
q_prim_vf(momxb + 1)%sf(i, j, 0) = 10._wp*sinA
@@ -284,7 +284,7 @@
284284
q_prim_vf(B_idx%beg + 1)%sf(i, j, 0) = (5._wp/sqrt(4._wp*pi))*sinA &
285285
+ (5._wp/sqrt(4._wp*pi))*cosA
286286
else
287-
! state: ρ=1, v∥=10, v⊥=0, p=1, B∥=B⊥=5/√(4π)
287+
! RIGHT state: ρ=1, v∥=10, v⊥=0, p=1, B∥=B⊥=5/√(4π)
288288
q_prim_vf(contxb)%sf(i, j, 0) = 1._wp
289289
q_prim_vf(momxb)%sf(i, j, 0) = -10._wp*cosA
290290
q_prim_vf(momxb + 1)%sf(i, j, 0) = -10._wp*sinA
@@ -294,16 +294,16 @@
294294
q_prim_vf(B_idx%beg + 1)%sf(i, j, 0) = (5._wp/sqrt(4._wp*pi))*sinA &
295295
+ (5._wp/sqrt(4._wp*pi))*cosA
296296
end if
297-
! and B^z remain zero by default
297+
! v^z and B^z remain zero by default
298298

299299
case (270)
300-
! hardcoded case extrudes a 1D profile to initialize a 2D simulation domain
300+
! This hardcoded case extrudes a 1D profile to initialize a 2D simulation domain
301301
@: HardcodedReadValues()
302302

303303
case (280)
304-
! is patch is hard-coded for test suite optimization used in the
305-
! case:
306-
! analytic patch uses geometry 2
304+
! This is patch is hard-coded for test suite optimization used in the
305+
! 2D_isentropicvortex case:
306+
! This analytic patch uses geometry 2
307307
if (patch_id == 1) then
308308
q_prim_vf(E_idx)%sf(i, j, 0) = 1.0*(1.0 - (1.0/1.0)*(5.0/(2.0*pi))*(5.0/(8.0*1.0*(1.4 + 1.0)*pi))*exp(2.0*1.0*(1.0 - (x_cc(i) - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)))**(1.4 + 1.0)
309309
q_prim_vf(contxb + 0)%sf(i, j, 0) = 1.0*(1.0 - (1.0/1.0)*(5.0/(2.0*pi))*(5.0/(8.0*1.0*(1.4 + 1.0)*pi))*exp(2.0*1.0*(1.0 - (x_cc(i) - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)))**1.4
@@ -312,18 +312,18 @@
312312
end if
313313

314314
case (281)
315-
! is patch is hard-coded for test suite optimization used in the
316-
! case:
317-
! analytic patch uses geometry 2
315+
! This is patch is hard-coded for test suite optimization used in the
316+
! 2D_acoustic_pulse case:
317+
! This analytic patch uses geometry 2
318318
if (patch_id == 2) then
319319
q_prim_vf(E_idx)%sf(i, j, 0) = 101325*(1 - 0.5*(1.4 - 1)*(0.4)**2*exp(0.5*(1 - sqrt(x_cc(i)**2 + y_cc(j)**2))))**(1.4/(1.4 - 1))
320320
q_prim_vf(contxb + 0)%sf(i, j, 0) = 1*(1 - 0.5*(1.4 - 1)*(0.4)**2*exp(0.5*(1 - sqrt(x_cc(i)**2 + y_cc(j)**2))))**(1/(1.4 - 1))
321321
end if
322322

323323
case (282)
324-
! is patch is hard-coded for test suite optimization used in the
325-
! case:
326-
! analytic patch uses geometry 2
324+
! This is patch is hard-coded for test suite optimization used in the
325+
! 2D_zero_circ_vortex case:
326+
! This analytic patch uses geometry 2
327327
if (patch_id == 2) then
328328
q_prim_vf(E_idx)%sf(i, j, 0) = 101325*(1 - 0.5*(1.4 - 1)*(0.1/0.3)**2*exp(0.5*(1 - sqrt(x_cc(i)**2 + y_cc(j)**2))))**(1.4/(1.4 - 1))
329329
q_prim_vf(contxb + 0)%sf(i, j, 0) = 1*(1 - 0.5*(1.4 - 1)*(0.1/0.3)**2*exp(0.5*(1 - sqrt(x_cc(i)**2 + y_cc(j)**2))))**(1/(1.4 - 1))

src/common/include/3dHardcodedIC.fpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#:def Hardcoded3DVariables()
2-
! any declaration of intermediate variables here
2+
! Place any declaration of intermediate variables here
33
real(wp) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH, alph, Mach
44
real(wp) :: eps
55

6-
! Jets
7-
! to stor position and radii of jets from input file
6+
! IGR Jets
7+
! Arrays to stor position and radii of jets from input file
88
real(wp), dimension(:), allocatable :: y_th_arr, z_th_arr, r_th_arr
9-
! to describe initial condition of jet
9+
! Variables to describe initial condition of jet
1010
real(wp) :: r, ux_th, ux_am, p_th, p_am, rho_th, rho_am, y_th, z_th, r_th, eps_smooth
1111
real(wp) :: rcut, xcut ! Intermediate variables for creating smooth initial condition
1212

@@ -175,13 +175,13 @@
175175
q_prim_vf(E_idx)%sf(i, j, k) = p_th*rcut*xcut + p_am
176176

177177
case (370)
178-
! hardcoded case extrudes a 2D profile to initialize a 3D simulation domain
178+
! This hardcoded case extrudes a 2D profile to initialize a 3D simulation domain
179179
@: HardcodedReadValues()
180180

181181
case (380)
182-
! is patch is hard-coded for test suite optimization used in the
183-
! case:
184-
! analytic patch used geometry 9
182+
! This is patch is hard-coded for test suite optimization used in the
183+
! 3D_TaylorGreenVortex case:
184+
! This analytic patch used geometry 9
185185
Mach = 0.1
186186
if (patch_id == 1) then
187187
q_prim_vf(E_idx)%sf(i, j, k) = 101325 + (Mach**2*376.636429464809**2/16)*(cos(2*x_cc(i)/1) + cos(2*y_cc(j)/1))*(cos(2*z_cc(k)/1) + 2)

0 commit comments

Comments
 (0)