From d9c6f9e134c7d5e7f97701d4cd5c99e94619fb98 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 18 Jun 2012 09:27:36 +0000 Subject: [PATCH] switch on restartRead logical when requested by "--restart" cmdline switch --- code/DAMASK_spectral.f90 | 8 ++++---- code/DAMASK_spectral_interface.f90 | 32 ++++++++---------------------- code/FEsolving.f90 | 3 ++- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index e0cd3a4dd..494987cca 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -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 diff --git a/code/DAMASK_spectral_interface.f90 b/code/DAMASK_spectral_interface.f90 index 18e12c458..4a77b623e 100644 --- a/code/DAMASK_spectral_interface.f90 +++ b/code/DAMASK_spectral_interface.f90 @@ -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 diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index 7d551f325..88ef9d76b 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -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)