Changeset 32289cd for init_molecule.f
- Timestamp:
- 11/19/09 11:29:41 (14 years ago)
- Branches:
- master
- Children:
- 38d77eb
- Parents:
- 6650a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
init_molecule.f
r6650a56 r32289cd 4 4 ! 5 5 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 6 ! Shura Hayryan, Chin-Ku 6 ! Shura Hayryan, Chin-Ku 7 7 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 8 8 ! Jan H. Meinke, Sandipan Mohanty … … 16 16 ! PURPOSE: construct starting structure of molecule(s) 17 17 ! 18 ! iabin = 1 : ab Initio using sequence & 18 ! iabin = 1 : ab Initio using sequence & 19 19 ! variables given in input files 20 20 ! iabin != 1 : sequence, variable information … … 32 32 include 'INCP.H' 33 33 34 integer iabin, iendst, ntl, i, j, l, it, ier, ir, nursvr, i1, i2 35 integer its 36 34 37 Cf2py character*80 optional, intent(in) :: seqfile = ' ' 35 Cf2py character*80 optional, intent(in) :: varfile = ' ' 36 38 Cf2py character*80 optional, intent(in) :: varfile = ' ' 39 37 40 character grpn*4,grpc*4 38 character navr*3, nars*4 41 character navr*3, nars*4 39 42 character seqfile*80, varfile*80 40 43 integer ontlml … … 44 47 readFromStdin = .false. 45 48 46 write ( *,*) 'init_molecule: Solvent: ', itysol47 if (iabin.eq.1) then 48 49 write (logString, *) 'init_molecule: Solvent: ', itysol 50 if (iabin.eq.1) then 51 49 52 ! ----------------------------------------- get sequence for molecule(s) 50 53 lunseq=11 … … 53 56 endif 54 57 if (iendst(seqfile).le.1.or.seqfile.eq.' ') then 55 1 write ( *,'(/,a,$)') ' file with SEQUENCE:'58 1 write (logString, '(/,a,$)') ' file with SEQUENCE:' 56 59 seqfil=' ' 57 60 read (*,'(a)',err=1) seqfil 58 61 readFromStdin = .true. 59 else 62 else 60 63 seqfil = seqfile 61 endif 64 endif 62 65 call redseq 63 64 write (*,*) 'File with sequence is ', seqfil(1:iendst(seqfil)) 65 66 67 write (logString, *) 'File with sequence is ', 68 & seqfil(1:iendst(seqfil)) 69 66 70 ! --------------------------------- read & assemble data from libraries 67 71 ! initial coordinates, interaction lists 68 72 69 73 ntl = ntlml 70 74 do i=ontlml, ntl 71 75 72 76 call getmol(i) ! assemble data from libraries 73 77 74 78 do j=1,6 ! initialize global parameters 75 79 gbpr(j,i)=0.d0 76 80 enddo 77 81 78 82 call bldmol(i) ! co-ordinates 79 83 80 84 ntlml = i 81 85 call addend(i,grpn,grpc) ! modify ends 82 86 call setmvs(i) ! determine sets of moving atoms for given variables 83 87 call mklist(i) ! compile lists of interaction partners 84 88 85 89 enddo 86 90 87 91 ! --------------------------- Read the initial conformation if necessary 88 if(readFromStdin) then 89 write ( *,'(a,$)') ' file with VARIABLES:'90 ! 92 if(readFromStdin) then 93 write (logString, '(a,$)') ' file with VARIABLES:' 94 ! 91 95 varfil=' ' 92 96 read(*,'(a)',end=2,err=2) varfil … … 96 100 l=iendst(varfil) 97 101 if (l.gt.0.and.varfil.ne.' ') then 98 write ( *,'(1x,a,/)') varfil(1:l)102 write (logString, '(1x,a,/)') varfil(1:l) 99 103 lunvar=13 100 104 101 105 call redvar ! get vars. and rebuild 102 103 endif 104 105 2 write(*,*) ' ' 106 107 ireg = 0 108 109 else ! =========================== from PDB 110 if (iendst(seqfile).le.1) then 111 3 write (*,'(/,a,$)') ' PDB-file:' 112 seqfil=' ' 113 read (*,'(a)',err=3) seqfil 114 else 115 seqfil = seqfile 116 endif 117 write (*,*) 'PDB structure ',seqfil(1:iendst(seqfil)) 118 print *, 'calling readpdb with ',seqfile 119 call pdbread(seqfil,ier) 120 121 if (ier.ne.0) stop 122 123 call pdbvars() 124 125 ireg = 1 126 127 endif 128 129 ! If Lund force field is in use, keep omega angles fixed 130 if (ientyp.eq.2) then 131 do iv=1,nvrml(ntlml) 132 if ((nmvr(iv)(1:2).eq.'om')) then 133 vlvr(iv)=pi 134 toat(iatvr(iv))=pi 135 fxvr(iv)=.true. 136 print *, 'Fixed variable ',iv,nmvr(iv),vlvr(iv) 137 endif 138 enddo 139 endif 106 107 endif 108 109 2 write (logString, *) ' ' 140 110 141 111 ! -------------------- get: nvr,idvr, vlvr, olvlvr … … 161 131 enddo 162 132 133 ireg = 0 134 135 else ! =========================== from PDB 136 if (iendst(seqfile).le.1) then 137 3 write (logString, '(/,a,$)') ' PDB-file:' 138 seqfil=' ' 139 read (*,'(a)',err=3) seqfil 140 else 141 seqfil = seqfile 142 endif 143 write (logString, *) 'PDB structure ',seqfil(1:iendst(seqfil)) 144 print *, 'calling readpdb with ',seqfile 145 call pdbread(seqfil,ier) 146 147 if (ier.ne.0) stop 148 149 call pdbvars() 150 151 ireg = 1 152 153 endif 154 163 155 ! -------------------------- set var. amplitudes for simulations 164 156 165 157 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 166 158 167 159 if (ityvr(i).eq.3.and..not.fxvr(i)) then ! torsion 168 160 169 161 navr = nmvr(i) 170 162 171 163 ir = nursvr(i) 172 164 nars = seq(ir) 173 165 174 166 if ( navr(1:2).eq.'om' 175 167 176 168 & .or.nars(1:3).eq.'arg'.and.(navr(1:2).eq.'x5' 177 169 & .or.navr(1:2).eq.'x6') 178 170 179 171 & .or.(nars(1:3).eq.'asn'.or.nars(1:3).eq.'asp') 180 172 & .and.navr(1:2).eq.'x3' 181 173 182 174 & .or.(nars(1:3).eq.'gln'.or.nars(1:3).eq.'glu') 183 175 & .and.navr(1:2).eq.'x4' 184 176 185 177 & ) then 186 178 187 179 ! axvr(i) = pi/9.d0 ! 20 deg. 188 180 axvr(i) = pi2 ! Trying out 360 deg. for these as well 189 181 190 182 else 191 183 axvr(i) = pi2 ! 360 deg. 192 184 endif 193 185 194 186 else 195 187 axvr(i) = 0.d0 196 188 endif 197 189 198 190 enddo ! vars. 199 191 200 192 ! --------------------- initialize solvation pars. if necessary 201 193 202 194 if (itysol.ne.0) then 203 195 204 196 i1=iatrs1(irsml1(1)) ! 1st atom of 1st molecule 205 197 i2=iatrs2(irsml2(ntlml)) ! last atom of last molecule 206 198 207 199 its = iabs(itysol) 208 200 209 201 do i=i1,i2 ! all atoms 210 202 it=ityat(i) 211 203 sigma(i)=coef_sl(its,it) 212 204 rvdw(i) =rad_vdw(its,it) 213 205 214 206 if (nmat(i)(1:1).ne.'h') rvdw(i)=rvdw(i)+rwater 215 207 216 208 enddo 217 209 218 210 endif 219 211 ! Initialize calpha array 220 212 do i=ontlml, ntlml 221 call c_alfa(i,1) 213 call c_alfa(i,1) 222 214 enddo 223 215 224 216 ! Initialize arrays used in the BGS update 225 call init_lund() 217 call init_lund() 226 218 return 227 219 end 228 229 220 221
Note:
See TracChangeset
for help on using the changeset viewer.