Commit 2aab68af authored by Gregor Michalicek's avatar Gregor Michalicek

Remove continuous restart from mix/broyden2.F90

parent 9c49035b
...@@ -63,6 +63,7 @@ CONTAINS ...@@ -63,6 +63,7 @@ CONTAINS
! Local Scalars ! Local Scalars
INTEGER :: i,j,it,k,nit,iread,nmaph, mit, historyLength INTEGER :: i,j,it,k,nit,iread,nmaph, mit, historyLength
INTEGER :: relIndex
REAL :: vFMetProd,alphan,coeff,vNorm REAL :: vFMetProd,alphan,coeff,vNorm
LOGICAL :: l_pot, l_exist LOGICAL :: l_pot, l_exist
...@@ -128,6 +129,12 @@ CONTAINS ...@@ -128,6 +129,12 @@ CONTAINS
! save F_m and rho_m for next iteration ! save F_m and rho_m for next iteration
nit = mit +1 nit = mit +1
! Comment out the following code line to switch to continuous restart mode
! Note: The continuous restart mode is not good at the moment. It produces undesired and
! bad convergence behavior. But it is tested and seems to be correct.
IF (nit > input%maxiter+1) nit = 1
CALL writeLastIterInAndDiffDen(hybrid,nmap,nit,input%alpha,sm,fm,smMet,fmMet) CALL writeLastIterInAndDiffDen(hybrid,nmap,nit,input%alpha,sm,fm,smMet,fmMet)
IF (mit.EQ.1) THEN IF (mit.EQ.1) THEN
...@@ -158,18 +165,10 @@ CONTAINS ...@@ -158,18 +165,10 @@ CONTAINS
dNdFLast = 0.0 dNdFLast = 0.0
dFdNLast = 0.0 dFdNLast = 0.0
! WRITE(1400,*) '========================================'
! WRITE(1400,*) '========================================'
! WRITE(1400,*) '========================================'
! WRITE(1400,*) 'mit: ', mit
! WRITE(1400,*) 'iread, historyLength: ', iread, historyLength
DO it = 2, iread DO it = 2, iread
CALL readDeltaNVec(input,hybrid,nmap,it-iread-1,mit,deltaN_i) relIndex = it-iread-1
CALL readDeltaFVec(input,hybrid,nmap,it-iread-1,mit,deltaF_i) CALL readDeltaNVec(input,hybrid,nmap,relIndex,mit,deltaN_i)
CALL readDeltaFVec(input,hybrid,nmap,relIndex,mit,deltaF_i)
! WRITE(1400,'(4i7)') it,mit,it-iread-1,mit+(it-iread-1)
! WRITE(1400,'(a,5f15.8)') 'deltaN_i: ', deltaN_i(1), deltaN_i(2), deltaN_i(3), deltaN_i(4), deltaN_i(5)
! WRITE(1400,'(a,5f15.8)') 'deltaF_i: ', deltaF_i(1), deltaF_i(2), deltaF_i(3), deltaF_i(4), deltaF_i(5)
dNdNLast(it-1) = CPP_BLAS_sdot(nmap,deltaN_i,1,dNMet,1) dNdNLast(it-1) = CPP_BLAS_sdot(nmap,deltaN_i,1,dNMet,1)
dFdFLast(it-1) = CPP_BLAS_sdot(nmap,deltaF_i,1,dFMet,1) dFdFLast(it-1) = CPP_BLAS_sdot(nmap,deltaF_i,1,dFMet,1)
...@@ -182,11 +181,6 @@ CONTAINS ...@@ -182,11 +181,6 @@ CONTAINS
dNdFLast(historyLength) = CPP_BLAS_sdot(nmap,dNVec,1,dFMet,1) dNdFLast(historyLength) = CPP_BLAS_sdot(nmap,dNVec,1,dFMet,1)
dFdNLast(historyLength) = CPP_BLAS_sdot(nmap,dFVec,1,dNMet,1) dFdNLast(historyLength) = CPP_BLAS_sdot(nmap,dFVec,1,dNMet,1)
! WRITE(1400,*) 'last overlaps:'
! DO i = 1, historyLength
! WRITE(1400,'(i7,4f20.13)') i,dNdNLast(i),dFdFLast(i),dNdFLast(i),dFdNLast(i)
! END DO
CALL writeBroydenOverlapExt(input,hybrid,mit,historyLength,& CALL writeBroydenOverlapExt(input,hybrid,mit,historyLength,&
dNdNLast,dFdFLast,dNdFLast,dFdNLast) dNdNLast,dFdFLast,dNdFLast,dFdNLast)
...@@ -198,14 +192,6 @@ CONTAINS ...@@ -198,14 +192,6 @@ CONTAINS
CALL readBroydenOverlaps(input,hybrid,mit,historyLength,& CALL readBroydenOverlaps(input,hybrid,mit,historyLength,&
dNdNMat,dFdFMat,dNdFMat,dFdNMat) dNdNMat,dFdFMat,dNdFMat,dFdNMat)
! WRITE(1400,*) 'all overlaps'
! DO i = 1, historyLength
! DO j = 1, historyLength
! WRITE(1400,'(2i7,4f20.13)') i,j,dNdNMat(j,i),dFdFMat(j,i),dNdFMat(j,i),dFdNMat(j,i)
! END DO
! END DO
! WRITE(1400,*) '-----------------------------'
! Extend overlap matrices <delta n(i) | delta n(j)>, <delta F(i) | delta F(j)>, ! Extend overlap matrices <delta n(i) | delta n(j)>, <delta F(i) | delta F(j)>,
! <delta n(i) | delta F(j)>, <delta F(i) | delta n(j)> -end- ! <delta n(i) | delta F(j)>, <delta F(i) | delta n(j)> -end-
...@@ -347,8 +333,9 @@ CONTAINS ...@@ -347,8 +333,9 @@ CONTAINS
vVec = 0.0 vVec = 0.0
DO it = 2, iread DO it = 2, iread
CALL readDeltaNVec(input,hybrid,nmap,it-iread-1,mit,deltaN_i) relIndex = it-iread-1
CALL readDeltaFVec(input,hybrid,nmap,it-iread-1,mit,deltaF_i) CALL readDeltaNVec(input,hybrid,nmap,relIndex,mit,deltaN_i)
CALL readDeltaFVec(input,hybrid,nmap,relIndex,mit,deltaF_i)
DO k = 1, nmap DO k = 1, nmap
uVec(k) = uVec(k) + uDNTableau(it-1,historyLength)*deltaN_i(k) uVec(k) = uVec(k) + uDNTableau(it-1,historyLength)*deltaN_i(k)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment