Skip to content

Commit

Permalink
Corrected 0.4 to 0.25 in coupled-beta and improved fitting output
Browse files Browse the repository at this point in the history
  • Loading branch information
Trovemaster committed Apr 11, 2023
1 parent ba61436 commit ebe750a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
28 changes: 18 additions & 10 deletions diatom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module diatom_module
!
character(len=cl) :: dscr ! file with fingeprints and descriptions of each levels + energy values
character(len=cl) :: primitives ! file with the primitive quantum numbres
character(len=cl) :: vectors ! eigenvectors stored here
character(len=cl) :: vectors = 'eigen' ! eigenvectors stored here
!
end type eigenfileT
!
Expand Down Expand Up @@ -994,9 +994,17 @@ subroutine ReadInput
!
case("CHECK_POINT","CHECKPOINT","CHECKPOINTS")
!
job%eigenfile%vectors = 'eigen'
!
call readu(w)
! skip if checkpoint NONE
if (Nitems>1) then
call readu(w)
if (trim(w)=="NONE".or.trim(w)=="OFF") then
do while (trim(w)/="".and.trim(w)/="END")
call read_line(eof,iut) ; if (eof) exit
call readu(w)
enddo
cycle
endif
endif
!
call read_line(eof,iut) ; if (eof) exit
call readu(w)
Expand All @@ -1006,6 +1014,8 @@ subroutine ReadInput
select case(w)
!
case('EIGENFUNC','EIGENVECT','EIGENVECTORS')
!
!job%eigenfile%vectors = 'eigen'
!
call readu(w)
!
Expand All @@ -1014,22 +1024,20 @@ subroutine ReadInput
if (all(trim(w)/=(/'READ','SAVE','NONE'/))) then
call report('ReadInput: illegal key in CHECK_POINT '//trim(w),.true.)
endif
!
!
case('DENSITY','DENS')
!
call readu(w)
!
job%IO_density = trim(w)
!
job%IO_eigen = 'SAVE'
!
job%basis_set='KEEP'
!
if (all(trim(w)/=(/'READ','SAVE','NONE'/))) then
call report('ReadInput: illegal key in CHECK_POINT '//trim(w),.true.)
endif
!
case('VECTOR-FILENAME','VECTOR','FILENAME')
case('VECTOR-FILENAME','VECTOR','FILENAME','NAME','FILE')
!
call reada(w)
!
Expand Down Expand Up @@ -4863,7 +4871,7 @@ subroutine map_fields_onto_grid(iverbose)
!
! Define the diabatic coupling: VD = 0.5*tan(2*gamma)*(V1-V2)
!
if (abs(beta-pi*0.4_rk)>sqrt(small_)) then
if (abs(beta-pi*0.25_rk)>sqrt(small_)) then
!
VD = 0.5_rk*tan(2.0_rk*beta)*(V1-V2)
!
Expand Down Expand Up @@ -4928,7 +4936,7 @@ subroutine map_fields_onto_grid(iverbose)
!
! VD = 0.5*tan(2*gamma)*(V2-V1)
!
if (abs(beta-pi*0.4_rk)>sqrt(small_)) then
if (abs(beta-pi*0.25_rk)>sqrt(small_)) then
!
field%gridvalue(i) = -0.5_rk*tan(2.0_rk*beta)*(V2-V1)
!
Expand Down
12 changes: 9 additions & 3 deletions refinement.f90
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,11 @@ subroutine sf_fitting
!
if (fit_factor<0) rjacob(1:en_npts,:) = 0
!
if (do_print) write(out,"(/'Iteration = ',i8)") fititer
if (do_print) write(enunit,"(/'Iteration = ',i8)") fititer
if (action%frequency.and.do_print) write(frequnit,"(/'Iteration = ',i8)") fititer
if (do_print) write(out,"(/'Iteration = ',i8)") fititer-1
if (do_print) write(enunit,"(/'Iteration = ',i8)") fititer-1
if (action%frequency.and.do_print) write(frequnit,"(/'Iteration = ',i8)") fititer-1
if (do_print.and.fititer-1==0) write(out,"(a)") 'Straight through calculations with initial parameters...'
if (do_print.and.fititer-1==0.and.itmax>0) write(out,"(a)") ' Generating derivatives for the least-squares fit...'
!
! Reconstruct the potential expansion from the local to linearized coords.
!
Expand Down Expand Up @@ -1404,9 +1406,13 @@ subroutine sf_fitting
ssq=sum(eps(1:npts)*eps(1:npts)*wtall(1:npts))
rms=sqrt(sum(eps(1:npts)*eps(1:npts))/npts)
!
if (do_print.and.fititer==1) write(out,"(/a)") 'Refinement using the least-squared fitting ...'
if (do_print) write(out,"(/'Iteration = ',i8)") fititer
!
! Prepare the linear system a x = b as in the Newton fitting approach.
!
if (itmax>=1.and.(.not.do_Armijo.or.ialpha_Armijo==0)) then
!
!----- form the a and b matrix ------c
! form A matrix
do irow=1,numpar
Expand Down

0 comments on commit ebe750a

Please sign in to comment.