-
Notifications
You must be signed in to change notification settings - Fork 0
/
RW_driver.f
96 lines (65 loc) · 2.41 KB
/
RW_driver.f
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
module RW_driver
use RW_routines , only : View_XYZ, View_Yaehmop, Save_POSCAR, Save_MD_Urht
use types_m , only : universe
use GMX_routines , only : Save_GROMACS
use Topology_routines , only : get_topology
use Read_Parms , only : atom
use diagnosis_m
public :: WritingRoutines
private
contains
!======================================
subroutine WritingRoutines( structure )
!======================================
implicit none
type(universe) , intent(inout) :: structure
! local variables
integer :: AtNo, N_of_atom_type, file_type
character(len=1) :: Writing_Method
!-----------------------------------------------------------
! Writing the output file
CALL system( "clear" )
CALL diagnosis( structure )
do
write(*,'(/a)') '>>> Writing the output file <<<'
write(*,'(/a)') '1 : XYZ format'
write(*,'(/a)') '2 : Yaehmop format '
write(*,'(/a)') '3 : POSCAR format '
write(*,'(/a)') '4 : PDB format '
write(*,'(/a)') '5 : Generate Topology ( must have CONECT in the pdb file; "obabel -ipdb input.pdb -opdb -O output.pdb" ) '
write(*,'(/a)') '6 : DONE '
write(*,'(/a)',advance='no') '>>> '
read (*,'(a)') Writing_Method
select case ( Writing_Method )
case ('1')
CALL View_XYZ( structure )
case ('2')
CALL View_Yaehmop( structure )
CALL system("tbind seed") !<== uses Yaehmop software tbind
case ('3')
CALL Save_POSCAR( structure )
case ('4')
CALL Save_GROMACS( structure )
case ('5')
write(*,'(/a)') 'Choose format: 1=OPLS , 2=GAFF/NAMD/Amber'
write(*,'(/a)',advance='no') '>>> '
read (*,*) file_type
CALL get_topology( structure , file_type )
pause ">>> DONE <<<"
case default
exit
end select
call system("clear")
end do
! total number of atoms of given type ...
If( Writing_Method /= '3' ) then
do AtNo = 1 , size(atom)
N_of_atom_type = count(structure % atom % AtNo == AtNo)
If( N_of_atom_type /= 0 ) Print 121 , atom(AtNo) % symbol , N_of_atom_type
end do
end If
121 FORMAT(1x,A2,' atoms = ',I5)
122 FORMAT(1x,A34,I6)
123 FORMAT(1x,A12,I4)
end subroutine WritingRoutines
end module RW_driver