Skip to content

Commit

Permalink
Removed line end whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bhourahine committed Sep 22, 2017
1 parent b08d796 commit fdfe5a0
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 46 deletions.
20 changes: 10 additions & 10 deletions lib/api.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module dftd3_api

!> C6 max flags (or unallocated if not needed)
logical, allocatable :: maxc6list(:)

!> Real space cutoff in atomic units.
real(wp) :: cutoff = sqrt(9000.0_wp)

Expand Down Expand Up @@ -101,7 +101,7 @@ subroutine dftd3_init(this, input)
maxc6list(:) = .false.
end if
maxc6 = any(maxc6list)

allocate(this%c6ab(max_elem, max_elem, maxc, maxc, 3))
allocate(this%mxc(max_elem))
call copyc6(maxc, max_elem, this%c6ab, this%mxc, minc6, minc6list, &
Expand All @@ -112,8 +112,8 @@ subroutine dftd3_init(this, input)
call setr0ab(max_elem, autoang, this%r0ab)

end subroutine dftd3_init


!> Sets the parameter for the dftd3 calculator by choosing a functional.
!!
!! \param func Name of the functional.
Expand All @@ -129,13 +129,13 @@ subroutine dftd3_set_functional(this, func, version, tz)
this%version = version
call setfuncpar(func, this%version, tz, this%s6, this%rs6, this%s18, &
& this%rs18, this%alp)

end subroutine dftd3_set_functional


!> Sets the parameter for the dftd3 calculator directly.
!!
!! \param pars Parameter to use. The 5 parameters must follow the same
!! \param pars Parameter to use. The 5 parameters must follow the same
!! order as when specified in the dftd3.local file for the dftd3 program.
!! (see the documentation of the dftd3 program for details)
!! \param version Version to use. Note, that depending on the version the
Expand All @@ -157,7 +157,7 @@ subroutine dftd3_set_params(this, pars, version)
this%rs18 = pars(4)
this%alp = pars(5)
this%version = version

end subroutine dftd3_set_params


Expand Down Expand Up @@ -205,7 +205,7 @@ subroutine dftd3_dispersion(this, coords, izp, disp, grads)
& this%r0ab, rcov, s6, s18, rs6, rs8, alp6, alp8, &
& this%noabc, this%rthr, this%numgrad, this%version, .false., grads, &
& gdsp, gnorm, this%cn_thr, fix)

end subroutine dftd3_dispersion


