-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.f90
138 lines (114 loc) · 5.16 KB
/
main.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
!================================================================================!
! This file is part of gfnff.
!
! Copyright (C) 2023 Philipp Pracht
!
! gfnff is free software: you can redistribute it and/or modify it under
! the terms of the GNU Lesser General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! gfnff is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU Lesser General Public License for more details.
!
! You should have received a copy of the GNU Lesser General Public License
! along with gfnff. If not, see <https://www.gnu.org/licenses/>.
!================================================================================!
program gfnff_main_tester
use iso_fortran_env, only: wp=>real64,stdout=>output_unit
use testmol
use gfnff_interface
implicit none
integer :: nat
integer,allocatable :: at(:)
real(wp),allocatable :: xyz(:,:)
integer :: chrg
integer :: uhf
integer :: i,j,k,l
!========================================================================================!
real(wp) :: energy
real(wp),allocatable :: gradient(:,:)
real(wp) :: gnorm
logical :: fail,pr
integer :: io
type(gfnff_data) :: dat
!========================================================================================!
fail = .false.
pr = .true.
nat = testnat
allocate(at(nat),xyz(3,nat))
at = testat
xyz = testxyz
chrg = 0
energy = 0.0_wp
gnorm = 0.0_wp
allocate(gradient(3,nat),source=0.0_wp)
write(*,*) nat
write(*,*)
do i=1,nat
write(*,'(2x,i3,3x,3f16.6)') at(i),xyz(1:3,i)
enddo
call writetestcoord()
!=======================================================================================!
!=======================================================================================!
!> STANDARD USAGE
!=======================================================================================!
!=======================================================================================!
write(*,*)
write(*,*) '================================================================='
write(*,*) '==================== GFN-FF SINGLEPOINT ========================='
write(*,*) '================================================================='
!>--- First, setup of parametrisation and topology into DAT
write(*,*)
write(*,*) 'Initializing GFN-FF'
call gfnff_initialize(nat,at,xyz,DAT,verbose=.false.,ichrg=chrg,iostat=io)
write(*,*) 'Setup exit status:',io
!>--- Then call to the singlepoint routine
write(*,*)
write(*,*) 'Performing GFN-FF singlepoint calculation'
call gfnff_singlepoint(nat,at,xyz,DAT, energy,gradient, pr,iostat=io)
write(*,*) 'Singlepoint exit status:',io
!>--- And printout of the results from DAT%res
write(*,*)
write(*,*) 'GFN-FF results'
call print_gfnff_results(stdout, DAT%res, allocated(DAT%solvation))
call DAT%deallocate()
write(*,*)
write(*,*) '=========================== END ================================='
write(*,*) '==================== GFN-FF SINGLEPOINT ========================='
write(*,*) '=========================== END ================================='
!=======================================================================================!
!=======================================================================================!
!> USAGE WITH ALPB
!=======================================================================================!
!=======================================================================================!
write(*,*)
write(*,*) '================================================================='
write(*,*) '========= GFN-FF + ALPB implicit solvation SINGLEPOINT =========='
write(*,*) '================================================================='
!>--- First, setup of parametrisation and topology into DAT
write(*,*)
write(*,*) 'Initializing GFN-FF + ALPB(water)'
DAT%solvent = 'h2o'
call gfnff_initialize(nat,at,xyz,DAT,print=.true.,ichrg=chrg,iostat=io)
write(*,*) 'Setup exit status:',io
!>--- Then call to the singlepoint routine
write(*,*)
write(*,*) 'Performing GFN-FF singlepoint calculation'
call gfnff_singlepoint(nat,at,xyz,DAT, energy,gradient, pr,iostat=io)
write(*,*) 'Singlepoint exit status:',io
!>--- And printout of the results from DAT%res
write(*,*)
write(*,*) 'GFN-FF results'
call print_gfnff_results(stdout, DAT%res, allocated(DAT%solvation))
write(*,*)
write(*,*) '========================== END =================================='
write(*,*) '========= GFN-FF + ALPB implicit solvation SINGLEPOINT =========='
write(*,*) '========================== END =================================='
!=======================================================================================!
deallocate(gradient)
deallocate(xyz,at)
!=======================================================================================!
end program gfnff_main_tester