From f4e5d32cdef92d5d544db72b0360e6ba6027f1ee Mon Sep 17 00:00:00 2001 From: Christoph Kords Date: Fri, 19 Mar 2010 14:14:08 +0000 Subject: [PATCH] added flag verboseDebugger to debug in order to have more control about debugging statements set this to true if you want extended debugging info in the output file --- code/CPFEM.f90 | 48 ++++++++++++++++++------------ code/constitutive_nonlocal.f90 | 38 +++++++++++------------- code/crystallite.f90 | 54 ++++++++++++++++++---------------- code/debug.f90 | 5 +++- code/homogenization.f90 | 30 +++++++++++-------- 5 files changed, 97 insertions(+), 78 deletions(-) diff --git a/code/CPFEM.f90 b/code/CPFEM.f90 index 1a2ac2ca5..55941ff93 100644 --- a/code/CPFEM.f90 +++ b/code/CPFEM.f90 @@ -76,7 +76,9 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt use debug, only: debug_init, & debug_g, & debug_i, & - debug_e + debug_e, & + debugger, & + verboseDebugger use FEsolving, only: FE_init, & parallelExecution, & outdatedFFN1, & @@ -205,14 +207,16 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt cp_en = mesh_FEasCP('elem',element) if (cp_en == 1 .and. IP == 1) then - !$OMP CRITICAL (write2out) - write(6,*) - write(6,*) '#####################################' - write(6,'(a10,x,f8.4,x,a10,x,f8.4,x,a10,x,i6,x,a10,x,i3,x,a16,x,i2,x,a16,x,i2)') & - 'theTime',theTime,'theDelta',theDelta,'theInc',theInc,'cycleCounter',cycleCounter,'computationMode',mode - write(6,*) '#####################################' - call flush (6) - !$OMP END CRITICAL (write2out) + if (debugger) then + !$OMP CRITICAL (write2out) + write(6,*) + write(6,*) '#####################################' + write(6,'(a10,x,f8.4,x,a10,x,f8.4,x,a10,x,i6,x,a10,x,i3,x,a16,x,i2,x,a16,x,i2)') & + 'theTime',theTime,'theDelta',theDelta,'theInc',theInc,'cycleCounter',cycleCounter,'computationMode',mode + write(6,*) '#####################################' + call flush (6) + !$OMP END CRITICAL (write2out) + endif endif ! according to our "mode" we decide what to do @@ -230,10 +234,12 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt j = 1:mesh_maxNips, & k = 1:mesh_NcpElems ) & constitutive_state0(i,j,k)%p = constitutive_state(i,j,k)%p ! microstructure of crystallites - !$OMP CRITICAL (write2out) - write(6,'(a,3(x,i4),/,4(3(e20.8,x),/))') 'aged state at', debug_g, debug_i, debug_e, & + if (debugger) then + !$OMP CRITICAL (write2out) + write(6,'(a,3(x,i4),/,4(3(e20.8,x),/))') 'aged state at', debug_g, debug_i, debug_e, & constitutive_state(debug_g,debug_i,debug_e)%p - !$OMP END CRITICAL (write2out) + !$OMP END CRITICAL (write2out) + endif do k = 1,mesh_NcpElems do j = 1,mesh_maxNips if (homogenization_sizeState(j,k) > 0_pInt) & @@ -251,9 +257,11 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt ! deformation gradient outdated or any actual deformation gradient differs more than relevantStrain from the stored one if (terminallyIll .or. outdatedFFN1 .or. any(abs(ffn1 - materialpoint_F(:,:,IP,cp_en)) > relevantStrain)) then if (.not. terminallyIll .and. .not. outdatedFFN1) then - !$OMP CRITICAL (write2out) - write(6,'(a11,x,i5,x,i2,x,a10,/,3(3(f10.6,x),/))') 'outdated at',cp_en,IP,'FFN1 now:',ffn1(:,1),ffn1(:,2),ffn1(:,3) - !$OMP END CRITICAL (write2out) + if (debugger) then + !$OMP CRITICAL (write2out) + write(6,'(a11,x,i5,x,i2,x,a10,/,3(3(f10.6,x),/))') 'outdated at',cp_en,IP,'FFN1 now:',ffn1(:,1),ffn1(:,2),ffn1(:,3) + !$OMP END CRITICAL (write2out) + endif outdatedFFN1 = .true. endif CPFEM_cs(:,IP,cp_en) = CPFEM_odd_stress @@ -334,10 +342,12 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt cauchyStress(:) = CPFEM_cs(:,IP,cp_en) jacobian(:,:) = CPFEM_dcsdE(:,:,IP,cp_en) if (IP == 1 .and. cp_en == 1) then - !$OMP CRITICAL (write2out) - write(6,'(a,/,6(6(f10.3,x)/))') 'jacobian/GPa at ip 1 el 1',jacobian/1e9 - call flush(6) - !$OMP END CRITICAL (write2out) + if (debugger) then + !$OMP CRITICAL (write2out) + write(6,'(a,/,6(6(f10.3,x)/))') 'jacobian/GPa at ip 1 el 1',jacobian/1e9 + call flush(6) + !$OMP END CRITICAL (write2out) + endif endif ! return temperature diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90 index d004d7d6a..def0e5817 100644 --- a/code/constitutive_nonlocal.f90 +++ b/code/constitutive_nonlocal.f90 @@ -961,7 +961,8 @@ use prec, only: pReal, & use math, only: math_mul6x6, & math_Mandel6to33 use debug, only: debugger, & - selectiveDebugger + selectiveDebugger, & + verboseDebugger use mesh, only: mesh_NcpElems, & mesh_maxNips use material, only: homogenization_maxNgrains, & @@ -1018,7 +1019,7 @@ do s = 1,ns endif enddo -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: kinetics',g,ip,el write(6,*) @@ -1046,7 +1047,8 @@ use math, only: math_Plain3333to99, & math_mul6x6, & math_Mandel6to33 use debug, only: debugger, & - selectiveDebugger + selectiveDebugger, & + verboseDebugger use mesh, only: mesh_NcpElems, & mesh_maxNips use material, only: homogenization_maxNgrains, & @@ -1135,7 +1137,7 @@ enddo dLp_dTstar99 = math_Plain3333to99(dLp_dTstar3333) -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: LpandItsTangent',g,ip,el write(6,*) @@ -1162,7 +1164,8 @@ use prec, only: pReal, & p_vec use IO, only: IO_error use debug, only: debugger, & - selectiveDebugger + selectiveDebugger, & + verboseDebugger use math, only: math_norm3, & math_mul6x6, & math_mul3x3, & @@ -1277,7 +1280,7 @@ real(pReal) area, & ! area of D ! self diffusion logical highOrderScheme ! flag indicating whether we use a high order interpolation scheme or not -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: constitutive_nonlocal_dotState at ',g,ip,el write(6,*) @@ -1360,13 +1363,6 @@ previousDUpper(:,1) = previousDUpper(:,2) / ( 1.0_pReal - constitutive_nonlocal_ if (dt_previous > 0.0_pReal) dUpperDot = (dUpper - previousDUpper) / dt_previous -if (debugger) then - !$OMP CRITICAL (write2out) - ! write(6,'(a,/,2(12(f12.5,x),/))') 'dUpper / micron', dUpper*1e6_pReal - ! write(6,'(a,/,2(12(f12.5,x),/))') 'dUpperDot / micron/s', dUpperDot * 1e6_pReal - !$OMPEND CRITICAL (write2out) -endif - !**************************************************************************** !*** dislocation remobilization (bauschinger effect) @@ -1387,7 +1383,7 @@ endif totalRhoDotSgl = totalRhoDotSgl + thisRhoDotSgl -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,8(12(e12.5,x),/))') 'dislocation remobilization', thisRhoDotSgl * timestep !$OMPEND CRITICAL (write2out) @@ -1408,7 +1404,7 @@ thisRhoDotDip = 0.0_pReal ! dipoles don't multiplicate totalRhoDotSgl = totalRhoDotSgl + thisRhoDotSgl -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,4(12(e12.5,x),/))') 'dislocation multiplication', thisRhoDotSgl(:,1:4) * timestep !$OMPEND CRITICAL (write2out) @@ -1512,7 +1508,7 @@ constitutive_nonlocal_rhoDotFlux(:,:,g,ip,el) = thisRhoDotSgl totalRhoDotSgl = totalRhoDotSgl + thisRhoDotSgl -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,8(12(e12.5,x),/))') 'dislocation flux', thisRhoDotSgl * timestep !$OMPEND CRITICAL (write2out) @@ -1549,7 +1545,7 @@ enddo totalRhoDotSgl = totalRhoDotSgl + thisRhoDotSgl totalRhoDotDip = totalRhoDotDip + thisRhoDotDip -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,10(12(e12.5,x),/))') 'dipole formation by glide', thisRhoDotSgl * timestep, thisRhoDotDip * timestep !$OMPEND CRITICAL (write2out) @@ -1566,7 +1562,7 @@ forall (c=1:2) & totalRhoDotDip = totalRhoDotDip + thisRhoDotDip -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,2(12(e12.5,x),/))') 'athermal dipole annihilation', thisRhoDotDip * timestep !$OMPEND CRITICAL (write2out) @@ -1586,7 +1582,7 @@ thisRhoDotDip(:,2) = 0.0_pReal totalRhoDotDip = totalRhoDotDip + thisRhoDotDip -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,2(12(e12.5,x),/))') 'thermally activated dipole annihilation', thisRhoDotDip * timestep !$OMPEND CRITICAL (write2out) @@ -1610,7 +1606,7 @@ forall (t=1:4) & totalRhoDotSgl = totalRhoDotSgl + thisRhoDotSgl totalRhoDotDip = totalRhoDotDip + thisRhoDotDip -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,10(12(e12.5,x),/))') 'dipole stability by stress change', thisRhoDotSgl * timestep, thisRhoDotDip * timestep !$OMPEND CRITICAL (write2out) @@ -1623,7 +1619,7 @@ endif dotState(1,ip,el)%p(1:8*ns) = dotState(1,ip,el)%p(1:8*ns) + reshape(totalRhoDotSgl,(/8*ns/)) dotState(1,ip,el)%p(8*ns+1:10*ns) = dotState(1,ip,el)%p(8*ns+1:10*ns) + reshape(totalRhoDotDip,(/2*ns/)) -if (selectiveDebugger) then +if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a,/,8(12(e12.5,x),/))') 'deltaRho:', totalRhoDotSgl * timestep write(6,'(a,/,2(12(e12.5,x),/))') 'deltaRhoDip:', totalRhoDotDip * timestep diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 9ad2549d3..3e4ff6d9e 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -337,6 +337,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) iJacoStiffness use debug, only: debugger, & selectiveDebugger, & + verboseDebugger, & debug_e, & debug_i, & debug_g, & @@ -486,7 +487,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) do g = 1,myNgrains selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_converged(g,i,e)) then - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a21,f10.8,a32,f10.8,a35)') 'winding forward from ', & crystallite_subFrac(g,i,e),' to current crystallite_subfrac ', & @@ -518,7 +519,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) crystallite_Lp(:,:,g,i,e) = crystallite_subLp0(:,:,g,i,e) ! ...plastic velocity grad constitutive_state(g,i,e)%p = constitutive_subState0(g,i,e)%p ! ...microstructure crystallite_Tstar_v(:,g,i,e) = crystallite_subTstar0_v(:,g,i,e) ! ...2nd PK stress - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a78,f10.8)') 'cutback step in crystallite_stressAndItsTangent with new crystallite_subStep: ',& crystallite_subStep(g,i,e) @@ -568,7 +569,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed do g = 1,myNgrains -! selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_todo(g,i,e)) then ! all undone crystallites call constitutive_collectDotState(crystallite_Tstar_v(:,g,i,e), crystallite_subTstar0_v(:,g,i,e), & crystallite_Fe, crystallite_Fp, crystallite_Temperature(g,i,e), & @@ -584,7 +585,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed do g = 1,myNgrains -! selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_todo(g,i,e)) then ! all undone crystallites crystallite_stateConverged(g,i,e) = crystallite_updateState(g,i,e) ! update state crystallite_temperatureConverged(g,i,e) = crystallite_updateTemperature(g,i,e) ! update temperature @@ -615,7 +616,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed do g = 1,myNgrains -! selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_todo(g,i,e)) then ! all undone crystallites crystallite_todo(g,i,e) = crystallite_integrateStress(g,i,e) if ( .not. crystallite_localConstitution(g,i,e) & @@ -625,7 +626,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) enddo; enddo; enddo !$OMPEND PARALLEL DO - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) count(crystallite_todo(:,:,:)),'grains todo after stress integration' !$OMPEND CRITICAL (write2out) @@ -659,7 +660,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed do g = 1,myNgrains -! selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_todo(g,i,e)) then ! all undone crystallites call constitutive_collectDotState(crystallite_Tstar_v(:,g,i,e), crystallite_subTstar0_v(:,g,i,e), & crystallite_Fe, crystallite_Fp, crystallite_Temperature(g,i,e), & @@ -682,7 +683,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed do g = 1,myNgrains -! selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_todo(g,i,e)) then ! all undone crystallites crystallite_stateConverged(g,i,e) = crystallite_updateState(g,i,e) ! update state crystallite_temperatureConverged(g,i,e) = crystallite_updateTemperature(g,i,e) ! update temperature @@ -702,7 +703,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) enddo !$OMPEND PARALLEL DO - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) count(crystallite_converged(:,:,:)),'grains converged after state integration no.', NiterationState write(6,*) @@ -719,7 +720,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) crystallite_todo = crystallite_todo .and. .not. crystallite_converged ! skip all converged - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) count(crystallite_converged(:,:,:)),'grains converged after non-local check' write(6,*) count(crystallite_todo(:,:,:)),'grains todo after state integration no.', NiterationState @@ -784,10 +785,10 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed do g = 1,myNgrains -! selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) if (crystallite_requested(g,i,e)) then ! first check whether is requested at all! if (crystallite_converged(g,i,e)) then ! grain converged in above iteration - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write (6,*) '#############' write (6,*) 'central solution of cryst_StressAndTangent' @@ -804,7 +805,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) do k = 1,3 ! perturbation... do l = 1,3 ! ...components to the positive direction crystallite_subF(k,l,g,i,e) = crystallite_subF(k,l,g,i,e) + myPert ! perturb single component (either forward or backward) - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write (6,'(i1,x,i1)') k,l write (6,'(a8,3(x,i4),/,3(3(f12.6,x)/))') 'pertF of', g, i, e, crystallite_subF(1:3,:,g,i,e) @@ -826,7 +827,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) temperatureConverged = crystallite_updateTemperature(g,i,e) ! update temperature converged = stateConverged .and. temperatureConverged endif - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write (6,*) '-------------' write (6,'(a,x,l,x,l)') 'ontrack + converged:',onTrack,converged @@ -881,6 +882,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do g = 1,myNgrains + selectiveDebugger = (e == debug_e .and. i == debug_i .and. g == debug_g) mask = .true. do comp = 1,9 kl(:,comp,g,i,e) = maxloc(abs(crystallite_subF(:,:,g,i,e)-crystallite_F0(:,:,g,i,e)), mask) ! map from component to array indices for F (sorted in descending order of abs(deltaF)) @@ -888,7 +890,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) enddo k = kl(1,mod(cycleCounter/iJacoStiffness,9)+1,g,i,e) ! perturb components in the descending order of change in F (-> component with biggest change in F is perturbed in first cycle, component with second biggest change in next cycle, ...) l = kl(2,mod(cycleCounter/iJacoStiffness,9)+1,g,i,e) - if (e==debug_e .and. i==debug_i) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write (6,*) 'perturb component ',k,l !$OMPEND CRITICAL (write2out) @@ -1055,7 +1057,8 @@ endsubroutine constitutive_relevantState, & constitutive_microstructure use debug, only: debugger, & - selectiveDebugger + selectiveDebugger, & + verboseDebugger use FEsolving, only: cycleCounter, theInc !*** input variables ***! @@ -1083,7 +1086,7 @@ endsubroutine if (any(residuum/=residuum)) then ! if NaN occured then return without changing the state... crystallite_updateState = .false. ! ...indicate state update failed crystallite_todo(g,i,e) = .false. ! ...no need to calculate any further - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: updateState encountered NaN',g,i,e !$OMPEND CRITICAL (write2out) @@ -1100,7 +1103,7 @@ endsubroutine ! setting flag to true if state is below relative tolerance, otherwise set it to false crystallite_updateState = all( constitutive_state(g,i,e)%p(1:mySize) < constitutive_relevantState(g,i,e)%p(1:mySize) & .or. abs(residuum) < rTol_crystalliteState*abs(constitutive_state(g,i,e)%p(1:mySize)) ) - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) if (crystallite_updateState) then write(6,*) '::: updateState converged',g,i,e @@ -1211,6 +1214,7 @@ endsubroutine relevantStrain use debug, only: debugger, & selectiveDebugger, & + verboseDebugger, & debug_cumLpCalls, & debug_cumLpTicks, & debug_StressLoopDistribution @@ -1296,7 +1300,7 @@ endsubroutine ! inversion of Fp_current... invFp_current = math_inv3x3(Fp_current) if (all(invFp_current == 0.0_pReal)) then ! ... failed? - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress failed on invFp_current inversion',g,i,e write(6,*) @@ -1326,7 +1330,7 @@ LpLoop: do ! too many loops required ? if (NiterationStress > nStress) then - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress reached loop limit at ',g,i,e write(6,*) @@ -1352,7 +1356,7 @@ LpLoop: do debug_cumLpCalls = debug_cumLpCalls + 1_pInt debug_cumLpTicks = debug_cumLpTicks + tock-tick if (tock < tick) debug_cumLpTicks = debug_cumLpTicks + maxticks - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress at ' ,g,i,e, ' ; iteration ', NiterationStress write(6,*) @@ -1376,7 +1380,7 @@ LpLoop: do ! NaN occured at regular speed? if (any(residuum/=residuum) .and. leapfrog == 1.0) then - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress encountered NaN at ',g,i,e,' ; iteration ', NiterationStress !$OMPEND CRITICAL (write2out) @@ -1410,7 +1414,7 @@ LpLoop: do invdRdLp = 0.0_pReal call math_invert(9,dRdLp,invdRdLp,dummy,error) ! invert dR/dLp --> dLp/dR if (error) then - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress failed on dR/dLp inversion at ',g,i,e,' ; iteration ', NiterationStress write(6,*) @@ -1443,7 +1447,7 @@ LpLoop: do invFp_new = invFp_new/math_det3x3(invFp_new)**(1.0_pReal/3.0_pReal) ! regularize by det call math_invert3x3(invFp_new,Fp_new,det,error) if (error) then - if (debugger) then + if (verboseDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress failed on invFp_new inversion at ',g,i,e,' ; iteration ', NiterationStress write(6,*) @@ -1469,7 +1473,7 @@ LpLoop: do ! set return flag to true crystallite_integrateStress = .true. - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress converged at ',g,i,e,' ; iteration ', NiterationStress write(6,*) diff --git a/code/debug.f90 b/code/debug.f90 index d2b63c7ed..39228116d 100644 --- a/code/debug.f90 +++ b/code/debug.f90 @@ -21,7 +21,8 @@ integer(pInt) :: debug_i = 1_pInt integer(pInt) :: debug_g = 1_pInt logical :: selectiveDebugger = .false. - logical :: debugger = .false. + logical :: verboseDebugger = .false. + logical :: debugger = .true. logical :: distribution_init = .false. CONTAINS @@ -40,6 +41,8 @@ subroutine debug_init() nHomog implicit none + if (.not. debugger) verboseDebugger = .false. + write(6,*) write(6,*) '<<<+- debug init -+>>>' write(6,*) '$Id$' diff --git a/code/homogenization.f90 b/code/homogenization.f90 index 6034c8e89..a68793c17 100644 --- a/code/homogenization.f90 +++ b/code/homogenization.f90 @@ -258,6 +258,7 @@ subroutine materialpoint_stressAndItsTangent(& crystallite_orientations use debug, only: debugger, & selectiveDebugger, & + verboseDebugger, & debug_e, & debug_i, & debug_MaterialpointLoopDistribution, & @@ -272,13 +273,15 @@ subroutine materialpoint_stressAndItsTangent(& ! ------ initialize to starting condition ------ - write (6,*) - write (6,*) 'Material Point start' - write (6,'(a,/,(f12.7,x))') 'Temp0 of 1 1' ,materialpoint_Temperature(1,1) - write (6,'(a,/,3(3(f12.7,x)/))') 'F0 of 1 1',materialpoint_F0(1:3,:,1,1) - write (6,'(a,/,3(3(f12.7,x)/))') 'F of 1 1',materialpoint_F(1:3,:,1,1) - write (6,'(a,/,3(3(f12.7,x)/))') 'Fp0 of 1 1 1',crystallite_Fp0(1:3,:,1,1,1) - write (6,'(a,/,3(3(f12.7,x)/))') 'Lp0 of 1 1 1',crystallite_Lp0(1:3,:,1,1,1) + if (debugger) then + write (6,*) + write (6,*) 'Material Point start' + write (6,'(a,/,(f12.7,x))') 'Temp0 of 1 1' ,materialpoint_Temperature(1,1) + write (6,'(a,/,3(3(f12.7,x)/))') 'F0 of 1 1',materialpoint_F0(1:3,:,1,1) + write (6,'(a,/,3(3(f12.7,x)/))') 'F of 1 1',materialpoint_F(1:3,:,1,1) + write (6,'(a,/,3(3(f12.7,x)/))') 'Fp0 of 1 1 1',crystallite_Fp0(1:3,:,1,1,1) + write (6,'(a,/,3(3(f12.7,x)/))') 'Lp0 of 1 1 1',crystallite_Lp0(1:3,:,1,1,1) + endif !$OMP PARALLEL DO do e = FEsolving_execElem(1),FEsolving_execElem(2) ! iterate over elements to be processed @@ -322,7 +325,7 @@ subroutine materialpoint_stressAndItsTangent(& ! if our materialpoint converged or consists of only one single grain then we are either finished or have to wind forward if ( materialpoint_converged(i,e) .or. (myNgrains == 1_pInt .and. materialpoint_subStep(i,e) <= 1.0_pReal) ) then - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a21,f10.8,a34,f10.8,a37,/)') 'winding forward from ', & materialpoint_subFrac(i,e), ' to current materialpoint_subFrac ', & @@ -361,7 +364,7 @@ subroutine materialpoint_stressAndItsTangent(& materialpoint_subStep(i,e) = subStepSizeHomog * materialpoint_subStep(i,e) ! crystallite had severe trouble, so do a significant cutback ! <> - if (selectiveDebugger) then + if (verboseDebugger .and. selectiveDebugger) then !$OMP CRITICAL (write2out) write(6,'(a82,f10.8,/)') 'cutback step in materialpoint_stressAndItsTangent with new materialpoint_subStep: ',& materialpoint_subStep(i,e) @@ -491,9 +494,12 @@ elementLoop: do e = FEsolving_execElem(1),FEsolving_execElem(2) ! iterate enddo elementLoop !$OMP END PARALLEL DO - write (6,*) - write (6,*) 'Material Point end' - write (6,*) + + if (debugger) then + write (6,*) + write (6,*) 'Material Point end' + write (6,*) + endif return endsubroutine