[skip ci] fixed indentation

This commit is contained in:
Martin Diehl 2019-09-19 12:58:51 -07:00
parent 7fd4b8bff6
commit 5ab8f55f21
1 changed files with 105 additions and 105 deletions

View File

@ -6,48 +6,48 @@
!> @brief input/output functions, partly depending on chosen solver !> @brief input/output functions, partly depending on chosen solver
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module IO module IO
use prec use prec
use DAMASK_interface use DAMASK_interface
implicit none implicit none
private private
character(len=5), parameter, public :: & character(len=5), parameter, public :: &
IO_EOF = '#EOF#' !< end of file string IO_EOF = '#EOF#' !< end of file string
character(len=207), parameter, private :: & character(len=207), parameter, private :: &
IO_DIVIDER = '───────────────────'//& IO_DIVIDER = '───────────────────'//&
'───────────────────'//& '───────────────────'//&
'───────────────────'//& '───────────────────'//&
'────────────' '────────────'
public :: & public :: &
IO_init, & IO_init, &
IO_read_ASCII, & IO_read_ASCII, &
IO_open_file, & IO_open_file, &
IO_open_jobFile_binary, & IO_open_jobFile_binary, &
IO_write_jobFile, & IO_write_jobFile, &
IO_isBlank, & IO_isBlank, &
IO_getTag, & IO_getTag, &
IO_stringPos, & IO_stringPos, &
IO_stringValue, & IO_stringValue, &
IO_floatValue, & IO_floatValue, &
IO_intValue, & IO_intValue, &
IO_lc, & IO_lc, &
IO_error, & IO_error, &
IO_warning, & IO_warning, &
IO_intOut IO_intOut
#if defined(Marc4DAMASK) || defined(Abaqus) #if defined(Marc4DAMASK) || defined(Abaqus)
public :: & public :: &
IO_open_inputFile, & IO_open_inputFile, &
IO_open_logFile, & IO_open_logFile, &
IO_countContinuousIntValues, & IO_countContinuousIntValues, &
IO_continuousIntValues, & IO_continuousIntValues, &
#if defined(Abaqus) #if defined(Abaqus)
IO_extractValue, & IO_extractValue, &
IO_countDataLines IO_countDataLines
#elif defined(Marc4DAMASK) #elif defined(Marc4DAMASK)
IO_skipChunks, & IO_skipChunks, &
IO_fixedNoEFloatValue, & IO_fixedNoEFloatValue, &
IO_fixedIntValue, & IO_fixedIntValue, &
IO_countNumericalDataLines IO_countNumericalDataLines
#endif #endif
#endif #endif
@ -961,17 +961,17 @@ end subroutine IO_warning
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
character(len=300) pure function IO_extractValue(pair,key) character(len=300) pure function IO_extractValue(pair,key)
character(len=*), intent(in) :: pair, & !< key=value pair character(len=*), intent(in) :: pair, & !< key=value pair
key !< key to be expected key !< key to be expected
character(len=*), parameter :: SEP = achar(61) ! '=' character(len=*), parameter :: SEP = achar(61) ! '='
integer :: myChunk !< position number of desired chunk integer :: myChunk !< position number of desired chunk
IO_extractValue = '' IO_extractValue = ''
myChunk = scan(pair,SEP) myChunk = scan(pair,SEP)
if (myChunk > 0 .and. pair(:myChunk-1) == key) IO_extractValue = pair(myChunk+1:) ! extract value if key matches if (myChunk > 0 .and. pair(:myChunk-1) == key) IO_extractValue = pair(myChunk+1:) ! extract value if key matches
end function IO_extractValue end function IO_extractValue
@ -981,27 +981,27 @@ end function IO_extractValue
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
integer function IO_countDataLines(fileUnit) integer function IO_countDataLines(fileUnit)
integer, intent(in) :: fileUnit !< file handle integer, intent(in) :: fileUnit !< file handle
integer, allocatable, dimension(:) :: chunkPos integer, allocatable, dimension(:) :: chunkPos
character(len=65536) :: line, & character(len=65536) :: line, &
tmp tmp
IO_countDataLines = 0 IO_countDataLines = 0
line = '' line = ''
do while (trim(line) /= IO_EOF) do while (trim(line) /= IO_EOF)
line = IO_read(fileUnit) line = IO_read(fileUnit)
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
tmp = IO_lc(IO_stringValue(line,chunkPos,1)) tmp = IO_lc(IO_stringValue(line,chunkPos,1))
if (tmp(1:1) == '*' .and. tmp(2:2) /= '*') then ! found keyword if (tmp(1:1) == '*' .and. tmp(2:2) /= '*') then ! found keyword
exit exit
else else
if (tmp(2:2) /= '*') IO_countDataLines = IO_countDataLines + 1 if (tmp(2:2) /= '*') IO_countDataLines = IO_countDataLines + 1
endif endif
enddo enddo
backspace(fileUnit) backspace(fileUnit)
end function IO_countDataLines end function IO_countDataLines
#endif #endif
@ -1013,27 +1013,27 @@ end function IO_countDataLines
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
integer function IO_countNumericalDataLines(fileUnit) integer function IO_countNumericalDataLines(fileUnit)
integer, intent(in) :: fileUnit !< file handle integer, intent(in) :: fileUnit !< file handle
integer, allocatable, dimension(:) :: chunkPos integer, allocatable, dimension(:) :: chunkPos
character(len=65536) :: line, & character(len=65536) :: line, &
tmp tmp
IO_countNumericalDataLines = 0 IO_countNumericalDataLines = 0
line = '' line = ''
do while (trim(line) /= IO_EOF) do while (trim(line) /= IO_EOF)
line = IO_read(fileUnit) line = IO_read(fileUnit)
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
tmp = IO_lc(IO_stringValue(line,chunkPos,1)) tmp = IO_lc(IO_stringValue(line,chunkPos,1))
if (verify(trim(tmp),'0123456789') == 0) then ! numerical values if (verify(trim(tmp),'0123456789') == 0) then ! numerical values
IO_countNumericalDataLines = IO_countNumericalDataLines + 1 IO_countNumericalDataLines = IO_countNumericalDataLines + 1
else else
exit exit
endif endif
enddo enddo
backspace(fileUnit) backspace(fileUnit)
end function IO_countNumericalDataLines end function IO_countNumericalDataLines
@ -1043,19 +1043,19 @@ end function IO_countNumericalDataLines
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine IO_skipChunks(fileUnit,N) subroutine IO_skipChunks(fileUnit,N)
integer, intent(in) :: fileUnit, & !< file handle integer, intent(in) :: fileUnit, & !< file handle
N !< minimum number of chunks to skip N !< minimum number of chunks to skip
integer :: remainingChunks integer :: remainingChunks
character(len=65536) :: line character(len=65536) :: line
line = '' line = ''
remainingChunks = N remainingChunks = N
do while (trim(line) /= IO_EOF .and. remainingChunks > 0) do while (trim(line) /= IO_EOF .and. remainingChunks > 0)
line = IO_read(fileUnit) line = IO_read(fileUnit)
remainingChunks = remainingChunks - (size(IO_stringPos(line))-1)/2 remainingChunks = remainingChunks - (size(IO_stringPos(line))-1)/2
enddo enddo
end subroutine IO_skipChunks end subroutine IO_skipChunks
#endif #endif