156c156 < external ch_psi_all, cg_psi, cch_psi_all, ccg_psi --- > external ch_psi_all, cg_psi, cch_psi_all, ccg_psi, cch_psi_all_fix 384c384 < call davcio (dvpsi, lrbar, iubar, nrec, 1) --- > call davcio (dvpsi, lrbar, iubar, nrec, +1) 428,433c428,434 < ! call cgsolve_all (ch_psi_all, cg_psi, et(1,ikk), dvpsi, dpsi, & < ! h_diag, npwx, npwq, thresh, ik, lter, conv_root, & < ! anorm, nbnd_occ(ikk), npol ) < ! call cgsolve_all (ch_psi_all, cg_psi, et(:,ikk), dvpsi, dpsi, & < ! h_diag, npwx, npwq, thresh, ik, lter, conv_root, & < ! anorm, nbnd_occ(ikk), npol ) --- > call cgsolve_all (ch_psi_all, cg_psi, et(1,ikk), dvpsi, dpsim, & > h_diag, npwx, npwq, thresh, ik, lter, conv_root, & > anorm, nbnd_occ(ikk), npol ) > > call cgsolve_all (ch_psi_all, cg_psi, et(1,ikk), dvpsi, dpsip, & > h_diag, npwx, npwq, thresh, ik, lter, conv_root, & > anorm, nbnd_occ(ikk), npol ) 442,448c443,459 < etc(:,:) = CMPLX( et(:,:), fiu(iw) ,kind=DP) < call cbcg_solve(cch_psi_all, cg_psi, etc(:,ikk), dvpsi, dpsip, h_diag, & < npwx, npwq, thresh, ik, lter, conv_root, anorm, nbnd_occ(ikk), npol, .true.) < < ! (etc = e - iw) < call cbcg_solve(cch_psi_all, cg_psi, conjg(etc(:,ikk)), dvpsi, dpsim, h_diag, & < npwx, npwq, thresh, ik, lter, conv_root, anorm, nbnd_occ(ikk), npol, .true.) --- > ! etc(:,:) = CMPLX( et(:,:), fiu(iw) ,kind=DP) > ! etc(:,:) = CMPLX( et(:,:), 0.0d0 , kind=DP) > ! cw = CMPLX(fiu(iw), 0.0d0, kind=DP) > ! call cbcg_solve(ch_psi_all, cg_psi, etc(:,ikk), dvpsi, dpsip, h_diag, & > ! npwx, npwq, thresh, ik, lter, conv_root, anorm, nbnd_occ(ikk), npol, .true.) > > ! call cbcg_solve(ch_psi_all, cg_psi, conjg(etc(:,ikk)), dvpsi, dpsim, h_diag, & > ! npwx, npwq, thresh, ik, lter, conv_root, anorm, nbnd_occ(ikk), npol, .true.) > > > ! call cbcg_solve_fix(cch_psi_all_fix, cg_psi, etc(1,ikk), dvpsi, dpsip, h_diag, & > ! npwx, npwq, thresh, ik, lter, conv_root, anorm, nbnd_occ(ikk), npol, cw, .true.) > > ! (etc = e - iw) > ! call cbcg_solve_fix(cch_psi_all_fix, cg_psi, (etc(1,ikk)), dvpsi, dpsim, h_diag, & > ! npwx, npwq, thresh, ik, lter, conv_root, anorm, nbnd_occ(ikk), npol, (-1.0d0,0.0d0)*cw, .true.) > 466a478 > 470d481 < ! writes delta_psi on iunit iudwf, k=kpoint, 471a483 > ! writes delta_psi on iunit iudwf, k=kpoint, 486c498 < dpsi(:,:) = 0.5*(dpsim(:,:) + dpsip(:,:)) --- > dpsi(:,:) = 0.5d0 * (dpsim(:,:) + dpsip(:,:)) 493a506 > 500a514 > 504a519 > 505a521 > 527a544 > 582,583c599,600 < ! ... save them on disk and < ! compute the corresponding change in scf potential --- > ! ... save them on disk and > ! compute the corresponding change in scf potential 607a625 > 616a635 > 618a638 > 622a643 > 624a646 > 660,662c682,683 < < !HL not updating Q in SCF: no need for newdq. < !call newdq (dvscfin) --- > ! HL not updating Q in SCF: no need for newdq. > ! call newdq (dvscfin) 704,705c725 < write(6,'(" iterations", i4)')iter < --- > ! write(6,'(" iterations", i4)')iter