Skip to content

Commit c59fc0f

Browse files
committed
cleanup
1 parent b7bf6e5 commit c59fc0f

File tree

12 files changed

+72
-83
lines changed

12 files changed

+72
-83
lines changed

.github/workflows/lint-source.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ jobs:
4242
run: |
4343
! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/*
4444
45+
- name: Looking for all caps comments in source
46+
run: |
47+
! grep -RE '^\s+[!]\s+[A-Z]{5}' ./src/*
48+
4549
- name: Looking for junk comments in examples
4650
run: |
4751
! grep -R '# ===' ./benchmarks **/*.py
4852
! grep -R '# ===' ./examples/**/*.py
4953
! grep -R '===' ./benchmarks/**/*.py
5054
! grep -R '===' ./examples/**/*.py
5155
56+

src/post_process/m_data_output.fpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ module m_data_output
4343

4444
! Including the Silo Fortran interface library that features the subroutines
4545
! and parameters that are required to write in the Silo-HDF5 database format
46-
! INCLUDE 'silo.inc'
4746
include 'silo_f9x.inc'
4847

4948
! Generic storage for flow variable(s) that are to be written to formatted

src/post_process/m_derived_variables.fpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ contains
288288

289289
if (top == bottom) then
290290
slope = 1._wp
291-
! ELSEIF((top == 0._wp .AND. bottom /= 0._wp) &
292-
! .OR. &
293-
! (bottom == 0._wp .AND. top /= 0._wp)) THEN
294-
! slope = 0._wp
295291
else
296292
slope = (top*bottom)/(bottom**2._wp + 1e-16_wp)
297293
end if

src/post_process/m_global_parameters.fpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,13 +843,7 @@ contains
843843
call MPI_INFO_CREATE(mpi_info_int, ierr)
844844
call MPI_INFO_SET(mpi_info_int, 'romio_ds_write', 'disable', ierr)
845845

846-
! Option for UNIX file system (Hooke/Thomson)
847-
! WRITE(mpiiofs, '(A)') '/ufs_'
848-
! mpiiofs = TRIM(mpiiofs)
849-
! mpi_info_int = MPI_INFO_NULL
850-
851846
allocate (start_idx(1:num_dims))
852-
853847
#endif
854848

855849
end subroutine s_initialize_parallel_io

src/pre_process/m_global_parameters.fpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -834,11 +834,6 @@ contains
834834
call MPI_INFO_CREATE(mpi_info_int, ierr)
835835
call MPI_INFO_SET(mpi_info_int, 'romio_ds_write', 'disable', ierr)
836836

837-
! Option for UNIX file system (Hooke/Thomson)
838-
! WRITE(mpiiofs, '(A)') '/ufs_'
839-
! mpiiofs = TRIM(mpiiofs)
840-
! mpi_info_int = MPI_INFO_NULL
841-
842837
allocate (start_idx(1:num_dims))
843838

844839
#endif

