From 680f4cb0e23dc1b5e1909a767962eea6af936f07 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Wed, 30 Sep 2020 09:59:18 +0200 Subject: [PATCH] debugging sf --- examples/molecule.He | 2 +- input/methods | 4 +-- input/options | 4 +-- src/ADC/Makefile | 2 +- src/AOtoMO/Makefile | 2 +- src/BasCor/Makefile | 2 +- src/CC/Makefile | 2 +- src/CI/Makefile | 2 +- src/HF/Makefile | 2 +- src/MBPT/Makefile | 2 +- src/MC/Makefile | 2 +- src/MP/Makefile | 2 +- src/Makefile | 28 +++++++++++-------- src/Makefile.common | 5 ++-- src/Makefile.include | 10 +++---- src/QuAcK/Makefile | 2 +- src/RPA/Makefile | 2 +- src/RPA/RPAx.f90 | 8 ++++++ src/RPA/URPAx.f90 | 11 +++++++- src/RPA/UdRPA.f90 | 7 +++++ src/RPA/dRPA.f90 | 7 +++++ src/RPA/print_transition_vectors.f90 | 7 +++-- .../print_unrestricted_transition_vectors.f90 | 8 ++++-- src/eDFT/Makefile | 2 +- src/utils/Makefile | 2 +- 25 files changed, 86 insertions(+), 41 deletions(-) diff --git a/examples/molecule.He b/examples/molecule.He index c78e87e..1ac370f 100644 --- a/examples/molecule.He +++ b/examples/molecule.He @@ -1,4 +1,4 @@ # nAt nEla nElb nCore nRyd - 1 1 1 0 0 + 1 2 0 0 0 # Znuc x y z He 0.0 0.0 0.0 diff --git a/input/methods b/input/methods index b1f2358..adb472a 100644 --- a/input/methods +++ b/input/methods @@ -9,11 +9,11 @@ # CIS* CID CISD F F F # RPA* RPAx* ppRPA - F F F + F T F # G0F2 evGF2 G0F3 evGF3 F F F F # G0W0* evGW* qsGW - T F F + F F F # G0T0 evGT qsGT F F F # MCMP2 diff --git a/input/options b/input/options index de8da3b..e47f07d 100644 --- a/input/options +++ b/input/options @@ -1,11 +1,11 @@ # HF: maxSCF thresh DIIS n_diis guess_type ortho_type - 64 0.00001 T 5 1 1 + 64 0.0000001 T 5 1 1 # MP: # CC: maxSCF thresh DIIS n_diis 64 0.0000001 T 5 # spin: singlet triplet spin_conserved spin_flip TDA - T T T F F + T T T T T # GF: maxSCF thresh DIIS n_diis lin eta renorm 256 0.00001 T 5 T 0.0 3 # GW/GT: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0 diff --git a/src/ADC/Makefile b/src/ADC/Makefile index 291c256..00821e8 100644 --- a/src/ADC/Makefile +++ b/src/ADC/Makefile @@ -1,2 +1,2 @@ TARGET=ADC.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/AOtoMO/Makefile b/src/AOtoMO/Makefile index 030aef4..ae75223 100644 --- a/src/AOtoMO/Makefile +++ b/src/AOtoMO/Makefile @@ -1,2 +1,2 @@ TARGET=AOtoMO.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/BasCor/Makefile b/src/BasCor/Makefile index cb32779..4997d71 100644 --- a/src/BasCor/Makefile +++ b/src/BasCor/Makefile @@ -1,2 +1,2 @@ TARGET=BasCor.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/CC/Makefile b/src/CC/Makefile index df8eebf..af03903 100644 --- a/src/CC/Makefile +++ b/src/CC/Makefile @@ -1,2 +1,2 @@ TARGET=CC.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/CI/Makefile b/src/CI/Makefile index 22a571c..3331af2 100644 --- a/src/CI/Makefile +++ b/src/CI/Makefile @@ -1,2 +1,2 @@ TARGET=CI.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/HF/Makefile b/src/HF/Makefile index e33698c..fa8a68e 100644 --- a/src/HF/Makefile +++ b/src/HF/Makefile @@ -1,2 +1,2 @@ TARGET=HF.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/MBPT/Makefile b/src/MBPT/Makefile index 3d135d7..c4ae474 100644 --- a/src/MBPT/Makefile +++ b/src/MBPT/Makefile @@ -1,2 +1,2 @@ TARGET=MBPT.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/MC/Makefile b/src/MC/Makefile index 656f285..dbaece1 100644 --- a/src/MC/Makefile +++ b/src/MC/Makefile @@ -1,2 +1,2 @@ TARGET=MC.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/MP/Makefile b/src/MP/Makefile index 8e0c07c..a423b1b 100644 --- a/src/MP/Makefile +++ b/src/MP/Makefile @@ -1,2 +1,2 @@ TARGET=MP.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/Makefile b/src/Makefile index abc97eb..e9c9dc7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,3 +1,7 @@ +QUACK_ROOT=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))/..)) +export QUACK_ROOT + +SDIR=$(QUACK_ROOT)/src ALL_DIRS=$(filter-out modules,$(patsubst %/,%,$(wildcard */))) # Rules for Modules @@ -9,17 +13,16 @@ MOD_DIRS=numgrid # Rules for Libraries ##################### -LDIR =../lib +LDIR =$(QUACK_ROOT)/lib LIB_DIRS=$(filter-out $(MAIN_DIRS), $(ALL_DIRS)) -MAKEFILES=$(patsubst %,%/Makefile, $(ALL_DIRS)) FORCE: -%/Makefile: - @(echo TARGET=$*.a > $*/Makefile && echo include ../Makefile.include >> $@) +$(SDIR)/%/Makefile: FORCE + @(echo TARGET=$*.a > $*/Makefile && echo include $$QUACK_ROOT/src/Makefile.include >> $@) -$(LDIR)/%.a: FORCE %/Makefile $(MOD_DIRS) - $(MAKE) -C $* lib +$(LDIR)/%.a: FORCE $(SDIR)/%/Makefile $(MOD_DIRS) + $(MAKE) -C $(SDIR)/$* lib @@ -28,11 +31,11 @@ $(LDIR)/%.a: FORCE %/Makefile $(MOD_DIRS) MAIN_DIRS=QuAcK eDFT -BDIR=../bin +BDIR=$(QUACK_ROOT)/bin ALL_EXEC=$(patsubst %, $(BDIR)/%, $(MAIN_DIRS) ) -$(BDIR)/%: $(patsubst %,$(LDIR)/%.a,$(LIB_DIRS)) %/Makefile - $(MAKE) -C $* ../$@ +$(BDIR)/%: $(patsubst %,$(LDIR)/%.a,$(LIB_DIRS)) $(SDIR)/%/Makefile + $(MAKE) -C $* $@ @@ -40,10 +43,13 @@ $(BDIR)/%: $(patsubst %,$(LDIR)/%.a,$(LIB_DIRS)) %/Makefile # Rules for both ################ -default: $(ALL_EXEC) +default: $(ALL_EXEC) $(wildcard $(SDIR)/*/Makefile) + +debug: + DEBUG=1 $(MAKE) default .DEFAULT_GOAL := default -.PHONY: default +.PHONY: default debug .PRECIOUS: $(LDIR)/%.a %/Makefile clean: diff --git a/src/Makefile.common b/src/Makefile.common index 2f08f04..a934963 100644 --- a/src/Makefile.common +++ b/src/Makefile.common @@ -1,9 +1,10 @@ -IDIR =../../include -MODDIR=../modules +IDIR =$(QUACK_ROOT)/include +MODDIR=$(QUACK_ROOT)/src/modules FC = gfortran -I$(IDIR) -J$(MODDIR) -I$(MODDIR) #FC = ifort -I$(IDIR) -module $(MODDIR) AR = libtool + ifeq ($(DEBUG),1) FFLAGS = -Wall -g -msse4.2 -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant else diff --git a/src/Makefile.include b/src/Makefile.include index 4e1fb3a..a8ff4e0 100644 --- a/src/Makefile.include +++ b/src/Makefile.include @@ -1,8 +1,8 @@ -BDIR =../../bin -LDIR =../../lib +BDIR =$(QUACK_ROOT)/bin +LDIR =$(QUACK_ROOT)/lib ODIR = obj SDIR =. -include ../Makefile.common +include $(QUACK_ROOT)/src/Makefile.common LIBS = $(filter-out $(LDIR)/$(TARGET), $(wildcard $(LDIR)/*.a)) LIBS += -lblas -llapack -lc++ @@ -25,7 +25,7 @@ $(LDIR)/$(TARGET): $(patsubst %,$(LDIR)/%,$(DEPEND)) $(OBJ) $(AR) -static -o $@ $^ debug: - DEBUG=1 make $(LDIR)/$(TARGET) + DEBUG=1 $(MAKE) $(LDIR)/$(TARGET) clean: rm -f $(ODIR)/*.o $(LDIR)/$(TARGET) @@ -34,7 +34,7 @@ $(BDIR)/%: $(OBJ) FORCE $(FC) -o $@ $(FFLAGS) $(LIBS) $(OBJ) default: - $(MAKE) -C .. + $(MAKE) -C $(QUACK_ROOT)/src lib: $(LDIR)/$(TARGET) diff --git a/src/QuAcK/Makefile b/src/QuAcK/Makefile index 235fdec..2d30ace 100644 --- a/src/QuAcK/Makefile +++ b/src/QuAcK/Makefile @@ -1,2 +1,2 @@ TARGET=QuAcK.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/RPA/Makefile b/src/RPA/Makefile index 79e1bcd..cd01025 100644 --- a/src/RPA/Makefile +++ b/src/RPA/Makefile @@ -1,2 +1,2 @@ TARGET=RPA.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/RPA/RPAx.f90 b/src/RPA/RPAx.f90 index 3e523b4..34f1655 100644 --- a/src/RPA/RPAx.f90 +++ b/src/RPA/RPAx.f90 @@ -46,6 +46,14 @@ subroutine RPAx(TDA,doACFDT,exchange_kernel,singlet,triplet,eta,nBas,nC,nO,nV,nR write(*,*)'***********************************************************' write(*,*) +! TDA + + if(TDA) then + write(*,*) 'Tamm-Dancoff approximation activated!' + write(*,*) ' => RPAx + TDA = CIS ' + write(*,*) + end if + ! Initialization EcRPAx(:) = 0d0 diff --git a/src/RPA/URPAx.f90 b/src/RPA/URPAx.f90 index d7cf08c..12172c2 100644 --- a/src/RPA/URPAx.f90 +++ b/src/RPA/URPAx.f90 @@ -57,6 +57,14 @@ subroutine URPAx(TDA,doACFDT,exchange_kernel,spin_conserved,spin_flip,eta,nBas,n write(*,*)'*********************************************************************' write(*,*) +! TDA + + if(TDA) then + write(*,*) 'Tamm-Dancoff approximation activated!' + write(*,*) ' => RPAx + TDA = CIS ' + write(*,*) + end if + ! Initialization EcRPAx(:) = 0d0 @@ -103,7 +111,8 @@ subroutine URPAx(TDA,doACFDT,exchange_kernel,spin_conserved,spin_flip,eta,nBas,n call unrestricted_linear_response(ispin,.false.,TDA,.false.,eta,nBas,nC,nO,nV,nR,nS_aa,nS_bb,nS_sf,nS_sf,1d0,e, & ERI_aaaa,ERI_aabb,ERI_bbbb,ERI_abab,Omega_sf,rho_sf,EcRPAx(ispin),Omega_sf,XpY_sf,XmY_sf) call print_excitation('URPAx ',6,nS_sf,Omega_sf) -! call print_transition_vectors(.false.,nBas,nC,nO,nV,nR,nS,dipole_int,Omega(:,ispin),XpY(:,:,ispin),XmY(:,:,ispin)) + call print_unrestricted_transition_vectors(.false.,nBas,nC,nO,nV,nR,nS,nS_ab,nS_ba,nS_sf,dipole_int_aa,dipole_int_bb, & + Omega_sf,XpY_sf,XmY_sf) deallocate(Omega_sf,XpY_sf,XmY_sf) diff --git a/src/RPA/UdRPA.f90 b/src/RPA/UdRPA.f90 index fd1aa0e..4efddc4 100644 --- a/src/RPA/UdRPA.f90 +++ b/src/RPA/UdRPA.f90 @@ -57,6 +57,13 @@ subroutine UdRPA(TDA,doACFDT,exchange_kernel,spin_conserved,spin_flip,eta,nBas,n write(*,*)'**************************************************************' write(*,*) +! TDA + + if(TDA) then + write(*,*) 'Tamm-Dancoff approximation activated!' + write(*,*) + end if + ! Initialization EcRPA(:) = 0d0 diff --git a/src/RPA/dRPA.f90 b/src/RPA/dRPA.f90 index fa45771..02ce6d3 100644 --- a/src/RPA/dRPA.f90 +++ b/src/RPA/dRPA.f90 @@ -45,6 +45,13 @@ subroutine dRPA(TDA,doACFDT,exchange_kernel,singlet,triplet,eta,nBas,nC,nO,nV,nR write(*,*)'***********************************************' write(*,*) +! TDA + + if(TDA) then + write(*,*) 'Tamm-Dancoff approximation activated!' + write(*,*) + end if + ! Initialization EcRPA(:) = 0d0 diff --git a/src/RPA/print_transition_vectors.f90 b/src/RPA/print_transition_vectors.f90 index 3c30621..605f439 100644 --- a/src/RPA/print_transition_vectors.f90 +++ b/src/RPA/print_transition_vectors.f90 @@ -36,10 +36,13 @@ subroutine print_transition_vectors(spin_allowed,nBas,nC,nO,nV,nR,nS,dipole_int, allocate(X(nS),Y(nS),f(nS,ncart),os(nS)) -! Compute dipole moments and oscillator strengths - +! Initialization f(:,:) = 0d0 + os(:) = 0d0 + +! Compute dipole moments and oscillator strengths + if(spin_allowed) then do ia=1,nS diff --git a/src/RPA/print_unrestricted_transition_vectors.f90 b/src/RPA/print_unrestricted_transition_vectors.f90 index 256f83c..862b5b9 100644 --- a/src/RPA/print_unrestricted_transition_vectors.f90 +++ b/src/RPA/print_unrestricted_transition_vectors.f90 @@ -42,10 +42,14 @@ subroutine print_unrestricted_transition_vectors(spin_allowed,nBas,nC,nO,nV,nR,n allocate(X(nSt),Y(nSt),f(nSt,ncart),os(nSt)) -! Compute dipole moments and oscillator strengths - +! Initialization f(:,:) = 0d0 + os(:) = 0d0 + +! Compute dipole moments and oscillator strengths + + if(spin_allowed) then do ia=1,nSt diff --git a/src/eDFT/Makefile b/src/eDFT/Makefile index 795c0b4..7367a3c 100644 --- a/src/eDFT/Makefile +++ b/src/eDFT/Makefile @@ -1,2 +1,2 @@ TARGET=eDFT.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include diff --git a/src/utils/Makefile b/src/utils/Makefile index 530241b..07c28c6 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -1,2 +1,2 @@ TARGET=utils.a -include ../Makefile.include +include /Users/loos/Dropbox/quack/src/Makefile.include