Intel compiler failed with SIGSEV
derived types, pointers, finalize .... altogether seems to bring both Compilers to their limits. I cannot see what was wrong before, but now it works and might be a little faster
This commit is contained in:
parent
271b9ba76b
commit
7ecb7689f1
|
@ -194,41 +194,39 @@ subroutine parseFile(line,sectionNames,part,&
|
||||||
type(tPartitionedStringList), allocatable, dimension(:), intent(out) :: part
|
type(tPartitionedStringList), allocatable, dimension(:), intent(out) :: part
|
||||||
character(len=pStringLen), dimension(:), intent(in) :: fileContent
|
character(len=pStringLen), dimension(:), intent(in) :: fileContent
|
||||||
|
|
||||||
integer(pInt), allocatable, dimension(:) :: partPosition
|
integer(pInt), allocatable, dimension(:) :: partPosition ! position of [] tags + last line in section
|
||||||
type(tPartitionedStringList) :: emptyList
|
integer(pInt) :: i, j
|
||||||
integer(pInt) :: i
|
|
||||||
logical :: echo
|
logical :: echo
|
||||||
|
|
||||||
echo = .false.
|
echo = .false.
|
||||||
allocate(part(0))
|
|
||||||
allocate(partPosition(0))
|
allocate(partPosition(0))
|
||||||
|
|
||||||
do i = 1_pInt, size(fileContent)
|
do i = 1_pInt, size(fileContent)
|
||||||
line = trim(fileContent(i))
|
line = trim(fileContent(i))
|
||||||
if (IO_getTag(line,'<','>') /= '') exit
|
if (IO_getTag(line,'<','>') /= '') exit
|
||||||
nextSection: if (IO_getTag(line,'[',']') /= '') then
|
nextSection: if (IO_getTag(line,'[',']') /= '') then
|
||||||
part = [part, emptyList]
|
|
||||||
partPosition = [partPosition, i]
|
partPosition = [partPosition, i]
|
||||||
cycle
|
cycle
|
||||||
endif nextSection
|
endif nextSection
|
||||||
inSection: if (size(part) > 0_pInt) then
|
if (size(partPosition) < 1_pInt) &
|
||||||
call part(size(part))%add(trim(adjustl(line)))
|
echo = (trim(IO_getTag(line,'/','/')) == 'echo') .or. echo
|
||||||
else inSection
|
|
||||||
if (trim(IO_getTag(line,'/','/')) == 'echo') echo = .true.
|
|
||||||
endif inSection
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
allocate(sectionNames(size(partPosition)))
|
allocate(sectionNames(size(partPosition)))
|
||||||
do i = 1_pInt, size(partPosition)
|
allocate(part(size(partPosition)))
|
||||||
sectionNames(i) = trim(adjustl(fileContent(partPosition(i))))
|
|
||||||
enddo
|
|
||||||
|
|
||||||
if (echo) then
|
partPosition = [partPosition, i] ! needed when actually storing content
|
||||||
do i = 1, size(sectionNames)
|
|
||||||
write(6,'(a)') 'section',i, '"'//trim(sectionNames(i))//'"'
|
do i = 1_pInt, size(partPosition) -1_pInt
|
||||||
call part(i)%show()
|
sectionNames(i) = trim(adjustl(fileContent(partPosition(i))))
|
||||||
|
do j = partPosition(i) + 1_pInt, partPosition(i+1) -1_pInt
|
||||||
|
call part(i)%add(trim(adjustl(fileContent(j))))
|
||||||
enddo
|
enddo
|
||||||
|
if (echo) then
|
||||||
|
write(6,*) 'section',i, '"'//trim(sectionNames(i))//'"'
|
||||||
|
call part(i)%show()
|
||||||
endif
|
endif
|
||||||
|
enddo
|
||||||
|
|
||||||
end subroutine parseFile
|
end subroutine parseFile
|
||||||
|
|
||||||
|
@ -316,7 +314,7 @@ subroutine show(this)
|
||||||
|
|
||||||
item => this
|
item => this
|
||||||
do while (associated(item%next))
|
do while (associated(item%next))
|
||||||
write(6,'(a)') trim(item%string%val)
|
write(6,'(a)') ' '//trim(item%string%val)
|
||||||
item => item%next
|
item => item%next
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue