- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minim.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: minim,move4 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: minim,move 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 13 13 subroutine minim(imin, maxit, eps) 14 14 15 c......................................................................16 cPURPOSE: Use minimizers17 c 18 cimin = 1: use Quasi-Newton19 cimin = 2: use Conjugated Gradients20 c 21 c@param maxit maximum number of iterations22 c@param eps acceptance criterium23 cInstitute24 cCALLS: difang,energy,gradient, mincjg,minqsn, nursvr25 c......................................................................15 ! ...................................................................... 16 ! PURPOSE: Use minimizers 17 ! 18 ! imin = 1: use Quasi-Newton 19 ! imin = 2: use Conjugated Gradients 20 ! 21 ! @param maxit maximum number of iterations 22 ! @param eps acceptance criterium 23 !Institute 24 ! CALLS: difang,energy,gradient, mincjg,minqsn, nursvr 25 ! ...................................................................... 26 26 27 27 include 'INCL.H' 28 cf2py intent(in) imin29 cf2py intent(in) maxit30 cf2py intent(in) eps28 !f2py intent(in) imin 29 !f2py intent(in) maxit 30 !f2py intent(in) eps 31 31 parameter (msvmx=mxvr*(mxvr+5)/(2*(2*mxvr+1)), 32 #msv = 50 )32 & msv = 50 ) 33 33 34 34 dimension w(mxvr*(mxvr+13)/2) … … 36 36 dimension vlvrn(mxvr),vlvro(mxvr),gdvr(mxvr),scl(mxvr) 37 37 38 c--------------------------- new38 ! --------------------------- new 39 39 dimension gbpro(6,mxml) 40 40 … … 47 47 endif 48 48 49 c----------------------- energy & gradient49 ! ----------------------- energy & gradient 50 50 51 51 call gradient() … … 56 56 57 57 write (*,'(a,e12.5,/,3(a,e11.4),/,2(a,e11.4),/)') ' Total: ', 58 #eysm,59 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,60 #' Variables: ',eyvr,' Solvatation: ',eysl58 & eysm, 59 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 60 & ' Variables: ',eyvr,' Solvatation: ',eysl 61 61 62 62 else … … 64 64 65 65 write (*,'(a,e12.5,/,3(a,e11.4),/,3(a,e11.4),/)') ' Total: ', 66 #wtey*eysm + wtrg*eyrg,67 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,68 #' Variables: ',eyvr,' Solvatation: ',eysl,69 #' Regularization: ',eyrg66 & wtey*eysm + wtrg*eyrg, 67 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 68 & ' Variables: ',eyvr,' Solvatation: ',eysl, 69 & ' Regularization: ',eyrg 70 70 71 71 endif 72 72 73 c--------------------------------------- variables73 ! --------------------------------------- variables 74 74 75 75 ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1 … … 129 129 enddo 130 130 131 cif (abs(wtrg-1.d0).gt.1.d-4.and.abs(wtey-1.d0).gt.1.d-4) then132 cgdey2 = max(acc,gdey2)133 cgdrg2 = max(acc,gdrg2)134 cwtrg = wtrg * sqrt(gdey2/gdrg2)135 cwrite(*,*) ' --> Wt_energy = ',wtey,' Wt_regul. = ',wtrg136 cwrite(*,*) ' '137 cendif131 ! if (abs(wtrg-1.d0).gt.1.d-4.and.abs(wtey-1.d0).gt.1.d-4) then 132 ! gdey2 = max(acc,gdey2) 133 ! gdrg2 = max(acc,gdrg2) 134 ! wtrg = wtrg * sqrt(gdey2/gdrg2) 135 ! write(*,*) ' --> Wt_energy = ',wtey,' Wt_regul. = ',wtrg 136 ! write(*,*) ' ' 137 ! endif 138 138 139 139 esm=wtey*eysm+wtrg*eyrg … … 152 152 153 153 call minqsn(n,mxvr,vlvrn,esm,gdvr,scl,acc,w,w(n1),w(n2), 154 #w(n3),w(n4),w(n5),w(n6),mxop,nop)154 & w(n3),w(n4),w(n5),w(n6),mxop,nop) 155 155 156 156 elseif (imin.eq.2) then ! Conjugated Gradients … … 163 163 164 164 call mincjg(n,mxvr,vlvrn,esm,gdvr,acc,w,w(n1),w(n2), ! no 'scl' 165 #w(n3),w(n4),w(n5),mxop,nop)165 & w(n3),w(n4),w(n5),mxop,nop) 166 166 167 167 endif … … 176 176 177 177 write (*,'(/,2a,/)') ' Final energies ', 178 #'__________________________________________________'178 & '__________________________________________________' 179 179 180 180 eysm = energy() … … 183 183 184 184 write (*,'(a,e12.5,/,3(a,e11.4),/,2(a,e11.4))') ' Total: ',eysm, 185 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,186 #' Variables: ',eyvr,' Solvatation: ',eysl185 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 186 & ' Variables: ',eyvr,' Solvatation: ',eysl 187 187 188 188 else 189 189 190 190 write (*,'(a,e12.5,/,3(a,e11.4),/,3(a,e11.4))') ' Total: ', 191 #wtey*eysm + wtrg*eyrg,192 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,193 #' Variables: ',eyvr,' Solvatation: ',eysl,194 #' Regularization: ',eyrg191 & wtey*eysm + wtrg*eyrg, 192 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 193 & ' Variables: ',eyvr,' Solvatation: ',eysl, 194 & ' Regularization: ',eyrg 195 195 196 196 endif … … 207 207 208 208 write (*,'(1x,a,1x,i4,f8.1,a,f5.1,a)') nmvr(i),nursvr(i), 209 #vr*crd,' (',abs(difang(vr,vlvro(i)))*crd,')'209 & vr*crd,' (',abs(difang(vr,vlvro(i)))*crd,')' 210 210 211 211 vlvr(i) = vr … … 231 231 232 232 write (*,'(/,2a)') ' Gradient ', 233 #'______________________________________________________________'233 & '______________________________________________________________' 234 234 235 235 write (*,'(8(1x,f8.3))') (gdvr(i),i=1,nv) … … 244 244 return 245 245 end 246 c********************************************246 ! ******************************************** 247 247 subroutine move(nop,nvr1,esm,vlvrn,gdvr) 248 c 249 cCALLS: gradient250 c 248 ! 249 ! CALLS: gradient 250 ! 251 251 include 'INCL.H' 252 252 … … 254 254 255 255 256 c------------------------ compile & new variables256 ! ------------------------ compile & new variables 257 257 258 258 ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1 … … 278 278 endif 279 279 280 c-------------------------- new minimz. gradient280 ! -------------------------- new minimz. gradient 281 281 282 282 call gradient() … … 309 309 310 310 write (*,'(a,i5,a,2(e13.6,a))') ' Step ',nop,': energy ',esm 311 #,' (',gdsmey,' )'311 & ,' (',gdsmey,' )' 312 312 313 313 else … … 328 328 329 329 write (*,'(a,i5,a,3(e13.6,a))') ' Step ',nop,': energy ',esm 330 #,' (',gdsmey,',',gdsmrg,' )'330 & ,' (',gdsmey,',',gdsmrg,' )' 331 331 332 332 endif
Note:
See TracChangeset
for help on using the changeset viewer.