Skip to content

Commit 7a34619

Browse files
authored
Changed sp2run in examples (#143)
1 parent d2a6f5b commit 7a34619

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

examples/sp2run/src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ F90 = gfortran
77
COMPFLAGS += -fopenmp -I/$(bml_PATH)/install/include -I/$(progress_PATH)/install/include
88

99
LINKFLAGS+= -L$(progress_PATH)/install/lib -lprogress
10-
LINKFLAGS+= -L$(bml_PATH)/install/lib -lbml
10+
LINKFLAGS+= -L$(bml_PATH)/install/lib -lbml_fortran -lbml
1111
LINKFLAGS+= -llapack -lblas
1212

1313
all:

examples/sp2run/src/main.F90

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,19 @@ program sp2run
2727
call bml_read_matrix(ham_bml,"ham.mtx")
2828

2929
!> Do sp2.
30-
call prg_sp2_alg1(ham_bml,rho_bml,sp2%threshold,sp2%bndfil,sp2%minsp2iter,sp2%maxsp2iter &
31-
,sp2%sp2conv,sp2%sp2tol,sp2%verbose)
30+
write(*,*)sp2%flavor
31+
if(sp2%flavor .eq. "Basic") then
32+
call prg_sp2_basic(ham_bml,rho_bml,sp2%threshold,sp2%bndfil,sp2%minsp2iter,sp2%maxsp2iter &
33+
,sp2%sp2conv,sp2%sp2tol,sp2%verbose)
34+
elseif(sp2%flavor .eq. "Alg1") then
35+
call prg_sp2_alg1(ham_bml,rho_bml,sp2%threshold,sp2%bndfil,sp2%minsp2iter,sp2%maxsp2iter &
36+
,sp2%sp2conv,sp2%sp2tol,sp2%verbose)
37+
elseif(sp2%flavor .eq. "Alg2") then
38+
call prg_sp2_alg2(ham_bml,rho_bml,sp2%threshold,sp2%bndfil,sp2%minsp2iter,sp2%maxsp2iter &
39+
,sp2%sp2conv,sp2%sp2tol,sp2%verbose)
40+
else
41+
write(*,*)"SP2 algorithm variant/flavor not recognized"
42+
endif
3243

3344
call bml_print_matrix("rho_bml",rho_bml,0,6,0,6)
3445

0 commit comments

Comments
 (0)