Skip to content

Commit

Permalink
Merge pull request #151 from nekStab/150-track-unused-variables
Browse files Browse the repository at this point in the history
150 track unused variables
  • Loading branch information
loiseaujc authored Jan 31, 2025
2 parents 876f4f5 + a14c319 commit c159ae9
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 28 deletions.
8 changes: 4 additions & 4 deletions example/ginzburg_landau/Ginzburg_Landau.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Ginzburg_Landau
use stdlib_optval, only: optval
implicit none

character*128, parameter, private :: this_module = 'Ginzburg_Landau'
character(len=*), parameter, private :: this_module = 'Ginzburg_Landau'

public :: nx
public :: initialize_parameters
Expand Down Expand Up @@ -112,7 +112,7 @@ subroutine rhs(me, t, x, f)
real(kind=wp), dimension(:), intent(out) :: f

! Internal variables.
integer :: i, j, k
integer :: i
real(kind=wp), dimension(nx) :: u, du
real(kind=wp), dimension(nx) :: v, dv
real(kind=wp) :: d2u, d2v, cu, cv
Expand Down Expand Up @@ -179,7 +179,7 @@ end subroutine rhs

subroutine adjoint_rhs(me, t, x, f)
! Time-integrator.
class(rk_class), intent(inout) :: me
class(rk_class), intent(inout) :: me
! Current time.
real(kind=wp), intent(in) :: t
! State vector.
Expand All @@ -188,7 +188,7 @@ subroutine adjoint_rhs(me, t, x, f)
real(kind=wp), dimension(:), intent(out) :: f

! Internal variables.
integer :: i, j, k
integer :: i
real(kind=wp), dimension(nx) :: u, du
real(kind=wp), dimension(nx) :: v, dv
real(kind=wp) :: d2u, d2v, cu, cv
Expand Down
12 changes: 5 additions & 7 deletions example/roessler/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ program demo
use Roessler_OTD
implicit none

character(len=*), parameter :: this_module = 'Example Roessler'
! character(len=*), parameter :: this_module = 'Example Roessler'

! Roessler system.
type(roessler_upo) :: sys_jac, sys_floquet
! State vectors
type(state_vector) :: bf, dx, residual, fp
type(state_vector) :: bf, dx, residual
! Position vectors
type(pos_vector) :: bfp
! OTD basis
Expand All @@ -33,15 +33,13 @@ program demo

! Misc
type(newton_dp_opts) :: opts
type(gmres_dp_opts) :: gmres_opts
integer :: i, j, info
real(wp) :: rnorm, tol, Tend, t_FTLE, d, tmp
real(wp) :: tol, Tend, t_FTLE, d
real(wp), dimension(npts, npts) :: M, Id
real(wp), dimension(npts) :: eval, vec
real(wp), dimension(npts, r) :: u, Lu
real(wp), dimension(r, r) :: Lr
real(wp) :: etime, etmin, etmax, etimp
integer :: lcount, rcount, gcount

! IO
character(len=20) :: data_fmt, header_fmt

Expand Down Expand Up @@ -223,7 +221,7 @@ program demo
end do
end do
eval = 0.0_wp
eval(1:r) = eigvals(Lr)
eval(1:r) = real(eigvals(Lr), kind=wp)
print '(*(A16,1X))', ' ', 'lambda_1', 'lambda_2'
print '(A16,1X,*(F16.9,1X))', 'Reference ', EV_ref
print *, ''
Expand Down
3 changes: 1 addition & 2 deletions example/roessler/roessler.f90
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ subroutine monodromy_map(self, vec_in, vec_out)
real(wp) :: dt = 1.0_wp
real(wp) :: period
real(wp), dimension(2*npts) :: pos_in, pos_out
type(state_vector) :: vec

select type (vec_in)
type is (state_vector)
Expand Down Expand Up @@ -431,7 +430,7 @@ end subroutine roessler_report_stdout

