replaced real 'guessmode' with logical 'guess', caused trouble on gfortran 6.3 with ultra optimization

This commit is contained in:
Martin Diehl 2012-11-08 19:32:00 +00:00
parent 91bfcbcfa3
commit ee5903c767
5 changed files with 31 additions and 30 deletions

View File

@ -95,7 +95,7 @@ program DAMASK_spectral_Driver
! loop variables, convergence etc.
real(pReal), dimension(3,3), parameter :: ones = 1.0_pReal, zeros = 0.0_pReal
real(pReal) :: time = 0.0_pReal, time0 = 0.0_pReal, timeinc = 1.0_pReal, timeinc_old = 0.0_pReal ! elapsed time, begin of interval, time interval, previous time interval
real(pReal) :: guessmode
logical :: guess
integer(pInt) :: i, j, k, l, errorID, cutBackLevel = 0_pInt, stepFraction = 0_pInt
integer(pInt) :: currentLoadcase = 0_pInt, inc, &
totalIncsCounter = 0_pInt,&
@ -317,9 +317,9 @@ program DAMASK_spectral_Driver
loadCaseLooping: do currentLoadCase = 1_pInt, size(loadCases)
time0 = time ! currentLoadCase start time
if (loadCases(currentLoadCase)%followFormerTrajectory) then
guessmode = 1.0_pReal
guess = .true.
else
guessmode = 0.0_pReal ! change of load case, homogeneous guess for the first inc
guess = .false. ! change of load case, homogeneous guess for the first inc
endif
!--------------------------------------------------------------------------------------------------
@ -372,7 +372,7 @@ program DAMASK_spectral_Driver
case (DAMASK_spectral_SolverBasic_label)
solres = basic_solution (&
incInfo, guessmode,timeinc,timeinc_old, &
incInfo, guess,timeinc,timeinc_old, &
P_BC = loadCases(currentLoadCase)%P, &
F_BC = loadCases(currentLoadCase)%deformation, &
temperature_bc = loadCases(currentLoadCase)%temperature, &
@ -380,7 +380,7 @@ program DAMASK_spectral_Driver
#ifdef PETSc
case (DAMASK_spectral_SolverBasicPETSC_label)
solres = BasicPETSC_solution (&
incInfo, guessmode,timeinc,timeinc_old, &
incInfo, guess,timeinc,timeinc_old, &
P_BC = loadCases(currentLoadCase)%P, &
F_BC = loadCases(currentLoadCase)%deformation, &
temperature_bc = loadCases(currentLoadCase)%temperature, &
@ -388,7 +388,7 @@ program DAMASK_spectral_Driver
case (DAMASK_spectral_SolverAL_label)
solres = AL_solution (&
incInfo, guessmode,timeinc,timeinc_old, &
incInfo, guess,timeinc,timeinc_old, &
P_BC = loadCases(currentLoadCase)%P, &
F_BC = loadCases(currentLoadCase)%deformation, &
temperature_bc = loadCases(currentLoadCase)%temperature, &
@ -408,12 +408,12 @@ program DAMASK_spectral_Driver
elseif (solres%termIll) then ! material point model cannot find a solution
call IO_error(850_pInt)
else
guessmode = 1.0_pReal ! start guessing after first accepted (not converged) (sub)inc
guess = .true. ! start guessing after first accepted (not converged) (sub)inc
endif
else
guessmode = 1.0_pReal ! start guessing after first converged (sub)inc
guess = .true. ! start guessing after first converged (sub)inc
endif
if(guessmode == 1.0_pReal) &
if(guess) &
write(statUnit,*) inc, time, cutBackLevel, solres%converged, solres%iterationsNeeded
enddo subIncLooping
cutBackLevel = max(0_pInt, cutBackLevel - 1_pInt) ! try half subincs next inc
@ -437,7 +437,7 @@ program DAMASK_spectral_Driver
endif
else !just time forwarding
time = time + timeinc
guessmode = 1.0_pReal
guess = .true.
endif ! end calculation/forwarding
enddo incLooping

View File

@ -206,7 +206,7 @@ subroutine AL_init()
!> @brief solution for the AL scheme with internal iterations
!--------------------------------------------------------------------------------------------------
type(tSolutionState) function &
AL_solution(incInfoIn,guessmode,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC)
AL_solution(incInfoIn,guess,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC)
use numerics, only: &
update_gamma
@ -236,7 +236,8 @@ subroutine AL_init()
#include <finclude/petscsnes.h90>
!--------------------------------------------------------------------------------------------------
! input data for solution
real(pReal), intent(in) :: timeinc, timeinc_old, temperature_bc, guessmode
real(pReal), intent(in) :: timeinc, timeinc_old, temperature_bc
logical, intent(in) :: guess
type(tBoundaryCondition), intent(in) :: P_BC,F_BC
character(len=*), intent(in) :: incInfoIn
real(pReal), dimension(3,3), intent(in) :: rotation_BC
@ -286,17 +287,16 @@ else
elseif(F_BC%myType=='fdot') then ! f_aimDot is prescribed
f_aimDot = F_BC%maskFloat * F_BC%values
endif
f_aimDot = f_aimDot &
+ guessmode * P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
if (guess) f_aimDot = f_aimDot + P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
F_aim_lastInc = F_aim
!--------------------------------------------------------------------------------------------------
! update coordinates and rate and forward last inc
Fdot = Utilities_calculateRate(math_rotate_backward33(f_aimDot,rotation_BC), &
timeinc,timeinc_old,guessmode,F_lastInc,reshape(F,[3,3,res(1),res(2),res(3)]))
timeinc,timeinc_old,guess,F_lastInc,reshape(F,[3,3,res(1),res(2),res(3)]))
F_lambdaDot = Utilities_calculateRate(math_rotate_backward33(f_aimDot,rotation_BC), &
timeinc,timeinc_old,guessmode,F_lambda_lastInc,reshape(F_lambda,[3,3,res(1),res(2),res(3)]))
timeinc,timeinc_old,guess,F_lambda_lastInc,reshape(F_lambda,[3,3,res(1),res(2),res(3)]))
F_lastInc = reshape(F,[3,3,res(1),res(2),res(3)])
F_lambda_lastInc = reshape(F_lambda,[3,3,res(1),res(2),res(3)])

View File

@ -147,7 +147,7 @@ end subroutine basic_init
!> @brief solution for the basic scheme with internal iterations
!--------------------------------------------------------------------------------------------------
type(tSolutionState) function &
basic_solution(incInfo,guessmode,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC)
basic_solution(incInfo,guess,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC)
use numerics, only: &
itmax, &
@ -190,7 +190,8 @@ type(tSolutionState) function &
implicit none
!--------------------------------------------------------------------------------------------------
! input data for solution
real(pReal), intent(in) :: timeinc, timeinc_old, temperature_bc, guessmode
real(pReal), intent(in) :: timeinc, timeinc_old, temperature_bc
logical, intent(in) :: guess
type(tBoundaryCondition), intent(in) :: P_BC,F_BC
character(len=*), intent(in) :: incInfo
real(pReal), dimension(3,3), intent(in) :: rotation_BC
@ -247,8 +248,7 @@ type(tSolutionState) function &
elseif(F_BC%myType=='fdot') then ! f_aimDot is prescribed
f_aimDot = F_BC%maskFloat * F_BC%values
endif
f_aimDot = f_aimDot &
+ guessmode * P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
if (guess) f_aimDot = f_aimDot + P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
F_aim_lastInc = F_aim
!--------------------------------------------------------------------------------------------------
@ -256,7 +256,7 @@ type(tSolutionState) function &
call deformed_fft(res,geomdim,math_rotate_backward33(F_aim_lastInc,rotation_BC), &
1.0_pReal,F_lastInc,coordinates)
Fdot = Utilities_calculateRate(math_rotate_backward33(f_aimDot,rotation_BC), &
timeinc,timeinc_old,guessmode,F_lastInc,F)
timeinc,timeinc_old,guess,F_lastInc,F)
F_lastInc = F
endif
F_aim = F_aim + f_aimDot * timeinc

