root / src / PrintGeom.f90
Historique | Voir | Annoter | Télécharger (6,83 ko)
1 | 1 | pfleura2 | ! This subroutine prints a geometry |
---|---|---|---|
2 | 1 | pfleura2 | SUBROUTINE PrintGeom(Title,Nat,NCoord,Geom,Coord,IOOUT,Atome,Order,OrderInv,IndZmat) |
3 | 1 | pfleura2 | |
4 | 12 | pfleura2 | !---------------------------------------------------------------------- |
5 | 12 | pfleura2 | ! Copyright 2003-2014 Ecole Normale Supérieure de Lyon, |
6 | 12 | pfleura2 | ! Centre National de la Recherche Scientifique, |
7 | 12 | pfleura2 | ! Université Claude Bernard Lyon 1. All rights reserved. |
8 | 12 | pfleura2 | ! |
9 | 12 | pfleura2 | ! This work is registered with the Agency for the Protection of Programs |
10 | 12 | pfleura2 | ! as IDDN.FR.001.100009.000.S.P.2014.000.30625 |
11 | 12 | pfleura2 | ! |
12 | 12 | pfleura2 | ! Authors: P. Fleurat-Lessard, P. Dayal |
13 | 12 | pfleura2 | ! Contact: optnpath@gmail.com |
14 | 12 | pfleura2 | ! |
15 | 12 | pfleura2 | ! This file is part of "Opt'n Path". |
16 | 12 | pfleura2 | ! |
17 | 12 | pfleura2 | ! "Opt'n Path" is free software: you can redistribute it and/or modify |
18 | 12 | pfleura2 | ! it under the terms of the GNU Affero General Public License as |
19 | 12 | pfleura2 | ! published by the Free Software Foundation, either version 3 of the License, |
20 | 12 | pfleura2 | ! or (at your option) any later version. |
21 | 12 | pfleura2 | ! |
22 | 12 | pfleura2 | ! "Opt'n Path" is distributed in the hope that it will be useful, |
23 | 12 | pfleura2 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | 12 | pfleura2 | ! |
25 | 12 | pfleura2 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26 | 12 | pfleura2 | ! GNU Affero General Public License for more details. |
27 | 12 | pfleura2 | ! |
28 | 12 | pfleura2 | ! You should have received a copy of the GNU Affero General Public License |
29 | 12 | pfleura2 | ! along with "Opt'n Path". If not, see <http://www.gnu.org/licenses/>. |
30 | 12 | pfleura2 | ! |
31 | 12 | pfleura2 | ! Contact The Office of Technology Licensing, valorisation@ens-lyon.fr, |
32 | 12 | pfleura2 | ! for commercial licensing opportunities. |
33 | 12 | pfleura2 | !---------------------------------------------------------------------- |
34 | 12 | pfleura2 | |
35 | 1 | pfleura2 | use Path_module, only : Renum,Nom,NCart,Pi |
36 | 1 | pfleura2 | |
37 | 1 | pfleura2 | IMPLICIT NONE |
38 | 1 | pfleura2 | |
39 | 1 | pfleura2 | |
40 | 1 | pfleura2 | INTEGER, PARAMETER :: KINT=KIND(1) |
41 | 1 | pfleura2 | INTEGER, PARAMETER :: KREAL=KIND(1.D0) |
42 | 1 | pfleura2 | |
43 | 1 | pfleura2 | CHARACTER(*), INTENT(IN) :: Title |
44 | 1 | pfleura2 | INTEGER(KINT), INTENT(IN) :: Nat,NCoord,IoOut |
45 | 1 | pfleura2 | INTEGER(KINT), INTENT(IN) :: Atome(Nat),Order(Nat), OrderInv(Nat),IndZmat(Nat,5) |
46 | 1 | pfleura2 | CHARACTER(32), INTENT(IN) :: Coord |
47 | 1 | pfleura2 | REAL(KREAL), INTENT(IN) :: Geom(NCoord) |
48 | 1 | pfleura2 | |
49 | 1 | pfleura2 | INTEGER(KINT) :: Idx, Iat,I,IBeg |
50 | 12 | pfleura2 | CHARACTER(32) :: Name1, Name2, Name3,Name4 |
51 | 1 | pfleura2 | LOGICAL :: Debug=.FALSE. |
52 | 1 | pfleura2 | |
53 | 1 | pfleura2 | SELECT CASE (COORD) |
54 | 1 | pfleura2 | CASE ("ZMAT") |
55 | 12 | pfleura2 | |
56 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A)') TRIM(AdjustL(Title)) |
57 | 12 | pfleura2 | WRITE(Name1,'(A,I5)') Nom(Atome(OrderInv(indzmat(1,1)))),indzmat(1,1) |
58 | 12 | pfleura2 | ! WRITE(*,*) "Name1:",Name1,"*" |
59 | 12 | pfleura2 | Call CleanString(Name1,' ') |
60 | 12 | pfleura2 | ! WRITE(*,*) "Name1:",Name1,"*" |
61 | 12 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(1X,A4,1X,F11.6))') Name1(1:5) |
62 | 12 | pfleura2 | WRITE(Name1,'(A,I5)') Nom(Atome(OrderInv(indzmat(2,1)))),indzmat(2,1) |
63 | 12 | pfleura2 | Call CleanString(Name1,' ') |
64 | 12 | pfleura2 | WRITE(Name2,'(A,I5)') Nom(Atome(OrderInv(indzmat(2,2)))),indzmat(2,2) |
65 | 12 | pfleura2 | Call CleanString(Name2,' ') |
66 | 12 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(1X,A4,1X,F11.6))') Name1(1:5), & |
67 | 12 | pfleura2 | Name2(1:5),Geom(1) |
68 | 12 | pfleura2 | WRITE(Name1,'(A,I5)') Nom(Atome(OrderInv(indzmat(3,1)))),indzmat(3,1) |
69 | 12 | pfleura2 | Call CleanString(Name1,' ') |
70 | 12 | pfleura2 | WRITE(Name2,'(A,I5)') Nom(Atome(OrderInv(indzmat(3,2)))),indzmat(3,2) |
71 | 12 | pfleura2 | Call CleanString(Name2,' ') |
72 | 12 | pfleura2 | WRITE(Name3,'(A,I5)') Nom(Atome(OrderInv(indzmat(3,3)))),indzmat(3,3) |
73 | 12 | pfleura2 | Call CleanString(Name3,' ') |
74 | 12 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(1X,A4,1X,F11.6))') Name1, & |
75 | 12 | pfleura2 | Name2,Geom(2), & |
76 | 12 | pfleura2 | Name3,Geom(3)*180./Pi |
77 | 1 | pfleura2 | Idx=4 |
78 | 1 | pfleura2 | DO Iat=4,Nat |
79 | 12 | pfleura2 | WRITE(Name1,'(A,I5)') Nom(Atome(OrderInv(indzmat(iat,1)))),indzmat(iat,1) |
80 | 12 | pfleura2 | Call CleanString(Name1,' ') |
81 | 12 | pfleura2 | WRITE(Name2,'(A,I5)') Nom(Atome(OrderInv(indzmat(iat,2)))),indzmat(iat,2) |
82 | 12 | pfleura2 | Call CleanString(Name2,' ') |
83 | 12 | pfleura2 | WRITE(Name3,'(A,I5)') Nom(Atome(OrderInv(indzmat(iat,3)))),indzmat(iat,3) |
84 | 12 | pfleura2 | Call CleanString(Name3,' ') |
85 | 12 | pfleura2 | WRITE(Name4,'(A,I5)') Nom(Atome(OrderInv(indzmat(iat,4)))),indzmat(iat,4) |
86 | 12 | pfleura2 | Call CleanString(Name4,' ') |
87 | 12 | pfleura2 | |
88 | 12 | pfleura2 | ! WRITE(IOOUT,'(1X,A5,3(1X,A4,1X,F11.6))') Nom(Atome(OrderInv(indzmat(iat,1)))), & |
89 | 12 | pfleura2 | ! Nom(Atome(OrderInv(indzmat(iat,2)))),Geom(Idx), & |
90 | 12 | pfleura2 | ! Nom(Atome(OrderInv(indzmat(iat,3)))),Geom(Idx+1)*180./Pi, & |
91 | 12 | pfleura2 | ! Nom(Atome(OrderInv(indzmat(iat,4)))),Geom(Idx+2)*180./Pi |
92 | 12 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(1X,A4,1X,F11.6))') Name1, & |
93 | 12 | pfleura2 | Name2,Geom(Idx), & |
94 | 12 | pfleura2 | Name3,Geom(Idx+1)*180./Pi, & |
95 | 12 | pfleura2 | Name4,Geom(Idx+2)*180./Pi |
96 | 1 | pfleura2 | Idx=Idx+3 |
97 | 1 | pfleura2 | END DO |
98 | 1 | pfleura2 | |
99 | 1 | pfleura2 | |
100 | 1 | pfleura2 | if (debug) THEN |
101 | 1 | pfleura2 | WRITE(*,'(1X,A)') TRIM(AdjustL(Title)) |
102 | 1 | pfleura2 | WRITE(*,'(1X,A5,3(1X,A4,1X,F11.6))') Nom(Atome(OrderInv(indzmat(1,1)))) |
103 | 1 | pfleura2 | WRITE(*,'(1X,A5,3(1X,A4,1X,F11.6))') Nom(Atome(OrderInv(indzmat(2,1)))), & |
104 | 1 | pfleura2 | Nom(Atome(OrderInv(indzmat(2,2)))),Geom(1) |
105 | 1 | pfleura2 | WRITE(*,'(1X,A5,3(1X,A4,1X,F14.6))') Nom(Atome(OrderInv(indzmat(3,1)))), & |
106 | 1 | pfleura2 | Nom(Atome(OrderInv(indzmat(3,2)))),Geom(2), & |
107 | 1 | pfleura2 | Nom(Atome(OrderInv(indzmat(3,3)))),Geom(3)*180./Pi |
108 | 1 | pfleura2 | Idx=4 |
109 | 1 | pfleura2 | DO Iat=4,Nat |
110 | 1 | pfleura2 | WRITE(*,'(1X,A5,3(1X,A4,1X,F11.6))') Nom(Atome(OrderInv(indzmat(iat,1)))), & |
111 | 1 | pfleura2 | Nom(Atome(OrderInv(indzmat(iat,2)))),Geom(Idx), & |
112 | 1 | pfleura2 | Nom(Atome(OrderInv(indzmat(iat,3)))),Geom(Idx+1)*180./Pi, & |
113 | 1 | pfleura2 | Nom(Atome(OrderInv(indzmat(iat,4)))),Geom(Idx+2)*180./Pi |
114 | 1 | pfleura2 | Idx=Idx+3 |
115 | 1 | pfleura2 | END DO |
116 | 1 | pfleura2 | END IF |
117 | 1 | pfleura2 | CASE ("MIXED") |
118 | 1 | pfleura2 | ! WRITE(*,'(1X,A,12(1X,F10.5))') "IntCoordTmp:",Geom(1:NCoord) |
119 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A)') TRIM(AdjustL(Title)) |
120 | 1 | pfleura2 | DO I=1,NCart |
121 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(1X,F11.6))') Nom(Atome(OrderInv(indzmat(1,1)))) & |
122 | 1 | pfleura2 | ,Geom(3*I-2:3*I) |
123 | 1 | pfleura2 | END DO |
124 | 1 | pfleura2 | Idx=3*NCart+1 |
125 | 1 | pfleura2 | SELECT CASE (NCart) |
126 | 1 | pfleura2 | CASE (1) |
127 | 1 | pfleura2 | I=2 |
128 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(I5,F11.6))') Nom(Atome(OrderInv(Indzmat(I,1)))), & |
129 | 1 | pfleura2 | IndZmat(I,2),Geom(Idx) |
130 | 1 | pfleura2 | Idx=Idx+1 |
131 | 1 | pfleura2 | I=3 |
132 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(I5,F11.6))') Nom(Atome(OrderInv(Indzmat(I,1)))), & |
133 | 1 | pfleura2 | IndZmat(I,2),Geom(Idx),IndZmat(I,3), & |
134 | 1 | pfleura2 | Geom(Idx+1)*180./Pi |
135 | 1 | pfleura2 | Idx=Idx+2 |
136 | 1 | pfleura2 | Ibeg=4 |
137 | 1 | pfleura2 | CASE (2) |
138 | 1 | pfleura2 | I=3 |
139 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(I5,F11.6))') Nom(Atome(OrderInv(Indzmat(I,1)))), & |
140 | 1 | pfleura2 | IndZmat(I,2),Geom(Idx),IndZmat(I,3), & |
141 | 1 | pfleura2 | Geom(Idx+1)*180./Pi |
142 | 1 | pfleura2 | Idx=Idx+2 |
143 | 1 | pfleura2 | Ibeg=4 |
144 | 1 | pfleura2 | CASE DEFAULT |
145 | 1 | pfleura2 | IBeg=NCart+1 |
146 | 1 | pfleura2 | END SELECT |
147 | 1 | pfleura2 | DO I=IBeg,Nat |
148 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(I5,F11.6))') Nom(Atome(OrderInv(Indzmat(I,1)))), & |
149 | 1 | pfleura2 | IndZmat(I,2),Geom(Idx),IndZmat(I,3), & |
150 | 1 | pfleura2 | Geom(Idx+1)*180./Pi, & |
151 | 1 | pfleura2 | IndZmat(I,4),Geom(Idx+2)*180./Pi |
152 | 1 | pfleura2 | Idx=Idx+3 |
153 | 1 | pfleura2 | END DO |
154 | 1 | pfleura2 | CASE ('CART','HYBRID') |
155 | 1 | pfleura2 | WRITE(IOOUT,'(1X,I5)') Nat |
156 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A)') TRIM(AdjustL(Title)) |
157 | 1 | pfleura2 | DO I=1,Nat |
158 | 1 | pfleura2 | Iat=I |
159 | 1 | pfleura2 | If (renum) Iat=Order(I) |
160 | 1 | pfleura2 | !!! CAUTION : PFL 29.AUG.2008 -> |
161 | 1 | pfleura2 | ! Old line: |
162 | 1 | pfleura2 | ! WRITE(IOOUT,'(1X,A5,3(1X,F11.6))') Nom(Atome(i)), Geom(3*Iat-2:3*Iat) |
163 | 1 | pfleura2 | ! uses implicitly that Geom is Geom(3,Nat) whereas it is in fact Geom(Nat,3) :-( |
164 | 1 | pfleura2 | WRITE(IOOUT,'(1X,A5,3(1X,F11.6))') Nom(Atome(i)), Geom(Iat), Geom(Iat+Nat), Geom(Iat+2*Nat) |
165 | 1 | pfleura2 | |
166 | 1 | pfleura2 | END DO |
167 | 1 | pfleura2 | CASE ('BAKER') |
168 | 1 | pfleura2 | !WRITE(IOOUT,*) "Baker coordinates are difficult to interpret. Therefore cartesian coordinates" |
169 | 1 | pfleura2 | !WRITE(IOOUT,*) "Should be printed" |
170 | 1 | pfleura2 | WRITE(*,*) "Baker coordinates are difficult to interpret. Therefore cartesian" |
171 | 1 | pfleura2 | WRITE(*,*) "coordinates are printed above." |
172 | 1 | pfleura2 | END SELECT |
173 | 1 | pfleura2 | |
174 | 1 | pfleura2 | END SUBROUTINE PRINTGEOM |