polishing

!incremental update, wait for commit of damask_spectral.f90 before checking out
This commit is contained in:
Martin Diehl 2011-10-18 09:22:33 +00:00
parent 7604a8aeb4
commit ea2ba1573c
1 changed files with 22 additions and 67 deletions

View File

@ -144,9 +144,7 @@ end function
endif endif
enddo enddo
620 return 620 endfunction
endfunction
@ -169,9 +167,7 @@ end function
open(unit,status='old',err=100,file=trim(getSolverWorkingDirectoryName())//relPath) open(unit,status='old',err=100,file=trim(getSolverWorkingDirectoryName())//relPath)
IO_open_file = .true. IO_open_file = .true.
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -205,9 +201,7 @@ end function
IO_open_inputFile = .true. IO_open_inputFile = .true.
endif endif
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -227,9 +221,7 @@ end function
trim(getSolverJobName())//LogFileExtension) trim(getSolverJobName())//LogFileExtension)
IO_open_logFile = .true. IO_open_logFile = .true.
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -251,9 +243,7 @@ end function
trim(getSolverJobName())//'.'//newExt) trim(getSolverJobName())//'.'//newExt)
IO_open_jobFile = .true. IO_open_jobFile = .true.
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -275,9 +265,7 @@ end function
trim(getSolverJobName())//'.'//newExt) trim(getSolverJobName())//'.'//newExt)
IO_write_jobFile = .true. IO_write_jobFile = .true.
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -306,9 +294,7 @@ end function
endif endif
IO_write_jobBinaryFile = .true. IO_write_jobBinaryFile = .true.
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -337,9 +323,7 @@ end function
endif endif
IO_read_jobBinaryFile = .true. IO_read_jobBinaryFile = .true.
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -363,7 +347,6 @@ end function
enddo enddo
enddo enddo
enddo enddo
return
endfunction endfunction
@ -504,7 +487,6 @@ end function
! on error ! on error
100 IO_hybridIA = -1 100 IO_hybridIA = -1
close(999) close(999)
return
endfunction endfunction
@ -526,8 +508,6 @@ end function
posNonBlank = verify(line,blank) posNonBlank = verify(line,blank)
posComment = scan(line,comment) posComment = scan(line,comment)
IO_isBlank = posNonBlank == 0 .or. posNonBlank == posComment IO_isBlank = posNonBlank == 0 .or. posNonBlank == posComment
return
endfunction endfunction
@ -582,9 +562,7 @@ end function
IO_countSections = IO_countSections + 1 IO_countSections = IO_countSections + 1
enddo enddo
100 return 100 endfunction
endfunction
!********************************************************************* !*********************************************************************
@ -628,7 +606,6 @@ end function
enddo enddo
100 IO_countTagInPart = counter 100 IO_countTagInPart = counter
return
endfunction endfunction
@ -673,10 +650,7 @@ endfunction
endif endif
enddo enddo
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
! locate at most N space-separated parts in line ! locate at most N space-separated parts in line
@ -712,9 +686,7 @@ endfunction
IO_stringPos(1) = IO_stringPos(1)+1 IO_stringPos(1) = IO_stringPos(1)+1
enddo enddo
return endfunction
endfunction
!******************************************************************** !********************************************************************
@ -734,7 +706,6 @@ endfunction
else else
IO_stringValue = line(positions(pos*2):positions(pos*2+1)) IO_stringValue = line(positions(pos*2):positions(pos*2+1))
endif endif
return
endfunction endfunction
@ -752,7 +723,6 @@ endfunction
character(len=ends(pos+1)-ends(pos)) IO_fixedStringValue character(len=ends(pos+1)-ends(pos)) IO_fixedStringValue
IO_fixedStringValue = line(ends(pos)+1:ends(pos+1)) IO_fixedStringValue = line(ends(pos)+1:ends(pos+1))
return
endfunction endfunction
@ -760,23 +730,22 @@ endfunction
!******************************************************************** !********************************************************************
! read float value at pos from line ! read float value at pos from line
!******************************************************************** !********************************************************************
pure function IO_floatValue (line,positions,pos) pure function IO_floatValue (line,positions,myPos)
use prec, only: pReal,pInt use prec, only: pReal,pInt
implicit none implicit none
character(len=*), intent(in) :: line character(len=*), intent(in) :: line
integer(pInt), intent(in) :: positions(*),pos integer(pInt), intent(in) :: positions(*),myPos
real(pReal) IO_floatValue real(pReal) IO_floatValue
if (positions(1) < pos) then if (positions(1) < myPos) then
IO_floatValue = 0.0_pReal IO_floatValue = 0.0_pReal
else else
read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_floatValue read(UNIT=line(positions(myPos*2):positions(myPos*2+1)),ERR=100,FMT=*) IO_floatValue
endif endif
return return
100 IO_floatValue = huge(1.0_pReal) 100 IO_floatValue = huge(1.0_pReal)
return
endfunction endfunction
@ -796,7 +765,6 @@ endfunction
read(UNIT=line(ends(pos-1)+1:ends(pos)),ERR=100,FMT=*) IO_fixedFloatValue read(UNIT=line(ends(pos-1)+1:ends(pos)),ERR=100,FMT=*) IO_fixedFloatValue
return return
100 IO_fixedFloatValue = huge(1.0_pReal) 100 IO_fixedFloatValue = huge(1.0_pReal)
return
endfunction endfunction
@ -825,7 +793,6 @@ endfunction
IO_fixedNoEFloatValue = base*10.0_pReal**expon IO_fixedNoEFloatValue = base*10.0_pReal**expon
return return
100 IO_fixedNoEFloatValue = huge(1.0_pReal) 100 IO_fixedNoEFloatValue = huge(1.0_pReal)
return
endfunction endfunction
@ -849,7 +816,6 @@ endfunction
endif endif
return return
100 IO_intValue = huge(1_pInt) 100 IO_intValue = huge(1_pInt)
return
endfunction endfunction
@ -869,7 +835,6 @@ endfunction
read(UNIT=line(ends(pos)+1:ends(pos+1)),ERR=100,FMT=*) IO_fixedIntValue read(UNIT=line(ends(pos)+1:ends(pos+1)),ERR=100,FMT=*) IO_fixedIntValue
return return
100 IO_fixedIntValue = huge(1_pInt) 100 IO_fixedIntValue = huge(1_pInt)
return
endfunction endfunction
@ -890,7 +855,6 @@ endfunction
do i=1,len(line) do i=1,len(line)
if(64<iachar(line(i:i)) .and. iachar(line(i:i))<91) IO_lc(i:i)=achar(iachar(line(i:i))+32) if(64<iachar(line(i:i)) .and. iachar(line(i:i))<91) IO_lc(i:i)=achar(iachar(line(i:i))+32)
enddo enddo
return
endfunction endfunction
@ -912,7 +876,6 @@ endfunction
if(64<iachar(line(i:i)) .and. iachar(line(i:i))<91) IO_lc(i:i)=achar(iachar(line(i:i))+32) if(64<iachar(line(i:i)) .and. iachar(line(i:i))<91) IO_lc(i:i)=achar(iachar(line(i:i))+32)
enddo enddo
line = IO_lc line = IO_lc
return
endsubroutine endsubroutine
@ -936,9 +899,7 @@ endfunction
pos = IO_stringPos(line,maxNchunks) pos = IO_stringPos(line,maxNchunks)
remainingChunks = remainingChunks - pos(1) remainingChunks = remainingChunks - pos(1)
enddo enddo
100 return 100 endsubroutine
endsubroutine
!******************************************************************** !********************************************************************
@ -960,8 +921,6 @@ endfunction
if (pos > 0 .and. line(:pos-1) == key(:pos-1)) & ! key matches expected key if (pos > 0 .and. line(:pos-1) == key(:pos-1)) & ! key matches expected key
IO_extractValue = line(pos+1:) ! extract value IO_extractValue = line(pos+1:) ! extract value
return
endfunction endfunction
@ -993,7 +952,6 @@ endfunction
endif endif
enddo enddo
100 backspace(unit) 100 backspace(unit)
return
endfunction endfunction
@ -1051,9 +1009,7 @@ endfunction
endselect endselect
100 return 100 endfunction
endfunction
!******************************************************************** !********************************************************************
@ -1158,9 +1114,7 @@ endfunction
endselect endselect
100 return 100 endfunction
endfunction
@ -1181,7 +1135,7 @@ endfunction
select case (ID) select case (ID)
case (30) case (30)
msg = 'opening spectral loadcase' msg = 'could not open spectral loadcase'
case (31) case (31)
msg = 'mask consistency violated in spectral loadcase' msg = 'mask consistency violated in spectral loadcase'
case (32) case (32)
@ -1206,6 +1160,8 @@ endfunction
msg = 'resolution in spectral mesh' msg = 'resolution in spectral mesh'
case (44) case (44)
msg = 'dimension in spectral mesh' msg = 'dimension in spectral mesh'
case (45)
msg = 'incomplete information in spectral mesh header'
case (50) case (50)
msg = 'writing constitutive output description' msg = 'writing constitutive output description'
case (100) case (100)
@ -1213,7 +1169,7 @@ endfunction
case (101) case (101)
msg = 'opening input file' msg = 'opening input file'
case (102) case (102)
msg = 'DAMASK_spectral misses arguments geom + load' msg = 'DAMASK_spectral misses arguments'
case (103) case (103)
msg = 'odd resolution given' msg = 'odd resolution given'
case (104) case (104)
@ -1432,7 +1388,6 @@ endfunction
!$OMP END CRITICAL (write2out) !$OMP END CRITICAL (write2out)
! ABAQUS returns in some cases ! ABAQUS returns in some cases
return
endsubroutine endsubroutine