diff --git a/src/FEsolving.f90 b/src/FEsolving.f90 index 070b05a28..bb2fe04ed 100644 --- a/src/FEsolving.f90 +++ b/src/FEsolving.f90 @@ -47,8 +47,7 @@ subroutine FE_init status='old', position='rewind', action='read',iostat=myStat) do read (fileUnit,'(A)',END=100) line - chunkPos = IO_stringPos(line) - if(IO_lc(IO_stringValue(line,chunkPos,1)) == 'solver') then + if(index(trim(lc(line)),'solver') == 1) then read (fileUnit,'(A)',END=100) line ! next line chunkPos = IO_stringPos(line) symmetricSolver = (IO_intValue(line,chunkPos,2) /= 1) @@ -56,6 +55,29 @@ subroutine FE_init enddo 100 close(fileUnit) end block + contains + + !-------------------------------------------------------------------------------------------------- + !> @brief changes characters in string to lower case + !> @details copied from IO_lc + !-------------------------------------------------------------------------------------------------- + function lc(string) + + character(len=*), intent(in) :: string !< string to convert + character(len=len(string)) :: lc + + character(26), parameter :: LOWER = 'abcdefghijklmnopqrstuvwxyz' + character(26), parameter :: UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + + integer :: i,n + + do i=1,len(string) + lc(i:i) = string(i:i) + n = index(UPPER,lc(i:i)) + if (n/=0) lc(i:i) = LOWER(n:n) + enddo + end function lc + #endif end subroutine FE_init diff --git a/src/IO.f90 b/src/IO.f90 index 867173a52..a0ba1e07d 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -452,10 +452,10 @@ pure function IO_lc(string) character(26), parameter :: LOWER = 'abcdefghijklmnopqrstuvwxyz' character(26), parameter :: UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - integer :: i,n + integer :: i,n - IO_lc = string do i=1,len(string) + IO_lc(i:i) = string(i:i) n = index(UPPER,IO_lc(i:i)) if (n/=0) IO_lc(i:i) = LOWER(n:n) enddo