hdiff output

r30182/commons.f90 2016-03-19 14:30:06.195189317 +0000 r30181/commons.f90 2016-03-19 14:30:06.787195378 +0000
 48:      &                 TFAC(3), RMS, TEMPS, SACCRAT, CEIG, PNEWJUMP, EAMP, DISTFAC, ODDCHARGE, COULQ, COULSWAP, & 48:      &                 TFAC(3), RMS, TEMPS, SACCRAT, CEIG, PNEWJUMP, EAMP, DISTFAC, ODDCHARGE, COULQ, COULSWAP, &
 49:      &                 COULTEMP, APP, AMM, APM, XQP, XQM, ALPHAP, ALPHAM, ZSTAR, K_COMP, DGUESS, GUIDECUT, EFAC,&  49:      &                 COULTEMP, APP, AMM, APM, XQP, XQM, ALPHAP, ALPHAM, ZSTAR, K_COMP, DGUESS, GUIDECUT, EFAC,& 
 50:      &                 TRENORM, HISTMIN, HISTMAX, HISTFAC, EPSSPHERE, FINALCUTOFF, SHELLPROB, RINGROTSCALE, & 50:      &                 TRENORM, HISTMIN, HISTMAX, HISTFAC, EPSSPHERE, FINALCUTOFF, SHELLPROB, RINGROTSCALE, &
 51:      &                 HISTFACMUL, HPERCENT, AVOIDDIST, MAXERISE, MAXEFALL, TSTART, MATDIFF, STICKYSIG, SDTOL, & 51:      &                 HISTFACMUL, HPERCENT, AVOIDDIST, MAXERISE, MAXEFALL, TSTART, MATDIFF, STICKYSIG, SDTOL, &
 52:      &                 MinimalTemperature, MaximalTemperature, SwapProb, hdistconstraint, COREFRAC, TSTAR, & 52:      &                 MinimalTemperature, MaximalTemperature, SwapProb, hdistconstraint, COREFRAC, TSTAR, &
 53:      &                 RK_R, RK_THETA,ARMA,ARMB, ExtrapolationPercent, lnHarmFreq, PTEMIN, PTEMAX, PTTMIN, PTTMAX, EXCHPROB, & 53:      &                 RK_R, RK_THETA,ARMA,ARMB, ExtrapolationPercent, lnHarmFreq, PTEMIN, PTEMAX, PTTMIN, PTTMAX, EXCHPROB, &
 54:      &                 PTSTEPS, NEQUIL, NQUENCH, COLDFUSIONLIMIT, NEWRES_TEMP, MINOMEGA, LJSIGMA, LJEPSILON, TAUMAX, & 54:      &                 PTSTEPS, NEQUIL, NQUENCH, COLDFUSIONLIMIT, NEWRES_TEMP, MINOMEGA, LJSIGMA, LJEPSILON, TAUMAX, &
 55:      &                 TAUMAXFULL, CPFACTORSG, CPFACTORFG, VGWTOL, ABTHRESH, ACTHRESH, CSMPMAT(3,3), & 55:      &                 TAUMAXFULL, CPFACTORSG, CPFACTORFG, VGWTOL, ABTHRESH, ACTHRESH, CSMPMAT(3,3), &
 56:      &                 RADIUS_CONTAINER, HYDROPHOBIC, RESTRICTREGIONX0, RESTRICTREGIONY0, RESTRICTREGIONZ0, & 56:      &                 RADIUS_CONTAINER, HYDROPHOBIC, RESTRICTREGIONX0, RESTRICTREGIONY0, RESTRICTREGIONZ0, &
 57:      &                 RESTRICTREGIONRADIUS, HARMONICSTR, DUMPUNIQUEEPREV, DUMPUNIQUEEMARKOV, FREEZESAVEE, & 57:      &                 RESTRICTREGIONRADIUS, HARMONICSTR, DUMPUNIQUEEPREV, DUMPUNIQUEEMARKOV, FREEZESAVEE, &
 58:      &                 TBPMIN, TBPSTEP, TBPHF, TBPCF, TBPINCR, SHIFTV, GEOMDIFFTOL, LJATTOC, GCMU, HESS_EIGEN_TOL, & 58:      &                 TBPMIN, TBPSTEP, TBPHF, TBPCF, TBPINCR, SHIFTV, GEOMDIFFTOL, LJATTOC, GCMU, &
 59:      &                 SRATIO, TRATIO, EXCHINT, DDMCUT, SUMTEMP, SUMSTEP, SUMOSTEP, EXPANDFACTOR, ROTATEFACTOR, EPSRIGID, & 59:      &                 SRATIO, TRATIO, EXCHINT, DDMCUT, SUMTEMP, SUMSTEP, SUMOSTEP, EXPANDFACTOR, ROTATEFACTOR, EPSRIGID, &
 60:      &                 CONTOURBOUNDS(3,2), KCOMP_RIGID, RIGIDCOMDIST, PALPHA, PBETA, PGAMMA, LAT(3,3), MFETPCTL, MFETTRGT, QUIPEQDIST, & 60:      &                 CONTOURBOUNDS(3,2), KCOMP_RIGID, RIGIDCOMDIST, PALPHA, PBETA, PGAMMA, LAT(3,3), MFETPCTL, MFETTRGT, QUIPEQDIST, &
 61:  61: 
 62: !   parameters for anisotropic potentials 62: !   parameters for anisotropic potentials
 63: ! 63: !
 64: !    DC430 > 64: !    DC430 >
 65:      &                 CAPEPS2, CAPRAD, CAPRHO, CAPHEIGHT1, CAPHEIGHT2, & 65:      &                 CAPEPS2, CAPRAD, CAPRHO, CAPHEIGHT1, CAPHEIGHT2, &
 66:      &                 EPSR, GBKAPPA, GBKAPPRM, GBMU,GBNU, GBSIGNOT, GBEPSNOT, GBCHI, GBCHIPRM, & 66:      &                 EPSR, GBKAPPA, GBKAPPRM, GBMU,GBNU, GBSIGNOT, GBEPSNOT, GBCHI, GBCHIPRM, &
 67:      &                 SIGNOT, EPSNOT, SIGMAF, INVKAP, ESA(3), LPRSQ, LSQDFR, GBDPMU, GBDPEPS, GBDPFCT, & 67:      &                 SIGNOT, EPSNOT, SIGMAF, INVKAP, ESA(3), LPRSQ, LSQDFR, GBDPMU, GBDPEPS, GBDPFCT, &
 68:      &                 PYSIGNOT, PYEPSNOT, PYA1(3), PYA2(3), PYDPMU, PYDPEPS, PYDPFCT, PYGRAVITYC1, PYGRAVITYC2, & 68:      &                 PYSIGNOT, PYEPSNOT, PYA1(3), PYA2(3), PYDPMU, PYDPEPS, PYDPFCT, PYGRAVITYC1, PYGRAVITYC2, &


r30182/finalio.f90 2016-03-19 14:30:06.395191364 +0000 r30181/finalio.f90 2016-03-19 14:30:07.039197963 +0000
 10: !   GMIN is distributed in the hope that it will be useful, 10: !   GMIN is distributed in the hope that it will be useful,
 11: !   but WITHOUT ANY WARRANTY; without even the implied warranty of 11: !   but WITHOUT ANY WARRANTY; without even the implied warranty of
 12: !   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 12: !   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13: !   GNU General Public License for more details. 13: !   GNU General Public License for more details.
 14: ! 14: !
 15: !   You should have received a copy of the GNU General Public License 15: !   You should have received a copy of the GNU General Public License
 16: !   along with this program; if not, write to the Free Software 16: !   along with this program; if not, write to the Free Software
 17: !   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 17: !   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18: ! 18: !
 19: SUBROUTINE FINALIO 19: SUBROUTINE FINALIO
 20:   USE COMMONS 20:     USE COMMONS
 21:   USE GENRIGID, ONLY : RIGIDINIT 21:     USE GENRIGID, ONLY : RIGIDINIT
 22:   USE MODAMBER 22:     USE MODAMBER
 23:   USE MODAMBER9, ONLY : COORDS1,IH,M04,AMBFINALIO_NODE 23:     USE MODAMBER9, ONLY : COORDS1,IH,M04,AMBFINALIO_NODE
 24:   USE AMBER12_INTERFACE_MOD, ONLY : AMBER12_FINISH, AMBER12_WRITE_RESTART, AMBER12_WRITE_PDB, & 24:     USE AMBER12_INTERFACE_MOD, ONLY : AMBER12_FINISH, AMBER12_WRITE_RESTART, AMBER12_WRITE_PDB, &
 25:        AMBER12_WRITE_XYZ 25:                                       AMBER12_WRITE_XYZ
 26:   USE QMODULE 26:     USE QMODULE
 27:   USE MODCHARMM 27:     USE MODCHARMM
 28:   USE AMHGLOBALS, ONLY:NMRES,IRES 28:     USE AMHGLOBALS, ONLY:NMRES,IRES
 29:   USE BGUPMOD 29:     USE BGUPMOD
 30:   USE PERMU 30:     USE PERMU
 31:   USE MODHESS, ONLY : HESS, MASSWT 31:     USE MODHESS, ONLY : HESS, MASSWT
 32:    32: 
 33:   IMPLICIT NONE 33:     IMPLICIT NONE
 34:    34: 
 35:   !   MCP 35:     !   MCP
 36:   INTEGER III, I3,  GLY_COUNT, ID, NUMCRD, NUMPRO, NCPHST, GETUNIT, AMHUNIT1, AMHUNIT2, LUNIT, NSYMOPS 36:     INTEGER III, I3,  GLY_COUNT, ID, NUMCRD, NUMPRO, NCPHST, GETUNIT, AMHUNIT1, AMHUNIT2, LUNIT, NSYMOPS
 37:   INTEGER J1, J2, J3, J4, J5, MYUNIT2, I1, NDUMMY, MYUNIT3, NC, NRBS1, NRBS2, MYUNIT4 37:     INTEGER J1, J2, J3, J4, J5, MYUNIT2, I1, NDUMMY, MYUNIT3, NC, NRBS1, NRBS2, MYUNIT4
 38:   DOUBLE PRECISION RBCOORDS(NRBSITES*3), DCOORDS(3*NATOMS), EDUMMY, ITDET 38:     DOUBLE PRECISION RBCOORDS(NRBSITES*3), DCOORDS(3*NATOMS), EDUMMY, ITDET
 39:   ! 
 40:   !ds656> Symmetry detection for clusters on a substrate... 
 41:   INTEGER :: ISITES(MIEF_NSITES), NSITES, COMBO_N 
 42:   DOUBLE PRECISION :: SITES(3*MIEF_NSITES), DISTS(MIEF_NSITES) 
 43:   INTEGER, ALLOCATABLE :: COMBO_LABELS(:) 
 44:   DOUBLE PRECISION, ALLOCATABLE :: COMBO_COORDS(:) 
 45:   !<ds656 
 46:     ! 39:     !
 47:   DOUBLE PRECISION P3(3,3), P(3), DU(3), RMI(3,3), DRMI(3,3), PI, PHI, THT, CHI 40:     !ds656> Symmetry detection for clusters on a substrate...
 48:   !DOUBLE PRECISION, ALLOCATABLE :: XCOORDS(:), YCOORDS(:) 41:     INTEGER :: ISITES(MIEF_NSITES), NSITES, COMBO_N
 49:   CHARACTER(LEN=13) J1CHAR,J1CHAR2                  !for gay-berne output files 42:     DOUBLE PRECISION :: SITES(3*MIEF_NSITES), DISTS(MIEF_NSITES)
 50:   CHARACTER(LEN=6) ZSTR 43:     INTEGER, ALLOCATABLE :: COMBO_LABELS(:)
 51:   CHARACTER(LEN=2)  DUMMYSTR 44:     DOUBLE PRECISION, ALLOCATABLE :: COMBO_COORDS(:)
 52:   DOUBLE PRECISION EulerPhi,EulerPsi,EulerTheta,EulerThetadeg,EulerPhiDeg,EulerPsiDeg  ! Euler angles for ellipsoids of revolution 45:     !<ds656
 53:    46:     !
 54:   DOUBLE PRECISION EPS2, RAD, HEIGHT,sumx,sumy,sumz,CM(3),SYMOPS(120,3,3) 47:     DOUBLE PRECISION P3(3,3), P(3), DU(3), RMI(3,3), DRMI(3,3), PI, PHI, THT, CHI
 55:   LOGICAL :: GTEST 48:     !DOUBLE PRECISION, ALLOCATABLE :: XCOORDS(:), YCOORDS(:)
 56:   COMMON /CAPS/ EPS2, RAD, HEIGHT 49:     CHARACTER(LEN=13) J1CHAR,J1CHAR2                  !for gay-berne output files
 57:    50:     CHARACTER(LEN=6) ZSTR
 58:   CHARACTER(LEN=4) :: FPGRP 51:     CHARACTER(LEN=2)  DUMMYSTR
 59:   CHARACTER(LEN=6) :: CRMS 52:     DOUBLE PRECISION EulerPhi,EulerPsi,EulerTheta,EulerThetadeg,EulerPhiDeg,EulerPsiDeg  ! Euler angles for ellipsoids of revolution
 60:   CHARACTER(LEN=20) :: MYFILENAME2, ISTR, DBNUM, MYFILENAME3 53: 
 61:   CHARACTER(LEN=15), ALLOCATABLE :: DBNAME(:) 54:     DOUBLE PRECISION EPS2, RAD, HEIGHT,sumx,sumy,sumz,CM(3),SYMOPS(120,3,3)
 62:    55:     LOGICAL :: GTEST
 63:   CHARACTER(LEN=6) :: J1_STRING, MYNODE_STRING 56:     COMMON /CAPS/ EPS2, RAD, HEIGHT
 64:    57: 
 65:   !  AMH 58:     CHARACTER(LEN=4) :: FPGRP
 66:   CHARACTER(LEN=3) :: RES_TYPE 59:     CHARACTER(LEN=6) :: CRMS
 67:   CHARACTER(LEN=2) :: ATOM_TYPE 60:     CHARACTER(LEN=20) :: MYFILENAME2, ISTR, DBNUM, MYFILENAME3
 68:   CHARACTER*1 COUNTTT 61:     CHARACTER(LEN=15), ALLOCATABLE :: DBNAME(:)
 69:   INTEGER COUNTT 62: 
 70:   DOUBLE PRECISION  PPPCORD(NMRES*3*3,3,3,5) 63:     CHARACTER(LEN=6) :: J1_STRING, MYNODE_STRING
 71:   EXTERNAL NUM_TO_CHAR 64: 
 72:   DOUBLE PRECISION TEND 65:     !  AMH
 73:   INTEGER ITERATIONS, BRUN,QDONE, NP 66:     CHARACTER(LEN=3) :: RES_TYPE
 74:   DOUBLE PRECISION SCREENC(3*NATOMSALLOC), TIME 67:     CHARACTER(LEN=2) :: ATOM_TYPE
 75:    68:     CHARACTER*1 COUNTTT
 76:   ! ds656> Extra stuff for HSA in OPTIM's min.data format 69:     INTEGER COUNTT
 77:   INTEGER :: NUM_ZERO_EVS, INFO 70:     DOUBLE PRECISION  PPPCORD(NMRES*3*3,3,3,5)
 78:   DOUBLE PRECISION :: LOG_PROD, EVALS(3*NATOMS), WORK(9*NATOMS) 71:     EXTERNAL NUM_TO_CHAR
 79:    72:     DOUBLE PRECISION TEND
 80:    73:     INTEGER ITERATIONS, BRUN,QDONE, NP
 81:   PI = 4.D0*DATAN(1.D0) 74:     DOUBLE PRECISION SCREENC(3*NATOMSALLOC), TIME
 82:    75:     
 83:   !ds656> test 76:     ! ds656> Extra stuff for HSA in OPTIM's min.data format
 84:   !write(*,*) "finalio> START, PI=", PI 77:     INTEGER :: NUM_ZERO_EVS, INFO
 85:    78:     DOUBLE PRECISION :: LOG_PROD, EVALS(3*NATOMS), WORK(9*NATOMS)
 86:   IF (PERMOPT) THEN 79:     
 87:      NSAVE=2 80: 
 88:      QMIN(2)=0.0D0 81:     PI = 4.D0*DATAN(1.D0)
 89:      QMINP(2,:)=FIN(:) 82:     
 90:      FF(:)=0 83:     !ds656> test
 91:   ENDIF 84:     !write(*,*) "finalio> START, PI=", PI
 92:    85:     
 93:   NUMPRO = 1 86:     IF (PERMOPT) THEN
 94:   NUMCRD = 3 87:        NSAVE=2
 95:    88:        QMIN(2)=0.0D0
 96:   ALLOCATE(DBNAME(NSAVE)) 89:        QMINP(2,:)=FIN(:)
 97:    90:        FF(:)=0
 98:   IF (DEBUG) WRITE(MYUNIT,'(A,3I6)') ' in finalio MYNODE,MYUNIT,NSAVE=',MYNODE,MYUNIT,NSAVE !jdf43> 91:     ENDIF
 99:   DO J1=1,NSAVE 92: 
100:      WRITE(DBNUM,*) J1 93:     NUMPRO = 1
101:      DBNAME(J1)='dbase.'//TRIM(ADJUSTL(DBNUM)) 94:     NUMCRD = 3
102:   ENDDO 95: 
103:   DCOORDS(1:3*NATOMS)=0.0D0 96:     ALLOCATE(DBNAME(NSAVE))
104:   !      IF (AMH) THEN 97:      
105:   !         CALL WALESAMH_FINALIO 98:     IF (DEBUG) WRITE(MYUNIT,'(A,3I6)') ' in finalio MYNODE,MYUNIT,NSAVE=',MYNODE,MYUNIT,NSAVE !jdf43>
106:   !         STOP 99:     DO J1=1,NSAVE
107:   !      ENDIF100:         WRITE(DBNUM,*) J1
108:   101:         DBNAME(J1)='dbase.'//TRIM(ADJUSTL(DBNUM))
109:   IF (AMHT) THEN102:     ENDDO
110:      AMHUNIT1=GETUNIT()103:     DCOORDS(1:3*NATOMS)=0.0D0
111:      OPEN(UNIT=AMHUNIT1,FILE='movie_gmin',STATUS='UNKNOWN')104:     !      IF (AMH) THEN
112:      WRITE(AMHUNIT1,334)NMRES,NUMCRD,NUMPRO,NSAVE105:     !         CALL WALESAMH_FINALIO
113: 334  FORMAT(4(I8,1X),' NMRES NMCRD NUMPRO NMSNAP')106:     !         STOP
114:   ENDIF107:     !      ENDIF
115:   108: 
116:   IF (DMACRYST) THEN109:     IF (AMHT) THEN
117:      CALL DMACRYS_DUMP_LOWEST110:         AMHUNIT1=GETUNIT()
118:   ENDIF111:         OPEN(UNIT=AMHUNIT1,FILE='movie_gmin',STATUS='UNKNOWN')
119:   112:         WRITE(AMHUNIT1,334)NMRES,NUMCRD,NUMPRO,NSAVE
120:   IF(USERPOTT) THEN113: 334     FORMAT(4(I8,1X),' NMRES NMCRD NUMPRO NMSNAP')
121:      CALL USERPOT_DUMP_LOWEST114:     ENDIF
122:   ENDIF115: 
123:   116:     IF (DMACRYST) THEN
124:   117:         CALL DMACRYS_DUMP_LOWEST
125:   IF (MPIT) THEN118:     ENDIF
126:      WRITE (ISTR, '(I10)') MYNODE+1119: 
127:      MYUNIT2=GETUNIT()120:     IF(USERPOTT) THEN
128:      MYFILENAME2="lowest."//TRIM(ADJUSTL(ISTR))121:         CALL USERPOT_DUMP_LOWEST
129:      !        WRITE(MYUNIT,'(A,I6,A)') ' in finalio MYUNIT2,MYFILENAME2=',MYUNIT2,TRIM(ADJUSTL(MYFILENAME2))122:     ENDIF
130:      OPEN(MYUNIT2,FILE=TRIM(ADJUSTL(MYFILENAME2)), STATUS="UNKNOWN", FORM="FORMATTED")123: 
131:      IF (CHRMMT) THEN124: 
132:         DO J1=1,NSAVE125:     IF (MPIT) THEN
133:            WRITE(DBNUM,*) J1126:         WRITE (ISTR, '(I10)') MYNODE+1
134:            DBNAME(J1)='dbase.'//TRIM(ADJUSTL(ISTR))//'.'//TRIM(ADJUSTL(DBNUM))127:         MYUNIT2=GETUNIT()
135:         ENDDO128:         MYFILENAME2="lowest."//TRIM(ADJUSTL(ISTR))
136:      ENDIF129: !        WRITE(MYUNIT,'(A,I6,A)') ' in finalio MYUNIT2,MYFILENAME2=',MYUNIT2,TRIM(ADJUSTL(MYFILENAME2))
137:      IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) THEN130:         OPEN(MYUNIT2,FILE=TRIM(ADJUSTL(MYFILENAME2)), STATUS="UNKNOWN", FORM="FORMATTED")
138:         MYUNIT3=GETUNIT()131:         IF (CHRMMT) THEN
139:         MYFILENAME3="CSMav."//trim(adjustl(istr))132:             DO J1=1,NSAVE
140:      ENDIF133:                 WRITE(DBNUM,*) J1
141:   ELSE134:                 DBNAME(J1)='dbase.'//TRIM(ADJUSTL(ISTR))//'.'//TRIM(ADJUSTL(DBNUM))
142:      MYUNIT2=GETUNIT()135:             ENDDO
143:      ! hk286136:         ENDIF
144:      IF (RIGIDINIT) THEN137:         IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) THEN
145:         OPEN(MYUNIT2,FILE='GRlowest',STATUS='UNKNOWN')138:             MYUNIT3=GETUNIT()
146:      ELSE139:             MYFILENAME3="CSMav."//trim(adjustl(istr))
147:         OPEN(MYUNIT2,FILE='lowest',STATUS='UNKNOWN')140:         ENDIF
148:      ENDIF141:     ELSE
149:      ! hk286142:         MYUNIT2=GETUNIT()
150:      IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) THEN143:         ! hk286
151:         MYUNIT3=26 144:         IF (RIGIDINIT) THEN
152:         OPEN(MYUNIT3,FILE='CSMav.xyz',STATUS='UNKNOWN')145:             OPEN(MYUNIT2,FILE='GRlowest',STATUS='UNKNOWN')
153:      ENDIF146:         ELSE
154:   ENDIF147:             OPEN(MYUNIT2,FILE='lowest',STATUS='UNKNOWN')
 148:         ENDIF
 149:         ! hk286
 150:         IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) THEN
 151:             MYUNIT3=26 
 152:             OPEN(MYUNIT3,FILE='CSMav.xyz',STATUS='UNKNOWN')
 153:         ENDIF
 154:     ENDIF