subroutine write_report_header()
! internals
integer :: i, j, iunit
integer :: iunit
open (newunit=iunit, file=report_file, status='new', action='write')
! time, baseflow
write (iunit, '(*(A16,1X))') 't', 'BF_x', 'BF_y', 'BF_z'
Expand Down
2 changes: 1 addition & 1 deletion example/roessler/roessler_OTD.f90
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ subroutine OTD_map(bf, vec_in, Tend, vec_out, t_FTLE, if_rst)
type(rks54_class) :: OTD_roessler
integer :: idx(1)
real(wp) :: time, t_complete, t1, t2, tvec(2)
logical :: if_GS
! logical :: if_GS
integer :: i, j, p_cnt
real(wp), dimension(r) :: FTLE_in, FTLE_out
real(wp), dimension(npts) :: bf_bkp
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractTypes/AbstractLinops.f90
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ subroutine reset_counter(self, trans, procedure, counter, reset_timer, soft_rese
!! optional flag to choose whether to fully reset the timer (default: .false.)
! internals
integer :: counter_, count_old
logical :: reset_timer_, soft, clean
logical :: reset_timer_
character(len=128) :: msg
counter_ = optval(counter, 0)
count_old = self%get_counter(trans)
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractTypes/AbstractLinops.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ contains
!! optional flag to choose whether to fully reset the timer (default: .false.)
! internals
integer :: counter_, count_old
logical :: reset_timer_, soft, clean
logical :: reset_timer_
character(len=128) :: msg
counter_ = optval(counter, 0)
count_old = self%get_counter(trans)
Expand Down
8 changes: 4 additions & 4 deletions src/Krylov/BaseKrylov.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ subroutine krylov_schur_rsp(n, X, H, select_eigs)
!----- Internal variables -----
!--------------------------------------

integer :: i, kdim
integer :: kdim

! Schur-related.
real(sp) :: Z(size(H, 2), size(H, 2)), T(size(H, 2), size(H, 2))
Expand Down Expand Up @@ -1209,7 +1209,7 @@ subroutine krylov_schur_rdp(n, X, H, select_eigs)
!----- Internal variables -----
!--------------------------------------

integer :: i, kdim
integer :: kdim

! Schur-related.
real(dp) :: Z(size(H, 2), size(H, 2)), T(size(H, 2), size(H, 2))
Expand Down Expand Up @@ -1268,7 +1268,7 @@ subroutine krylov_schur_csp(n, X, H, select_eigs)
!----- Internal variables -----
!--------------------------------------

integer :: i, kdim
integer :: kdim

! Schur-related.
complex(sp) :: Z(size(H, 2), size(H, 2)), T(size(H, 2), size(H, 2))
Expand Down Expand Up @@ -1327,7 +1327,7 @@ subroutine krylov_schur_cdp(n, X, H, select_eigs)
!----- Internal variables -----
!--------------------------------------

integer :: i, kdim
integer :: kdim

! Schur-related.
complex(dp) :: Z(size(H, 2), size(H, 2)), T(size(H, 2), size(H, 2))
Expand Down
2 changes: 1 addition & 1 deletion src/Krylov/BaseKrylov.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ contains
!----- Internal variables -----
!--------------------------------------

integer :: i, kdim
integer :: kdim

! Schur-related.
${type}$ :: Z(size(H, 2), size(H, 2)), T(size(H, 2), size(H, 2))
Expand Down
10 changes: 5 additions & 5 deletions src/Utilities/Logger.f90
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ subroutine check_info(info, origin, module, procedure, info_msg)
character(len=*), optional, intent(in) :: procedure
!! The name of the procedure in which the call happens
character(len=*), optional, intent(in) :: info_msg
character*128 :: str
character(len=128) :: str
!! Optional extra message

! internals
character*256 :: msg
character(len=256) :: msg
integer :: ierr

str = optval(info_msg, '')
Expand Down Expand Up @@ -564,11 +564,11 @@ subroutine check_test(error, test_name, info, eq, context)
character(len=*), optional, intent(in) :: info
character(len=*), optional, intent(in) :: eq
character(len=*), optional, intent(in) :: context
character*128 :: name
character(len=128) :: name

! internals
character*128 :: msg, info_, eq_
character(len=*), parameter :: indent = repeat(" ", 7)
character(len=128) :: msg, info_, eq_
! character(len=*), parameter :: indent = repeat(" ", 7)
character(len=4), dimension(4) :: substrings
integer :: i

Expand Down
2 changes: 0 additions & 2 deletions src/Utilities/Timer_Utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ subroutine finalize_timer(self, if_silent)
logical, optional, intent(in) :: if_silent
!! No output
! internal
integer :: i, count
logical :: silent
real(dp) :: etime, etavg
character(len=128) :: msg
silent = optval(if_silent, .false.)
call self%stop()
Expand Down

0 comments on commit c159ae9

Please sign in to comment.