View File

@ -198,7 +198,7 @@ subroutine BasicPETSC_init()
!> @brief solution for the Basic PETSC scheme with internal iterations
!--------------------------------------------------------------------------------------------------
type(tSolutionState) function &
basicPETSc_solution(incInfoIn,guessmode,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC)
basicPETSc_solution(incInfoIn,guess,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC)
use numerics, only: &
update_gamma
use math, only: &
@ -225,7 +225,8 @@ subroutine BasicPETSC_init()
#include <finclude/petscsnes.h90>
!--------------------------------------------------------------------------------------------------
! input data for solution
real(pReal), intent(in) :: timeinc, timeinc_old, temperature_bc, guessmode
real(pReal), intent(in) :: timeinc, timeinc_old, temperature_bc
logical, intent(in):: guess
type(tBoundaryCondition), intent(in) :: P_BC,F_BC
real(pReal), dimension(3,3), intent(in) :: rotation_BC
character(len=*), intent(in) :: incInfoIn
@ -271,8 +272,7 @@ else
elseif(F_BC%myType=='fdot') then ! f_aimDot is prescribed
f_aimDot = F_BC%maskFloat * F_BC%values
endif
f_aimDot = f_aimDot &
+ guessmode * P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
if (guess) f_aimDot = f_aimDot + P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
F_aim_lastInc = F_aim
!--------------------------------------------------------------------------------------------------
@ -280,7 +280,7 @@ else
call deformed_fft(res,geomdim,math_rotate_backward33(F_aim_lastInc,rotation_BC), &
1.0_pReal,F_lastInc,coordinates)
Fdot = Utilities_calculateRate(math_rotate_backward33(f_aimDot,rotation_BC), &
timeinc,timeinc_old,guessmode,F_lastInc,reshape(F,[3,3,res(1),res(2),res(3)]))
timeinc,timeinc_old,guess,F_lastInc,reshape(F,[3,3,res(1),res(2),res(3)]))
F_lastInc = reshape(F,[3,3,res(1),res(2),res(3)])
endif
F_aim = F_aim + f_aimDot * timeinc