155: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!155: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
156: !156: !
157: ! debug DJW157: ! debug DJW
158: !158: !
159: !        MYUNIT3=GETUNIT()159: !        MYUNIT3=GETUNIT()
160: !        OPEN(MYUNIT3,FILE='GCBHlowest',STATUS='UNKNOWN')160: !        OPEN(MYUNIT3,FILE='GCBHlowest',STATUS='UNKNOWN')
161: !        MYUNIT4=GETUNIT()161: !        MYUNIT4=GETUNIT()
162: !        OPEN(MYUNIT4,FILE='GCBHlowest.new',STATUS='UNKNOWN')162: !        OPEN(MYUNIT4,FILE='GCBHlowest.new',STATUS='UNKNOWN')
163: ! 777    READ(MYUNIT3,*,END=888) J1163: ! 777    READ(MYUNIT3,*,END=888) J1
164: !        NATOMS=J1164: !        NATOMS=J1
173: !        WRITE(MYUNIT4,'(A,2G20.10)') 'energy=',QPE(J1),QENERGIES(J1)173: !        WRITE(MYUNIT4,'(A,2G20.10)') 'energy=',QPE(J1),QENERGIES(J1)
174: !        DO J2=1,J1174: !        DO J2=1,J1
175: !           WRITE(MYUNIT4,'(A2,1X,3G20.10)') 'AX',QCOORDINATES(J1,3*(J2-1)+1:3*(J2-1)+3)175: !           WRITE(MYUNIT4,'(A2,1X,3G20.10)') 'AX',QCOORDINATES(J1,3*(J2-1)+1:3*(J2-1)+3)
176: !        ENDDO176: !        ENDDO
177: ! 177: ! 
178: !        GOTO 777178: !        GOTO 777
179: ! 888    CLOSE(MYUNIT3)179: ! 888    CLOSE(MYUNIT3)
180: !        CLOSE(MYUNIT4)180: !        CLOSE(MYUNIT4)
181: !        STOP181: !        STOP
182: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!182: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
183:   IF (GCBHT) THEN183:     IF (GCBHT) THEN
184:      MYUNIT3=GETUNIT()184:        MYUNIT3=GETUNIT()
185:      OPEN(MYUNIT3,FILE='GCBHlowest',STATUS='UNKNOWN')185:        OPEN(MYUNIT3,FILE='GCBHlowest',STATUS='UNKNOWN')
186:      DO J1=1,GCNATOMS186:        DO J1=1,GCNATOMS
187:         IF (QENERGIES(J1).LT.HUGE(1.0D0)/10.0) THEN187:           IF (QENERGIES(J1).LT.HUGE(1.0D0)/10.0) THEN
188:            WRITE(MYUNIT3,'(I10)') J1188:              WRITE(MYUNIT3,'(I10)') J1
189:            WRITE(MYUNIT3,'(A,2G20.10)') 'energy=',QPE(J1),QENERGIES(J1)189:              WRITE(MYUNIT3,'(A,2G20.10)') 'energy=',QPE(J1),QENERGIES(J1)
190:            DO J2=1,J1190:              DO J2=1,J1
191:               WRITE(MYUNIT3,'(A2,1X,3G20.10)') 'AX',QCOORDINATES(J1,3*(J2-1)+1:3*(J2-1)+3)191:                 WRITE(MYUNIT3,'(A2,1X,3G20.10)') 'AX',QCOORDINATES(J1,3*(J2-1)+1:3*(J2-1)+3)
192:            ENDDO192:              ENDDO
 193:           ENDIF
 194:        ENDDO
 195:        CLOSE(MYUNIT3)
 196:     ENDIF
 197: 
 198:     DO J1=1,NSAVE
 199:         NATOMS=QMINNATOMS(J1)
 200:         IF (AMHT) THEN
 201:             COUNTT=J1
 202:             CALL NUM_TO_CHAR(COUNTT,COUNTTT)
 203:             OPEN(UNIT=27,FILE='movie_gmin.'//COUNTTT//'.pdb',STATUS='UNKNOWN')
193:         ENDIF204:         ENDIF
194:      ENDDO205: 
195:      CLOSE(MYUNIT3)206:         IF (RGCL2.OR.ARNO) THEN
196:   ENDIF207:             WRITE(MYUNIT2,*) NATOMS+2
197:   208:         ELSE IF (ELLIPSOIDT.OR.LJCAPSIDT.OR.GBT.OR.GBDT) THEN
198:   savemin: DO J1=1,NSAVE209:             WRITE(MYUNIT2,*) NATOMS/2
199:      !210:         ELSE IF (AMHT) THEN
200:      NATOMS=QMINNATOMS(J1)211:             WRITE(MYUNIT2,*) NMRES*3
201:      IF (AMHT) THEN212:         ELSE
202:         COUNTT=J1213:             WRITE(MYUNIT2,*) NATOMS
203:         CALL NUM_TO_CHAR(COUNTT,COUNTTT)214:         ENDIF
204:         OPEN(UNIT=27,FILE='movie_gmin.'//COUNTTT//'.pdb',STATUS='UNKNOWN')215:         !        IF (CSMT.AND.DEBUG) WRITE(MYUNIT,'(A,I6,2G20.10)') 'finalio> J1,QMIN,QMINAV=',J1,QMIN(J1),QMINAV(J1)
205:      ENDIF 
206:       
207:      IF (RGCL2.OR.ARNO) THEN 
208:         WRITE(MYUNIT2,*) NATOMS+2 
209:      ELSE IF (ELLIPSOIDT.OR.LJCAPSIDT.OR.GBT.OR.GBDT) THEN 
210:         WRITE(MYUNIT2,*) NATOMS/2 
211:      ELSE IF (AMHT) THEN 
212:         WRITE(MYUNIT2,*) NMRES*3 
213:      ELSE 
214:         WRITE(MYUNIT2,*) NATOMS 
215:      ENDIF 
216:      !        IF (CSMT.AND.DEBUG) WRITE(MYUNIT,'(A,I6,2G20.10)') 'finalio> J1,QMIN,QMINAV=',J1,QMIN(J1),QMINAV(J1) 
217:      ! 
218:      ! ds656> Either append point group or print stuff for HSA 
219:      IF(PRINT_MINDATA.OR.PRINT_PTGRP) THEN 
220:         ! 
221:         WRITE(MYUNIT,'(A,I4)') & 
222:              'finalio> Determining point group of minimum ', J1 
223:         ! 
224:         CM(1:3) = 0.0D0; NSYMOPS=0; SYMOPS(:,:,:) = 0.0D0 
225:         J3=1 ! Determine majority label/species 
226:         DO J2=2,NSPECIES(0) 
227:            IF(NSPECIES(J2) > NSPECIES(J3)) J3 = J2 
228:         ENDDO 
229:         ! Determine the overall point-group (for ALL species!). 
230:         CALL PGSYM( NATOMS, QMINP(J1,1:3*NATOMS), & 
231:              QMINT(J1,1:NATOMS), PGSYMTOLS, 2, J3,& 
232:              CM, NSYMOPS, SYMOPS, FPGRP ) 
233:         !216:         !
234:         IF(MIEFT.AND.NSYMOPS>1) THEN217:         ! ds656> Either append point group or print stuff for HSA
 218:         IF(PRINT_MINDATA.OR.PRINT_PTGRP) THEN
235:            !219:            !
236:            ! Sort field sites by distance from the cluster's220:            WRITE(MYUNIT,'(A,I4)') &
237:            ! system of symmetry (CM).221:                 'finalio> Determining point group of minimum ', J1
238:            DO J4=1,MIEF_NSITES222:            !
239:               ISITES(J4) = J4223:            CM(1:3) = 0.0D0; NSYMOPS=0; SYMOPS(:,:,:) = 0.0D0
240:               DISTS(J4) = 0.0224:            J3=1 ! Determine majority label/species
241:               DO J5=1,3225:            DO J2=2,NSPECIES(0)
242:                  DISTS(J4) = DISTS(J4) + &226:               IF(NSPECIES(J2) > NSPECIES(J3)) J3 = J2
243:                       (MIEF_SITES(J4,J5)-CM(J5))**2227:            ENDDO
 228:            ! Determine the overall point-group (for ALL species!).
 229:            CALL PGSYM( NATOMS, QMINP(J1,1:3*NATOMS), &
 230:                 QMINT(J1,1:NATOMS), PGSYMTOLS, 2, J3,&
 231:                 CM, NSYMOPS, SYMOPS, FPGRP )
 232:            !
 233:            IF(MIEFT.AND.NSYMOPS>1) THEN
 234:               !
 235:               ! Sort field sites by distance from the cluster's
 236:               ! system of symmetry (CM).
 237:               DO J4=1,MIEF_NSITES
 238:                  ISITES(J4) = J4
 239:                  DISTS(J4) = 0.0
 240:                  DO J5=1,3
 241:                     DISTS(J4) = DISTS(J4) + &
 242:                          (MIEF_SITES(J4,J5)-CM(J5))**2
 243:                  ENDDO
 244:                  DISTS(J4) = DSQRT(DISTS(J4))
 245:                  J5=J4
 246:                  sort_sites: DO WHILE(J5>1)
 247:                     IF(DISTS(J5) < DISTS(J5-1)) THEN
 248:                        NDUMMY = ISITES(J5) 
 249:                        ISITES(J5) = ISITES(J5-1)
 250:                        ISITES(J5-1) = NDUMMY
 251:                        EDUMMY = DISTS(J5)
 252:                        DISTS(J5) = DISTS(J5-1)
 253:                        DISTS(J5-1) = EDUMMY
 254:                        J5=J5-1
 255:                     ELSE
 256:                        EXIT sort_sites
 257:                     ENDIF
 258:                  ENDDO sort_sites
244:               ENDDO259:               ENDDO
245:               DISTS(J4) = DSQRT(DISTS(J4))260:               ! 
246:               J5=J4261:               !ds656> Extract a small subset of field sites. 
247:               sort_sites: DO WHILE(J5>1)262:               ! While coding this I had graphene-like lattice in
248:                  IF(DISTS(J5) < DISTS(J5-1)) THEN263:               ! in mind, in which case the fragment can be small.
249:                     NDUMMY = ISITES(J5) 264:               ! Complications may arise for other substrates...
250:                     ISITES(J5) = ISITES(J5-1)265:               J5=3 
251:                     ISITES(J5-1) = NDUMMY266:               count_sites: DO J4=4,MIEF_NSITES
252:                     EDUMMY = DISTS(J5)267:                  IF(ABS(DISTS(J4)-DISTS(J4-1)) < PGSYMTOLS(2)) THEN
253:                     DISTS(J5) = DISTS(J5-1)268:                     J5=J5+1
254:                     DISTS(J5-1) = EDUMMY 
255:                     J5=J5-1 
256:                  ELSE269:                  ELSE
257:                     EXIT sort_sites270:                     EXIT count_sites
258:                  ENDIF271:                  ENDIF
259:               ENDDO sort_sites272:               ENDDO count_sites
260:            ENDDO273:               NSITES=J5
261:            ! 274:               !
262:            !ds656> Extract a small subset of field sites. 275:               COMBO_N=NATOMS+NSITES
263:            ! While coding this I had graphene-like lattice in276:               IF(ALLOCATED(COMBO_COORDS)) DEALLOCATE(COMBO_COORDS)
264:            ! in mind, in which case the fragment can be small.277:               ALLOCATE(COMBO_COORDS(1:3*COMBO_N))
265:            ! Complications may arise for other substrates...278:               IF(ALLOCATED(COMBO_LABELS)) DEALLOCATE(COMBO_LABELS)
266:            J5=3 279:               ALLOCATE(COMBO_LABELS(1:COMBO_N))
267:            count_sites: DO J4=4,MIEF_NSITES280:               !
268:               IF(ABS(DISTS(J4)-DISTS(J4-1)) < PGSYMTOLS(2)) THEN281:               ! Set substrate labels to 0 and store coordinates
269:                  J5=J5+1282:               COMBO_LABELS(1:NSITES) = 0
270:               ELSE283:               DO J4=1,NSITES
271:                  EXIT count_sites284:                  DO J5=1,3
272:               ENDIF285:                     COMBO_COORDS(3*(J4-1)+J5) = &
273:            ENDDO count_sites286:                          MIEF_SITES(ISITES(J4),J5)
274:            NSITES=J5287:                  ENDDO
275:            ! 
276:            COMBO_N=NATOMS+NSITES 
277:            IF(ALLOCATED(COMBO_COORDS)) DEALLOCATE(COMBO_COORDS) 
278:            ALLOCATE(COMBO_COORDS(1:3*COMBO_N)) 
279:            IF(ALLOCATED(COMBO_LABELS)) DEALLOCATE(COMBO_LABELS) 
280:            ALLOCATE(COMBO_LABELS(1:COMBO_N)) 
281:            ! 
282:            ! Set substrate labels to 0 and store coordinates 
283:            COMBO_LABELS(1:NSITES) = 0 
284:            DO J4=1,NSITES 
285:               DO J5=1,3 
286:                  COMBO_COORDS(3*(J4-1)+J5) = & 
287:                       MIEF_SITES(ISITES(J4),J5) 
288:               ENDDO288:               ENDDO
289:            ENDDO289:               !
290:            !290:               COMBO_LABELS(NSITES+1:COMBO_N) = QMINT(J1,1:NATOMS)
291:            COMBO_LABELS(NSITES+1:COMBO_N) = QMINT(J1,1:NATOMS)291:               COMBO_COORDS(3*NSITES+1:3*COMBO_N) = &
292:            COMBO_COORDS(3*NSITES+1:3*COMBO_N) = &292:                    QMINP(J1,1:3*NATOMS)
293:                 QMINP(J1,1:3*NATOMS)293:               !
294:            !294:               WRITE(MYUNIT,'(A,I4,A,I4,A)') &
295:            WRITE(MYUNIT,'(A,I4,A,I4,A)') &295:                    'finalio> Determining point group of minimum ',&
296:                 'finalio> Determining point group of minimum ',&296:                    J1,' including ', NSITES, ' MIEF sites.'
297:                 J1,' including ', NSITES, ' MIEF sites.'297:               !
298:            !298:               CALL PGSYM( COMBO_N, COMBO_COORDS(1:3*COMBO_N), &
299:            CALL PGSYM( COMBO_N, COMBO_COORDS(1:3*COMBO_N), &299:                    COMBO_LABELS(1:COMBO_N), PGSYMTOLS, 2, J3,&
300:                 COMBO_LABELS(1:COMBO_N), PGSYMTOLS, 2, J3,&300:                    CM, NSYMOPS, SYMOPS, FPGRP )              
301:                 CM, NSYMOPS, SYMOPS, FPGRP )              301:               !
302:            !302:               DEALLOCATE(COMBO_COORDS, COMBO_LABELS)
303:            DEALLOCATE(COMBO_COORDS, COMBO_LABELS)303:               !
304:            ! 
305:         ENDIF 
306:         ! 
307:         IF(PRINT_PTGRP) THEN ! Just append point group 
308:            WRITE(MYUNIT2,99) J1, QMIN(J1), FF(J1), & 
309:                 NPCALL_QMIN(J1), FPGRP, NSYMOPS 
310: 99         FORMAT('Energy of minimum ',I6,'=',G20.10, & 
311:                 ' first found at step ',I8,' after ', & 
312:                 I20,' function calls. Point group ',A4, & 
313:                 ' of order ', I3,'.') 
314:         ELSE ! Print stuff for HSA in OPTIM's min.data format 
315:            ! 
316:            NUM_ZERO_EVS=6 
317:            IF (NATOMS.EQ.2) NUM_ZERO_EVS=5 
318:            IF (MIEFT) NUM_ZERO_EVS=0 
319:            ! 
320:            IF (ALLOCATED(HESS)) DEALLOCATE(HESS) 
321:            ALLOCATE(HESS(3*NATOMS,3*NATOMS)) 
322:            IF(NSPECIES(0)>1) & ! ds656> this also sets ATMASS 
323:                 CALL SET_ATOMLISTS(QMINT(J1,1:NATOMS),1) 
324:            CALL POTENTIAL(QMINP(J1,1:3*NATOMS), EVALS, EDUMMY, & 
325:                 .TRUE., .TRUE.) ! EVALS is dummy for gradient here 
326:            IF(ABS(EDUMMY-QMIN(J1)) > ECONV) THEN 
327:               WRITE(MYUNIT,'(A)') & 
328:                    'finalio> WARNING: Unexpected energy value!' 
329:            ENDIF304:            ENDIF
330:            CALL MASSWT() ! Weight the Hessian by mass.  
331:            !305:            !
332:            WRITE(MYUNIT, '(A,I6)') &306:            IF(PRINT_PTGRP) THEN ! Just append point group
333:                 'finalio> Using DSYEV to calculate Hessian eigenvalues for minimum ', J1307:               WRITE(MYUNIT2,99) J1, QMIN(J1), FF(J1), &
334:            CALL DSYEV('N','U',3*NATOMS,HESS,3*NATOMS,EVALS,&308:                    NPCALL_QMIN(J1), FPGRP, NSYMOPS
335:                 WORK,9*NATOMS,INFO)309: 99            FORMAT('Energy of minimum ',I6,'=',G20.10, &
336:            IF(INFO /= 0) THEN310:                    ' first found at step ',I8,' after ', &
337:               WRITE(MYUNIT,'(A,I2)') &311:                    I20,' function calls. Point group ',A4, &
338:                    'finalio> ***WARNING*** DSYEV error status', INFO312:                 ' of order ', I3,'.')
339:            ENDIF313:            ELSE ! Print stuff for HSA in OPTIM's min.data format
340:            J3=0314:               !
341:            WRITE(MYUNIT,'(A,I6,A)',ADVANCE='NO') &315:               NUM_ZERO_EVS=6
342:                 'finalio> ',3*NATOMS,' Hessian eigenvalues:'316:               IF (NATOMS.EQ.2) NUM_ZERO_EVS=5
343:            DO J2=1,3*NATOMS317:               IF (MIEFT) NUM_ZERO_EVS=0
344:               WRITE(MYUNIT,'(1X, E12.5E2)',ADVANCE='NO') EVALS(J2)318:               !
345:               IF(EVALS(J2) < - ABS(HESS_EIGEN_TOL)) THEN319:               IF (ALLOCATED(HESS)) DEALLOCATE(HESS)
 320:               ALLOCATE(HESS(3*NATOMS,3*NATOMS))
 321:               IF(NSPECIES(0)>1) & ! ds656> this also sets ATMASS
 322:                    CALL SET_ATOMLISTS(QMINT(J1,1:NATOMS),1)
 323:               CALL POTENTIAL(QMINP(J1,1:3*NATOMS), EVALS, EDUMMY, &
 324:                    .TRUE., .TRUE.) ! EVALS is dummy for gradient here
 325:               IF(ABS(EDUMMY-QMIN(J1)) > ECONV) THEN
346:                  WRITE(MYUNIT,'(A)') &326:                  WRITE(MYUNIT,'(A)') &
347:                       'finalio> WARNING: -ve eigenvalue => skipping!'327:                       'finalio> WARNING: Unexpected energy value!'
348:                  CYCLE savemin 
349:               ELSEIF(ABS(EVALS(J2)) < HESS_EIGEN_TOL) THEN  
350:                  J3=J3+1 
351:               ENDIF328:               ENDIF
352:            ENDDO329:               CALL MASSWT() ! Weight the Hessian by mass. 
353:            WRITE(MYUNIT,*)330:               !
354:            IF(J3 /= NUM_ZERO_EVS) THEN331:               WRITE(MYUNIT, '(A,I6)') &
355:               WRITE(MYUNIT,'(A,I6)') &332:                    'finalio> Using DSYEV to calculate Hessian eigenvalues for minimum ', J1
356:                    'finalio> WARNING: Unexpected number of zero evals ',J2333:               CALL DSYEV('N','U',3*NATOMS,HESS,3*NATOMS,EVALS,&
357:            ELSE334:                    WORK,9*NATOMS,INFO)
358:               WRITE(MYUNIT,'(A,I6,A)') &335:               IF(INFO /= 0) THEN
359:                    'finalio> Detected ', J3,' zero eigenvalues.'336:                  WRITE(MYUNIT,'(A,I2)') &
 337:                       'finalio> ***WARNING*** DSYEV error status', INFO
 338:               ENDIF
 339:               J3=0
 340:               WRITE(MYUNIT,'(A,I6,A)',ADVANCE='NO') &
 341:                    'finalio> ',3*NATOMS,' Hessian eigenvalues:'
 342:               DO J2=1,3*NATOMS
 343:                  WRITE(MYUNIT,'(1X, E12.5E2)',ADVANCE='NO') EVALS(J2)
 344:                  IF(ABS(EVALS(J2)) < 1.0D-3) J3=J3+1
 345:               ENDDO
 346:               WRITE(MYUNIT,*)
 347:               IF(J3 /= NUM_ZERO_EVS) THEN
 348:                  WRITE(MYUNIT,'(A,I6)') &
 349:                       'finalio> WARNING: Unexpected number of zero evals ',J2
 350:               ELSE
 351:                  WRITE(MYUNIT,'(A,I6,A)') &
 352:                       'finalio> Detected ', J3,' zero eigenvalues.'
 353:               ENDIF
 354:               ! Log prod. of frequencies is log prod. of sqrt of evals 
 355:               LOG_PROD = &
 356:                    SUM(DLOG(EVALS(NUM_ZERO_EVS+1:3*NATOMS)))
 357:               WRITE(MYUNIT,'(A,I6,A,G20.10)') &
 358:                    'finalio> Log product of ', &
 359:                    3*NATOMS-NUM_ZERO_EVS,&
 360:                    ' non-zero eigenvalues: ', &
 361:                    LOG_PROD
 362:               CALL MYINERTIA(QMINP(J1,1:3*NATOMS),ITDET)
 363:               WRITE(MYUNIT,'(A,G20.10)') &
 364:                    'finalio> Determinant of inertia tensor: ', ITDET
 365:               WRITE(MYUNIT2, '(2F20.10,I6,1X,E15.8E2)') &
 366:                    EDUMMY, LOG_PROD, NSYMOPS, ITDET
 367:               !
360:            ENDIF368:            ENDIF
361:            ! Log prod. of frequencies is log prod. of sqrt of evals  
362:            LOG_PROD = & 
363:                 SUM(DLOG(EVALS(NUM_ZERO_EVS+1:3*NATOMS))) 
364:            WRITE(MYUNIT,'(A,I6,A,G20.10)') & 
365:                 'finalio> Log product of ', & 
366:                 3*NATOMS-NUM_ZERO_EVS,& 
367:                 ' non-zero eigenvalues: ', & 
368:                 LOG_PROD 
369:            CALL MYINERTIA(QMINP(J1,1:3*NATOMS),ITDET) 
370:            WRITE(MYUNIT,'(A,G20.10)') & 
371:                 'finalio> Determinant of inertia tensor: ', ITDET 
372:            WRITE(MYUNIT2, '(2F20.10,I6,1X,E15.8E2)') & 
373:                 EDUMMY, LOG_PROD, NSYMOPS, ITDET 
374:            !369:            !
 370:         ELSE ! <ds656
 371:            WRITE(MYUNIT2,10) J1, QMIN(J1), FF(J1), NPCALL_QMIN(J1)
 372: 10         FORMAT('Energy of minimum ',I6,'=',G20.10, &
 373:                 ' first found at step ',I8,' after ',I20,' function calls')
375:         ENDIF374:         ENDIF
376:         !375:         !
377:      ELSE ! <ds656376:         IF (MSORIGT.OR.FRAUSIT) THEN
378:         WRITE(MYUNIT2,10) J1, QMIN(J1), FF(J1), NPCALL_QMIN(J1)377:             WRITE(MYUNIT2,20) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))
379: 10      FORMAT('Energy of minimum ',I6,'=',G20.10, &378: 20          FORMAT('Si',3F20.10)
380:              ' first found at step ',I8,' after ',I20,' function calls')379:         ELSE IF (MSTRANST) THEN
381:      ENDIF380:             WRITE(MYUNIT2,20) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))
382:      !381:         ELSE IF (RGCL2) THEN
383:      IF (MSORIGT.OR.FRAUSIT) THEN382:             WRITE(MYUNIT2,'(A,F20.10)') 'Cl 0.0 0.0 ', 0.995D0
384:         WRITE(MYUNIT2,20) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))383:             WRITE(MYUNIT2,'(A,F20.10)') 'Cl 0.0 0.0 ',-0.995D0
385: 20      FORMAT('Si',3F20.10)384:             WRITE(MYUNIT2,60) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))
386:      ELSE IF (MSTRANST) THEN385: 60          FORMAT('AR ',3F20.10)
387:         WRITE(MYUNIT2,20) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))386:         ELSE IF (AMHT) THEN
388:      ELSE IF (RGCL2) THEN387:             !
389:         WRITE(MYUNIT2,'(A,F20.10)') 'Cl 0.0 0.0 ', 0.995D0388:             !   OUTPUT CORDS FOR LOWEST IN X,Y,Z FORMAT
390:         WRITE(MYUNIT2,'(A,F20.10)') 'Cl 0.0 0.0 ',-0.995D0389:             !   OUTPUT CORDS FOR MOVIE_GMIN IN MOVIESEG FORMAT
391:         WRITE(MYUNIT2,60) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))390:             !
392: 60      FORMAT('AR ',3F20.10)391:             WRITE(AMHUNIT1,683)NUMCRD,j1,NUMCRD,REAL(NUMCRD),NUMCRD
393:      ELSE IF (AMHT) THEN392: 683         FORMAT(3(I6,1X),F8.4,1X,I5,' STUCT SNAP T T TID')
394:         !393: 
395:         !   OUTPUT CORDS FOR LOWEST IN X,Y,Z FORMAT394:             GLY_COUNT = 0
396:         !   OUTPUT CORDS FOR MOVIE_GMIN IN MOVIESEG FORMAT395: 
397:         !396:             DO 1964 III = 1,NMRES
398:         WRITE(AMHUNIT1,683)NUMCRD,j1,NUMCRD,REAL(NUMCRD),NUMCRD397:                 IF (IRES(III).EQ.8) THEN
399: 683     FORMAT(3(I6,1X),F8.4,1X,I5,' STUCT SNAP T T TID')398:                     !!                pppcord(residue, xyz, numpro, atom types
400:         399:                     PPPCORD(III, 1, 1, 1) = REAL(QMINP(J1,9*(III-1)+1- GLY_COUNT*3)) !  CA X
401:         GLY_COUNT = 0400:                     PPPCORD(III, 2, 1, 1) = REAL(QMINP(J1,9*(III-1)+2- GLY_COUNT*3)) !  CA Y
402:         401:                     PPPCORD(III, 3, 1, 1) = REAL(QMINP(J1,9*(III-1)+3- GLY_COUNT*3)) !  CA Z
403:         DO III = 1,NMRES402:                     !    SWAP  CA for CB
404:            IF (IRES(III).EQ.8) THEN403:                     PPPCORD(III, 1, 1, 2) = REAL(QMINP(j1,9*(III-1)+1- GLY_COUNT*3)) !  CB X
405:               !!                pppcord(residue, xyz, numpro, atom types404:                     PPPCORD(III, 2, 1, 2) = REAL(QMINP(J1,9*(III-1)+2- GLY_COUNT*3)) !  CB Y
406:               PPPCORD(III, 1, 1, 1) = REAL(QMINP(J1,9*(III-1)+1- GLY_COUNT*3)) !  CA X405:                     PPPCORD(III, 3, 1, 2) = REAL(QMINP(J1,9*(III-1)+3- GLY_COUNT*3)) !  CB Z
407:               PPPCORD(III, 2, 1, 1) = REAL(QMINP(J1,9*(III-1)+2- GLY_COUNT*3)) !  CA Y406:                     PPPCORD(III, 1, 1, 3) = REAL(QMINP(J1,9*(III-1)+4- GLY_COUNT*3)) !  O X
408:               PPPCORD(III, 3, 1, 1) = REAL(QMINP(J1,9*(III-1)+3- GLY_COUNT*3)) !  CA Z407:                     PPPCORD(III, 2, 1, 3) = REAL(QMINP(J1,9*(III-1)+5- GLY_COUNT*3)) !  O Y
409:               !    SWAP  CA for CB408:                     PPPCORD(III, 3, 1, 3) = REAL(QMINP(J1,9*(III-1)+6- GLY_COUNT*3)) !  O Z
410:               PPPCORD(III, 1, 1, 2) = REAL(QMINP(j1,9*(III-1)+1- GLY_COUNT*3)) !  CB X409: 
411:               PPPCORD(III, 2, 1, 2) = REAL(QMINP(J1,9*(III-1)+2- GLY_COUNT*3)) !  CB Y410:                     WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+1-GLY_COUNT*3),QMINP(J1,9*(III-1)+2-GLY_COUNT*3), &
412:               PPPCORD(III, 3, 1, 2) = REAL(QMINP(J1,9*(III-1)+3- GLY_COUNT*3)) !  CB Z411:                     QMINP(J1,9*(III-1)+3-GLY_COUNT*3)
413:               PPPCORD(III, 1, 1, 3) = REAL(QMINP(J1,9*(III-1)+4- GLY_COUNT*3)) !  O X412:                     WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+1-GLY_COUNT*3),QMINP(J1,9*(III-1)+2-GLY_COUNT*3), &
414:               PPPCORD(III, 2, 1, 3) = REAL(QMINP(J1,9*(III-1)+5- GLY_COUNT*3)) !  O Y413:                     QMINP(J1,9*(III-1)+3-GLY_COUNT*3)
415:               PPPCORD(III, 3, 1, 3) = REAL(QMINP(J1,9*(III-1)+6- GLY_COUNT*3)) !  O Z414:                     WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+4-GLY_COUNT*3),QMINP(J1,9*(III-1)+5-GLY_COUNT*3), &
416:               415:                     QMINP(J1,9*(III-1)+6-GLY_COUNT*3)
417:               WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+1-GLY_COUNT*3),QMINP(J1,9*(III-1)+2-GLY_COUNT*3), &416: 31                  FORMAT('AM',3G25.15)
418:                    QMINP(J1,9*(III-1)+3-GLY_COUNT*3)417: 
419:               WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+1-GLY_COUNT*3),QMINP(J1,9*(III-1)+2-GLY_COUNT*3), &418:                     GLY_COUNT = GLY_COUNT +1
420:                    QMINP(J1,9*(III-1)+3-GLY_COUNT*3)419:                 ELSE
421:               WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+4-GLY_COUNT*3),QMINP(J1,9*(III-1)+5-GLY_COUNT*3), &420:                     PPPCORD(III, 1, 1, 1) = REAL(QMINP(J1,9*(iii-1)+1- GLY_COUNT*3)) !  CA X
422:                    QMINP(J1,9*(III-1)+6-GLY_COUNT*3)421:                     PPPCORD(III, 2, 1, 1) = REAL(QMINP(J1,9*(III-1)+2- GLY_COUNT*3)) !  CA Y
423: 31            FORMAT('AM',3G25.15)422:                     PPPCORD(III, 3, 1, 1) = REAL(QMINP(J1,9*(III-1)+3- GLY_COUNT*3)) !  CA Z
424:               423:                     PPPCORD(III, 1, 1, 2) = REAL(QMINP(J1,9*(III-1)+4- GLY_COUNT*3)) !  CB X
425:               GLY_COUNT = GLY_COUNT +1424:                     PPPCORD(III, 2, 1, 2) = REAL(QMINP(J1,9*(III-1)+5- GLY_COUNT*3)) !  CB Y
426:            ELSE425:                     PPPCORD(III, 3, 1, 2) = REAL(QMINP(J1,9*(III-1)+6- GLY_COUNT*3)) !  CB Z
427:               PPPCORD(III, 1, 1, 1) = REAL(QMINP(J1,9*(iii-1)+1- GLY_COUNT*3)) !  CA X426:                     PPPCORD(III, 1, 1, 3) = REAL(QMINP(J1,9*(III-1)+7- GLY_COUNT*3)) !  O X
428:               PPPCORD(III, 2, 1, 1) = REAL(QMINP(J1,9*(III-1)+2- GLY_COUNT*3)) !  CA Y427:                     PPPCORD(III, 2, 1, 3) = REAL(QMINP(J1,9*(III-1)+8- GLY_COUNT*3)) !  O Y
429:               PPPCORD(III, 3, 1, 1) = REAL(QMINP(J1,9*(III-1)+3- GLY_COUNT*3)) !  CA Z428:                     PPPCORD(III, 3, 1, 3) = REAL(QMINP(J1,9*(III-1)+9- GLY_COUNT*3)) !  O Z
430:               PPPCORD(III, 1, 1, 2) = REAL(QMINP(J1,9*(III-1)+4- GLY_COUNT*3)) !  CB X429:  
431:               PPPCORD(III, 2, 1, 2) = REAL(QMINP(J1,9*(III-1)+5- GLY_COUNT*3)) !  CB Y430:                     WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+1-GLY_COUNT*3),QMINP(J1,9*(III-1)+2-GLY_COUNT*3),&
432:               PPPCORD(III, 3, 1, 2) = REAL(QMINP(J1,9*(III-1)+6- GLY_COUNT*3)) !  CB Z431:                     QMINP(J1,9*(III-1)+3-GLY_COUNT*3)
433:               PPPCORD(III, 1, 1, 3) = REAL(QMINP(J1,9*(III-1)+7- GLY_COUNT*3)) !  O X432:                     WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+4-GLY_COUNT*3),QMINP(J1,9*(III-1)+5-GLY_COUNT*3),&
434:               PPPCORD(III, 2, 1, 3) = REAL(QMINP(J1,9*(III-1)+8- GLY_COUNT*3)) !  O Y433:                     QMINP(J1,9*(III-1)+6-GLY_COUNT*3)
435:               PPPCORD(III, 3, 1, 3) = REAL(QMINP(J1,9*(III-1)+9- GLY_COUNT*3)) !  O Z434:                     WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+7-GLY_COUNT*3),QMINP(J1,9*(III-1)+8-GLY_COUNT*3),&
436:               435:                     QMINP(J1,9*(III-1)+9-GLY_COUNT*3)
437:               WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+1-GLY_COUNT*3),QMINP(J1,9*(III-1)+2-GLY_COUNT*3),&436:                 ENDIF
438:                    QMINP(J1,9*(III-1)+3-GLY_COUNT*3)437: 1964        CONTINUE
439:               WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+4-GLY_COUNT*3),QMINP(J1,9*(III-1)+5-GLY_COUNT*3),&438: 
440:                    QMINP(J1,9*(III-1)+6-GLY_COUNT*3)439:             DO 526 III=1,NMRES
441:               WRITE(MYUNIT2,31) QMINP(J1,9*(III-1)+7-GLY_COUNT*3),QMINP(J1,9*(III-1)+8-GLY_COUNT*3),&440:                 WRITE(AMHUNIT1,632)(PPPCORD(III,I3,1,1),I3=1,3),(PPPCORD(III,I3,1,2),I3=1,3),(PPPCORD(III,I3,1,3),I3=1,3)
442:                    QMINP(J1,9*(III-1)+9-GLY_COUNT*3)441: 632             FORMAT('CA: ',3(F8.3,1X),'CB: ',3(F8.3,1X),'OX: ', 3(F8.3,1X))
443:            ENDIF442:             !632           FORMAT('CA: ',3(f25.15,1x),'CB: ',3(f25.15,1x),'Ox: ', 3(f25.15,1x))
444:         ENDDO443: 526         CONTINUE
445:         444: 
446:         DO III=1,NMRES445:             DO III = 1+1, NMRES
447:            WRITE(AMHUNIT1,632)(PPPCORD(III,I3,1,1),I3=1,3),(PPPCORD(III,I3,1,2),I3=1,3),(PPPCORD(III,I3,1,3),I3=1,3)446:                 PPPCORD(III,1,1,4) = &
448: 632        FORMAT('CA: ',3(F8.3,1X),'CB: ',3(F8.3,1X),'OX: ', 3(F8.3,1X)) 
449:            !632           FORMAT('CA: ',3(f25.15,1x),'CB: ',3(f25.15,1x),'Ox: ', 3(f25.15,1x)) 
450:         END DO 
451:          
452:         DO III = 1+1, NMRES 
453:            PPPCORD(III,1,1,4) = & 
454:                 0.4831806D0*PPPCORD(III-1,1,1,1) + 0.7032820D0*PPPCORD(III,1,1,1) - 0.1864626D0*PPPCORD(III-1,1,1,3)447:                 0.4831806D0*PPPCORD(III-1,1,1,1) + 0.7032820D0*PPPCORD(III,1,1,1) - 0.1864626D0*PPPCORD(III-1,1,1,3)
455:            PPPCORD(III,2,1,4) = &448:                 PPPCORD(III,2,1,4) = &
456:                 0.4831806D0*PPPCORD(III-1,2,1,1) + 0.7032820D0*PPPCORD(III,2,1,1) - 0.1864626D0*PPPCORD(III-1,2,1,3)449:                 0.4831806D0*PPPCORD(III-1,2,1,1) + 0.7032820D0*PPPCORD(III,2,1,1) - 0.1864626D0*PPPCORD(III-1,2,1,3)
457:            PPPCORD(III,3,1,4) = &450:                 PPPCORD(III,3,1,4) = &
458:                 0.4831806D0*PPPCORD(III-1,3,1,1) + 0.7032820d0*PPPCORD(III,3,1,1) - 0.1864626D0*PPPCORD(III-1,3,1,3)451:                 0.4831806D0*PPPCORD(III-1,3,1,1) + 0.7032820d0*PPPCORD(III,3,1,1) - 0.1864626D0*PPPCORD(III-1,3,1,3)
459:         ENDDO452:             ENDDO
460:         453: 
461:         DO III = 1, NMRES-1454:             DO III = 1, NMRES-1
462:            PPPCORD(III,1,1,5) = &455:                 PPPCORD(III,1,1,5) = &
463:                 0.4436538d0*PPPCORD(III,1,1,1)+0.2352006D0*PPPCORD(III+1,1,1,1)+0.3211455D0*PPPCORD(III,1,1,3)456:                 0.4436538d0*PPPCORD(III,1,1,1)+0.2352006D0*PPPCORD(III+1,1,1,1)+0.3211455D0*PPPCORD(III,1,1,3)
464:            PPPCORD(III,2,1,5) = &457:                 PPPCORD(III,2,1,5) = &
465:                 0.4436538D0*PPPCORD(III,2,1,1)+0.2352006D0*PPPCORD(III+1,2,1,1)+0.3211455D0*PPPCORD(III,2,1,3)458:                 0.4436538D0*PPPCORD(III,2,1,1)+0.2352006D0*PPPCORD(III+1,2,1,1)+0.3211455D0*PPPCORD(III,2,1,3)
466:            PPPCORD(III,3,1,5) = &459:                 PPPCORD(III,3,1,5) = &
467:                 0.4436538d0*PPPCORD(III,3,1,1)+0.2352006D0*PPPCORD(III+1,3,1,1)+0.3211455D0*PPPCORD(III,3,1,3)460:                 0.4436538d0*PPPCORD(III,3,1,1)+0.2352006D0*PPPCORD(III+1,3,1,1)+0.3211455D0*PPPCORD(III,3,1,3)
468:         ENDDO461:             ENDDO
469:         462: 
470:         DO III = 1, NMRES463:             DO III = 1, NMRES
471:            RES_TYPE = AMINOA(IRES(III))464:                 RES_TYPE = AMINOA(IRES(III))
472:            465: 
473:            IF (III .NE. 1) THEN466:                 IF (III .NE. 1) THEN
474:               ATOM_TYPE='N '467:                     ATOM_TYPE='N '
475:               ID = 4468:                     ID = 4
476:               WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III469:                     WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III
477: 61            FORMAT('ATOM',4X,i3,2X,A2,2X,A3,3X,i3,4X,F8.3,F8.3,F8.3,2X,'1.00',2X,'0.00',6X,'TPDB',1x,I3)470: 61                  FORMAT('ATOM',4X,i3,2X,A2,2X,A3,3X,i3,4X,F8.3,F8.3,F8.3,2X,'1.00',2X,'0.00',6X,'TPDB',1x,I3)
478:               471: 
479:            ENDIF472:                 ENDIF
480:            473: 
481:            ATOM_TYPE='CA'474:                 ATOM_TYPE='CA'
482:            ID = 1475:                 ID = 1
483:            WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III476:                 WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III
484:            477: 
485:            IF (RES_TYPE .NE. 'gly') THEN478:                 IF (RES_TYPE .NE. 'gly') THEN
486:               ATOM_TYPE='CB'479:                     ATOM_TYPE='CB'
487:               ID = 2480:                     ID = 2
488:               WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III481:                     WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III
489:            ENDIF482:                 ENDIF
490:            483: 
491:            IF (III .NE. NMRES) THEN484:                 IF (III .NE. NMRES) THEN
492:               ATOM_TYPE='C '485:                     ATOM_TYPE='C '
493:               ID = 5486:                     ID = 5
494:               WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III487:                     WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III
495:            ENDIF488:                 ENDIF
496:            489: 
497:            ATOM_TYPE='O '490:                 ATOM_TYPE='O '
498:            ID = 3491:                 ID = 3
499:            WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III492:                 WRITE(27,61)III,ATOM_TYPE,RES_TYPE,III,PPPCORD(III,1,1,ID),PPPCORD(III,2,1,ID),PPPCORD(III,3,1,ID),III
500:            493: 
501:         ENDDO494:             ENDDO
502:         CLOSE(27)495:             CLOSE(27)
503:         496: 
504:      ELSE IF (ARNO) THEN497:         ELSE IF (ARNO) THEN
505:         WRITE(MYUNIT2,'(A,F20.10)') 'N 0.0 0.0 ', 0.577D0498:             WRITE(MYUNIT2,'(A,F20.10)') 'N 0.0 0.0 ', 0.577D0
506:         WRITE(MYUNIT2,'(A,F20.10)') 'O 0.0 0.0 ',-0.577D0499:             WRITE(MYUNIT2,'(A,F20.10)') 'O 0.0 0.0 ',-0.577D0
507:         WRITE(MYUNIT2,65) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))500:             WRITE(MYUNIT2,65) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))
508: 65      FORMAT('AR ',3F20.10)501: 65          FORMAT('AR ',3F20.10)
509:      ELSE IF (TOSI.OR.WELCH) THEN502:         ELSE IF (TOSI.OR.WELCH) THEN
510:         DO J2=1,NATOMS503:             DO J2=1,NATOMS
511:            IF (ZSYM(J2).EQ.'PL') WRITE(MYUNIT2,'(A,3F20.10)') 'Na  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)504:                 IF (ZSYM(J2).EQ.'PL') WRITE(MYUNIT2,'(A,3F20.10)') 'Na  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)
512:            IF (ZSYM(J2).EQ.'MI') WRITE(MYUNIT2,'(A,3F20.10)') 'Cl  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)505:                 IF (ZSYM(J2).EQ.'MI') WRITE(MYUNIT2,'(A,3F20.10)') 'Cl  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)
513:         ENDDO506:             ENDDO
514:         ! hk286 - generalised Thomson problem, convert to Cartesians before printing507: ! hk286 - generalised Thomson problem, convert to Cartesians before printing
515:      ELSE IF (GTHOMSONT) THEN508:         ELSE IF (GTHOMSONT) THEN
516:         CALL GTHOMSONANGTOC(DCOORDS(1:3*NATOMS), QMINP(J1, 1:3*NATOMS), NATOMS) 509:             CALL GTHOMSONANGTOC(DCOORDS(1:3*NATOMS), QMINP(J1, 1:3*NATOMS), NATOMS) 
517:         DO J2=1,NATOMS510:             DO J2=1,NATOMS
518:            WRITE(MYUNIT2,'(A,3F20.10)') 'C  ',(DCOORDS(3*(J2-1)+J3),J3=1,3)511:                WRITE(MYUNIT2,'(A,3F20.10)') 'C  ',(DCOORDS(3*(J2-1)+J3),J3=1,3)
519:         ENDDO512:             ENDDO
520:      ELSE IF ((BLJCLUSTER.OR.BLJCLUSTER_NOCUT).AND..NOT.QALCST) THEN513:         ELSE IF ((BLJCLUSTER.OR.BLJCLUSTER_NOCUT).AND..NOT.QALCST) THEN
521:         DO J2=1,NATOMS514:             DO J2=1,NATOMS
522:            IF (J2.LE.NTYPEA) THEN515:                 IF (J2.LE.NTYPEA) THEN
523:               WRITE(MYUNIT2,'(A,3F20.10)') 'LA  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)516:                     WRITE(MYUNIT2,'(A,3F20.10)') 'LA  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)
524:            ELSE517:                 ELSE
525:               WRITE(MYUNIT2,'(A,3F20.10)') 'LB  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)518:                     WRITE(MYUNIT2,'(A,3F20.10)') 'LB  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)
526:            ENDIF519:                 ENDIF
527:         ENDDO520:             ENDDO
528:      ELSE IF (GLJT) THEN521:         ELSE IF (GLJT) THEN
529:         J3=1522:             J3=1
530:         J4=1523:             J4=1
531:         DO J2=1,NATOMS524:             DO J2=1,NATOMS
532:            !525:                !
533:            DO J5=1,3526:                DO J5=1,3
534:               P(J5) = QMINP(J1,3*(J2-1)+J5)                  527:                   P(J5) = QMINP(J1,3*(J2-1)+J5)                  
535:               IF(PERIODIC) THEN ! wrap back into the box528:                   IF(PERIODIC) THEN ! wrap back into the box
536:                  P(J5)=P(J5)-BOX3D(J5)*ANINT(P(J5)/BOX3D(J5))529:                      P(J5)=P(J5)-BOX3D(J5)*ANINT(P(J5)/BOX3D(J5))
537:               ENDIF530:                   ENDIF
538:            ENDDO531:                ENDDO
539:            !532:                !
540:            WRITE(ZSTR,'(I6)') J4533:                WRITE(ZSTR,'(I6)') J4
541:            ZSTR='L' // TRIM(ADJUSTL(ZSTR))534:                ZSTR='L' // TRIM(ADJUSTL(ZSTR))
542:            WRITE(MYUNIT2,'(A2,1X,3F20.10)') ZSTR,(P(J5),J5=1,3)535:                WRITE(MYUNIT2,'(A2,1X,3F20.10)') ZSTR,(P(J5),J5=1,3)
543:            J3=J3+1536:                J3=J3+1
544:            IF (J3.GT.NSPECIES(J4)) THEN537:                IF (J3.GT.NSPECIES(J4)) THEN
545:               J3=1538:                   J3=1
546:               J4=J4+1539:                   J4=J4+1
547:            ENDIF540:                ENDIF
548:         ENDDO541:             ENDDO
549:         !542:             !
550:      ELSE IF (BGUPTAT .AND. .NOT. QALCST .AND. .NOT. MULTIPERMT) THEN543:          ELSE IF (BGUPTAT .AND. .NOT. QALCST .AND. .NOT. MULTIPERMT) THEN
551:         DO J2=1,NATOMS544:             DO J2=1,NATOMS
552:            IF (J2.LE.NTYPEA) THEN545:                 IF (J2.LE.NTYPEA) THEN
553:               WRITE(MYUNIT2,'(A,3F20.10)') BGUPTANAME1, (QMINP(J1,3*(J2-1)+J3),J3=1,3)546:                     WRITE(MYUNIT2,'(A,3F20.10)') BGUPTANAME1, (QMINP(J1,3*(J2-1)+J3),J3=1,3)
554:            ELSE547:                 ELSE
555:               WRITE(MYUNIT2,'(A,3F20.10)') BGUPTANAME2, (QMINP(J1,3*(J2-1)+J3),J3=1,3)548:                     WRITE(MYUNIT2,'(A,3F20.10)') BGUPTANAME2, (QMINP(J1,3*(J2-1)+J3),J3=1,3)
556:            ENDIF549:                 ENDIF
557:         END DO550:             END DO
558:         551: 
559:      ELSE IF (AMBER.OR.MOLECULART) THEN552: 
560:         DO J2=1,NATOMS553:         ELSE IF (AMBER.OR.MOLECULART) THEN
561:            WRITE(MYUNIT2,'(A,3F20.10)') typech(J2)(1:1),(QMINP(J1,3*(J2-1)+J3),J3=1,3)554:             DO J2=1,NATOMS
562:         ENDDO555:                 WRITE(MYUNIT2,'(A,3F20.10)') typech(J2)(1:1),(QMINP(J1,3*(J2-1)+J3),J3=1,3)
563:      ELSE IF (AMBER12T) THEN556:             ENDDO
564:         ! Create a string for J1557:         ELSE IF (AMBER12T) THEN
565:         WRITE(J1_STRING,'(I6)') J1558:             ! Create a string for J1
566:         IF (DUMPSTRUCTURES) THEN559:             WRITE(J1_STRING,'(I6)') J1
567:            IF (MPIT) THEN560:             IF (DUMPSTRUCTURES) THEN
568:               ! If we're writing output for multiple parallel MPI runs we need to use MYNODE to561:                IF (MPIT) THEN
569:               ! distinguish the outputs.562:                   ! If we're writing output for multiple parallel MPI runs we need to use MYNODE to
570:               ! Create a string for the node too.563:                   ! distinguish the outputs.
571:               WRITE(MYNODE_STRING,'(I6)') MYNODE564:                   ! Create a string for the node too.
572:               CALL AMBER12_WRITE_RESTART(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&565:                   WRITE(MYNODE_STRING,'(I6)') MYNODE
573:                    &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&566:                   CALL AMBER12_WRITE_RESTART(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&
574:                    &'.rst', &567:                                                                &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&
575:                    &  LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//&568:                                                                &'.rst', &
576:                    &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&569:                                                        &  LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//&
577:                    &'.rst'))570:                                                                    &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&
578:               CALL AMBER12_WRITE_PDB(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&571:                                                                    &'.rst'))
579:                    &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&572:                   CALL AMBER12_WRITE_PDB(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&
580:                    &'.pdb', &573:                                                            &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&
581:                    & LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//&574:                                                            &'.pdb', &
582:                    &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&575:                                                     & LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//&
583:                    &'.pdb'))576:                                                                &'.'//TRIM(ADJUSTL(MYNODE_STRING))//&
584:            ELSE577:                                                                &'.pdb'))
585:               ! Otherwise, just use one output without the MYNODE suffix.578:                ELSE
586:               CALL AMBER12_WRITE_RESTART(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&579:                   ! Otherwise, just use one output without the MYNODE suffix.
587:                    &'.rst', &580:                   CALL AMBER12_WRITE_RESTART(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&
588:                    & LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//'.rst'))581:                                                                &'.rst', &
589:               CALL AMBER12_WRITE_PDB(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&582:                                                         & LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//'.rst'))
590:                    &'.pdb', &583:                   CALL AMBER12_WRITE_PDB(QMINP(J1,:), 'coords.'//TRIM(ADJUSTL(J1_STRING))//&
591:                    & LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//'.pdb'))584:                                                            &'.pdb', &
592:            END IF585:                                                     & LEN('coords.'//TRIM(ADJUSTL(J1_STRING))//'.pdb'))
593:         END IF586:                END IF
594:         IF (MPIT) THEN587:             END IF
595:            WRITE(MYNODE_STRING,'(I6)') MYNODE588:             IF (MPIT) THEN
596:            ! Pass the name, length of the string and whether or not to write a header.589:                WRITE(MYNODE_STRING,'(I6)') MYNODE
597:            CALL AMBER12_WRITE_XYZ(QMINP(J1,:), 'lowest.'//TRIM(ADJUSTL(MYNODE_STRING)), &590:                ! Pass the name, length of the string and whether or not to write a header.
598:                 LEN('lowest.'//TRIM(ADJUSTL(MYNODE_STRING))), &591:                CALL AMBER12_WRITE_XYZ(QMINP(J1,:), 'lowest.'//TRIM(ADJUSTL(MYNODE_STRING)), &
599:                 LOGICAL(.FALSE.,KIND=1))592:                                                    LEN('lowest.'//TRIM(ADJUSTL(MYNODE_STRING))), &
600:         ELSE 593:                                                    LOGICAL(.FALSE.,KIND=1))
601:            ! Pass the name, length of the string and whether or not to write a header.594:             ELSE 
602:            CALL AMBER12_WRITE_XYZ(QMINP(J1,:), 'lowest', LEN('lowest'), LOGICAL(.FALSE.,KIND=1))595:                ! Pass the name, length of the string and whether or not to write a header.
603:         END IF596:                CALL AMBER12_WRITE_XYZ(QMINP(J1,:), 'lowest', LEN('lowest'), LOGICAL(.FALSE.,KIND=1))
604:      ELSE IF (AMBERT) THEN597:             END IF
605:         ! sf344> write out coordinates598:         ELSE IF (AMBERT) THEN
606:         COORDS1(1:3*NATOMS) = QMINP(J1,1:3*NATOMS)599:             ! sf344> write out coordinates
607:         IF (DUMPSTRUCTURES) THEN600:             COORDS1(1:3*NATOMS) = QMINP(J1,1:3*NATOMS)
608:            CALL AMBERFINALIO(j1,MYUNIT2,MYNODE+1,'0',0,COORDS1(1:3*NATOMS))601:             IF (DUMPSTRUCTURES) THEN
609:            WRITE(J1CHAR2,'(I3)') J1602:                 CALL AMBERFINALIO(j1,MYUNIT2,MYNODE+1,'0',0,COORDS1(1:3*NATOMS))
610:            IF (MPIT) THEN603:                 WRITE(J1CHAR2,'(I3)') J1
611:               WRITE (ISTR, '(I10)') MYNODE+1604:              IF (MPIT) THEN
612:               MYUNIT3=GETUNIT()605:                 WRITE (ISTR, '(I10)') MYNODE+1
613:               MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))//'.'//trim(adjustl(istr))606:                 MYUNIT3=GETUNIT()
614:               OPEN(MYUNIT3,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")607:                 MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))//'.'//trim(adjustl(istr))
615:            ELSE608:                 OPEN(MYUNIT3,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")
616:               MYUNIT3=GETUNIT()609:              ELSE
617:               MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))610:                 MYUNIT3=GETUNIT()
618:               OPEN(MYUNIT3,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")611:                 MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))
619:            END IF612:                 OPEN(MYUNIT3,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")
620:            DO J2=1,NATOMS613:              END IF
621:               WRITE(MYUNIT3,'(3F28.20)') QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3)614:                 DO J2=1,NATOMS
622:            ENDDO615:                     WRITE(MYUNIT3,'(3F28.20)') QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3)
623:            CLOSE(MYUNIT3)616:                 ENDDO
624:         ELSE617:                 CLOSE(MYUNIT3)
625:            DO I1=1,NATOMS618:             ELSE
626:               WRITE(MYUNIT2,'(A2,3F20.10)') ih(m04+I1-1),COORDS1(3*I1-2),COORDS1(3*I1-1),COORDS1(3*I1)619:                 DO I1=1,NATOMS
627:            ENDDO620:                     WRITE(MYUNIT2,'(A2,3F20.10)') ih(m04+I1-1),COORDS1(3*I1-2),COORDS1(3*I1-1),COORDS1(3*I1)
628:         ENDIF621:                 ENDDO
629:         622:             ENDIF
630:      ELSE IF (CHIROT) THEN623: 
631:         CALL CHIRO_OUTPUT624:         ELSE IF (CHIROT) THEN
632:         625:             CALL CHIRO_OUTPUT
633:      ELSE IF (ELLIPSOIDT.OR.LJCAPSIDT.OR.GBT.OR.GBDT) THEN626: 
634:         !627:         ELSE IF (ELLIPSOIDT.OR.LJCAPSIDT.OR.GBT.OR.GBDT) THEN
635:         ! determine the centre of coordinates, then centre them628:             !
636:         !629:             ! determine the centre of coordinates, then centre them
637:         SUMX=0.0D0630:             !
638:         SUMY=0.0d0631:             SUMX=0.0D0
639:         SUMZ=0.0d0632:             SUMY=0.0d0
640:         633:             SUMZ=0.0d0
641:         DO J2=1,NATOMS/2634: 
642:            SUMX=SUMX+QMINP(J1,3*(J2-1)+1)635:             DO J2=1,NATOMS/2
643:            SUMY=SUMY+QMINP(J1,3*(J2-1)+2)636:                 SUMX=SUMX+QMINP(J1,3*(J2-1)+1)
644:            SUMZ=SUMZ+QMINP(J1,3*(J2-1)+3)637:                 SUMY=SUMY+QMINP(J1,3*(J2-1)+2)
645:         ENDDO638:                 SUMZ=SUMZ+QMINP(J1,3*(J2-1)+3)
646:         SUMX=2*SUMX/NATOMS639:             ENDDO
647:         SUMY=2*SUMY/NATOMS640:             SUMX=2*SUMX/NATOMS
648:         SUMZ=2*SUMZ/NATOMS641:             SUMY=2*SUMY/NATOMS
649:         DO J2=1,NATOMS/2642:             SUMZ=2*SUMZ/NATOMS
650:            QMINP(J1,3*(J2-1)+1)=QMINP(J1,3*(J2-1)+1)-SUMX643:             DO J2=1,NATOMS/2
651:            QMINP(J1,3*(J2-1)+2)=QMINP(J1,3*(J2-1)+2)-SUMY644:                 QMINP(J1,3*(J2-1)+1)=QMINP(J1,3*(J2-1)+1)-SUMX
652:            QMINP(J1,3*(J2-1)+3)=QMINP(J1,3*(J2-1)+3)-SUMZ645:                 QMINP(J1,3*(J2-1)+2)=QMINP(J1,3*(J2-1)+2)-SUMY
653:         ENDDO646:                 QMINP(J1,3*(J2-1)+3)=QMINP(J1,3*(J2-1)+3)-SUMZ
654:         647:             ENDDO
655:         DO j2=1,NATOMS/2648: 
656:            IF (PARAMONOVPBCX) THEN649:             DO j2=1,NATOMS/2
657:               ! ensure y component of particle 1 vector is within BoxLy/2 of zero. 650:                 IF (PARAMONOVPBCX) THEN
658:               ! If it isn't then subtract integer number of boxly's such that it is.651:                         ! ensure y component of particle 1 vector is within BoxLy/2 of zero. 
659:               QMINP(J1,3*J2-2)=QMINP(J1,3*J2-2)-BOXLX*NINT(QMINP(J1,3*J2-2)/BOXLX)652:                         ! If it isn't then subtract integer number of boxly's such that it is.
660:            ENDIF653:                     QMINP(J1,3*J2-2)=QMINP(J1,3*J2-2)-BOXLX*NINT(QMINP(J1,3*J2-2)/BOXLX)
661:            IF (PARAMONOVPBCY) THEN654:                 ENDIF
662:               ! ensure y component of particle 1 vector is within BoxLy/2 of zero. 655:                 IF (PARAMONOVPBCY) THEN
663:               ! If it isn't then subtract integer number of boxly's such that it is.656:                         ! ensure y component of particle 1 vector is within BoxLy/2 of zero. 
664:               QMINP(J1,3*J2-1)=QMINP(J1,3*J2-1)-BOXLY*NINT(QMINP(J1,3*J2-1)/BOXLY)657:                         ! If it isn't then subtract integer number of boxly's such that it is.
665:            ENDIF658:                     QMINP(J1,3*J2-1)=QMINP(J1,3*J2-1)-BOXLY*NINT(QMINP(J1,3*J2-1)/BOXLY)
666:            IF (PARAMONOVPBCZ) THEN659:                 ENDIF
667:               ! ensure y component of particle 1 vector is within BoxLy/2 of zero. 660:                 IF (PARAMONOVPBCZ) THEN
668:               ! If it isn't then subtract integer number of boxly's such that it is.661:                         ! ensure y component of particle 1 vector is within BoxLy/2 of zero. 
669:               QMINP(J1,3*J2  )=QMINP(J1,3*J2  )-BOXLZ*NINT(QMINP(J1,3*J2  )/BOXLZ)662:                         ! If it isn't then subtract integer number of boxly's such that it is.
670:            ENDIF663:                     QMINP(J1,3*J2  )=QMINP(J1,3*J2  )-BOXLZ*NINT(QMINP(J1,3*J2  )/BOXLZ)
671:         ENDDO664:                 ENDIF
672:         665:             ENDDO
673:         DO J2=1,NATOMS/2666: 
674:            WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a11,3f20.10)') 'H',QMINP(J1,3*(J2-1)+1), &667:             DO J2=1,NATOMS/2
 668:                 WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a11,3f20.10)') 'H',QMINP(J1,3*(J2-1)+1), &
675:                 QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3), &669:                 QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3), &
676:                 'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1), &670:                 'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1), &
677:                 QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)671:                 QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)
678:         ENDDO672:             ENDDO
679:         673: 
680:      ELSE IF (CHRMMT) THEN674:         ELSE IF (CHRMMT) THEN
681:         DO J2=1,NATOMS675:             DO J2=1,NATOMS
682:            WRITE(MYUNIT2,'(A,1X,3F20.10)') ZSYM(J2)(1:1),(QMINP(J1,3*(J2-1)+J3),J3=1,3)676:                 WRITE(MYUNIT2,'(A,1X,3F20.10)') ZSYM(J2)(1:1),(QMINP(J1,3*(J2-1)+J3),J3=1,3)
683:         ENDDO677:             ENDDO
684:         !       csw34> This DO loop appeared to be be missing on 30/9/08 which would easily678:             !       csw34> This DO loop appeared to be be missing on 30/9/08 which would easily
685:         !       explain the output problems!679:             !       explain the output problems!
686:         DO J2=1,NATOMS680:             DO J2=1,NATOMS
687:            DCOORDS(3*(J2-1)+1)=QMINP(J1,3*(J2-1)+1)681:                 DCOORDS(3*(J2-1)+1)=QMINP(J1,3*(J2-1)+1)
688:            DCOORDS(3*(J2-1)+2)=QMINP(J1,3*(J2-1)+2)682:                 DCOORDS(3*(J2-1)+2)=QMINP(J1,3*(J2-1)+2)
689:            DCOORDS(3*(J2-1)+3)=QMINP(J1,3*(J2-1)+3)683:                 DCOORDS(3*(J2-1)+3)=QMINP(J1,3*(J2-1)+3)
690:         ENDDO684:             ENDDO
691:         CALL CHARMMDUMP(DCOORDS,DBNAME(J1))685:             CALL CHARMMDUMP(DCOORDS,DBNAME(J1))
692:         686: 
693:         !    DC430 >687:         !    DC430 >
694:         !    |gd351> added patchy688:         !    |gd351> added patchy
695:         689: 
696:      ELSE IF (CAPBINT.OR.DBPT.OR.DBPTDT.OR.DMBLMT.OR.DMBLPYT.OR.LINRODT.OR.LWOTPT.OR.MSTBINT.OR.MSSTOCKT.OR.NCAPT.OR.NPAHT &690:         ELSE IF (CAPBINT.OR.DBPT.OR.DBPTDT.OR.DMBLMT.OR.DMBLPYT.OR.LINRODT.OR.LWOTPT.OR.MSTBINT.OR.MSSTOCKT.OR.NCAPT.OR.NPAHT &
697:           .OR. NTIPT .OR. STOCKAAT .OR. PAHAT .OR. PAHW99T .OR. TDHDT .OR. WATERDCT .OR. WATERKZT .OR. PATCHY .OR. PAPT   &691:         .OR. NTIPT .OR. STOCKAAT .OR. PAHAT .OR. PAHW99T .OR. TDHDT .OR. WATERDCT .OR. WATERKZT .OR. PATCHY .OR. PAPT   &
698:           .OR. PAPBINT .OR. PAPJANT .OR. PTSTSTT .OR. MORSEDPT) THEN692:         .OR. PAPBINT .OR. PAPJANT .OR. PTSTSTT .OR. MORSEDPT) THEN
699:         DO J2 = 1, NATOMS/2693:             DO J2 = 1, NATOMS/2
700:            WRITE(MYUNIT2,'(3f25.15)') (QMINP(J1,3*(J2-1)+J3),J3=1,3)694:                 WRITE(MYUNIT2,'(3f25.15)') (QMINP(J1,3*(J2-1)+J3),J3=1,3)
701:         ENDDO695:             ENDDO
702:         DO J2 = 1, NATOMS/2696:             DO J2 = 1, NATOMS/2
703:            WRITE(MYUNIT2,'(3f25.15)') (QMINP(J1,3*NATOMS/2+3*(J2-1)+J3),J3=1,3)697:                 WRITE(MYUNIT2,'(3f25.15)') (QMINP(J1,3*NATOMS/2+3*(J2-1)+J3),J3=1,3)
704:         ENDDO698:             ENDDO
705:         699: 
706:      ELSE IF (GBT.OR.GBDT.OR.GBDPT.OR.MSGBT) THEN700:         ELSE IF (GBT.OR.GBDT.OR.GBDPT.OR.MSGBT) THEN
707:         DO J2 = 1, NATOMS/2701:             DO J2 = 1, NATOMS/2
708:            WRITE(MYUNIT2,'(3f20.10)') (QMINP(J1,3*(J2-1)+J3),J3=1,3)702:                 WRITE(MYUNIT2,'(3f20.10)') (QMINP(J1,3*(J2-1)+J3),J3=1,3)
709:         ENDDO703:             ENDDO
710:         DO J2 = 1, NATOMS/2704:             DO J2 = 1, NATOMS/2
711:            WRITE(MYUNIT2,'(3f20.10)') (QMINP(J1,3*NATOMS/2+3*(J2-1)+J3),J3=1,3)705:                 WRITE(MYUNIT2,'(3f20.10)') (QMINP(J1,3*NATOMS/2+3*(J2-1)+J3),J3=1,3)
712:         ENDDO706:             ENDDO
713:         707: 
714:      ELSE IF (MLP3T.OR.MLPB3T) THEN708:          ELSE IF (MLP3T.OR.MLPB3T) THEN
715:         DO J2 = 1, NATOMS709:             DO J2 = 1, NATOMS
716:            WRITE(MYUNIT2,'(3G20.10)') QMINP(J1,J2)710:                 WRITE(MYUNIT2,'(3G20.10)') QMINP(J1,J2)
717:         ENDDO711:             ENDDO
718:         712: 
719:      ELSE IF (GEMT) THEN713:          ELSE IF (GEMT) THEN
720:         DO J2 = 1, NATOMS714:             DO J2 = 1, NATOMS
721:            WRITE(MYUNIT2,'(3f20.10)') (QMINP(J1,3*(J2-1)+J3),J3=1,3)715:                 WRITE(MYUNIT2,'(3f20.10)') (QMINP(J1,3*(J2-1)+J3),J3=1,3)
722:         ENDDO716:             ENDDO
723:         717: 
724:      ELSE IF (BLNT.AND.(.NOT.P46).AND.(.NOT.G46)) THEN718:         ELSE IF (BLNT.AND.(.NOT.P46).AND.(.NOT.G46)) THEN
725:         !719: !
726:         ! this writes 'lowest' in xyz (Xmakemol) format720: ! this writes 'lowest' in xyz (Xmakemol) format
727:         !721: !
728:         WRITE(MYUNIT,'(A,I6,A)') ' in finalio BLN block MYUNIT2=',MYUNIT2722:             WRITE(MYUNIT,'(A,I6,A)') ' in finalio BLN block MYUNIT2=',MYUNIT2
729:         DO J2=1,NATOMS723:             DO J2=1,NATOMS
730:            WRITE(MYUNIT2,'(2A1,1X,3F20.10)') BEADLETTER(J2),'L',(QMINP(J1,3*(J2-1)+J3),J3=1,3)724:                 WRITE(MYUNIT2,'(2A1,1X,3F20.10)') BEADLETTER(J2),'L',(QMINP(J1,3*(J2-1)+J3),J3=1,3)
731:         ENDDO725:             ENDDO
732:      ELSE IF(QALCST.OR.MULTIPERMT.OR.MLJT.OR.MGUPTAT.OR.MSCT) THEN726:         ELSE IF(QALCST.OR.MULTIPERMT.OR.MLJT.OR.MGUPTAT.OR.MSCT) THEN
733:         !727:            !
734:         CALL SET_ATOMLISTS(QMINT(J1,1:NATOMS),1)728:            CALL SET_ATOMLISTS(QMINT(J1,1:NATOMS),1)
735:         IF(SPECMASST) THEN 729:            IF(SPECMASST) THEN 
736:            EDUMMY = SUM(ATMASS)730:               EDUMMY = SUM(ATMASS)
737:            WRITE(MYUNIT,'(A,I6,A,E20.10)') &731:               WRITE(MYUNIT,'(A,I6,A,E20.10)') &
738:                 'finalio> Min ',J1,' has total mass ', EDUMMY732:                    'finalio> Min ',J1,' has total mass ', EDUMMY
739:         ENDIF 
740:         ! 
741:         IF(STRESST) CALL CALC_STRESS(QMINP(J1,1:3*NATOMS),EDUMMY) 
742:         ! 
743:         DO J2=1,NSPECIES(0) !ds656> Should not exceed 10 
744:            IF(SPECLABELST) THEN 
745:               ATOM_TYPE = SPECLABELS(J2) 
746:            ELSE 
747:               WRITE(ATOM_TYPE,'(I1)') J2 
748:               ATOM_TYPE='L' // TRIM(ADJUSTL(ATOM_TYPE)) 
749:            ENDIF733:            ENDIF
750:            DO J3=1,ATOMLISTS(J2,1,0)734:            !
751:               J4=ATOMLISTS(J2,1,J3) ! Actual atom index735:            IF(STRESST) CALL CALC_STRESS(QMINP(J1,1:3*NATOMS),EDUMMY)
752:               DO J5=1,3736:            !
753:                  P(J5) = QMINP(J1,3*(J4-1)+J5)                  737:            DO J2=1,NSPECIES(0) !ds656> Should not exceed 10
754:                  IF(PERIODIC) THEN ! wrap back into the box738:               IF(SPECLABELST) THEN
755:                     P(J5)=P(J5)-BOX3D(J5)*ANINT(P(J5)/BOX3D(J5))739:                  ATOM_TYPE = SPECLABELS(J2)
 740:               ELSE
 741:                  WRITE(ATOM_TYPE,'(I1)') J2
 742:                  ATOM_TYPE='L' // TRIM(ADJUSTL(ATOM_TYPE))
 743:               ENDIF
 744:               DO J3=1,ATOMLISTS(J2,1,0)
 745:                  J4=ATOMLISTS(J2,1,J3) ! Actual atom index
 746:                  DO J5=1,3
 747:                     P(J5) = QMINP(J1,3*(J4-1)+J5)                  
 748:                     IF(PERIODIC) THEN ! wrap back into the box
 749:                        P(J5)=P(J5)-BOX3D(J5)*ANINT(P(J5)/BOX3D(J5))
 750:                     ENDIF
 751:                  ENDDO
 752:                  WRITE(MYUNIT2,'(A,3(1X,F20.10))',ADVANCE='NO') &
 753:                       ATOM_TYPE,(P(J5), J5=1,3)
 754:                  IF(STRESST) THEN ! Tack on local stresses
 755:                     IF(STRESS_MODE==2) THEN
 756:                        ! Just print the uniqe elements of the stress
 757:                        ! tensor
 758:                        WRITE(MYUNIT2,'(6(1X,F10.5))',ADVANCE='YES') &
 759:                             STRESS(J4,1,1),STRESS(J4,2,2),STRESS(J4,3,3),&
 760:                             STRESS(J4,1,2),STRESS(J4,1,3),STRESS(J4,2,3)
 761:                     ELSEIF(STRESS_MODE==1) THEN
 762:                        WRITE(MYUNIT2,'(2(1X,F10.5))',ADVANCE='YES') &
 763:                             -(STRESS(J4,1,1)+STRESS(J4,2,2)+STRESS(J4,3,3))/3.0D0, &
 764:                             DSQRT( (STRESS(J4,1,1)-STRESS(J4,2,2))**2 + &
 765:                             (STRESS(J4,2,2)-STRESS(J4,3,3))**2 + &
 766:                             (STRESS(J4,3,3)-STRESS(J4,1,1))**2 )/3.0D0
 767:                     ELSE
 768:                        WRITE(MYUNIT2,'(1X,F10.5)',ADVANCE='YES') &
 769:                             -(STRESS(0,1,1)+STRESS(0,2,2)+STRESS(0,3,3))/&
 770:                             DBLE(3*NATOMS)
 771:                     ENDIF
 772:                  ELSE ! Just advance to next line
 773:                     WRITE(MYUNIT2,*)
756:                  ENDIF774:                  ENDIF
757:               ENDDO775:               ENDDO
758:               WRITE(MYUNIT2,'(A,3(1X,F20.10))',ADVANCE='NO') & 
759:                    ATOM_TYPE,(P(J5), J5=1,3) 
760:               IF(STRESST) THEN ! Tack on local stresses 
761:                  IF(STRESS_MODE==2) THEN 
762:                     ! Just print the uniqe elements of the stress 
763:                     ! tensor 
764:                     WRITE(MYUNIT2,'(6(1X,F10.5))',ADVANCE='YES') & 
765:                          STRESS(J4,1,1),STRESS(J4,2,2),STRESS(J4,3,3),& 
766:                          STRESS(J4,1,2),STRESS(J4,1,3),STRESS(J4,2,3) 
767:                  ELSEIF(STRESS_MODE==1) THEN 
768:                     WRITE(MYUNIT2,'(2(1X,F10.5))',ADVANCE='YES') & 
769:                          -(STRESS(J4,1,1)+STRESS(J4,2,2)+STRESS(J4,3,3))/3.0D0, & 
770:                          DSQRT( (STRESS(J4,1,1)-STRESS(J4,2,2))**2 + & 
771:                          (STRESS(J4,2,2)-STRESS(J4,3,3))**2 + & 
772:                          (STRESS(J4,3,3)-STRESS(J4,1,1))**2 )/3.0D0 
773:                  ELSE 
774:                     WRITE(MYUNIT2,'(1X,F10.5)',ADVANCE='YES') & 
775:                          -(STRESS(0,1,1)+STRESS(0,2,2)+STRESS(0,3,3))/& 
776:                          DBLE(3*NATOMS) 
777:                  ENDIF 
778:               ELSE ! Just advance to next line 
779:                  WRITE(MYUNIT2,*) 
780:               ENDIF 
781:            ENDDO776:            ENDDO
782:         ENDDO777:         ELSE
783:      ELSE778:             IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) THEN
784:         IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) THEN779:                 WRITE(MYUNIT3,'(I6)') NATOMS
785:            WRITE(MYUNIT3,'(I6)') NATOMS780:                 WRITE(MYUNIT3,'(A,I6,2(A,G20.10))') 'averaged structure for final solution ',J1, &
786:            WRITE(MYUNIT3,'(A,I6,2(A,G20.10))') 'averaged structure for final solution ',J1, & 
787:                 ' CSM=',QMINAV(J1),' CSM for reference structure=',QMIN(J1)781:                 ' CSM=',QMINAV(J1),' CSM for reference structure=',QMIN(J1)
788:            WRITE(MYUNIT3,30) (QMINPCSMAV(J1,J2),J2=1,3*(NATOMS-NS))782:                 WRITE(MYUNIT3,30) (QMINPCSMAV(J1,J2),J2=1,3*(NATOMS-NS))
 783:             ENDIF
 784:             WRITE(MYUNIT2,30) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))
 785: 30          FORMAT('BE ',3F20.10)
789:         ENDIF786:         ENDIF
790:         WRITE(MYUNIT2,30) (QMINP(J1,J2),J2=1,3*(NATOMS-NS))787: 
791: 30      FORMAT('BE ',3F20.10)788:         !|gd351>
792:      ENDIF789:         IF (ASAOOS) THEN
793:      790:             LUNIT=GETUNIT()
794:      !|gd351>791:             OPEN(LUNIT,file='particles.xyz')
795:      IF (ASAOOS) THEN792:             WRITE(LUNIT,*) NATOMS
796:         LUNIT=GETUNIT()793:             WRITE(LUNIT,*) ' '
797:         OPEN(LUNIT,file='particles.xyz')794:             DO J2=1,NATOMS
798:         WRITE(LUNIT,*) NATOMS795:                 WRITE(LUNIT,'(A,3F20.10)') 'H  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)
799:         WRITE(LUNIT,*) ' '796:             ENDDO
800:         DO J2=1,NATOMS797:             CLOSE(LUNIT)
801:            WRITE(LUNIT,'(A,3F20.10)') 'H  ',(QMINP(J1,3*(J2-1)+J3),J3=1,3)798:         END IF
802:         ENDDO799:         !<gd351|
803:         CLOSE(LUNIT)800: 
804:      END IF801:         IF ((NS.GT.0).AND.(.NOT.(WELCH.OR.TOSI))) THEN
805:      !<gd351|802:             IF (MSORIGT.OR.FRAUSIT) THEN
806:      803:                 WRITE(MYUNIT2,40) (QMINP(J1,J2),J2=3*(NATOMS-NS)+1,3*NATOMS)
807:      IF ((NS.GT.0).AND.(.NOT.(WELCH.OR.TOSI))) THEN804: 40              FORMAT('Si',3F20.10)
808:         IF (MSORIGT.OR.FRAUSIT) THEN805:             ELSE IF (MSTRANST) THEN
809:            WRITE(MYUNIT2,40) (QMINP(J1,J2),J2=3*(NATOMS-NS)+1,3*NATOMS)806:                 WRITE(MYUNIT2,40) (QMINP(J1,J2),J2=3*(NATOMS-NS)+1,3*NATOMS)
810: 40         FORMAT('Si',3F20.10)807:             ELSE
811:         ELSE IF (MSTRANST) THEN808:                 WRITE(MYUNIT2,50) (QMINP(J1,J2),J2=3*(NATOMS-NS)+1,3*NATOMS)
812:            WRITE(MYUNIT2,40) (QMINP(J1,J2),J2=3*(NATOMS-NS)+1,3*NATOMS)809: 50              FORMAT('LB',3F20.10)
813:         ELSE810:             ENDIF
814:            WRITE(MYUNIT2,50) (QMINP(J1,J2),J2=3*(NATOMS-NS)+1,3*NATOMS) 
815: 50         FORMAT('LB',3F20.10) 
816:         ENDIF811:         ENDIF
817:      ENDIF812:         IF (AMBER) CALL AMBERDUMP(J1,QMINP)
818:      IF (AMBER) CALL AMBERDUMP(J1,QMINP)813:     ENDDO
819:      !814: 
820:   ENDDO savemin815: !
821:   !816: ! End of loop over dump to file lowest or equivalent.
822:   ! End of loop over dump to file lowest or equivalent. 817: !
823:   !818:     CLOSE(MYUNIT2)
824:   CLOSE(MYUNIT2)819:     IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) CLOSE(MYUNIT3)
825:   IF (CSMT.AND.(.NOT.SYMMETRIZECSM)) CLOSE(MYUNIT3)820:     !
826:   !821:     !     csw34> New loop for dumping interaction energy files if A9INTE is specified
827:   !     csw34> New loop for dumping interaction energy files if A9INTE is specified822:     !     Added the missing IF block to test for A9INTE 9/12/09 DJW
828:   !     Added the missing IF block to test for A9INTE 9/12/09 DJW823:     !
829:   !824:     IF (A9INTET) THEN
830:   IF (A9INTET) THEN825:         IF (MPIT) THEN
831:      IF (MPIT) THEN826:             WRITE (ISTR, '(I10)') MYUNIT-22980+1
832:         WRITE (ISTR, '(I10)') MYUNIT-22980+1827:             MYUNIT2=(MYUNIT-22980+1)+100
833:         MYUNIT2=(MYUNIT-22980+1)+100828:             MYFILENAME2="intelowest."//trim(adjustl(istr))
834:         MYFILENAME2="intelowest."//trim(adjustl(istr))829:             OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")
835:         OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted") 
836:      ELSE 
837:         MYUNIT2=25 
838:         OPEN(MYUNIT2,FILE='intelowest',STATUS='UNKNOWN') 
839:      ENDIF 
840:   ENDIF 
841:   ! 
842:   !     csw34> loop structure copied from the ELSEIF(AMBERT) block above 
843:   ! 
844:   IF (A9INTET.AND.AMBERT) THEN 
845:      DO J1=1,NSAVEINTE 
846:         WRITE(MYUNIT2,*) NATOMS 
847:         !     csw34> write header to intelowest for current minimum 
848:         WRITE(MYUNIT2,10) J1, INTEQMIN(J1), INTEFF(J1) 
849:         !     sf344> write out coordinates 
850:         COORDS1(1:3*NATOMS) = INTEQMINP(J1,1:3*NATOMS) 
851:         IF (DUMPSTRUCTURES) THEN 
852:            CALL INTEFINALIO(j1,MYUNIT2,AMBFINALIO_NODE,'0',0,COORDS1(1:3*NATOMS)) 
853:            WRITE(J1CHAR2,'(I3)') J1 
854:            WRITE(J1CHAR,'(A,A)') 'intecoords.',TRIM(ADJUSTL(J1CHAR2)) 
855:            OPEN(UNIT=226,FILE=trim(adjustl(J1CHAR)),STATUS='UNKNOWN') 
856:             
857:            DO J2=1,NATOMS 
858:               WRITE(226,'(3F28.20)') INTEQMINP(J1,3*(J2-1)+1),INTEQMINP(J1,3*(J2-1)+2),INTEQMINP(J1,3*(J2-1)+3) 
859:            ENDDO 
860:            CLOSE(226) 
861:            WRITE(J1CHAR2,'(I3)') J1 
862:            WRITE(J1CHAR,'(A,A)') 'intecoords.',TRIM(ADJUSTL(J1CHAR2)) 
863:            OPEN(UNIT=226,FILE=trim(adjustl(J1CHAR)),STATUS='UNKNOWN') 
864:             
865:            DO J2=1,NATOMS 
866:               WRITE(226,'(3F28.20)') INTEQMINP(J1,3*(J2-1)+1),INTEQMINP(J1,3*(J2-1)+2),INTEQMINP(J1,3*(J2-1)+3) 
867:            ENDDO 
868:            CLOSE(226) 
869:             
870:         ELSE830:         ELSE
871:            DO I1=1,NATOMS831:             MYUNIT2=25
872:               WRITE(MYUNIT2,'(A2,3F20.10)') ih(m04+I1-1),COORDS1(3*I1-2),COORDS1(3*I1-1),COORDS1(3*I1)832:             OPEN(MYUNIT2,FILE='intelowest',STATUS='UNKNOWN')
873:            ENDDO 
874:         ENDIF833:         ENDIF
875:      ENDDO834:     ENDIF
876:   ENDIF835:     !
877:   !836:     !     csw34> loop structure copied from the ELSEIF(AMBERT) block above
878:   !  End of loop over dump to file intelowest837:     !
879:   !        838:     IF (A9INTET.AND.AMBERT) THEN
880:   ! csw34> Output for the HBONDMATRIX keyword (subroutine in hbondmatrix.f90)839:         DO J1=1,NSAVEINTE
881:   IF ((AMBERT.OR.AMBER12T.OR.(CUDAT.AND.(CUDAPOT.EQ.'A'))).AND.HBONDMATRIX) CALL HBONDMATRIXFINALIO()840:             WRITE(MYUNIT2,*) NATOMS
882:   841:             !     csw34> write header to intelowest for current minimum
883:   CLOSE(MYUNIT2)842:             WRITE(MYUNIT2,10) J1, INTEQMIN(J1), INTEFF(J1)
884:   843:             !     sf344> write out coordinates
885:   !     csw34> Edits to the RMS keyword844:             COORDS1(1:3*NATOMS) = INTEQMINP(J1,1:3*NATOMS)
886:   IF (CHRMMT.AND.RMST) THEN845:             IF (DUMPSTRUCTURES) THEN
887:      !        IF (PROGRESS) THEN846:                 CALL INTEFINALIO(j1,MYUNIT2,AMBFINALIO_NODE,'0',0,COORDS1(1:3*NATOMS))
888:      !           DCOORDS(1:3*NATOMS)=RMSCOOR(1,1:3*NATOMS)847:                 WRITE(J1CHAR2,'(I3)') J1
889:      !           IF(RMSBEST(1,2)<0.D0) CALL CHARMMDUMP(DCOORDS,'closestrms')848:                 WRITE(J1CHAR,'(A,A)') 'intecoords.',TRIM(ADJUSTL(J1CHAR2))
890:      !           WRITE(MYUNIT,'(A9,F8.5)') 'RMSDmin= ',RMSBEST(1,1)849:                 OPEN(UNIT=226,FILE=trim(adjustl(J1CHAR)),STATUS='UNKNOWN')
891:      !        ELSE850: 
892:      ! REMEMBER TO RE-INDENT THE BELOW IF UNCOMMENTING ABOVE!851:                 DO J2=1,NATOMS
893:      OPEN(UNIT=MYUNIT2,FILE='rmsbest.'//TRIM(ADJUSTL(ISTR)),STATUS='UNKNOWN')852:                     WRITE(226,'(3F28.20)') INTEQMINP(J1,3*(J2-1)+1),INTEQMINP(J1,3*(J2-1)+2),INTEQMINP(J1,3*(J2-1)+3)
894:      DO J2=1,RMSSAVE853:                 ENDDO
895:         WRITE(MYUNIT2,'(I6,F6.3,F15.5)')J2,RMSBEST(J2,1),RMSBEST(J2,2)854:                 CLOSE(226)
896:         WRITE(CRMS,'(I6)') J2855:                 WRITE(J1CHAR2,'(I3)') J1
897:         DCOORDS(1:3*NATOMS)=RMSCOOR(J2,1:3*NATOMS)856:                 WRITE(J1CHAR,'(A,A)') 'intecoords.',TRIM(ADJUSTL(J1CHAR2))
898:         IF(RMSBEST(J2,2)<0.D0) CALL CHARMMDUMP(DCOORDS,'rms.'//TRIM(ADJUSTL(ISTR))//'.'//TRIM(ADJUSTL(CRMS)))857:                 OPEN(UNIT=226,FILE=trim(adjustl(J1CHAR)),STATUS='UNKNOWN')
899:      ENDDO858:               
900:      CLOSE(MYUNIT2)859:                 DO J2=1,NATOMS
901:      !        ENDIF860:                     WRITE(226,'(3F28.20)') INTEQMINP(J1,3*(J2-1)+1),INTEQMINP(J1,3*(J2-1)+2),INTEQMINP(J1,3*(J2-1)+3)
902:   ENDIF861:                 ENDDO
903:   862:                 CLOSE(226)
904:   IF (LJCOULT) THEN863: 
905:      OPEN(UNIT=AMHUNIT1,FILE='ljcoul.xyz',STATUS='UNKNOWN')864:             ELSE
906:      DO J1=1,NSAVE865:                 DO I1=1,NATOMS
907:         WRITE(AMHUNIT1,'(I6)') NATOMS866:                     WRITE(MYUNIT2,'(A2,3F20.10)') ih(m04+I1-1),COORDS1(3*I1-2),COORDS1(3*I1-1),COORDS1(3*I1)
908:         WRITE(AMHUNIT1,10) J1, QMIN(J1), FF(J1)867:                 ENDDO
909:         DO J2=1,NATOMS868:             ENDIF
910:            !              Use "O" atom type to highlight charged particles and "N" for the neutral ones. 
911:            IF (J2.LE.COULN) THEN 
912:               WRITE(AMHUNIT1,'(A4,3F18.10,A12,3F18.10)') 'O ',& 
913:                    QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3) 
914:            ELSE 
915:               WRITE(AMHUNIT1,'(A4,3F18.10,A12,3F18.10)') 'N ',& 
916:                    QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3) 
917:            END IF 
918:         ENDDO869:         ENDDO
919:      ENDDO870:     ENDIF
920:      CLOSE(AMHUNIT1)871:     !
921:      872:     !  End of loop over dump to file intelowest
922:      873:     !
923:   ELSE IF (STOCKT) THEN874: 
924:      LUNIT=GETUNIT()875: ! csw34> Output for the HBONDMATRIX keyword (subroutine in hbondmatrix.f90)
925:      OPEN(UNIT=LUNIT,FILE='stock.xyz',STATUS='UNKNOWN')876:     IF ((AMBERT.OR.AMBER12T.OR.(CUDAT.AND.(CUDAPOT.EQ.'A'))).AND.HBONDMATRIX) CALL HBONDMATRIXFINALIO()
926:      DO J1=1,NSAVE877: 
927:         WRITE(LUNIT,'(I6)') NATOMS/2878:     CLOSE(MYUNIT2)
928:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)879: 
929:         DO J2=1,NATOMS/2880:     !     csw34> Edits to the RMS keyword
930:            WRITE (LUNIT,'(A4,3F18.10,A12,3F18.10)') 'LA ', &881:     IF (CHRMMT.AND.RMST) THEN
 882:         !        IF (PROGRESS) THEN
 883:         !           DCOORDS(1:3*NATOMS)=RMSCOOR(1,1:3*NATOMS)
 884:         !           IF(RMSBEST(1,2)<0.D0) CALL CHARMMDUMP(DCOORDS,'closestrms')
 885:         !           WRITE(MYUNIT,'(A9,F8.5)') 'RMSDmin= ',RMSBEST(1,1)
 886:         !        ELSE
 887:         ! REMEMBER TO RE-INDENT THE BELOW IF UNCOMMENTING ABOVE!
 888:         OPEN(UNIT=MYUNIT2,FILE='rmsbest.'//TRIM(ADJUSTL(ISTR)),STATUS='UNKNOWN')
 889:         DO J2=1,RMSSAVE
 890:             WRITE(MYUNIT2,'(I6,F6.3,F15.5)')J2,RMSBEST(J2,1),RMSBEST(J2,2)
 891:             WRITE(CRMS,'(I6)') J2
 892:             DCOORDS(1:3*NATOMS)=RMSCOOR(J2,1:3*NATOMS)
 893:             IF(RMSBEST(J2,2)<0.D0) CALL CHARMMDUMP(DCOORDS,'rms.'//TRIM(ADJUSTL(ISTR))//'.'//TRIM(ADJUSTL(CRMS)))
 894:         ENDDO
 895:         CLOSE(MYUNIT2)
 896:     !        ENDIF
 897:     ENDIF
 898: 
 899:     IF (LJCOULT) THEN
 900:         OPEN(UNIT=AMHUNIT1,FILE='ljcoul.xyz',STATUS='UNKNOWN')
 901:         DO J1=1,NSAVE
 902:             WRITE(AMHUNIT1,'(I6)') NATOMS
 903:             WRITE(AMHUNIT1,10) J1, QMIN(J1), FF(J1)
 904:             DO J2=1,NATOMS
 905:                 !              Use "O" atom type to highlight charged particles and "N" for the neutral ones.
 906:                 IF (J2.LE.COULN) THEN
 907:                     WRITE(AMHUNIT1,'(A4,3F18.10,A12,3F18.10)') 'O ',&
 908:                     QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3)
 909:                 ELSE
 910:                     WRITE(AMHUNIT1,'(A4,3F18.10,A12,3F18.10)') 'N ',&
 911:                     QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3)
 912:                 END IF
 913:             ENDDO
 914:         ENDDO
 915:         CLOSE(AMHUNIT1)
 916: 
 917: 
 918:     ELSE IF (STOCKT) THEN
 919:         LUNIT=GETUNIT()
 920:         OPEN(UNIT=LUNIT,FILE='stock.xyz',STATUS='UNKNOWN')
 921:         DO J1=1,NSAVE
 922:             WRITE(LUNIT,'(I6)') NATOMS/2
 923:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
 924:             DO J2=1,NATOMS/2
 925:                 WRITE (LUNIT,'(A4,3F18.10,A12,3F18.10)') 'LA ', &
