subroutine DeallocateMem()
character(len=*), parameter :: this_routine = 'DeallocateMem'
deallocate(Lab)
call LogMemDealloc(this_routine, LabTag)
deallocate(CoeffT1)
call LogMemDealloc(this_routine, CoeffT1Tag)
deallocate(CoeffCorT2)
call LogMemDealloc(this_routine, CoeffCorT2Tag)
deallocate(CoeffUncorT2)
call LogMemDealloc(this_routine, CoeffUncorT2Tag)
if (tLagrange) then
deallocate(Lambdas)
call LogMemDealloc(this_routine, LambdasTag)
deallocate(DerivLambda)
call LogMemDealloc(this_routine, DerivLambdaTag)
end if
deallocate(DerivCoeff)
call LogMemDealloc(this_routine, DerivCoeffTag)
deallocate(DiagTMAT2Dfull)
call LogMemDealloc(this_routine, DiagTMAT2DfullTag)
deallocate(TwoIndInts01)
call LogMemDealloc(this_routine, TwoIndInts01Tag)
deallocate(ThreeIndInts02)
call LogMemDealloc(this_routine, ThreeIndInts02Tag)
deallocate(FourIndInts)
call LogMemDealloc(this_routine, FourIndIntsTag)
deallocate(FourIndInts02)
call LogMemDealloc(this_routine, FourIndInts02Tag)
if (tERLocalization .and. (.not. tStoreSpinOrbs)) then
deallocate(TwoIndIntsER)
call LogMemDeAlloc(this_routine, TwoIndIntsERTag)
deallocate(ThreeIndInts01ER)
call LogMemDeAlloc(this_routine, ThreeIndInts01ERTag)
deallocate(ThreeIndInts02ER)
call LogMemDeAlloc(this_routine, ThreeIndInts02ERTag)
deallocate(FourIndIntsER)
call LogMemDeAlloc(this_routine, FourIndIntsERTag)
else
deallocate(TMAT2DTemp)
call LogMemDealloc(this_routine, TMAT2DTempTag)
deallocate(TMAT2DPartRot01)
call LogMemDealloc(this_routine, TMAT2DPartRot01Tag)
deallocate(TMAT2DPartRot02)
call LogMemDealloc(this_routine, TMAT2DPartRot02Tag)
deallocate(TMAT2DRot)
call LogMemDealloc(this_routine, TMAT2DRotTag)
deallocate(TwoIndInts02)
call LogMemDealloc(this_routine, TwoIndInts02Tag)
deallocate(ThreeIndInts01)
call LogMemDealloc(this_routine, ThreeIndInts01Tag)
deallocate(ThreeIndInts03)
call LogMemDealloc(this_routine, ThreeIndInts03Tag)
deallocate(ThreeIndInts04)
call LogMemDealloc(this_routine, ThreeIndInts04Tag)
deallocate(UMATTemp02)
call LogMemDealloc(this_routine, UMATTemp02Tag)
end if
deallocate(UMATTemp01)
call LogMemDealloc(this_routine, UMATTemp01Tag)
deallocate(SymLabelList2_rot)
call LogMemDealloc(this_routine, SymLabelList2_rotTag)
deallocate(SymLabelCounts2_rot)
call LogMemDealloc(this_routine, SymLabelCounts2_rotTag)
deallocate(SymLabelListInv_rot)
call LogMemDealloc(this_routine, SymLabelListInv_rotTag)
if (tShake) then
deallocate(ShakeLambda)
call LogMemDealloc(this_routine, ShakeLambdaTag)
deallocate(ShakeLambdaNew)
call LogMemDealloc(this_routine, ShakeLambdaNewTag)
deallocate(Constraint)
call LogMemDealloc(this_routine, ConstraintTag)
deallocate(ConstraintCor)
call LogMemDealloc(this_routine, ConstraintCorTag)
deallocate(DerivConstrT1)
call LogMemDealloc(this_routine, DerivConstrT1Tag)
deallocate(DerivConstrT2)
call LogMemDealloc(this_routine, DerivConstrT2Tag)
deallocate(ForceCorrect)
call LogMemDealloc(this_routine, ForceCorrectTag)
deallocate(Correction)
call LogMemDealloc(this_routine, CorrectionTag)
if (tShakeApprox) then
deallocate(DerivConstrT1T2Diag)
call LogMemDealloc(this_routine, DerivConstrT1T2DiagTag)
else
deallocate(DerivConstrT1T2)
call LogMemDealloc(this_routine, DerivConstrT1T2Tag)
end if
end if
end subroutine DeallocateMem