Skip to content

Commit

Permalink
fix the control problem where basis can overright J in control step 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Trovemaster committed Sep 9, 2023
1 parent 3be4d10 commit 7b280c0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 18 deletions.
64 changes: 49 additions & 15 deletions fields.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1463,18 +1463,6 @@ subroutine FLReadInput(NPTorder,Npolyads,Natoms,Nmodes,Jrot)
!
enddo
!
!call readi(i_t)
!
!do while (i_t/=0.and.i<=size(job%select_gamma))
! !
! i = i+1
! !
! job%select_gamma(i_t) = .true.
! !
! call readi(i_t)
! !
!enddo
!
case ("GRAM-SCHMIDT","SVD","SCHMIDT")
!
job%orthogonalizer =trim(w)
Expand Down Expand Up @@ -2005,7 +1993,7 @@ subroutine FLReadInput(NPTorder,Npolyads,Natoms,Nmodes,Jrot)
call readi(job%bset(imode)%range(1))
call readi(job%bset(imode)%range(2))
!
! in case the range(2) is given for imode=0 we use Jrot as range(2) in order
! in case the range(2) is given for imode=0 we use Jrot as range(2)
!
if (imode==0.and.Jrot/=0) then
!
Expand All @@ -2017,15 +2005,15 @@ subroutine FLReadInput(NPTorder,Npolyads,Natoms,Nmodes,Jrot)
if (job%bset(imode)%dvrpoints==0) job%bset(imode)%dvrpoints = job%bset(imode)%range(2)+1
!
case("JROT")
!
! we use range(1) to store the Jrot value
!
call readi(i_t)
!
if (Jrot==0) then
Jrot = i_t
endif
!
! we use range(1) to store the Jrot value
!
job%bset(imode)%range(1) = Jrot
!
case("KROT","K")
Expand Down Expand Up @@ -3220,6 +3208,7 @@ subroutine FLReadInput(NPTorder,Npolyads,Natoms,Nmodes,Jrot)
case("3")
!
call readi(Jrot)
job%bset(0)%range(1) = Jrot
!
case("4")
!
Expand All @@ -3228,6 +3217,51 @@ subroutine FLReadInput(NPTorder,Npolyads,Natoms,Nmodes,Jrot)
!
end select
!
case ("GAMMA")
!
if (.not.symmetry_defined) then
!
write (out,"('FLinput: keyword GAMMA in CONTRACT cannot appear before symmetry is defined')")
stop 'FLinput - symmetry should be defined before GAMMA '
!
endif
!
if (Nitems>sym%Nrepresen+1.or.Nitems==1) then
write (out,"('FLinput: illegal number of irreps in gamma in DIAGONALIZER: ',i7)") Nitems-1
stop 'FLinput - illegal number of gammas in DIAGONALIZER'
endif
!
i = 0
job%select_gamma = .false.
!
do while (item<Nitems.and.i<size(job%select_gamma))
!
i = i + 1
!
call readu(w)
!
if (trim(w)/="-") then
!
read(w,*) i_t
job%select_gamma(i_t) = .true.
!
else
!
call readi(i_tt)
!
do while (i_t<i_tt.and.i<size(job%select_gamma))
!
i_t = i_t + 1
job%select_gamma(i_t) = .true.
i = i + 1
!
enddo
i = i - 1
!
endif
!
enddo
!
case default
!
call report ("Unrecognized unit name "//trim(w),.true.)
Expand Down
6 changes: 3 additions & 3 deletions perturbation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ subroutine PTinit(NPTorder,Nmodes,Npolyads)
integer(ik) :: alloc,i
integer(ik) :: imode,ispecies,Nspecies,Nclasses,iclass

if (job%verbose>=5) write(out,"(/'PTinit/start: Initialization of the perturbation theory elements ')")
if (job%verbose>=5) write(out,"(/'PTinit/start: Initialization of the variational theory elements ')")


! Define the PT-elements
Expand Down Expand Up @@ -8361,10 +8361,10 @@ subroutine PThamiltonian_contract(jrot)
!
! Diagonalization
!
deallocate (smat(isym)%coeffs)
deallocate (smat(isym)%coeffs)
call Arraystop('PThamiltonian_contract:smat'//sym%label(isym))
!
if (job%verbose>=3) write(out,"('Ready fo diagonalization...')")
if (job%verbose>=3) write(out,"('Ready for diagonalization...')")
!
if (job%verbose>=1) then
write (out,"(//'Size of the symmetrized hamiltonian = ',i7,' Symmetry = ',a4)") dimen_s,sym%label(isym)
Expand Down

0 comments on commit 7b280c0

Please sign in to comment.