931:                 QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3), &926:                 QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3), &
932:                 'atom_vector', &927:                 'atom_vector', &
933:                 SIN(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+1))*COS(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+2)), &928:                 SIN(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+1))*COS(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+2)), &
934:                 SIN(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+1))*SIN(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+2)), &929:                 SIN(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+1))*SIN(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+2)), &
935:                 COS(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+1))930:                 COS(QMINP(J1,3*(NATOMS/2)+3*(J2-1)+1))
 931:             ENDDO
936:         ENDDO932:         ENDDO
937:      ENDDO933:         CLOSE(LUNIT)
938:      CLOSE(LUNIT)934: 
939:      935:     ELSE IF (ELLIPSOIDT.OR.LJCAPSIDT.OR.GBT.OR.GBDT.OR.PYT) THEN
940:   ELSE IF (ELLIPSOIDT.OR.LJCAPSIDT.OR.GBT.OR.GBDT.OR.PYT) THEN936:         DO J1=1,NSAVE
941:      DO J1=1,NSAVE937:             WRITE(J1CHAR2,'(I3)') J1
942:         WRITE(J1CHAR2,'(I3)') J1938:             IF (MPIT) THEN
 939:                 WRITE (ISTR, '(I10)') MYNODE+1
 940:                 MYUNIT2=GETUNIT()
 941:                 MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))//'.'//trim(adjustl(istr))
 942:                 OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")
 943:             ELSE
 944:                 MYUNIT2=GETUNIT()
 945:                 MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))
 946:                 OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")
 947:             END IF
 948: 
 949:             DO J2=1,NATOMS
 950:                 WRITE(MYUNIT2,'(3F28.20)') QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3)
 951:             ENDDO
 952: 
 953:             CLOSE(MYUNIT2)
 954: 
 955:         ENDDO
 956: !
 957: !  Write out lowest NSAVE structures to xmakemol ellipsoid format for
 958: !  clusters of ellipsoids of revolution
 959: !
 960: 
