Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1f83aeb
Integrate ffmt Fortran formatter into MFC
sbryngelson Mar 20, 2026
d9d7ee2
Apply ffmt formatting with comment alignment and idempotency fixes
sbryngelson Mar 21, 2026
cb33f11
Apply ffmt: remove bare !<, convert to !> block comments, align inlin…
sbryngelson Mar 21, 2026
49353ad
Apply ffmt: blank line formatting, comment rewrapping, use/declaratio…
sbryngelson Mar 21, 2026
01fd1b6
Apply ffmt: remove blanks after #ifdef, fix Fypp continuation alignment
sbryngelson Mar 21, 2026
91eabae
Apply ffmt: fix blank lines after #ifdef in declaration regions
sbryngelson Mar 21, 2026
023a5b4
Apply ffmt: remove blank lines after #else/#elif continuations
sbryngelson Mar 21, 2026
83576b6
Apply ffmt: strip trailing !& no-op comments from m_weno.fpp
sbryngelson Mar 21, 2026
adc5219
Apply ffmt: strip comment-only continuation lines (& ! ...)
sbryngelson Mar 21, 2026
4ab00f4
Condense verbose multi-line comments across codebase
sbryngelson Mar 21, 2026
a1af509
Fix spelling errors and remove redundant comments across codebase
sbryngelson Mar 22, 2026
55e39d8
Fix stale comments and remove dead code
sbryngelson Mar 22, 2026
b6fa124
Remove commented-out dead code (debug prints, old IB I/O, stale imple…
sbryngelson Mar 22, 2026
861cb51
Add physics documentation: paper references, equation citations, algo…
sbryngelson Mar 22, 2026
9be1d12
Add documentation: model branch labels, solver references, algorithm …
sbryngelson Mar 22, 2026
237f38a
Trim verbose paper references and remove duplicate comments
sbryngelson Mar 22, 2026
17d142e
Fix unterminated comment: remove /**R pattern that triggers C-style b…
sbryngelson Mar 22, 2026
b15c089
Document GPU macros and constants; remove generic use-statement comments
sbryngelson Mar 22, 2026
eb81d5c
Fix dead Stanford link in NACA airfoil docs
sbryngelson Mar 22, 2026
81e4e98
Fix comment typos, remove dead code, apply ffmt S102/S081 formatting
sbryngelson Mar 22, 2026
17b6fdd
Standardize Doxygen: remove obvious @param, clean verbose headers, co…
sbryngelson Mar 22, 2026
eeece9b
Add missing subroutine headers; fix orphan !!, !!IB markers, !!> syntax
sbryngelson Mar 22, 2026
10c5a16
Fix Doxygen markers: !! to !<, !!< to !<, inline variable docs, conde…
sbryngelson Mar 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@ benchmarks/*.png
cce_*/
cce_*.log
run_cce_*.sh
.ffmt_cache/
2 changes: 1 addition & 1 deletion docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Definitions for currently implemented immersed boundary patch types are listed i

- `c`, `t`, `p`, and `m` specify the parameters for a NACA airfoil.
`m` is the maximum camber, `p` is the location of maximum camber, `c` is the coord length, and `t` is the thickness.
Additional details on this specification can be found in [The Naca Airfoil Series](https://web.stanford.edu/~cantwell/AA200_Course_Material/The%20NACA%20airfoil%20series.pdf)
Additional details on this specification can be found in [NACA airfoil](https://en.wikipedia.org/wiki/NACA_airfoil).

- `slip` applies a slip boundary to the surface of the patch if true and a no-slip boundary condition to the surface if false.

Expand Down
17 changes: 17 additions & 0 deletions ffmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# MFC Fortran formatting configuration
# These are the defaults — this file makes them explicit.

indent-width = 4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use 2-space indentation in formatter config.

Line 4 sets indent-width = 4, which conflicts with the project Fortran style and can cause persistent formatting drift.

Suggested fix
-indent-width = 4
+indent-width = 2

As per coding guidelines: Use 2-space indentation, lowercase keywords, and explicit intent on all subroutine/function arguments in Fortran code.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
indent-width = 4
indent-width = 2

keyword-case = "lower"
normalize-keywords = true
indent-fypp = true

[whitespace]
relational = true
logical = true
plusminus = true
multdiv = false
power = false
assignment = true
declaration = true
comma = true
34 changes: 13 additions & 21 deletions src/common/include/1dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,29 @@

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

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

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

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

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

case (182)
case (182) ! Multi-component diffusion
! This patch is a hard-coded for test suite optimization (multiple component diffusion)
x_mid_diffu = 0.05_wp/2.0_wp
width_sq = (2.5_wp*10.0_wp**(-3.0_wp))**2
Expand All @@ -51,16 +48,11 @@

temp = (320.0_wp - 1350.0_wp)*profile_shape + 1350.0_wp

molar_mass_inv = y1/31.998_wp + &
y2/18.01508_wp + &
y3/16.04256_wp + &
y4/28.0134_wp
molar_mass_inv = y1/31.998_wp + y2/18.01508_wp + y3/16.04256_wp + y4/28.0134_wp

q_prim_vf(contxb)%sf(i, 0, 0) = 1.01325_wp*(10.0_wp)**5/(temp*8.3144626_wp*1000.0_wp*molar_mass_inv)

case default
call s_int_to_str(patch_id, iStr)
call s_mpi_abort("Invalid hcid specified for patch "//trim(iStr))
call s_mpi_abort("Invalid hcid specified for patch " // trim(iStr))
end select

#:enddef
183 changes: 77 additions & 106 deletions src/common/include/2dHardcodedIC.fpp

Large diffs are not rendered by default.

52 changes: 20 additions & 32 deletions src/common/include/3dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
real(wp) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH, alph, Mach
real(wp) :: eps

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

real(wp) :: r, ux_th, ux_am, p_th, p_am, rho_th, rho_am, y_th, z_th, r_th, eps_smooth
real(wp) :: rcut, xcut ! Intermediate variables for creating smooth initial condition
real(wp), dimension(0:n, 0:p) :: rcut_arr
integer :: l, q, s ! Iterators for reading input files
integer :: start, end ! Ints to keep track of position in file
character(len=1000) :: line ! String to store line in ile
character(len=25) :: value ! String to store value in line
integer :: NJet ! Number of jets
integer :: l, q, s ! Iterators for reading input files
integer :: start, end ! Ints to keep track of position in file
character(len=1000) :: line ! String to store line in file
character(len=25) :: value ! String to store value in line
integer :: NJet ! Number of jets

eps = 1e-9_wp

Expand Down Expand Up @@ -44,7 +42,7 @@
end if
if (l == 0) then
read (value, *) y_th_arr(q) ! Convert string to numeric value
elseif (l == 1) then
else if (l == 1) then
read (value, *) z_th_arr(q)
else
read (value, *) r_th_arr(q)
Expand All @@ -64,13 +62,11 @@
end do
end do
end if

#:enddef

#:def Hardcoded3D()

select case (patch_icpp(patch_id)%hcid)
case (300) ! Rayleigh-Taylor instability
case (300) ! Rayleigh-Taylor instability
rhoH = 3._wp
rhoL = 1._wp
pRef = 1.e5_wp
Expand Down Expand Up @@ -101,8 +97,7 @@
pInt = pref + rhoH*9.81_wp*(1.2_wp - intH)
q_prim_vf(E_idx)%sf(i, j, k) = pInt + rhoL*9.81_wp*(intH - y_cc(j))
end if

case (301) ! (3D lung geometry in X direction, |sin(*)+sin(*)|)
case (301) ! (3D lung geometry in X direction, |sin(*)+sin(*)|)
h = 0.0_wp
lam = 1.0_wp
amp = patch_icpp(patch_id)%a(2)
Expand All @@ -114,8 +109,7 @@
q_prim_vf(advxb)%sf(i, j, k) = patch_icpp(1)%alpha(1)
q_prim_vf(advxe)%sf(i, j, k) = patch_icpp(1)%alpha(2)
end if

case (302) ! 3D Jet with IGR
case (302) ! 3D Jet with IGR
ux_th = 10*sqrt(1.4*0.4)
ux_am = 0.0*sqrt(1.4)
p_th = 2.0_wp
Expand Down Expand Up @@ -145,9 +139,7 @@
end if

q_prim_vf(E_idx)%sf(i, j, k) = p_th*rcut*xcut + p_am

case (303) ! 3D Multijet

case (303) ! 3D Multijet
eps_smooth = 3.0_wp
ux_th = 10*sqrt(1.4*0.4)
ux_am = 2.5*sqrt(1.4*0.4)
Expand All @@ -173,25 +165,21 @@
end if

q_prim_vf(E_idx)%sf(i, j, k) = p_th*rcut*xcut + p_am

case (370)
case (370) ! 3D extrusion of 2D profile from external data
! This hardcoded case extrudes a 2D profile to initialize a 3D simulation domain
@: HardcodedReadValues()

case (380)
! This is patch is hard-coded for test suite optimization used in the
! 3D_TaylorGreenVortex case:
! This analytic patch used geometry 9
case (380) ! Taylor-Green vortex
! This is patch is hard-coded for test suite optimization used in the 3D_TaylorGreenVortex case: This analytic patch used
! geometry 9
Mach = 0.1
if (patch_id == 1) then
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)
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)
q_prim_vf(momxb + 0)%sf(i, j, k) = Mach*376.636429464809*sin(x_cc(i)/1)*cos(y_cc(j)/1)*sin(z_cc(k)/1)
q_prim_vf(momxb + 1)%sf(i, j, k) = -Mach*376.636429464809*cos(x_cc(i)/1)*sin(y_cc(j)/1)*sin(z_cc(k)/1)
end if

case default
call s_int_to_str(patch_id, iStr)
call s_mpi_abort("Invalid hcid specified for patch "//trim(iStr))
call s_mpi_abort("Invalid hcid specified for patch " // trim(iStr))
end select

#:enddef
Loading
Loading