hot fix for so far non-supported input file format of Marc 2017

This commit is contained in:
Franz Roters 2017-10-04 17:18:06 +02:00
parent b66a9a3527
commit 4d4a546e2d
2 changed files with 24 additions and 10 deletions

View File

@ -1587,6 +1587,8 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
! DAMASK_marc errors
case (700_pInt)
msg = 'invalid materialpoint result requested'
case (701_pInt)
msg = 'not supported input file format, use Marc 2016 or earlier'
!-------------------------------------------------------------------------------------------------
! errors related to spectral solver

View File

@ -706,7 +706,6 @@ integer(pInt) function mesh_FEasCP(what,myID)
mesh_FEasCP = lookupMap(2_pInt,upper)
return
endif
! this might be the reason for the heap problems
binarySearch: do while (upper-lower > 1_pInt)
center = (lower+upper)/2_pInt
if (lookupMap(1_pInt,center) < myID) then
@ -1692,13 +1691,15 @@ subroutine mesh_marc_count_cpElements(fileUnit)
use IO, only: IO_lc, &
IO_stringValue, &
IO_stringPos, &
IO_countContinuousIntValues
IO_countContinuousIntValues, &
IO_error, &
IO_intValue
implicit none
integer(pInt), intent(in) :: fileUnit
integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt) :: i
integer(pInt) :: i, version
character(len=300):: line
mesh_NcpElems = 0_pInt
@ -1709,15 +1710,26 @@ subroutine mesh_marc_count_cpElements(fileUnit)
do
read (fileUnit,610,END=620) line
chunkPos = IO_stringPos(line)
if ( IO_lc(IO_stringValue(line,chunkPos,1_pInt)) == 'hypoelastic') then
do i=1_pInt,3_pInt+hypoelasticTableStyle ! Skip 3 or 4 lines
if ( IO_lc(IO_stringValue(line,chunkPos,1_pInt)) == 'version') then
version = IO_intValue(line,chunkPos,2_pInt)
if (version < 13) then ! Marc 2016 or earlier
rewind(fileUnit)
do
read (fileUnit,610,END=620) line
chunkPos = IO_stringPos(line)
if ( IO_lc(IO_stringValue(line,chunkPos,1_pInt)) == 'hypoelastic') then
do i=1_pInt,3_pInt+hypoelasticTableStyle ! Skip 3 or 4 lines
read (fileUnit,610,END=620) line
enddo
mesh_NcpElems = mesh_NcpElems + IO_countContinuousIntValues(fileUnit) ! why not simply mesh_NcpElems = IO_countContinuousIntValues(fileUnit)? keyword hypoelastic might appear several times
exit
endif
enddo
mesh_NcpElems = mesh_NcpElems + IO_countContinuousIntValues(fileUnit) ! why not simply mesh_NcpElems = IO_countContinuousIntValues(fileUnit)?
exit
endif
enddo
else ! Marc2017 and later
call IO_error(error_ID=701_pInt)
end if
end if
enddo
620 end subroutine mesh_marc_count_cpElements