943:         IF (MPIT) THEN961:         IF (MPIT) THEN
944:            WRITE (ISTR, '(I10)') MYNODE+1962:             WRITE (ISTR, '(I10)') MYNODE+1
945:            MYUNIT2=GETUNIT()963:             MYUNIT2=GETUNIT()
946:            MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))//'.'//trim(adjustl(istr))964:             MYFILENAME2="ellipsoid."//trim(adjustl(istr))//".xyz"
947:            OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")965:             OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")
948:         ELSE966:         ELSE
949:            MYUNIT2=GETUNIT()967:             MYUNIT2=GETUNIT()
950:            MYFILENAME2='coords.'//TRIM(ADJUSTL(J1CHAR2))968:             OPEN(MYUNIT2,FILE='ellipsoid.xyz',STATUS='UNKNOWN')
951:            OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted")969:         ENDIF
952:         END IF970: 
953:         971:         IF(PYT) THEN
954:         DO J2=1,NATOMS972:             CALL PY_OUTPUT(MYUNIT2)
955:            WRITE(MYUNIT2,'(3F28.20)') QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3)973:         ELSE
956:         ENDDO974: 
957:          
958:         CLOSE(MYUNIT2) 
959:          
960:      ENDDO 
961:      ! 
962:      !  Write out lowest NSAVE structures to xmakemol ellipsoid format for 
963:      !  clusters of ellipsoids of revolution 
964:      ! 
965:       
966:      IF (MPIT) THEN 
967:         WRITE (ISTR, '(I10)') MYNODE+1 
968:         MYUNIT2=GETUNIT() 
969:         MYFILENAME2="ellipsoid."//trim(adjustl(istr))//".xyz" 
970:         OPEN(MYUNIT2,FILE=trim(adjustl(MYFILENAME2)), STATUS="unknown", form="formatted") 
971:      ELSE 
972:         MYUNIT2=GETUNIT() 
973:         OPEN(MYUNIT2,FILE='ellipsoid.xyz',STATUS='UNKNOWN') 
974:      ENDIF 
975:       
976:      IF(PYT) THEN 
977:         CALL PY_OUTPUT(MYUNIT2) 
978:      ELSE 
979:          
980:         do J1=1,NSAVE975:         do J1=1,NSAVE
981:            WRITE(MYUNIT2,*) NATOMS/2976:             WRITE(MYUNIT2,*) NATOMS/2
982:            WRITE(MYUNIT2,10) J1, QMIN(J1), FF(J1)977:             WRITE(MYUNIT2,10) J1, QMIN(J1), FF(J1)
983:            978: 
984:            DO J2=1,NATOMS/2979:             DO J2=1,NATOMS/2
985:               980:                
986:               IF (GAYBERNET) THEN981:                 IF (GAYBERNET) THEN
987:                  CALL EllipsoidsAAtoPolar(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&982:                     CALL EllipsoidsAAtoPolar(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&
988:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhi,EulerPsi,EulerTheta,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)983:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhi,EulerPsi,EulerTheta,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)
989:                  !  EulerPhiDeg = 90-EulerPhiDeg    ! EulerPhiDeg returned from EllipsoidsAAtoPolar is in fact the alpha angle984: !  EulerPhiDeg = 90-EulerPhiDeg    ! EulerPhiDeg returned from EllipsoidsAAtoPolar is in fact the alpha angle
990:                  !                                  ! defined by me (angle of vector with the xy plane)985: !                                  ! defined by me (angle of vector with the xy plane)
991:                  WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') '0',QMINP(J1,3*(J2-1)+1),&986:                     WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') '0',QMINP(J1,3*(J2-1)+1),&
992:                       QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&987:                     QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
993:                       'ellipse ',1.0D0,1.0D0,GBANISOTROPYR,&988:                     'ellipse ',1.0D0,1.0D0,GBANISOTROPYR,&
994:                       EulerPsiDeg,EulerPhiDeg,0.0D0,&! this is in degrees989:                     EulerPsiDeg,EulerPhiDeg,0.0D0,&! this is in degrees
995:                       'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&990:                     'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&
996:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)991:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)
997:               ELSE IF (PYGPERIODICT.OR.PYBINARYT) THEN992:                 ELSE IF (PYGPERIODICT.OR.PYBINARYT) THEN
998:                  CALL AAtoEuler(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&993:                     CALL AAtoEuler(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&
999:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)994:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)
1000:                  995: 
1001:                  WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') 'O',QMINP(J1,3*(J2-1)+1),&996:                     WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') 'O',QMINP(J1,3*(J2-1)+1),&
1002:                       QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&997:                     QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
1003:                       'ellipse ',PYA1BIN(J2,1)*2.0D0,PYA1BIN(J2,2)*2.0D0,PYA1BIN(J2,3)*2.0D0,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg,&998:                     'ellipse ',PYA1BIN(J2,1)*2.0D0,PYA1BIN(J2,2)*2.0D0,PYA1BIN(J2,3)*2.0D0,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg,&
1004:                       'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&999:                     'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&
1005:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)1000:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)
1006:               ELSE IF (GBT.OR.GBDT) THEN1001:                 ELSE IF (GBT.OR.GBDT) THEN
1007:                  CALL AAtoEuler(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&1002:                     CALL AAtoEuler(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&
1008:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)1003:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)
1009:                  1004: 
1010:                  WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') 'O',QMINP(J1,3*(J2-1)+1),&1005:                     WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') 'O',QMINP(J1,3*(J2-1)+1),&
1011:                       QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&1006:                     QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
1012:                       'ellipse ',GBKAPPA,1.0D0,1.0D0,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg,&1007:                     'ellipse ',GBKAPPA,1.0D0,1.0D0,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg,&
1013:                       'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&1008:                     'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&
1014:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)1009:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)
1015:               ELSE IF (LJCAPSIDT) THEN1010:                 ELSE IF (LJCAPSIDT) THEN
1016:                  CALL AAtoEuler(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&1011:                     CALL AAtoEuler(QMINP(J1,3*NATOMS/2+3*(J2-1)+1),QMINP(J1,3*NATOMS/2+3*(J2-1)+2),&
1017:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)1012:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+3),EulerPhiDeg,EulerPsiDeg,EulerThetaDeg)
1018:                  1013: 
1019:                  WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') 'O',QMINP(J1,3*(J2-1)+1),&1014:                     WRITE(MYUNIT2,'(a5,2x,3f20.10,2x,a8,6f15.8,2x,a11,3f15.8)') 'O',QMINP(J1,3*(J2-1)+1),&
1020:                       QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&1015:                     QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
1021:                       'ellipse ',1.0D0,1.0D0,1.0D0,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg,&1016:                     'ellipse ',1.0D0,1.0D0,1.0D0,EulerPhiDeg,EulerPsiDeg,EulerThetaDeg,&
1022:                       'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&1017:                     'atom_vector',QMINP(J1,3*NATOMS/2+3*(J2-1)+1),&
1023:                       QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)1018:                     QMINP(J1,3*NATOMS/2+3*(J2-1)+2),QMINP(J1,3*NATOMS/2+3*(J2-1)+3)
1024:               ENDIF1019:                 ENDIF
1025:            ENDDO1020:             ENDDO
1026:         ENDDO1021:         ENDDO
1027:         1022: 
1028:      ENDIF ! PYT1023:         ENDIF ! PYT
1029:      1024: 
1030:      CLOSE(MYUNIT2)1025:         CLOSE(MYUNIT2)
1031:      1026: 
1032:   ELSE IF (TIP) THEN1027:     ELSE IF (TIP) THEN
1033:      LUNIT=GETUNIT()1028:         LUNIT=GETUNIT()
1034:      OPEN(UNIT=LUNIT,FILE='tip.xyz',STATUS='UNKNOWN')1029:         OPEN(UNIT=LUNIT,FILE='tip.xyz',STATUS='UNKNOWN')
1035:      DO J1=1,NSAVE1030:         DO J1=1,NSAVE
1036:         WRITE(LUNIT,'(I6)') (NATOMS/2)*31031:             WRITE(LUNIT,'(I6)') (NATOMS/2)*3
1037:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1032:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1038:         DO J2=1,NATOMS/21033:             DO J2=1,NATOMS/2
1039:            CALL TIPIO(QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&1034:                 CALL TIPIO(QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
1040:                 QMINP(J1,3*(NATOMS/2+J2-1)+1),QMINP(J1,3*(NATOMS/2+J2-1)+2),QMINP(J1,3*(NATOMS/2+J2-1)+3),&1035:                 QMINP(J1,3*(NATOMS/2+J2-1)+1),QMINP(J1,3*(NATOMS/2+J2-1)+2),QMINP(J1,3*(NATOMS/2+J2-1)+3),&
1041:                 RBCOORDS)1036:                 RBCOORDS)
1042:            WRITE(LUNIT,'(A4,3F20.10)') 'O ',RBCOORDS(1),RBCOORDS(2),RBCOORDS(3)1037:                 WRITE(LUNIT,'(A4,3F20.10)') 'O ',RBCOORDS(1),RBCOORDS(2),RBCOORDS(3)
1043:            WRITE(LUNIT,'(A4,3F20.10)') 'H ',RBCOORDS(4),RBCOORDS(5),RBCOORDS(6)1038:                 WRITE(LUNIT,'(A4,3F20.10)') 'H ',RBCOORDS(4),RBCOORDS(5),RBCOORDS(6)
1044:            WRITE(LUNIT,'(A4,3F20.10)') 'H ',RBCOORDS(7),RBCOORDS(8),RBCOORDS(9)1039:                 WRITE(LUNIT,'(A4,3F20.10)') 'H ',RBCOORDS(7),RBCOORDS(8),RBCOORDS(9)
 1040:             ENDDO
1045:         ENDDO1041:         ENDDO
1046:      ENDDO1042:         CLOSE(LUNIT)
1047:      CLOSE(LUNIT)1043:     ELSE IF (CAPSID) THEN
1048:   ELSE IF (CAPSID) THEN1044:         LUNIT=GETUNIT()
1049:      LUNIT=GETUNIT()1045:         OPEN(UNIT=LUNIT,FILE='capsid.xyz',STATUS='UNKNOWN')
1050:      OPEN(UNIT=LUNIT,FILE='capsid.xyz',STATUS='UNKNOWN')1046:         DO J1=1,NSAVE
1051:      DO J1=1,NSAVE1047:             WRITE(LUNIT,'(I6)') (NATOMS/2)*6
1052:         WRITE(LUNIT,'(I6)') (NATOMS/2)*61048:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1053:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1049:             DO J2=1,NATOMS/2
1054:         DO J2=1,NATOMS/21050:                 CALL CAPSIDIO(QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
1055:            CALL CAPSIDIO(QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),& 
1056:                 QMINP(J1,3*(NATOMS/2+J2-1)+1),QMINP(J1,3*(NATOMS/2+J2-1)+2),QMINP(J1,3*(NATOMS/2+J2-1)+3),&1051:                 QMINP(J1,3*(NATOMS/2+J2-1)+1),QMINP(J1,3*(NATOMS/2+J2-1)+2),QMINP(J1,3*(NATOMS/2+J2-1)+3),&
1057:                 RBCOORDS,RAD,HEIGHT)1052:                 RBCOORDS,RAD,HEIGHT)
1058:            DO J3=1,51053:                 DO J3=1,5
1059:               WRITE(LUNIT,'(A4,3F20.10)') 'C1 ',RBCOORDS(3*(J3-1)+1),RBCOORDS(3*(J3-1)+2),RBCOORDS(3*(J3-1)+3)1054:                     WRITE(LUNIT,'(A4,3F20.10)') 'C1 ',RBCOORDS(3*(J3-1)+1),RBCOORDS(3*(J3-1)+2),RBCOORDS(3*(J3-1)+3)
1060:            ENDDO1055:                 ENDDO
1061:            WRITE(LUNIT,'(A4,3F20.10)') 'C4  ',RBCOORDS(16),RBCOORDS(17),RBCOORDS(18)1056:                 WRITE(LUNIT,'(A4,3F20.10)') 'C4  ',RBCOORDS(16),RBCOORDS(17),RBCOORDS(18)
 1057:             ENDDO
