- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
opereg.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: opereg,gdtgbl,gdtreg4 c 5 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,6 cShura Hayryan, Chin-Ku7 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,8 cJan H. Meinke, Sandipan Mohanty9 c 10 c**************************************************************1 ! ************************************************************** 2 ! 3 ! This file contains the subroutines: opereg,gdtgbl,gdtreg 4 ! 5 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 6 ! Shura Hayryan, Chin-Ku 7 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 8 ! Jan H. Meinke, Sandipan Mohanty 9 ! 10 ! ************************************************************** 11 11 12 12 subroutine opereg(nml) 13 13 14 c.......................................................................15 cPURPOSE: calculate regul. energy & it's partial derivatives16 cfor molecule 'nml' vs. variables 'iv'17 c 18 cNB: if the unit axis for an internal variable coincides with a19 cglobal axis (i.e. for torsion or bond length variation round20 cor along 'xrfax', respectively, and bd. angle var. round21 c'zrfax'): VdW & 14 interaction partners of moving set atoms22 cshould be used for calculation, instead of the mov. sets,23 cwith opposite sign.24 c 25 cExample: By the the way the molecule-fixed system is set up,26 cchanges in Phi_1 affect atomic positions BEFORE the27 cN-C^alpha bond relatively to the space-fixed system,28 cnot the moving set of Phi_1.29 c 30 cCALLS: gdtgbl, gdtreg31 c......................................................................14 ! ....................................................................... 15 ! PURPOSE: calculate regul. energy & it's partial derivatives 16 ! for molecule 'nml' vs. variables 'iv' 17 ! 18 ! NB: if the unit axis for an internal variable coincides with a 19 ! global axis (i.e. for torsion or bond length variation round 20 ! or along 'xrfax', respectively, and bd. angle var. round 21 ! 'zrfax'): VdW & 14 interaction partners of moving set atoms 22 ! should be used for calculation, instead of the mov. sets, 23 ! with opposite sign. 24 ! 25 ! Example: By the the way the molecule-fixed system is set up, 26 ! changes in Phi_1 affect atomic positions BEFORE the 27 ! N-C^alpha bond relatively to the space-fixed system, 28 ! not the moving set of Phi_1. 29 ! 30 ! CALLS: gdtgbl, gdtreg 31 ! ...................................................................... 32 32 33 33 include 'INCL.H' … … 35 35 36 36 dimension xfat(mxat),yfat(mxat),zfat(mxat), 37 #xfrat(mxat),yfrat(mxat),zfrat(mxat),38 39 #xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),40 #xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)37 & xfrat(mxat),yfrat(mxat),zfrat(mxat), 38 39 & xfvr(mxvr),yfvr(mxvr),zfvr(mxvr), 40 & xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr) 41 41 42 42 logical lnb … … 46 46 if (ntlvr.eq.0) then 47 47 write (*,'(a,i4)') 48 #' opereg> No variables defined in molecule #',nml48 & ' opereg> No variables defined in molecule #',nml 49 49 return 50 50 endif … … 55 55 ilavr=ifivr+ntlvr-1 ! last var. of 'nml' 56 56 57 c--------------------------- initializations57 ! --------------------------- initializations 58 58 do i=ifivr,ilavr 59 59 gdeyrg(i)=0.d0 … … 107 107 dz = 2.d0 * zji 108 108 109 c=============================================== global pars.109 ! =============================================== global pars. 110 110 111 111 gdeygb(ii+1) = gdeygb(ii+1) - dx ! d(E_ij) / d(x_i) … … 113 113 gdeygb(ii+3) = gdeygb(ii+3) - dz ! d(E_ij) / d(z_i) 114 114 115 c-------------------------- r = r_i - r_1115 ! -------------------------- r = r_i - r_1 116 116 x = xi - x1 117 117 y = yi - y1 … … 123 123 124 124 gdeygb(ii+6) = gdeygb(ii+6) +dx*(zk*y-yk*z)+dy*(xk*z-zk*x) ! d(E_ij) / d(g) 125 #+dz*(yk*x-xk*y)126 127 c=============================================== for internal vars.125 & +dz*(yk*x-xk*y) 126 127 ! =============================================== for internal vars. 128 128 129 129 xfat(i) = dx … … 164 164 zb=zat(ib) 165 165 166 c---------------------------------------- axis for var.166 ! ---------------------------------------- axis for var. 167 167 168 168 if (it.eq.3) then ! torsion … … 279 279 280 280 gdeyrg(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+ 281 #(ex*yb-ey*xb)*zfiv282 #+ex*xfriv+ey*yfriv+ez*zfriv281 & (ex*yb-ey*xb)*zfiv 282 & +ex*xfriv+ey*yfriv+ez*zfriv 283 283 284 284 elseif (it.eq.1) then ! b.length … … 294 294 return 295 295 end 296 c**************************296 ! ************************** 297 297 subroutine gdtgbl(nml) 298 C 299 CCALLS: bldmol,enyreg300 c 301 c-------------------------- gradtest for 'gbpr'298 ! 299 ! CALLS: bldmol,enyreg 300 ! 301 ! -------------------------- gradtest for 'gbpr' 302 302 303 303 include 'INCL.H' … … 310 310 do i = 1,6 311 311 312 c----------------------------- modify312 ! ----------------------------- modify 313 313 pro = gbpr(i,nml) 314 314 gbpr(i,nml) = pro+del … … 318 318 319 319 write (*,*) ' Gb. var #',(ii+i),': ',gdeygb(ii+i),gdn, 320 #abs(gdn-gdeygb(ii+i))321 c----------------------------- restore320 & abs(gdn-gdeygb(ii+i)) 321 ! ----------------------------- restore 322 322 gbpr(i,nml) = pro 323 323 call bldmol(nml) … … 327 327 return 328 328 end 329 c*****************************329 ! ***************************** 330 330 subroutine gdtreg(nml,iv) 331 331 332 c.................................................................333 cPURPOSE: calculate partial derivative of reg. energy for molecule334 c'nml' vs. variable 'iv' NUMERICALLY and compare with335 cits value obtained analytically336 c 337 cCALLS: setvar, enyreg338 c.................................................................332 ! ................................................................. 333 ! PURPOSE: calculate partial derivative of reg. energy for molecule 334 ! 'nml' vs. variable 'iv' NUMERICALLY and compare with 335 ! its value obtained analytically 336 ! 337 ! CALLS: setvar, enyreg 338 ! ................................................................. 339 339 340 340 include 'INCL.H' … … 344 344 dimension vlvrx(mxvr) 345 345 346 c____________________________ get & save values of variables346 ! ____________________________ get & save values of variables 347 347 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 348 348 it=ityvr(i) ! type … … 366 366 367 367 write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (', 368 #abs(gda-gdn),')'369 370 c_________________________ restore vars368 & abs(gda-gdn),')' 369 370 ! _________________________ restore vars 371 371 vlvrx(iv)=ovr 372 372 call setvar(nml,vlvrx)
Note:
See TracChangeset
for help on using the changeset viewer.