Skip to content

Commit

Permalink
Use runtime determination of strings len
Browse files Browse the repository at this point in the history
Signed-off-by: Igor S. Gerasimov <[email protected]>
  • Loading branch information
foxtran committed Feb 12, 2025
1 parent 094c4e1 commit add2b6b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/mctc/symbols.f90
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ subroutine getIdentitySymbol(nId, identity, symbol)
!> Chemical identity
integer, intent(out) :: identity(:)

character(len=symbolLength), allocatable :: sTmp(:)
character(len=:), allocatable :: sTmp(:)
integer :: nAt, iAt, iId

nAt = size(identity)
allocate(sTmp(nAt))
allocate(character(len=len(symbol)) :: sTmp(nAt))
nId = 0
do iAt = 1, nAt
iId = findSymbol(sTmp(:nId), symbol(iAt))
Expand Down Expand Up @@ -330,10 +330,6 @@ pure subroutine appendSymbol(list, nList, symbol)
!> Elements symbol
character(len=*), intent(in) :: symbol

if (len(symbol) > len(list)) then
error stop "Programmer's bug: len(symbol) > len(list)"
end if

if (nList >= size(list)) then
call resize(list)
end if
Expand Down

0 comments on commit add2b6b

Please sign in to comment.