Merge branch 'development' into Vectorize-Orientation
This commit is contained in:
commit
f8894b921c
12
src/IO.f90
12
src/IO.f90
|
@ -11,7 +11,6 @@ module IO
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
character(len=*), parameter, public :: &
|
character(len=*), parameter, public :: &
|
||||||
IO_EOF = '#EOF#', & !< end of file string
|
|
||||||
IO_WHITESPACE = achar(44)//achar(32)//achar(9)//achar(10)//achar(13) !< whitespace characters
|
IO_WHITESPACE = achar(44)//achar(32)//achar(9)//achar(10)//achar(13) !< whitespace characters
|
||||||
character, parameter, public :: &
|
character, parameter, public :: &
|
||||||
IO_EOL = new_line('DAMASK'), & !< end of line character
|
IO_EOL = new_line('DAMASK'), & !< end of line character
|
||||||
|
@ -106,7 +105,7 @@ function IO_readlines(fileName) result(fileContent)
|
||||||
endif
|
endif
|
||||||
startPos = endPos + 2 ! jump to next line start
|
startPos = endPos + 2 ! jump to next line start
|
||||||
|
|
||||||
fileContent(l) = line
|
fileContent(l) = trim(line)//''
|
||||||
l = l + 1
|
l = l + 1
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -114,7 +113,8 @@ end function IO_readlines
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief reads an entire ASCII file into a string
|
!> @brief read ASCII file into a string
|
||||||
|
!> @details ensures that the string ends with a new line (expected UNIX behavior)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
function IO_read(fileName) result(fileContent)
|
function IO_read(fileName) result(fileContent)
|
||||||
|
|
||||||
|
@ -130,10 +130,14 @@ function IO_read(fileName) result(fileContent)
|
||||||
status='old', position='rewind', action='read',iostat=myStat)
|
status='old', position='rewind', action='read',iostat=myStat)
|
||||||
if(myStat /= 0) call IO_error(100,ext_msg=trim(fileName))
|
if(myStat /= 0) call IO_error(100,ext_msg=trim(fileName))
|
||||||
allocate(character(len=fileLength)::fileContent)
|
allocate(character(len=fileLength)::fileContent)
|
||||||
|
if(fileLength==0) return
|
||||||
|
|
||||||
read(fileUnit,iostat=myStat) fileContent
|
read(fileUnit,iostat=myStat) fileContent
|
||||||
if(myStat > 0) call IO_error(102,ext_msg=trim(fileName)) ! <0 for ifort (https://software.intel.com/en-us/comment/1960081)
|
if(myStat /= 0) call IO_error(102,ext_msg=trim(fileName))
|
||||||
close(fileUnit)
|
close(fileUnit)
|
||||||
|
|
||||||
|
if(fileContent(fileLength:fileLength) /= IO_EOL) fileContent = fileContent//IO_EOL ! ensure EOL@EOF
|
||||||
|
|
||||||
end function IO_read
|
end function IO_read
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,8 @@ program DAMASK_grid
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! reading information from load case file and to sanity checks
|
! reading information from load case file and to sanity checks
|
||||||
fileContent = IO_read_ASCII(trim(loadCaseFile))
|
fileContent = IO_readlines(trim(loadCaseFile))
|
||||||
|
if(size(fileContent) == 0) call IO_error(307,ext_msg='No load case specified')
|
||||||
|
|
||||||
allocate (loadCases(0)) ! array of load cases
|
allocate (loadCases(0)) ! array of load cases
|
||||||
do currentLoadCase = 1, size(fileContent)
|
do currentLoadCase = 1, size(fileContent)
|
||||||
|
|
|
@ -119,7 +119,7 @@ subroutine discretization_mesh_init(restart)
|
||||||
call MPI_Bcast(mesh_boundaries,mesh_Nboundaries,MPI_INTEGER,0,PETSC_COMM_WORLD,ierr)
|
call MPI_Bcast(mesh_boundaries,mesh_Nboundaries,MPI_INTEGER,0,PETSC_COMM_WORLD,ierr)
|
||||||
|
|
||||||
if (worldrank == 0) then
|
if (worldrank == 0) then
|
||||||
fileContent = IO_read_ASCII(geometryFile)
|
fileContent = IO_readlines(geometryFile)
|
||||||
l = 0
|
l = 0
|
||||||
do
|
do
|
||||||
l = l + 1
|
l = l + 1
|
||||||
|
|
Loading…
Reference in New Issue