Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryngelson authored Dec 29, 2024
2 parents 4198795 + 1d87192 commit 344d3ac
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 45 deletions.
5 changes: 5 additions & 0 deletions .fortitude.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[check]
# Ignored Rules and justification:
ignore = ["E001","S001","S101","M011","F001","S041","T001","S101","S102","T002","T011","T042","M001"]
file-extensions = ["f90","fpp","fypp"]
output-format = "pylint"
17 changes: 7 additions & 10 deletions .github/workflows/lint-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Fortitude
run: pip install fortitude-lint ansi2txt
- name: Initialize MFC
run: ./mfc.sh init

- name: Lint the source code
run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101,S102,T002,T011 ./src/** || true

- name: Ensure kind is specified
run: fortitude check --file-extensions=f90,fpp,fypp --select=P001 ./src/**

- name: Ensure subroutines are named
run: fortitude check --file-extensions=f90,fpp,fypp --select=S061 ./src/**
- name: Lint the full source
run: |
source build/venv/bin/activate
find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \;
find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0'
- name: No double precision intrinsics
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/common/m_helper.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ contains
subroutine s_int_to_str(i, res)

integer, intent(in) :: i
character(len=*), intent(out) :: res
character(len=*), intent(inout) :: res

write (res, '(I0)') i
res = trim(res)
Expand Down
4 changes: 3 additions & 1 deletion src/common/m_variables_conversion.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ contains
real(wp) :: dyn_pres
real(wp) :: nbub, R3, vftmp, R3tmp
real(wp), dimension(nb) :: Rtmp
real(wp) :: G = 0._wp
real(wp) :: G
real(wp), dimension(2) :: Re_K

integer :: i, j, k, l, q !< Generic loop iterators
Expand All @@ -1098,6 +1098,8 @@ contains
real(wp), dimension(num_species) :: Ys
real(wp) :: e_mix, mix_mol_weight, T

G = 0._wp

#ifndef MFC_SIMULATION
! Converting the primitive variables to the conservative variables
do l = 0, p
Expand Down
17 changes: 1 addition & 16 deletions src/post_process/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module m_data_output
real(wp), allocatable, dimension(:, :, :), public :: q_sf
real(wp), allocatable, dimension(:, :, :) :: q_root_sf
real(wp), allocatable, dimension(:, :, :) :: cyl_q_sf

! Single precision storage for flow variables
real(sp), allocatable, dimension(:, :, :), public :: q_sf_s
real(sp), allocatable, dimension(:, :, :) :: q_root_sf_s
Expand Down Expand Up @@ -222,10 +223,6 @@ contains
file_loc = trim(proc_rank_dir)//'/.'
!INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler
!EXIST = dir_check )
! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler
! EXIST = dir_check )
call my_inquire(file_loc, dir_check)
if (dir_check .neqv. .true.) then
call s_create_directory(trim(proc_rank_dir))
Expand All @@ -238,10 +235,6 @@ contains
file_loc = trim(rootdir)//'/.'
!INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler
! EXIST = dir_check )
! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler
! EXIST = dir_check )
call my_inquire(file_loc, dir_check)
if (dir_check .neqv. .true.) then
call s_create_directory(trim(rootdir))
Expand All @@ -262,10 +255,6 @@ contains
file_loc = trim(proc_rank_dir)//'/.'
!INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler
! EXIST = dir_check )
! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler
! EXIST = dir_check )
call my_inquire(file_loc, dir_check)
if (dir_check .neqv. .true.) then
Expand All @@ -279,10 +268,6 @@ contains
file_loc = trim(rootdir)//'/.'
!INQUIRE( DIRECTORY = TRIM(file_loc), & ! Intel compiler
! EXIST = dir_check )
! INQUIRE( FILE = TRIM(file_loc), & ! NAG/PGI/GCC compiler
! EXIST = dir_check )
call my_inquire(file_loc, dir_check)
if (dir_check .neqv. .true.) then
Expand Down
2 changes: 1 addition & 1 deletion src/pre_process/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ contains
! Generic string used to store the address of a particular file
character(LEN=len_trim(case_dir) + 2*name_len) :: file_loc
character(len=15) :: temp
character(LEN=1), dimension(3) :: coord = (/'x', 'y', 'z'/)
character(LEN=1), dimension(3), parameter :: coord = (/'x', 'y', 'z'/)

! Generic logical used to check the existence of directories
logical :: dir_check
Expand Down
2 changes: 1 addition & 1 deletion src/pre_process/m_patches.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ contains
integer :: i, j, k !< generic loop iterators
real(wp) :: epsilon, beta
complex(wp) :: cmplx_i = (0._wp, 1._wp)
complex(wp), parameter :: cmplx_i = (0._wp, 1._wp)
complex(wp) :: H
! Transferring the patch's centroid and radius information
Expand Down
4 changes: 2 additions & 2 deletions src/pre_process/m_perturbation.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ contains
real(wp) :: ang, norm
real(wp) :: tr, ti, cr, ci !< temporary memory
real(wp) :: xratio
integer idx
integer i, j, k
integer :: idx
integer :: i, j, k

xratio = mixlayer_vel_coef

Expand Down
16 changes: 9 additions & 7 deletions src/simulation/m_bubbles_EL.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ contains
!! @param save_count File identifier
subroutine s_restart_bubbles(bub_id, save_count)

integer :: bub_id, save_count
integer, intent(inout) :: bub_id, save_count

character(LEN=path_len + 2*name_len) :: file_loc

Expand Down Expand Up @@ -1460,7 +1460,7 @@ contains
function particle_in_domain(pos_part)

logical :: particle_in_domain
real(wp), dimension(3) :: pos_part
real(wp), dimension(3), intent(in) :: pos_part

! 2D
if (p == 0 .and. cyl_coord .neqv. .true.) then
Expand Down Expand Up @@ -1513,7 +1513,7 @@ contains
function particle_in_domain_physical(pos_part)

logical :: particle_in_domain_physical
real(wp), dimension(3) :: pos_part
real(wp), dimension(3), intent(in) :: pos_part

particle_in_domain_physical = ((pos_part(1) < x_cb(m)) .and. (pos_part(1) >= x_cb(-1)) .and. &
(pos_part(2) < y_cb(n)) .and. (pos_part(2) >= y_cb(-1)))
Expand Down Expand Up @@ -1589,7 +1589,7 @@ contains
!! @param q_time Current time
subroutine s_write_lag_particles(qtime)

real(wp) :: qtime
real(wp), intent(in) :: qtime
integer :: k

character(LEN=path_len + 2*name_len) :: file_loc
Expand Down Expand Up @@ -1631,7 +1631,8 @@ contains
!! @param q_time Current time
subroutine s_write_void_evol(qtime)

real(wp) :: qtime, volcell, voltot
real(wp), intent(in) :: qtime
real(wp) :: volcell, voltot
real(wp) :: lag_void_max, lag_void_avg, lag_vol
real(wp) :: void_max_glb, void_avg_glb, vol_glb

Expand Down Expand Up @@ -1704,11 +1705,12 @@ contains
subroutine s_write_restart_lag_bubbles(t_step)

! Generic string used to store the address of a particular file
integer, intent(in) :: t_step

character(LEN=path_len + 2*name_len) :: file_loc
logical :: file_exist

integer :: i, k, t_step
integer :: bub_id, tot_part, tot_part_wrtn, npart_wrtn
integer :: i, k

#ifdef MFC_MPI
! For Parallel I/O
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ contains
!! time-step.
subroutine s_open_run_time_information_file

character(LEN=name_len) :: file_name = 'run_time.inf' !<
character(LEN=name_len), parameter :: file_name = 'run_time.inf' !<
!! Name of the run-time information file

character(LEN=path_len + name_len) :: file_path !<
Expand Down
4 changes: 2 additions & 2 deletions src/simulation/m_hyperelastic.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ contains
integer, intent(in) :: j, k, l

real(wp) :: trace
real(wp) :: f13 = 1_wp/3_wp
real(wp), parameter :: f13 = 1._wp/3._wp
integer :: i

! tensor is the symmetric tensor & calculate the trace of the tensor
Expand Down Expand Up @@ -267,7 +267,7 @@ contains
integer, intent(in) :: j, k, l

real(wp) :: trace
real(wp) :: f13 = 1_wp/3_wp
real(wp), parameter :: f13 = 1._wp/3._wp
integer :: i

!TODO Make this 1D and 2D capable
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_qbmm.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ contains
real(wp), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: pb, rhs_pb
real(wp), dimension(startx:, starty:, startz:, 1:, 1:), intent(inout) :: mv, rhs_mv
type(int_bounds_info), intent(in) :: ix, iy, iz
real(wp), dimension(startx:, starty:, startz:) :: nbub_sc !> Unused Variable not sure what to put as intent
real(wp), dimension(startx:, starty:, startz:), intent(inout) :: nbub_sc

real(wp), dimension(nmom) :: moms, msum
real(wp), dimension(nnode, nb) :: wght, abscX, abscY, wght_pb, wght_mv, wght_ht, ht
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ contains
subroutine s_read_input_file

! Relative path to the input file provided by the user
character(LEN=name_len) :: file_path = './simulation.inp'
character(LEN=name_len), parameter :: file_path = './simulation.inp'

logical :: file_exist !<
!! Logical used to check the existence of the input file
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_surface_tension.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ contains
flux_src_vf, &
id, isx, isy, isz)

type(scalar_field), dimension(sys_size) :: q_prim_vf !> unused so unsure what intent to give it
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf
real(wp), dimension(-1:, 0:, 0:, 1:), intent(in) :: vSrc_rsx_vf
real(wp), dimension(-1:, 0:, 0:, 1:), intent(in) :: vSrc_rsy_vf
real(wp), dimension(-1:, 0:, 0:, 1:), intent(in) :: vSrc_rsz_vf
Expand Down
2 changes: 2 additions & 0 deletions toolchain/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ dependencies = [
"pylint",
"fprettify",
"black",
"fortitude-lint",
"ansi2txt",

# Profiling
"numpy",
Expand Down

0 comments on commit 344d3ac

Please sign in to comment.