src/simulation/m_cbc.fpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ module m_cbc
9898
integer :: cbc_dir, cbc_loc
9999
!$acc declare create(dj, bcxb, bcxe, bcyb, bcye, bczb, bcze, cbc_dir, cbc_loc)
100100
101-
!! GRCBC inputs for subsonic inflow and outflow conditions consisting of
102-
!! inflow velocities, pressure, density and void fraction as well as
103-
!! outflow velocities and pressure
101+
! grCBC inputs for subsonic inflow and outflow conditions consisting of
102+
! inflow velocities, pressure, density and void fraction as well as
103+
! outflow velocities and pressure
104104
105105
real(wp), allocatable, dimension(:) :: pres_in, pres_out, Del_in, Del_out
106106
real(wp), allocatable, dimension(:, :) :: vel_in, vel_out
@@ -396,13 +396,13 @@ contains
396396
!$acc update device(bczb, bcze)
397397
end if
398398
399-
! Allocate GRCBC inputs
399+
! Allocate grCBC inputs
400400
@:ALLOCATE(pres_in(1:num_dims), pres_out(1:num_dims))
401401
@:ALLOCATE(Del_in(1:num_dims), Del_out(1:num_dims))
402402
@:ALLOCATE(vel_in(1:num_dims, 1:num_dims), vel_out(1:num_dims, 1:num_dims))
403403
@:ALLOCATE(alpha_rho_in(1:num_fluids, 1:num_dims), alpha_in(1:num_fluids, 1:num_dims))
404404
405-
! Assign and update GRCBC inputs
405+
! Assign and update grCBC inputs
406406
#:for CBC_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')]
407407
if (${CBC_DIR}$ <= num_dims) then
408408
vel_in(${CBC_DIR}$, 1) = bc_${XYZ}$%vel_in(1)
@@ -860,7 +860,7 @@ contains
860860
call s_compute_nonreflecting_subsonic_buffer_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
861861
else if ((cbc_loc == -1 .and. bc${XYZ}$b == -7) .or. (cbc_loc == 1 .and. bc${XYZ}$e == -7)) then
862862
call s_compute_nonreflecting_subsonic_inflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
863-
! Add GRCBC for Subsonic Inflow
863+
! Add grCBC for Subsonic Inflow
864864
if (bc_${XYZ}$%grcbc_in) then
865865
!$acc loop seq
866866
do i = 2, momxb
@@ -880,11 +880,11 @@ contains
880880
end if
881881
else if ((cbc_loc == -1 .and. bc${XYZ}$b == -8) .or. (cbc_loc == 1 .and. bc${XYZ}$e == -8)) then
882882
call s_compute_nonreflecting_subsonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
883-
! Add GRCBC for Subsonic Outflow (Pressure)
883+
! Add grCBC for Subsonic Outflow (Pressure)
884884
if (bc_${XYZ}$%grcbc_out) then
885885
L(advxe) = c*(1._wp - Ma)*(pres - pres_out(${CBC_DIR}$))/Del_out(${CBC_DIR}$)
886886
887-
! Add GRCBC for Subsonic Outflow (Normal Velocity)
887+
! Add grCBC for Subsonic Outflow (Normal Velocity)
888888
if (bc_${XYZ}$%grcbc_vel_out) then
889889
L(advxe) = L(advxe) + rho*c**2._wp*(1._wp - Ma)*(vel(dir_idx(1)) + vel_out(${CBC_DIR}$, dir_idx(1))*sign(1, cbc_loc))/Del_out(${CBC_DIR}$)
890890
end if
@@ -1536,7 +1536,7 @@ contains
15361536
! Deallocating the cell-width distribution in the s-direction
15371537
@:DEALLOCATE(ds)
15381538
1539-
! Deallocating GRCBC inputs
1539+
! Deallocating grCBC inputs
15401540
@:DEALLOCATE(vel_in, vel_out, pres_in, pres_out, Del_in, Del_out, alpha_rho_in, alpha_in)
15411541
15421542
! Deallocating CBC Coefficients in x-direction

src/simulation/m_checker.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ contains
120120
@:PROHIBIT(model_eqns == 3 .and. wave_speeds /= 1, "6-equation model (model_eqns = 3) requires wave_speeds = 1")
121121
end subroutine s_check_inputs_model_eqns
122122

123-
!> Checks constraints for GRCBC
123+
!> Checks constraints for grCBC
124124
subroutine s_check_inputs_grcbc
125125
#:for DIR in ['x', 'y', 'z']
126126
@:PROHIBIT(bc_${DIR}$%grcbc_in .and. (bc_${DIR}$%beg /= -7 .and. bc_${DIR}$%end /= -7), "Subsonic Inflow requires bc = -7")

src/simulation/m_global_parameters.fpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ contains
690690
integral(i)%ymax = dflt_real
691691
end do
692692
693-
! GRCBC flags
693+
! grCBC flags
694694
#:for dir in {'x', 'y', 'z'}
695695
bc_${dir}$%grcbc_in = .false.
696696
bc_${dir}$%grcbc_out = .false.
@@ -1216,11 +1216,6 @@ contains
12161216
call MPI_INFO_CREATE(mpi_info_int, ierr)
12171217
call MPI_INFO_SET(mpi_info_int, 'romio_ds_write', 'disable', ierr)
12181218
1219-
! Option for UNIX file system (Hooke/Thomson)
1220-
! WRITE(mpiiofs, '(A)') '/ufs_'
1221-
! mpiiofs = TRIM(mpiiofs)
1222-
! mpi_info_int = MPI_INFO_NULL
1223-
12241219
allocate (start_idx(1:num_dims))
12251220
12261221
#endif