1062:         ENDDO1058:         ENDDO
1063:      ENDDO1059:         CLOSE(LUNIT)
1064:      CLOSE(LUNIT)1060: 
1065:      1061:     ELSE IF (DBPT .OR. DMBLPYT) THEN
1066:   ELSE IF (DBPT .OR. DMBLPYT) THEN1062: 
1067:      1063:         LUNIT=GETUNIT()
1068:      LUNIT=GETUNIT()1064:         IF (DBPT) OPEN(UNIT=LUNIT, FILE='dbp.xyz', STATUS='UNKNOWN')
1069:      IF (DBPT) OPEN(UNIT=LUNIT, FILE='dbp.xyz', STATUS='UNKNOWN')1065:         IF (DMBLPYT) OPEN(UNIT=LUNIT, FILE='dmblpy.xyz', STATUS='UNKNOWN')
1070:      IF (DMBLPYT) OPEN(UNIT=LUNIT, FILE='dmblpy.xyz', STATUS='UNKNOWN')1066: 
1071:      1067:         GTEST = .FALSE.
1072:      GTEST = .FALSE.1068:         DU    = (/0.D0, 1.D0, 0.D0/)
1073:      DU    = (/0.D0, 1.D0, 0.D0/)1069:         DO J1 = 1, NSAVE
1074:      DO J1 = 1, NSAVE1070: 
1075:                 1071:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES 
1076:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES 1072:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1077:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1073: 
1078:         1074:             DO J2 = 1, NATOMS/2
1079:         DO J2 = 1, NATOMS/21075: 
1080:            1076:                 J3   = 3*J2
1081:            J3   = 3*J21077:                 J5   = 3*NATOMS/2 + J3
1082:            J5   = 3*NATOMS/2 + J31078:                 P(:) = QMINP(J1,J5-2:J5)
1083:            P(:) = QMINP(J1,J5-2:J5)1079: 
1084:            1080:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1085:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1081: 
1086:            1082:                 DO J4 = 1, NRBSITES
1087:            DO J4 = 1, NRBSITES1083: 
1088:               1084:                     IF (J4 == 1) THEN
1089:               IF (J4 == 1) THEN1085:                         RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
1090:                  RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1086:                         WRITE(LUNIT,'(A4,3F20.10)') 'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
1091:                  WRITE(LUNIT,'(A4,3F20.10)') 'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1087:                     ELSEIF (J4 == 2) THEN
1092:               ELSEIF (J4 == 2) THEN1088:                         RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
1093:                  RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1089:                         WRITE(LUNIT,'(A4,3F20.10)') 'C', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
1094:                  WRITE(LUNIT,'(A4,3F20.10)') 'C', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1090:                     ELSE
1095:               ELSE1091:                         RBCOORDS(1:3) = MATMUL(RMI(:,:),DU)
1096:                  RBCOORDS(1:3) = MATMUL(RMI(:,:),DU)1092:                         WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
1097:                  WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&1093:                         'H', QMINP(J1,J3-2), QMINP(J1,J3-1), QMINP(J1,J3),&
1098:                       'H', QMINP(J1,J3-2), QMINP(J1,J3-1), QMINP(J1,J3),&1094:                         'atom_vector', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
1099:                       'atom_vector', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1095:                     ENDIF
1100:               ENDIF1096: 
1101:               1097:                 ENDDO
1102:            ENDDO1098: 
1103:            1099:             ENDDO
 1100: 
1104:         ENDDO1101:         ENDDO
1105:         1102:         CLOSE(LUNIT)
1106:      ENDDO1103: 
1107:      CLOSE(LUNIT)1104:         RETURN
1108:      1105: 
1109:      RETURN1106:     ELSE IF (DBPTDT) THEN
1110:      1107: 
1111:   ELSE IF (DBPTDT) THEN1108:         CALL VIEWDMBLTD()
1112:      1109:         RETURN
1113:      CALL VIEWDMBLTD()1110: 
1114:      RETURN1111:     ELSE IF (DMBLMT) THEN
1115:      1112: 
1116:   ELSE IF (DMBLMT) THEN1113:         CALL VIEWDMBL()
1117:      1114:         RETURN
1118:      CALL VIEWDMBL()1115: 
1119:      RETURN1116:     ELSE IF (GBT .OR. GBDT) THEN
1120:      1117: 
1121:   ELSE IF (GBT .OR. GBDT) THEN1118:         LUNIT=GETUNIT()
1122:      1119:         OPEN(UNIT=LUNIT, FILE='gbe.xyz', STATUS='UNKNOWN')
1123:      LUNIT=GETUNIT()1120:         GTEST = .FALSE.
1124:      OPEN(UNIT=LUNIT, FILE='gbe.xyz', STATUS='UNKNOWN')1121:         DO J1 = 1, NSAVE
1125:      GTEST = .FALSE.1122: 
1126:      DO J1 = 1, NSAVE1123:             WRITE(LUNIT,'(I6)') NATOMS/2
1127:         1124:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1128:         WRITE(LUNIT,'(I6)') NATOMS/21125: 
1129:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1126:             DO J2 = 1, NATOMS/2
1130:         1127: 
1131:         DO J2 = 1, NATOMS/21128:                 J3   = 3*J2
1132:            1129:                 J5   = 3*NATOMS/2 + J3
1133:            J3   = 3*J21130:                 RBCOORDS(1:3) = QMINP(J1,J3-2:J3)
1134:            J5   = 3*NATOMS/2 + J31131:                 P(:)          = QMINP(J1,J5-2:J5)
1135:            RBCOORDS(1:3) = QMINP(J1,J3-2:J3)1132: 
1136:            P(:)          = QMINP(J1,J5-2:J5)1133:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1137:            1134: 
1138:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1135:                 PHI   = DATAN2(RMI(2,3),RMI(1,3))
1139:            1136:                 IF (PHI <= 0.D0) PHI = PHI + 2.D0*PI
1140:            PHI   = DATAN2(RMI(2,3),RMI(1,3))1137: 
1141:            IF (PHI <= 0.D0) PHI = PHI + 2.D0*PI1138:                 THT   = DACOS(RMI(3,3))
1142:            1139: 
1143:            THT   = DACOS(RMI(3,3))1140:                 PHI   = PHI*180.D0/PI
1144:            1141:                 THT   = THT*180.D0/PI
1145:            PHI   = PHI*180.D0/PI1142: 
1146:            THT   = THT*180.D0/PI1143:                 WRITE(LUNIT,'(a5,2x,3f20.10,2x,a8,6f20.10)')&
1147:             
1148:            WRITE(LUNIT,'(a5,2x,3f20.10,2x,a8,6f20.10)')& 
1149:                 'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3),&1144:                 'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3),&
1150:                 'ellipse', 2.D0*ESA(1), 2.D0*ESA(2), 2.D0*ESA(3), PHI, THT, 0.D01145:                 'ellipse', 2.D0*ESA(1), 2.D0*ESA(2), 2.D0*ESA(3), PHI, THT, 0.D0
1151:            1146: 
1152:         ENDDO1147:             ENDDO
1153:         1148: 
1154:      ENDDO 
1155:       
1156:      RETURN 
1157:       
1158:   ELSE IF (LINRODT) THEN 
1159:       
1160:      LUNIT=GETUNIT() 
1161:      OPEN(UNIT=LUNIT, FILE='linrod.xyz', STATUS='UNKNOWN') 
1162:      GTEST = .FALSE. 
1163:       
1164:      DO J1 = 1, NSAVE 
1165:          
1166:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES 
1167:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1) 
1168:          
1169:         DO J2 = 1, NATOMS/2 
1170:             
1171:            J3    = 3*J2 
1172:            J5    = 3*NATOMS/2 + J3 
1173:            P(:)  = QMINP(J1,J5-2:J5) 
1174:             
1175:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST) 
1176:             
1177:             
1178:            DO J4 = 1, NRBSITES 
1179:                
1180:               RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:)) 
1181:                
1182:            ENDDO 
1183:             
1184:            DO J4 = 1, NRBSITES 
1185:                
1186:               J3 = J4 + 1 
1187:               IF (J4 == NRBSITES) J3 = 1 
1188:               P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4) 
1189:               WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')& 
1190:                    'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3) 
1191:                
1192:            ENDDO 
1193:             
1194:         ENDDO1149:         ENDDO
1195:         1150: 
1196:      ENDDO1151:         RETURN
1197:      1152: 
1198:      CLOSE(UNIT=LUNIT)1153:     ELSE IF (LINRODT) THEN
1199:      1154: 
1200:      RETURN1155:         LUNIT=GETUNIT()
1201:      1156:         OPEN(UNIT=LUNIT, FILE='linrod.xyz', STATUS='UNKNOWN')
1202:   ELSE IF (LWOTPT) THEN1157:         GTEST = .FALSE.
1203:      1158: 
1204:      LUNIT=GETUNIT()1159:         DO J1 = 1, NSAVE
1205:      OPEN(UNIT=LUNIT, FILE='lwotp.xyz', STATUS='UNKNOWN')1160: 
1206:      GTEST = .FALSE.1161:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES
1207:      1162:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1208:      DO J1 = 1, NSAVE1163: 
1209:         1164:             DO J2 = 1, NATOMS/2
1210:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES1165: 
1211:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1166:                 J3    = 3*J2
1212:         1167:                 J5    = 3*NATOMS/2 + J3
1213:         DO J2 = 1, NATOMS/21168:                 P(:)  = QMINP(J1,J5-2:J5)
1214:            1169: 
1215:            J3    = 3*J21170:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1216:            J5    = 3*NATOMS/2 + J31171: 
1217:            P(:)  = QMINP(J1,J5-2:J5)1172: 
1218:            1173:                 DO J4 = 1, NRBSITES
1219:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1174: 
1220:            1175:                     RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
1221:            1176: 
1222:            DO J4 = 1, NRBSITES1177:                 ENDDO
1223:               1178: 
1224:               RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1179:                 DO J4 = 1, NRBSITES
1225:               1180: 
1226:            ENDDO1181:                     J3 = J4 + 1
1227:            1182:                     IF (J4 == NRBSITES) J3 = 1
1228:            DO J4 = 1, NRBSITES1183:                     P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4)
1229:               1184:                     WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
1230:               J3 = J4 + 11185:                     'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3)
1231:               IF (J4 == NRBSITES) J3 = 11186: 
1232:               P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4)1187:                 ENDDO
1233:               WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&1188: 
1234:                    'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3)1189:             ENDDO
1235:               1190: 
1236:            ENDDO 
1237:             
1238:         ENDDO1191:         ENDDO
1239:         1192: 
1240:      ENDDO1193:         CLOSE(UNIT=LUNIT)
1241:      1194: 
1242:      CLOSE(UNIT=LUNIT)1195:         RETURN
1243:      1196: 
1244:      RETURN1197:     ELSE IF (LWOTPT) THEN
1245:      1198: 
1246:   ELSE IF (MSTBINT) THEN1199:         LUNIT=GETUNIT()
1247:      1200:         OPEN(UNIT=LUNIT, FILE='lwotp.xyz', STATUS='UNKNOWN')
1248:      LUNIT=GETUNIT()1201:         GTEST = .FALSE.
1249:      OPEN(UNIT=LUNIT, FILE='mstbin.xyz', STATUS='UNKNOWN')1202:          
1250:      GTEST = .FALSE.1203:         DO J1 = 1, NSAVE
1251:      1204: 
1252:      DO J1 = 1, NSAVE1205:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES
1253:         1206:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1254:         WRITE(LUNIT,'(I6)') NPS*NRBSITES1 + (NATOMS/2 - NPS)*(NRBSITES - NRBSITES1)1207: 
1255:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1208:             DO J2 = 1, NATOMS/2
1256:         1209: 
1257:         DO J2 = 1, NATOMS/21210:                 J3    = 3*J2
1258:            1211:                 J5    = 3*NATOMS/2 + J3
1259:            J3    = 3*J21212:                 P(:)  = QMINP(J1,J5-2:J5)
1260:            J5    = 3*NATOMS/2 + J31213: 
1261:            P(:)  = QMINP(J1,J5-2:J5)1214:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1262:            1215: 
1263:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1216: 
1264:            1217:                 DO J4 = 1, NRBSITES
1265:            IF (J2 <= NPS) THEN1218: 
1266:               NRBS1 = 11219:                     RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
1267:               NRBS2 = NRBSITES11220: 
1268:            ELSE1221:                 ENDDO
1269:               NRBS1 = NRBSITES1 + 11222: 
1270:               NRBS2 = NRBSITES1223:                 DO J4 = 1, NRBSITES
1271:            ENDIF1224: 
1272:            1225:                     J3 = J4 + 1
1273:            DO J4 = NRBS1, NRBS21226:                     IF (J4 == NRBSITES) J3 = 1
1274:               1227:                     P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4)
1275:               RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1228:                     WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
1276:               1229:                     'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3)
1277:            ENDDO1230: 
1278:            1231:                 ENDDO
1279:            DO J4 = NRBS1, NRBS21232: 
1280:               1233:             ENDDO
1281:               J3 = J4 + 11234: 
1282:                
1283:               IF (J2 <= NPS) THEN 
1284:                  IF (J4 == NRBSITES1) J3 = 1 
1285:               ELSE 
1286:                  IF (J4 == NRBSITES) J3 = NRBSITES1 + 1 
1287:               ENDIF 
1288:                
1289:               P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4) 
1290:               IF (J2 <= NPS) THEN 
1291:                  WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')& 
1292:                       'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3) 
1293:               ELSE 
1294:                  WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')& 
1295:                       'N', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3) 
1296:               ENDIF 
1297:                
1298:            ENDDO 
1299:             
1300:         ENDDO1235:         ENDDO
1301:         1236: 
1302:      ENDDO1237:         CLOSE(UNIT=LUNIT)
1303:      1238: 
1304:      CLOSE(UNIT=LUNIT)1239:         RETURN
1305:      1240: 
1306:      RETURN1241:     ELSE IF (MSTBINT) THEN
1307:      1242: 
1308:   ELSE IF (MSSTOCKT) THEN1243:         LUNIT=GETUNIT()
1309:      1244:         OPEN(UNIT=LUNIT, FILE='mstbin.xyz', STATUS='UNKNOWN')
1310:      LUNIT=GETUNIT()1245:         GTEST = .FALSE.
1311:      OPEN(UNIT=LUNIT, FILE='msstock.xyz', STATUS='UNKNOWN')1246: 
1312:      GTEST = .FALSE.1247:         DO J1 = 1, NSAVE
1313:      1248: 
1314:      DO J1 = 1, NSAVE1249:             WRITE(LUNIT,'(I6)') NPS*NRBSITES1 + (NATOMS/2 - NPS)*(NRBSITES - NRBSITES1)
1315:         1250:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1316:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES1251: 
1317:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1252:             DO J2 = 1, NATOMS/2
1318:         1253: 
1319:         DO J2 = 1, NATOMS/21254:                 J3    = 3*J2
1320:            1255:                 J5    = 3*NATOMS/2 + J3
1321:            J3   = 3*J21256:                 P(:)  = QMINP(J1,J5-2:J5)
1322:            J5   = 3*NATOMS/2 + J31257: 
1323:            P(:) = QMINP(J1,J5-2:J5)1258:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1324:            1259: 
1325:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1260:                 IF (J2 <= NPS) THEN
1326:            1261:                     NRBS1 = 1
1327:            DO J4 = 1, NRBSITES1262:                     NRBS2 = NRBSITES1
1328:               1263:                 ELSE
1329:               RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1264:                     NRBS1 = NRBSITES1 + 1
1330:               P(:)          = MATMUL(RMI(:,:),RBUV(J4,:))1265:                     NRBS2 = NRBSITES
1331:               WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&1266:                 ENDIF
1332:                    'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3), 'atom_vector', P(1), P(2), P(3)1267: 
1333:               1268:                 DO J4 = NRBS1, NRBS2
1334:            ENDDO1269: 
1335:            1270:                     RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
 1271: 
 1272:                 ENDDO
 1273: 
 1274:                 DO J4 = NRBS1, NRBS2
 1275: 
 1276:                     J3 = J4 + 1
 1277:                  
 1278:                     IF (J2 <= NPS) THEN
 1279:                         IF (J4 == NRBSITES1) J3 = 1
 1280:                     ELSE
 1281:                         IF (J4 == NRBSITES) J3 = NRBSITES1 + 1
 1282:                     ENDIF
 1283:  
 1284:                     P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4)
 1285:                     IF (J2 <= NPS) THEN
 1286:                         WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
 1287:                         'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3)
 1288:                     ELSE
 1289:                         WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
 1290:                         'N', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3)
 1291:                     ENDIF
 1292: 
 1293:                 ENDDO
 1294: 
 1295:             ENDDO
 1296: 
1336:         ENDDO1297:         ENDDO
1337:         1298: 
1338:      ENDDO1299:         CLOSE(UNIT=LUNIT)
1339:      1300: 
1340:      CLOSE(UNIT=LUNIT)1301:         RETURN
1341:      1302: 
1342:      LUNIT=GETUNIT()1303:     ELSE IF (MSSTOCKT) THEN
1343:      OPEN(UNIT=LUNIT, FILE='msstktr.xyz', STATUS='UNKNOWN')1304: 
1344:      GTEST = .FALSE.1305:         LUNIT=GETUNIT()
1345:      1306:         OPEN(UNIT=LUNIT, FILE='msstock.xyz', STATUS='UNKNOWN')
1346:      DO J1 = 1, NSAVE1307:         GTEST = .FALSE.
1347:         1308:          
1348:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES !(NRBSITES - 1)1309:         DO J1 = 1, NSAVE
1349:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1310: 
1350:         1311:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES
1351:         DO J2 = 1, NATOMS/21312:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1352:            1313: 
1353:            J3    = 3*J21314:             DO J2 = 1, NATOMS/2
1354:            J5    = 3*NATOMS/2 + J31315: 
1355:            P(:)  = QMINP(J1,J5-2:J5)1316:                 J3   = 3*J2
1356:            1317:                 J5   = 3*NATOMS/2 + J3
1357:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1318:                 P(:) = QMINP(J1,J5-2:J5)
1358:            1319: 
1359:            DO J4 = 1, NRBSITES1320:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1360:               1321: 
1361:               RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1322:                 DO J4 = 1, NRBSITES
1362:               1323: 
1363:            ENDDO1324:                     RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
1364:            1325:                     P(:)          = MATMUL(RMI(:,:),RBUV(J4,:))
1365:            DO J4 = 1, NRBSITES !- 11326:                     WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
1366:               1327:                     'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3), 'atom_vector', P(1), P(2), P(3)
1367:               J3 = J4 + 11328: 
1368:               IF (J4 == NRBSITES) J3 = 11329:                 ENDDO
1369:               !                  IF (J4 == NRBSITES - 1) J3 = 11330: 
1370:               P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4)1331:             ENDDO
1371:               WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&1332: 
1372:                    'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3) 
1373:                
1374:            ENDDO 
1375:             
1376:         ENDDO1333:         ENDDO
1377:         1334: 
1378:      ENDDO1335:         CLOSE(UNIT=LUNIT)
1379:      1336: 
1380:      CLOSE(UNIT=LUNIT)1337:         LUNIT=GETUNIT()
1381:      1338:         OPEN(UNIT=LUNIT, FILE='msstktr.xyz', STATUS='UNKNOWN')
1382:      RETURN1339:         GTEST = .FALSE.
1383:      1340: 
1384:   ELSE IF (MULTPAHAT) THEN1341:         DO J1 = 1, NSAVE
1385:      1342: 
1386:      CALL VIEWMULTPAHA()1343:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES !(NRBSITES - 1)
1387:      RETURN1344:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1388:      1345: 
1389:   ELSE IF (NPAHT .OR. PAHAT .OR. PAHW99T) THEN1346:             DO J2 = 1, NATOMS/2
1390:      1347: 
1391:      LUNIT=GETUNIT()1348:                 J3    = 3*J2
1392:      OPEN(UNIT=LUNIT, FILE='rigid.xyz', STATUS='UNKNOWN')1349:                 J5    = 3*NATOMS/2 + J3
1393:      GTEST = .FALSE.1350:                 P(:)  = QMINP(J1,J5-2:J5)
1394:      1351: 
1395:      IF (PAHW99T) THEN1352:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1396:         NCPHST = NCARBON + (NRBSITES-NCARBON)/21353: 
1397:         DO J1 = 1, (NCPHST-NCARBON) 1354:                 DO J4 = 1, NRBSITES
1398:            SITE(NCARBON+J1,:) = SITE(NCPHST+J1,:)1355: 
 1356:                     RBCOORDS(3*J4-2:3*J4) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
 1357: 
 1358:                 ENDDO
 1359: 
 1360:                 DO J4 = 1, NRBSITES !- 1
 1361: 
 1362:                     J3 = J4 + 1
 1363:                     IF (J4 == NRBSITES) J3 = 1
 1364:                     !                  IF (J4 == NRBSITES - 1) J3 = 1
 1365:                     P(:) = RBCOORDS(3*J3-2:3*J3) - RBCOORDS(3*J4-2:3*J4)
 1366:                     WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)')&
 1367:                     'O', RBCOORDS(3*J4-2), RBCOORDS(3*J4-1), RBCOORDS(3*J4), 'atom_vector', P(1), P(2), P(3)
 1368: 
 1369:                 ENDDO
 1370: 
 1371:             ENDDO
 1372: 
