loop order that allows more memory efficient code

This commit is contained in:
Martin Diehl 2020-03-24 20:47:41 +01:00
parent 66aa20ad39
commit e7c585a02e
1 changed files with 2 additions and 2 deletions

View File

@ -1451,7 +1451,6 @@ subroutine integrateStateRKCK45
! --- SECOND TO SIXTH RUNGE KUTTA STEP --- ! --- SECOND TO SIXTH RUNGE KUTTA STEP ---
nonlocalBroken = .false. nonlocalBroken = .false.
do stage = 1,5
! --- state update --- ! --- state update ---
@ -1461,6 +1460,7 @@ subroutine integrateStateRKCK45
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if(crystallite_todo(g,i,e) .and. (.not. nonlocalBroken .or. crystallite_localPlasticity(g,i,e)) ) then if(crystallite_todo(g,i,e) .and. (.not. nonlocalBroken .or. crystallite_localPlasticity(g,i,e)) ) then
do stage = 1,5
p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
plasticState(p)%RKCK45dotState(stage,:,c) = plasticState(p)%dotState(:,c) plasticState(p)%RKCK45dotState(stage,:,c) = plasticState(p)%dotState(:,c)
@ -1518,11 +1518,11 @@ subroutine integrateStateRKCK45
nonlocalBroken = .true. nonlocalBroken = .true.
if(.not. crystallite_todo(g,i,e)) cycle if(.not. crystallite_todo(g,i,e)) cycle
enddo
endif endif
enddo; enddo; enddo enddo; enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
enddo
if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false. if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false.