src/simulation/m_hyperelastic.fpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ contains
128128
do i = 1, tensor_size
129129
tensora(i) = 0_wp
130130
end do
131-
! STEP 1: computing the grad_xi tensor using finite differences
131+
132+
! Step 1: computing the grad_xi tensor using finite differences
132133
! grad_xi definition / organization
133134
! number for the tensor 1-3: dxix_dx, dxiy_dx, dxiz_dx
134135
! 4-6 : dxix_dy, dxiy_dy, dxiz_dy
@@ -148,7 +149,7 @@ contains
148149
tensora(8) = tensora(8) + q_prim_vf(xibeg + 1)%sf(j, k, l + r)*fd_coeff_z(r, l)
149150
tensora(9) = tensora(9) + q_prim_vf(xiend)%sf(j, k, l + r)*fd_coeff_z(r, l)
150151
end do
151-
! STEP 2a: computing the adjoint of the grad_xi tensor for the inverse
152+
! Step 2a: computing the adjoint of the grad_xi tensor for the inverse
152153
tensorb(1) = tensora(5)*tensora(9) - tensora(6)*tensora(8)
153154
tensorb(2) = -(tensora(2)*tensora(9) - tensora(3)*tensora(8))
154155
tensorb(3) = tensora(2)*tensora(6) - tensora(3)*tensora(5)
@@ -159,45 +160,45 @@ contains
159160
tensorb(8) = -(tensora(1)*tensora(8) - tensora(2)*tensora(7))
160161
tensorb(9) = tensora(1)*tensora(5) - tensora(2)*tensora(4)
161162

162-
! STEP 2b: computing the determinant of the grad_xi tensor
163+
! Step 2b: computing the determinant of the grad_xi tensor
163164
tensorb(tensor_size) = tensora(1)*(tensora(5)*tensora(9) - tensora(6)*tensora(8)) &
164165
- tensora(2)*(tensora(4)*tensora(9) - tensora(6)*tensora(7)) &
165166
+ tensora(3)*(tensora(4)*tensora(8) - tensora(5)*tensora(7))
166167

167168
if (tensorb(tensor_size) > verysmall) then
168-
! STEP 2c: computing the inverse of grad_xi tensor = F
169+
! Step 2c: computing the inverse of grad_xi tensor = F
169170
! tensorb is the adjoint, tensora becomes F
170171
!$acc loop seq
171172
do i = 1, tensor_size - 1
172173
tensora(i) = tensorb(i)/tensorb(tensor_size)
173174
end do
174175

175-
! STEP 2d: computing the J = det(F) = 1/det(\grad{\xi})
176+
! Step 2d: computing the J = det(F) = 1/det(\grad{\xi})
176177
tensorb(tensor_size) = 1_wp/tensorb(tensor_size)
177178

178-
! STEP 3: computing F transpose F
179+
! Step 3: computing F transpose F
179180
tensorb(1) = tensora(1)**2 + tensora(2)**2 + tensora(3)**2
180181
tensorb(5) = tensora(4)**2 + tensora(5)**2 + tensora(6)**2
181182
tensorb(9) = tensora(7)**2 + tensora(8)**2 + tensora(9)**2
182183
tensorb(2) = tensora(1)*tensora(4) + tensora(2)*tensora(5) + tensora(3)*tensora(6)
183184
tensorb(3) = tensora(1)*tensora(7) + tensora(2)*tensora(8) + tensora(3)*tensora(9)
184185
tensorb(6) = tensora(4)*tensora(7) + tensora(5)*tensora(8) + tensora(6)*tensora(9)
185-
! STEP 4: update the btensor, this is consistent with Riemann solvers
186+
! Step 4: update the btensor, this is consistent with Riemann solvers
186187
#:for BIJ, TXY in [(1,1),(2,2),(3,5),(4,3),(5,6),(6,9)]
187188
btensor%vf(${BIJ}$)%sf(j, k, l) = tensorb(${TXY}$)
188189
#:endfor
189190
! store the determinant at the last entry of the btensor
190191
btensor%vf(b_size)%sf(j, k, l) = tensorb(tensor_size)
191-
! STEP 5a: updating the Cauchy stress primitive scalar field
192+
! Step 5a: updating the Cauchy stress primitive scalar field
192193
if (hyper_model == 1) then
193194
call s_neoHookean_cauchy_solver(btensor%vf, q_prim_vf, G, j, k, l)
194195
elseif (hyper_model == 2) then
195196
call s_Mooney_Rivlin_cauchy_solver(btensor%vf, q_prim_vf, G, j, k, l)
196197
end if
197-
! STEP 5b: updating the pressure field
198+
! Step 5b: updating the pressure field
198199
q_prim_vf(E_idx)%sf(j, k, l) = q_prim_vf(E_idx)%sf(j, k, l) - &
199200
G*q_prim_vf(xiend + 1)%sf(j, k, l)/gamma
200-
! STEP 5c: updating the Cauchy stress conservative scalar field
201+
! Step 5c: updating the Cauchy stress conservative scalar field
201202
!$acc loop seq
202203
do i = 1, b_size - 1
203204
q_cons_vf(strxb + i - 1)%sf(j, k, l) = &

0 commit comments

Comments
 (0)