avoid access to unused variable, no need for nested function

This commit is contained in:
Martin Diehl 2023-06-23 08:54:37 +02:00
parent 4e7d953fe9
commit e34ee25597
1 changed files with 31 additions and 31 deletions

View File

@ -56,7 +56,6 @@ subroutine CLI_init()
i i
integer, dimension(8) :: & integer, dimension(8) :: &
dateAndTime dateAndTime
integer :: err
external :: & external :: &
quit quit
@ -161,7 +160,6 @@ subroutine CLI_init()
call quit(1) call quit(1)
end if end if
end select end select
if (err /= 0) call quit(1)
end do end do
if (.not. all([allocated(loadcaseArg),allocated(geometryArg),allocated(materialArg)])) then if (.not. all([allocated(loadcaseArg),allocated(geometryArg),allocated(materialArg)])) then
@ -188,17 +186,19 @@ subroutine CLI_init()
if (CLI_restartInc > 0) & if (CLI_restartInc > 0) &
print'(1x,a,i6.6)', 'Restart from increment: ', CLI_restartInc print'(1x,a,i6.6)', 'Restart from increment: ', CLI_restartInc
contains
!------------------------------------------------------------------------------------------------ end subroutine CLI_init
!--------------------------------------------------------------------------------------------------
!> @brief Get argument from command line. !> @brief Get argument from command line.
!------------------------------------------------------------------------------------------------ !--------------------------------------------------------------------------------------------------
function getArg(n) function getArg(n)
integer, intent(in) :: n !< number of the argument integer, intent(in) :: n !< number of the argument
character(len=:), allocatable :: getArg character(len=:), allocatable :: getArg
integer :: l,err integer :: l,err
external :: quit
allocate(character(len=0)::getArg) allocate(character(len=0)::getArg)
@ -218,8 +218,6 @@ subroutine CLI_init()
end function getArg end function getArg
end subroutine CLI_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief extract working directory from given argument or from location of geometry file, !> @brief extract working directory from given argument or from location of geometry file,
@ -229,9 +227,11 @@ subroutine setWorkingDirectory(workingDirectoryArg)
character(len=*), intent(in) :: workingDirectoryArg !< working directory argument character(len=*), intent(in) :: workingDirectoryArg !< working directory argument
character(len=:), allocatable :: workingDirectory character(len=:), allocatable :: workingDirectory
logical :: error logical :: error
external :: quit external :: quit
absolutePath: if (workingDirectoryArg(1:1) == '/') then absolutePath: if (workingDirectoryArg(1:1) == '/') then
workingDirectory = workingDirectoryArg workingDirectory = workingDirectoryArg
else absolutePath else absolutePath