1399:         ENDDO1373:         ENDDO
1400:      ELSE1374: 
1401:         NCPHST = NRBSITES1375:         CLOSE(UNIT=LUNIT)
1402:      ENDIF1376: 
1403:      1377:         RETURN
1404:      DO J1 = 1, NSAVE1378: 
1405:         1379:     ELSE IF (MULTPAHAT) THEN
1406:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES1380: 
1407:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1381:         CALL VIEWMULTPAHA()
1408:         1382:         RETURN
1409:         DO J2 = 1, NATOMS/21383: 
1410:            1384:     ELSE IF (NPAHT .OR. PAHAT .OR. PAHW99T) THEN
1411:            J3   = 3*J21385: 
1412:            J5   = 3*NATOMS/2 + J31386:         LUNIT=GETUNIT()
1413:            P(:) = QMINP(J1,J5-2:J5)1387:         OPEN(UNIT=LUNIT, FILE='rigid.xyz', STATUS='UNKNOWN')
1414:            1388:         GTEST = .FALSE.
1415:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1389: 
1416:            1390:         IF (PAHW99T) THEN
1417:            DO J4 = 1, NCPHST1391:             NCPHST = NCARBON + (NRBSITES-NCARBON)/2
1418:               1392:             DO J1 = 1, (NCPHST-NCARBON) 
1419:               RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1393:                 SITE(NCARBON+J1,:) = SITE(NCPHST+J1,:)
1420:               IF (J4 <= NCARBON) THEN1394:             ENDDO
1421:                  WRITE(LUNIT,'(A4,3F20.10)') 'C', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1395:         ELSE
1422:               ELSE1396:             NCPHST = NRBSITES
1423:                  WRITE(LUNIT,'(A4,3F20.10)') 'H', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1397:         ENDIF
1424:               ENDIF1398: 
1425:               1399:         DO J1 = 1, NSAVE
1426:            ENDDO1400: 
1427:            1401:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES
 1402:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
 1403: 
 1404:             DO J2 = 1, NATOMS/2
 1405: 
 1406:                 J3   = 3*J2
 1407:                 J5   = 3*NATOMS/2 + J3
 1408:                 P(:) = QMINP(J1,J5-2:J5)
 1409: 
 1410:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
 1411: 
 1412:                 DO J4 = 1, NCPHST
 1413: 
 1414:                     RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
 1415:                     IF (J4 <= NCARBON) THEN
 1416:                         WRITE(LUNIT,'(A4,3F20.10)') 'C', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
 1417:                     ELSE
 1418:                         WRITE(LUNIT,'(A4,3F20.10)') 'H', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
 1419:                     ENDIF
 1420: 
 1421:                 ENDDO
 1422: 
 1423:             ENDDO
 1424: 
1428:         ENDDO1425:         ENDDO
1429:         1426: 
1430:      ENDDO1427:         RETURN
1431:      1428:     ELSE IF (CAPBINT) THEN
1432:      RETURN1429:         CALL VIEWCAPBIN()
1433:   ELSE IF (CAPBINT) THEN1430:         RETURN
1434:      CALL VIEWCAPBIN()1431: 
1435:      RETURN1432:     ELSE IF (NCAPT) THEN
1436:      1433: 
1437:   ELSE IF (NCAPT) THEN1434:         CALL VIEWNEWCAPSID()
1438:      1435:         RETURN
1439:      CALL VIEWNEWCAPSID()1436: 
1440:      RETURN1437:     ELSE IF (NTIPT) THEN
1441:      1438: 
1442:   ELSE IF (NTIPT) THEN1439:         CALL VIEWNEWTIP()
1443:      1440:         RETURN
1444:      CALL VIEWNEWTIP()1441: 
1445:      RETURN1442:     ELSE IF (MWFILMT) THEN
1446:      1443: 
1447:   ELSE IF (MWFILMT) THEN1444:         CALL MWDRAW(NATOMS, PERIODIC, LAT)
1448:      1445:         RETURN
1449:      CALL MWDRAW(NATOMS, PERIODIC, LAT)1446: 
1450:      RETURN1447:     ELSE IF (PAPT) THEN
1451:      1448: 
1452:   ELSE IF (PAPT) THEN1449:         CALL VIEWPAP()
1453:      1450:         RETURN
1454:      CALL VIEWPAP()1451: 
1455:      RETURN1452:     ELSE IF (PAPBINT) THEN
1456:      1453: 
1457:   ELSE IF (PAPBINT) THEN1454:         CALL VIEWPAPBIN()
1458:      1455:         RETURN
1459:      CALL VIEWPAPBIN()1456: 
1460:      RETURN1457:     ELSE IF (PAPJANT) THEN
1461:      1458: 
1462:   ELSE IF (PAPJANT) THEN1459:         CALL VIEWPAPJANUS()
1463:      1460:         RETURN
1464:      CALL VIEWPAPJANUS()1461: 
1465:      RETURN1462:     ELSE IF (PTSTSTT) THEN
1466:      1463: 
1467:   ELSE IF (PTSTSTT) THEN1464:         CALL VIEWPTSTST()
1468:      1465:         RETURN
1469:      CALL VIEWPTSTST()1466: 
1470:      RETURN1467:     !|gd351>
1471:      1468: 
1472:      !|gd351>1469:     ELSE IF (PATCHY) THEN
1473:      1470: 
1474:   ELSE IF (PATCHY) THEN1471:         CALL VIEWPATCHY()
1475:      1472:         RETURN
1476:      CALL VIEWPATCHY()1473: 
1477:      RETURN1474:     !<gd351|
1478:      1475:     ELSE IF (SANDBOXT) THEN
1479:      !<gd351|1476: 
1480:   ELSE IF (SANDBOXT) THEN1477:         CALL SANDBOX_OUTPUT()
1481:      1478: 
1482:      CALL SANDBOX_OUTPUT()1479:     ELSE IF (SILANET) THEN
1483:      1480: 
1484:   ELSE IF (SILANET) THEN1481:         CALL VIEWSILANE()
1485:      1482:         RETURN
1486:      CALL VIEWSILANE()1483: 
1487:      RETURN1484:     ELSE IF (STOCKAAT .OR. MORSEDPT) THEN
1488:      1485: 
1489:   ELSE IF (STOCKAAT .OR. MORSEDPT) THEN1486:         LUNIT=GETUNIT()
1490:      1487:         IF (STOCKAAT) OPEN(UNIT=LUNIT, FILE='stockaa.xyz', STATUS='UNKNOWN')
1491:      LUNIT=GETUNIT()1488:         IF (MORSEDPT) OPEN(UNIT=LUNIT, FILE='morsedp.xyz', STATUS='UNKNOWN')
1492:      IF (STOCKAAT) OPEN(UNIT=LUNIT, FILE='stockaa.xyz', STATUS='UNKNOWN')1489:         GTEST = .FALSE.
1493:      IF (MORSEDPT) OPEN(UNIT=LUNIT, FILE='morsedp.xyz', STATUS='UNKNOWN')1490:         DU    = (/0.D0, 0.D0, 1.D0/)
1494:      GTEST = .FALSE.1491: 
1495:      DU    = (/0.D0, 0.D0, 1.D0/)1492:         DO J1 = 1, NSAVE
1496:      1493: 
1497:      DO J1 = 1, NSAVE1494:             WRITE(LUNIT,'(I6)') NATOMS/2
1498:         1495:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1499:         WRITE(LUNIT,'(I6)') NATOMS/21496: 
1500:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1497:             DO J2 = 1, NATOMS/2
1501:         1498: 
1502:         DO J2 = 1, NATOMS/21499:                 J3   = 3*J2
1503:                1500:                 J5   = 3*NATOMS/2 + J3
1504:            J3   = 3*J21501:                 P(:) = QMINP(J1,J5-2:J5)
1505:            J5   = 3*NATOMS/2 + J31502: 
1506:            P(:) = QMINP(J1,J5-2:J5)1503:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1507:            1504: 
1508:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1505:                 RBCOORDS(1:3) = MATMUL(RMI(:,:),DU(:))
1509:            1506:                 WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)') 'O', QMINP(J1,J3-2), QMINP(J1,J3-1), QMINP(J1,J3),&
1510:            RBCOORDS(1:3) = MATMUL(RMI(:,:),DU(:))1507:                 'atom_vector', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
1511:            WRITE(LUNIT,'(A4,3F20.10,2X,A12,2X,3F20.10)') 'O', QMINP(J1,J3-2), QMINP(J1,J3-1), QMINP(J1,J3),&1508: 
1512:                     'atom_vector', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1509: 
1513:            1510:             ENDDO
1514:            1511: 
1515:         ENDDO1512:         ENDDO
1516:         1513: 
1517:      ENDDO1514:         CLOSE (UNIT=LUNIT)
1518:      1515: 
1519:      CLOSE (UNIT=LUNIT)1516:         RETURN
1520:          1517: 
1521:      RETURN1518:     ELSE IF (TDHDT) THEN
1522:      1519: 
1523:   ELSE IF (TDHDT) THEN1520:         CALL VIEWTDHD()
1524:      1521:         RETURN
1525:      CALL VIEWTDHD()1522: 
1526:      RETURN1523:     ELSE IF (DDMT) THEN
1527:      1524: 
1528:   ELSE IF (DDMT) THEN1525:         CALL VIEWDDM()
1529:          1526:         RETURN
1530:      CALL VIEWDDM()1527: 
1531:      RETURN1528:     ELSE IF (WATERDCT .OR. WATERKZT) THEN
1532:      1529: 
1533:   ELSE IF (WATERDCT .OR. WATERKZT) THEN1530:         LUNIT=GETUNIT()
1534:      1531:         OPEN(UNIT=LUNIT, FILE='rigid.xyz', STATUS='UNKNOWN')
1535:      LUNIT=GETUNIT()1532:         GTEST = .FALSE.
1536:      OPEN(UNIT=LUNIT, FILE='rigid.xyz', STATUS='UNKNOWN')1533: 
1537:      GTEST = .FALSE.1534:         DO J1 = 1, NSAVE
1538:      1535: 
1539:      DO J1 = 1, NSAVE1536:             WRITE(LUNIT,'(I6)') (NATOMS/2)*(NRBSITES - 1)
1540:         1537:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1541:         WRITE(LUNIT,'(I6)') (NATOMS/2)*(NRBSITES - 1)1538: 
1542:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1539:             DO J2 = 1, NATOMS/2
1543:         1540: 
1544:         DO J2 = 1, NATOMS/21541:                 J3   = 3*J2
1545:            1542:                 J5   = 3*NATOMS/2 + J3
1546:            J3   = 3*J21543:                 P(:) = QMINP(J1,J5-2:J5)
1547:            J5   = 3*NATOMS/2 + J31544: 
1548:            P(:) = QMINP(J1,J5-2:J5)1545:                 CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)
1549:            1546: 
1550:            CALL RMDRVT(P, RMI, DRMI, DRMI, DRMI, GTEST)1547:                 DO J4 = 1, NRBSITES - 1
1551:            1548: 
1552:            DO J4 = 1, NRBSITES - 11549:                     RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))
1553:                   1550:                     IF (J4 == 1) THEN
1554:               RBCOORDS(1:3) = QMINP(J1,J3-2:J3) + MATMUL(RMI(:,:),SITE(J4,:))1551:                         WRITE(LUNIT,'(A4,3F20.10)') 'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
1555:               IF (J4 == 1) THEN1552:                     ELSE
1556:                  WRITE(LUNIT,'(A4,3F20.10)') 'O', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1553:                         WRITE(LUNIT,'(A4,3F20.10)') 'H', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)
1557:               ELSE1554:                     ENDIF
1558:                  WRITE(LUNIT,'(A4,3F20.10)') 'H', RBCOORDS(1), RBCOORDS(2), RBCOORDS(3)1555: 
1559:               ENDIF1556:                 ENDDO
1560:               1557: 
1561:            ENDDO1558:             ENDDO
1562:            1559: 
1563:         ENDDO1560:         ENDDO
1564:         1561: 
1565:      ENDDO1562:         RETURN
1566:      1563: 
1567:      RETURN1564:     ELSE IF (RIGID) THEN
1568:      1565:         LUNIT=GETUNIT()
1569:   ELSE IF (RIGID) THEN1566:         OPEN(UNIT=LUNIT,FILE='rigid.xyz',STATUS='UNKNOWN')
1570:      LUNIT=GETUNIT()1567:         DO J1=1,NSAVE
1571:      OPEN(UNIT=LUNIT,FILE='rigid.xyz',STATUS='UNKNOWN')1568:             WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES
1572:      DO J1=1,NSAVE1569:             WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)
1573:         WRITE(LUNIT,'(I6)') (NATOMS/2)*NRBSITES1570:             DO J2=1,NATOMS/2
1574:         WRITE(LUNIT,10) J1, QMIN(J1), FF(J1)1571:                 CALL RBIO(QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),&
1575:         DO J2=1,NATOMS/2 
1576:            CALL RBIO(QMINP(J1,3*(J2-1)+1),QMINP(J1,3*(J2-1)+2),QMINP(J1,3*(J2-1)+3),& 
1577:                 QMINP(J1,3*(NATOMS/2+J2-1)+1),&1572:                 QMINP(J1,3*(NATOMS/2+J2-1)+1),&
1578:                 QMINP(J1,3*(NATOMS/2+J2-1)+2),&1573:                 QMINP(J1,3*(NATOMS/2+J2-1)+2),&
1579:                 QMINP(J1,3*(NATOMS/2+J2-1)+3),&1574:                 QMINP(J1,3*(NATOMS/2+J2-1)+3),&
1580:                 RBCOORDS,NRBSITES,SITE)1575:                 RBCOORDS,NRBSITES,SITE)
1581:            DO J3=1,NRBSITES1576:                 DO J3=1,NRBSITES
1582:               WRITE(LUNIT,'(A4,3F20.10)') 'LA ',RBCOORDS(3*(J3-1)+1),RBCOORDS(3*(J3-1)+2),RBCOORDS(3*(J3-1)+3)1577:                     WRITE(LUNIT,'(A4,3F20.10)') 'LA ',RBCOORDS(3*(J3-1)+1),RBCOORDS(3*(J3-1)+2),RBCOORDS(3*(J3-1)+3)
1583:            ENDDO1578:                 ENDDO
 1579:             ENDDO
1584:         ENDDO1580:         ENDDO
1585:      ENDDO1581:         CLOSE(LUNIT)
1586:      CLOSE(LUNIT)1582: 
1587:      1583:     ENDIF
1588:   ENDIF1584: 
1589:   1585:     IF(ALLOCATED(DBNAME)) DEALLOCATE(DBNAME)
1590:   IF(ALLOCATED(DBNAME)) DEALLOCATE(DBNAME)1586: 
1591:   1587:     IF (AMBER12T) THEN
1592:   IF (AMBER12T) THEN1588:        CALL AMBER12_FINISH()
1593:      CALL AMBER12_FINISH()1589:     END IF
1594:   END IF1590: 
1595:   1591:     CALL CPU_TIME(TEND)
1596:   CALL CPU_TIME(TEND)1592:     WRITE(MYUNIT,"(A,F18.1,A)") "time elapsed ", TEND - TSTART, " seconds"
1597:   WRITE(MYUNIT,"(A,F18.1,A)") "time elapsed ", TEND - TSTART, " seconds"1593:     WRITE(MYUNIT,"(A,I18)") "Number of potential calls ", NPCALL
1598:   WRITE(MYUNIT,"(A,I18)") "Number of potential calls ", NPCALL1594: 
1599:   1595:     RETURN
1600:   RETURN 
1601:    
1602: END SUBROUTINE FINALIO1596: END SUBROUTINE FINALIO
1603: 1597: 
1604: SUBROUTINE AMBERDUMP(J1,QMINP)1598: SUBROUTINE AMBERDUMP(J1,QMINP)
1605:     USE COMMONS1599:     USE COMMONS
1606:     USE MODAMBER1600:     USE MODAMBER
1607:     IMPLICIT NONE1601:     IMPLICIT NONE
1608: 1602: 
1609: 1603: 
1610:     CHARACTER(LEN=25) COORDFILE1604:     CHARACTER(LEN=25) COORDFILE
1611:     CHARACTER(LEN=2) FNAME1605:     CHARACTER(LEN=2) FNAME


r30182/keywords.f 2016-03-19 14:30:06.591193370 +0000 r30181/keywords.f 2016-03-19 14:30:07.279200411 +0000
881:       UNSTRING='UNDEFINED'881:       UNSTRING='UNDEFINED'
882:       BOXSIZE=20.D0882:       BOXSIZE=20.D0
883:       SPHERERAD=20.D0883:       SPHERERAD=20.D0
884:       NCHENCALLS=0884:       NCHENCALLS=0
885:       NATBT=.FALSE.885:       NATBT=.FALSE.
886:       MAXERISE=1.0D-10886:       MAXERISE=1.0D-10
887:       MAXERISE_SET=.FALSE.887:       MAXERISE_SET=.FALSE.
888:       MAXEFALL=-HUGE(1.0D0)888:       MAXEFALL=-HUGE(1.0D0)
889:       PRINT_PTGRP=.FALSE.889:       PRINT_PTGRP=.FALSE.
890:       PRINT_MINDATA=.FALSE.890:       PRINT_MINDATA=.FALSE.
891:       HESS_EIGEN_TOL=1.0D-3 
892:       SYMMETRIZE=.FALSE.891:       SYMMETRIZE=.FALSE.
893:       SYMMETRIZECSM=.FALSE.892:       SYMMETRIZECSM=.FALSE.
894:       NSYMINTERVAL=10893:       NSYMINTERVAL=10
895:       SYMTOL1=0.1D0894:       SYMTOL1=0.1D0
896:       SYMTOL2=0.1D0895:       SYMTOL2=0.1D0
897:       SYMTOL3=0.1D0896:       SYMTOL3=0.1D0
898:       SYMTOL4=0.1D0897:       SYMTOL4=0.1D0
899:       SYMTOL5=0.1D0898:       SYMTOL5=0.1D0
900:       PGSYMTOLS(1) = 1.0D-3     ! (Normalised) eigenvalue tolerance899:       PGSYMTOLS(1) = 1.0D-3     ! (Normalised) eigenvalue tolerance
901:       PGSYMTOLS(2) = 2.0D-1     ! Overlap (distance) tolerance900:       PGSYMTOLS(2) = 2.0D-1     ! Overlap (distance) tolerance
6724:          SETCHIRALGENERIC=.TRUE.6723:          SETCHIRALGENERIC=.TRUE.
6725: !6724: !
6726:       ELSE IF (WORD .EQ. 'PRINT_PTGRP') THEN6725:       ELSE IF (WORD .EQ. 'PRINT_PTGRP') THEN
6727:          PRINT_PTGRP = .TRUE.6726:          PRINT_PTGRP = .TRUE.
6728:          IF (NITEMS.GT.1) CALL READF(SYMTOL1)6727:          IF (NITEMS.GT.1) CALL READF(SYMTOL1)
6729:          IF (NITEMS.GT.2) CALL READF(SYMTOL2)6728:          IF (NITEMS.GT.2) CALL READF(SYMTOL2)
6730:          IF (NITEMS.GT.3) CALL READF(SYMTOL3)6729:          IF (NITEMS.GT.3) CALL READF(SYMTOL3)
6731: 6730: 
6732:       ELSE IF (WORD .EQ. 'PRINT_MINDATA') THEN6731:       ELSE IF (WORD .EQ. 'PRINT_MINDATA') THEN
6733:          PRINT_MINDATA = .TRUE.6732:          PRINT_MINDATA = .TRUE.
6734:          IF(NITEMS.GT.1) CALL READF(HESS_EIGEN_TOL) 
6735: 6733: 
6736: !  Keyword and parameters for symmetrisation.6734: !  Keyword and parameters for symmetrisation.
6737: !6735: !
6738:       ELSE IF (WORD.EQ.'SYMMETRISE') THEN6736:       ELSE IF (WORD.EQ.'SYMMETRISE') THEN
6739:          SYMMETRIZE=.TRUE.6737:          SYMMETRIZE=.TRUE.
6740:          NCORE=06738:          NCORE=0
6741:          IF (NITEMS.GT.1) CALL READI(NSYMINTERVAL)6739:          IF (NITEMS.GT.1) CALL READI(NSYMINTERVAL)
6742:          IF (NITEMS.GT.2) CALL READF(SYMTOL1)6740:          IF (NITEMS.GT.2) CALL READF(SYMTOL1)
6743:          IF (NITEMS.GT.3) CALL READF(SYMTOL2)6741:          IF (NITEMS.GT.3) CALL READF(SYMTOL2)
6744:          IF (NITEMS.GT.4) CALL READF(SYMTOL3)6742:          IF (NITEMS.GT.4) CALL READF(SYMTOL3)


legend
Lines Added 
Lines changed
 Lines Removed

hdiff - version: 2.1.0