autodetect string length

This commit is contained in:
Martin Diehl 2020-01-12 00:10:42 +01:00
parent 97ddd56540
commit ddd8027b8a
2 changed files with 6 additions and 6 deletions

View File

@ -46,10 +46,10 @@ subroutine FE_init
call IO_open_inputFile(FILEUNIT) call IO_open_inputFile(FILEUNIT)
rewind(FILEUNIT) rewind(FILEUNIT)
do do
read (FILEUNIT,'(a256)',END=100) line read (FILEUNIT,'(A)',END=100) line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
if(IO_lc(IO_stringValue(line,chunkPos,1)) == 'solver') then if(IO_lc(IO_stringValue(line,chunkPos,1)) == 'solver') then
read (FILEUNIT,'(a256)',END=100) line ! next line read (FILEUNIT,'(A)',END=100) line ! next line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
symmetricSolver = (IO_intValue(line,chunkPos,2) /= 1) symmetricSolver = (IO_intValue(line,chunkPos,2) /= 1)
endif endif

View File

@ -244,7 +244,7 @@ subroutine IO_open_inputFile(fileUnit)
do do
read(unit2,'(A256)',END=220) line read(unit2,'(A)',END=220) line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
if (IO_lc(IO_StringValue(line,chunkPos,1))=='*include') then if (IO_lc(IO_StringValue(line,chunkPos,1))=='*include') then
@ -1000,7 +1000,7 @@ function IO_continuousIntValues(fileUnit,maxN,lookupName,lookupMap,lookupMaxN)
#if defined(Marc4DAMASK) #if defined(Marc4DAMASK)
do do
read(fileUnit,'(A256)',end=100) line read(fileUnit,'(A)',end=100) line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
if (chunkPos(1) < 1) then ! empty line if (chunkPos(1) < 1) then ! empty line
exit exit
@ -1041,14 +1041,14 @@ function IO_continuousIntValues(fileUnit,maxN,lookupName,lookupMap,lookupMaxN)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! check if the element values in the elset are auto generated ! check if the element values in the elset are auto generated
backspace(fileUnit) backspace(fileUnit)
read(fileUnit,'(A256)',end=100) line read(fileUnit,'(A)',end=100) line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
do i = 1,chunkPos(1) do i = 1,chunkPos(1)
if (IO_lc(IO_stringValue(line,chunkPos,i)) == 'generate') rangeGeneration = .true. if (IO_lc(IO_stringValue(line,chunkPos,i)) == 'generate') rangeGeneration = .true.
enddo enddo
do l = 1,c do l = 1,c
read(fileUnit,'(A256)',end=100) line read(fileUnit,'(A)',end=100) line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
if (verify(IO_stringValue(line,chunkPos,1),'0123456789') > 0) then ! a non-int, i.e. set names follow on this line if (verify(IO_stringValue(line,chunkPos,1),'0123456789') > 0) then ! a non-int, i.e. set names follow on this line
do i = 1,chunkPos(1) ! loop over set names in line do i = 1,chunkPos(1) ! loop over set names in line