Expand Down Expand Up @@ -271,7 +271,7 @@ subroutine dftd3_pbc_dispersion(this, coords, izp, latvecs, disp, grads, &
! on return, so it needs to be converted to obtain the stress tensor.
stress(:,:) = -matmul(stress, transpose(latvecs))&
& / abs(determinant(latvecs))

end subroutine dftd3_pbc_dispersion


Expand All @@ -288,5 +288,5 @@ elemental function get_atomic_number(species) result(izp)

end function get_atomic_number


end module dftd3_api
12 changes: 6 additions & 6 deletions lib/core.f90
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,13 @@ subroutine gdisp(max_elem,maxc,n,xyz,iz,c6ab,mxc,r2r4,r0ab,rcov, &
integer kk

real(wp) :: xyzTmp(3,size(xyz,dim=2))

dc6i=0.0d0
abccalc=.FALSE.
abcthr=cn_thr

xyzTmp = xyz

!NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
if (num) then
if (echo)write(*,*) 'doing numerical gradient O(N^3) ...'
Expand Down Expand Up @@ -3134,7 +3134,7 @@ subroutine pbcgdisp(max_elem,maxc,n,xyz,iz,c6ab,mxc,r2r4,r0ab,&
integer,dimension(3) ::repv,repmin,repmax

real(wp) :: xyzTmp(3,size(xyz,dim=2))

! R^2 cut-off
rthr=crit_vdw
abcthr=crit_cn
Expand All @@ -3144,7 +3144,7 @@ subroutine pbcgdisp(max_elem,maxc,n,xyz,iz,c6ab,mxc,r2r4,r0ab,&
stress=0.0d0
gabc=0.0d0
glatabc=0.0d0

! testsum=0.0d0

if (echo)write(*,*)
Expand Down Expand Up @@ -4710,7 +4710,7 @@ subroutine copyc6(maxc,max_elem,c6ab,maxci, minc6,minc6list,maxc6,&
end if
kk=(nn*5)+1
end do

!no min/max at all
else
do nn=1,nlines
Expand Down Expand Up @@ -4738,7 +4738,7 @@ end subroutine copyc6
subroutine SET_CRITERIA(rthr,lat,tau_max)
real(wp), intent(in) :: rthr
real(wp), intent(in) :: lat(3,3)
real(wp), intent(out) :: tau_max(3)
real(wp), intent(out) :: tau_max(3)
real(wp) :: r_cutoff
real(wp) :: norm1(3),norm2(3),norm3(3)
real(wp) :: cos10,cos21,cos32
Expand Down
6 changes: 3 additions & 3 deletions prg/extras.f90
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ end subroutine wregrad

function ESYM(I)
INTEGER :: I

CHARACTER(2) ESYM
CHARACTER(2) ELEMNT(94)
DATA ELEMNT/'h ','he', &
Expand Down Expand Up @@ -909,7 +909,7 @@ function READAA(A,ISTART,IEND,IEND2)
INTEGER :: NINE, IZERO, MINUS, IdoT, ND, NE, IBL, IDIG, NL
INTEGER :: I, II, J, N, M
REAL(WP) :: C1, C2, ONE, X

NINE=ICHAR('9')
IZERO=ICHAR('0')
MINUS=ICHAR('-')
Expand Down Expand Up @@ -1434,7 +1434,7 @@ end subroutine pbcrdcoord
subroutine pbcrdatomnumber(fname,n)
integer, INTENT(out) :: n
character(*), INTENT(IN) :: fname

real(wp) xx(10)
character(80) line,args(90)

Expand Down
44 changes: 22 additions & 22 deletions prg/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -562,35 +562,35 @@ program dftd3_main
if (echo) then

if(version.lt.4)then
write(*,'(/10x,'' DFT-D V'',i1)') version
write(*,'(/10x,'' DFT-D V'',i1)') version
elseif(version.eq.4)then
write(*,'(/10x,'' DFT-D V3(BJ)'')')
elseif(version.eq.5)then
write(*,'(/10x,'' DFT-D V3 M'')')
elseif(version.eq.6)then
write(*,'(/10x,'' DFT-D V3 M(BJ)'')')
endif
write(*,'('' DF '',a50)') func
write(*,'('' parameters'')')
write(*,'('' DF '',a50)') func
write(*,'('' parameters'')')
if(version.eq.2)then
write(*,'('' s6 :'',f10.4)') s6
write(*,'('' alpha6 :'',f10.4)') alp6
write(*,'('' s6 :'',f10.4)') s6
write(*,'('' alpha6 :'',f10.4)') alp6
end if
if(version.eq.3)then
write(*,'('' s6 :'',f10.4)') s6
write(*,'('' s8 :'',f10.4)') s18
write(*,'('' rs6 :'',f10.4)') rs6
write(*,'('' rs18 :'',f10.4)') rs18
write(*,'('' alpha6 :'',f10.4)') alp6
write(*,'('' alpha8 :'',f10.4)') alp8
write(*,'('' k1-k3 :'',3f10.4)') k1,k2,k3
write(*,'('' s6 :'',f10.4)') s6
write(*,'('' s8 :'',f10.4)') s18
write(*,'('' rs6 :'',f10.4)') rs6
write(*,'('' rs18 :'',f10.4)') rs18
write(*,'('' alpha6 :'',f10.4)') alp6
write(*,'('' alpha8 :'',f10.4)') alp8
write(*,'('' k1-k3 :'',3f10.4)') k1,k2,k3
end if
if((version.eq.4).or.(version.eq.6))then
write(*,'('' s6 :'',F10.4)') s6
write(*,'('' s8 :'',F10.4)') s18
write(*,'('' a1 :'',F10.4)') rs6
write(*,'('' a2 :'',F10.4)') rs18
write(*,'('' k1-k3 :'',3F10.4)') k1,k2,k3
write(*,'('' s6 :'',F10.4)') s6
write(*,'('' s8 :'',F10.4)') s18
write(*,'('' a1 :'',F10.4)') rs6
write(*,'('' a2 :'',F10.4)') rs18
write(*,'('' k1-k3 :'',3F10.4)') k1,k2,k3
end if
if(version.eq.5)then
write(*,'('' s6 :'',f10.4)') s6
Expand All @@ -615,13 +615,13 @@ program dftd3_main
end if
write(*,'(/'' E6 /kcal :'',f11.4)')-e6*autokcal
if(version.gt.2)then
write(*,'('' E8 /kcal :'',f11.4)')-e8*autokcal
! write(*,'('' E10 /kcal :'',f11.4)')-e10*autokcal
write(*,'('' E8 /kcal :'',f11.4)')-e8*autokcal
! write(*,'('' E10 /kcal :'',f11.4)')-e10*autokcal
if(.not.noabc) &
& write(*,'('' E6(ABC) " :'',2f11.6,F16.12)')-e6abc*autokcal
write(*,'('' % E8 :'',f6.2)') -e8/disp/0.01
& write(*,'('' E6(ABC) " :'',2f11.6,F16.12)')-e6abc*autokcal
write(*,'('' % E8 :'',f6.2)') -e8/disp/0.01
if(.not.noabc) &
& write(*,'('' % E6(ABC) :'',f6.2)') -e6abc/disp/0.01
& write(*,'('' % E6(ABC) :'',f6.2)') -e6abc/disp/0.01
end if
end if
! this file for tmer2 read tool
Expand Down
10 changes: 5 additions & 5 deletions test/testapi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ program testapi
real(wp), parameter :: AA__Bohr = 1.0_wp / 0.52917726_wp

integer, parameter :: nAtoms = 60

! Coordinates in Angstrom as found in dna.xyz/dna.poscar
! They must be converted to Bohr before passed to dftd3
real(wp), parameter :: coords(3, nAtoms) = reshape([ &
Expand Down Expand Up @@ -93,7 +93,7 @@ program testapi
& 1.3605600000E-01, 3.3969160000E+00, 9.1243960000E+00, &
& 6.3723670000E+00, 3.3979410000E+00, 7.5470280000E+00 &
&] * AA__Bohr, [3, nAtoms])

integer, parameter :: species(nAtoms) = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, &
& 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, &
& 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
Expand All @@ -108,7 +108,7 @@ program testapi

integer, parameter :: nSpecies = 4
character(2), parameter :: speciesNames(nSpecies) = [ 'N ', 'C ', 'O ', 'H ']


type(dftd3_input) :: input
type(dftd3_calc) :: dftd3
Expand All @@ -122,7 +122,7 @@ program testapi

! You can set input variables if you like, or just leave them on their
! defaults, which are the same as the dftd3 program uses.

!! Threebody interactions (default: .false.)
!input%threebody = .true.
!
Expand Down Expand Up @@ -150,7 +150,7 @@ program testapi
write(*, "(A)") "Gradients [au]:"
write(*, "(3ES20.12)") grads
write(*, *)

! Calculate dispersion and gradients for periodic case
call dftd3_pbc_dispersion(dftd3, coords, atnum, latVecs, edisp, grads, stress)
write(*, "(A)") "*** Dispersion for periodic case"
Expand Down

0 comments on commit fdfe5a0

Please sign in to comment.