View File

@ -695,7 +695,7 @@ end subroutine utilities_constitutiveResponse
!--------------------------------------------------------------------------------------------------
!> @brief calculates forward rate, either guessing or just add delta/timeinc
!--------------------------------------------------------------------------------------------------
pure function utilities_calculateRate(delta_aim,timeinc,timeinc_old,guessmode,field_lastInc,field)
pure function utilities_calculateRate(delta_aim,timeinc,timeinc_old,guess,field_lastInc,field)
use mesh, only: &
res
@ -703,14 +703,15 @@ pure function utilities_calculateRate(delta_aim,timeinc,timeinc_old,guessmode,fi
real(pReal), intent(in), dimension(3,3) :: delta_aim !< homogeneous addon
real(pReal), intent(in) :: &
timeinc, & !< timeinc of current step
timeinc_old, & !< timeinc of last step
guessmode !< timeinc of current step
timeinc_old !< timeinc of last step
logical, intent(in) :: &
guess !< guess along former trajectory
real(pReal), intent(in), dimension(3,3,res(1),res(2),res(3)) :: &
field_lastInc, & !< data of previous step
field !< data of current step
real(pReal), dimension(3,3,res(1),res(2),res(3)) :: utilities_calculateRate
if (guessmode == 1.0_pReal) then
if (guess) then
utilities_calculateRate = (field-field_lastInc) / timeinc_old
else
utilities_calculateRate = spread(spread(spread(delta_aim,3,res(1)),4,res(2)),5,res(3))/timeinc