switch on restartRead logical when requested by "--restart" cmdline switch

This commit is contained in:
Philip Eisenlohr 2012-06-18 09:27:36 +00:00
parent 380f40561b
commit d9c6f9e134
3 changed files with 14 additions and 29 deletions

View File

@ -404,13 +404,13 @@ program DAMASK_spectral
else
write(6,'(a)')'deformation gradient rate:'
endif
write (*,'(3(3(f12.7,1x)/))',advance='no') merge(math_transpose33(bc(loadcase)%deformation),&
write (6,'(3(3(f12.7,1x)/))',advance='no') merge(math_transpose33(bc(loadcase)%deformation),&
reshape(spread(DAMASK_NaN,1,9),[ 3,3]),transpose(bc(loadcase)%maskDeformation))
write (*,'(a,/,3(3(f12.7,1x)/))',advance='no') ' stress / GPa:',&
write (6,'(a,/,3(3(f12.7,1x)/))',advance='no') ' stress / GPa:',&
1e-9_pReal*merge(math_transpose33(bc(loadcase)%stress),&
reshape(spread(DAMASK_NaN,1,9),[ 3,3]),transpose(bc(loadcase)%maskStress))
if (any(bc(loadcase)%rotation /= math_I3)) &
write (*,'(a,/,3(3(f12.7,1x)/))',advance='no') ' rotation of loadframe:',&
write (6,'(a,/,3(3(f12.7,1x)/))',advance='no') ' rotation of loadframe:',&
math_transpose33(bc(loadcase)%rotation)
write(6,'(a,f12.6)') 'temperature:', bc(loadcase)%temperature
write(6,'(a,f12.6)') 'time: ', bc(loadcase)%time
@ -527,7 +527,7 @@ program DAMASK_spectral
enddo; enddo; enddo
!--------------------------------------------------------------------------------------------------
! get reference material stifness and init fields to no deformation
! get reference material stiffness and init fields to no deformation
ielem = 0_pInt
do k = 1_pInt, res(3); do j = 1_pInt, res(2); do i = 1_pInt, res(1)
ielem = ielem + 1_pInt

View File

@ -32,7 +32,7 @@ module DAMASK_interface
logical, public :: &
appendToOutFile = .false. !< Append to existing spectralOut file (in case of restart, not in case of regridding)
integer(pInt), public :: &
spectralRestart = 1_pInt !< Increment at which calculation starts
spectralRestartInc = 1_pInt !< Increment at which calculation starts
character(len=1024), public :: &
geometryFile = '', & !< parameter given for geometry file
loadCaseFile = '' !< parameter given for load case file
@ -80,8 +80,7 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn)
dateAndTime ! type default integer
logical :: &
gotLoadCase = .false., &
gotGeometry = .false., &
gotRestart = .false.
gotGeometry = .false.
write(6,'(a)') ''
write(6,'(a)') '<<<+- DAMASK_spectral_interface init -+>>>'
@ -91,7 +90,7 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn)
if ( present(loadcaseParameterIn) .and. present(geometryParameterIn)) then ! both mandatory parameters given in function call
geometryParameter = geometryParameterIn
loadcaseParameter = loadcaseParameterIn
commandLine='n/a'
commandLine = 'n/a'
gotLoadCase = .true.
gotGeometry = .true.
else if ( .not.( present(loadcaseParameterIn) .and. present(geometryParameterIn))) then ! none parameters given in function call, trying to get them from command line
@ -145,32 +144,17 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn)
write(6,'(a)') ' '
call quit(0_pInt) ! normal Termination
case ('-l', '--load', '--loadcase')
if (gotLoadCase) then
write(6,'(a)') 'Got 2nd time loadcase keyword'
call quit(1_pInt)
endif
loadcaseParameter = IO_stringValue(commandLine,positions,i+1_pInt)
gotLoadCase = .true.
case ('-g', '--geom', '--geometry')
if (gotGeometry) then
write(6,'(a)') 'Got 2nd time geometry keyword'
call quit(1_pInt)
endif
geometryParameter = IO_stringValue(commandLine,positions,i+1_pInt)
gotGeometry = .true.
case ('-r', '--rs', '--restart')
spectralRestart = IO_IntValue(commandLine,positions,i+1_pInt)
spectralRestartInc = IO_IntValue(commandLine,positions,i+1_pInt)
appendToOutFile = .true.
if (gotRestart) then
write(6,'(a)') 'Got 2nd time restart/regrid keyword'
call quit(1_pInt)
endif
case ('--rg', '--regrid')
spectralRestart = IO_IntValue(commandLine,positions,i+1_pInt)
if (gotRestart) then
write(6,'(a)') 'Got 2nd time restart/regrid keyword'
call quit(1_pInt)
endif
spectralRestartInc = IO_IntValue(commandLine,positions,i+1_pInt)
appendToOutFile = .false.
end select
enddo
endif
@ -199,8 +183,8 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn)
write(6,'(a,a)') 'Command line call: ', trim(commandLine)
write(6,'(a,a)') 'Geometry parameter: ', trim(geometryParameter)
write(6,'(a,a)') 'Loadcase parameter: ', trim(loadcaseParameter)
if (SpectralRestart > 1) write(6,'(a,i6.6)') &
'Restart at increment: ', spectralRestart
if (SpectralRestartInc > 1_pInt) write(6,'(a,i6.6)') &
'Restart at increment: ', spectralRestartInc
write(6,'(a,l1)') 'Append to result file: ', appendToOutFile
end subroutine DAMASK_interface_init

View File

@ -103,11 +103,12 @@ subroutine FE_init
#ifdef Spectral
modelName = getSolverJobName()
restartInc = spectralRestart
restartInc = spectralRestartInc
if(restartInc <= 0_pInt) then
call IO_warning(warning_ID=34_pInt)
restartInc = 1_pInt
endif
restartRead = restartInc > 1_pInt ! only read in if "true" restart requested
#else
call IO_open_inputFile(fileunit,getSolverJobName())
rewind(fileunit)