Skip to content

Commit 756eb37

Browse files
committed
Minor refactorings.
1 parent 7998b7d commit 756eb37

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

GNUmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include make.arch
99

1010
lib:
1111
$(MAKE) -C lib FC="$(FC)" FCFLAGS="$(FCFLAGS)" LN="$(LN)" \
12-
LNFLAGS="$(LNFLAGS)"
12+
LNFLAGS="$(LNFLAGS)" SRCDIR="."
1313

1414
dftd3: lib
1515
$(MAKE) -C prg FC="$(FC)" FCFLAGS="$(FCFLAGS)" LN="$(LN)" \

lib/GNUmakefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@
88
# FCFLAGS Fortran compiler flags
99
# LN Linker
1010
# LNFLAGS Linker flags
11+
# SRCDIR Folder, where source files can be found
1112
#
1213
################################################################################
1314
.SUFFIX:
1415
.SUFFIX: .f90 .o
1516

17+
LIBD3 = libdftd3.a
18+
19+
all: $(LIBD3)
20+
21+
vpath % $(SRCDIR)
22+
1623
.PHONY: clean distclean
1724

18-
LIBD3 = libdftd3.a
1925

2026
OBJS = api.o common.o core.o pars.o sizes.o
2127

22-
all: $(LIBD3)
23-
2428
$(LIBD3): $(OBJS)
2529
ar r $@ $^
2630

lib/common.f90

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ module dftd3_common
3232
! Working precision (double precision)
3333
integer, parameter :: wp = kind(1.0d0)
3434

35+
! Large integers
36+
integer, parameter :: int64 = selected_int_kind(12)
37+
3538
! global ad hoc parameters
3639
real(wp), parameter :: k1 = 16.0
3740
real(wp), parameter :: k2 = 4./3.
@@ -50,7 +53,7 @@ module dftd3_common
5053
real(wp), parameter :: autokcal = 627.509541d0
5154
real(wp), parameter :: autoev = 27.21138505
5255
! J/mol nm^6 - > au
53-
real(wp), parameter :: c6conv = 1.d-3/2625.4999d0/((0.052917726d0)**6)
56+
real(wp), parameter :: c6conv = 1.d-3/2625.4999d0/((autoang / 10.0d0)**6)
5457

5558

5659
contains

lib/core.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ subroutine edisp(max_elem,maxc,n,xyz,iz,c6ab,mxc,r2r4,r0ab,rcov, &
698698
real(wp) cn(n)
699699
real(wp) r2ab(n*n),cc6ab(n*n),dmp(n*n),d2(3),t1,t2,t3,a1,a2,tmp2
700700
real(wp) abcthr
701-
integer*2 icomp(n*n)
701+
integer(int64) icomp(n*n)
702702
integer ij,ik,jk,k
703703

704704
e6 =0

prg/extras.f90

+6-6
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,12 @@ subroutine rdcoord(fname,n,xyz,iat,fix,fdum)
579579

580580
call readline(line,floats,strings,cs,cf)
581581
if (cf.eq.1.and.floats(1).gt.0) then
582-
f=1./0.52917726d0
582+
f=1.0d0 / autoang
583583
read(ich,'(A)',end=200)line
584584
else if (index(line,'$coord').ne.0) then
585585
f=1.0d0
586586
else if (index(line,'ang').ne.0) then
587-
f=1./0.52917726d0
587+
f=1.0d0 / autoang
588588
else if (index(line,'bohr').ne.0) then
589589
f=1.0d0
590590
end if
@@ -644,15 +644,15 @@ subroutine rdatomnumber(fname,n)
644644
if (line.eq."") goto 300
645645
call readline(line,floats,strings,cs,cf)
646646
if (cf.eq.1.and.floats(1).gt.0.and.cs.eq.0) then
647-
f=1./0.52917726d0
647+
f=1.0d0 / autoang
648648
! write(*,*)floats(1)
649649
n=int(floats(1))
650650
close(ich)
651651
return
652652
else if (index(line,'$coord').ne.0) then
653653
f=1.0d0
654654
else if (index(line,'ang').ne.0) then
655-
f=1./0.52917726d0
655+
f=1.0d0 / autoang
656656
else if (index(line,'bohr').ne.0) then
657657
f=1.0d0
658658
end if
@@ -2004,7 +2004,7 @@ subroutine split(str,delims,before,sep)
20042004
ibsl=0
20052005
cycle
20062006
end if
2007-
if (ch == '\\') then
2007+
if (ch == '\') then
20082008
k=k+1
20092009
before(k:k)=ch
20102010
ibsl=1
@@ -2066,7 +2066,7 @@ subroutine removebksl(str)
20662066
ibsl=0
20672067
cycle
20682068
end if
2069-
if (ch == '\\') then
2069+
if (ch == '\') then
20702070
ibsl=1
20712071
cycle
20722072
end if

0 commit comments

Comments
 (0)