2 !-----------------------------------------------------------------------------
10 !-----------------------------------------------------------------------------
13 !-----------------------------------------------------------------------------
15 !-----------------------------------------------------------------------------
17 !-----------------------------------------------------------------------------
18 subroutine check_sc_map
19 ! Subroutine is checking if the fitted function which describs sc_rot_pot
20 ! is correct, printing, alpha,beta, energy, data - for some known theta.
21 ! theta angle is read from the input file. Sc_rot_pot are printed
22 ! for the second residue in sequance.
23 use geometry, only:chainbuild
24 use energy, only:vec_and_deriv,esc
25 ! include 'DIMENSIONS'
26 ! include 'COMMON.VAR'
27 ! include 'COMMON.GEO'
28 ! include 'COMMON.INTERACT'
29 real(kind=8) :: xx,yy,zz,al,om
30 real(kind=8) :: escloc, escloc_min
31 real(kind=8),dimension(50000) :: escloc_ene,alph_plot,beta_plot
32 integer,dimension(5000) :: al_plot,be_plot
33 integer :: iialph, iibet,it
38 write (2,*) "Side-chain-rotamer potential energy map!!!!"
39 escloc_min = 1000000.00
45 al = iialph*10.0d0*deg2rad
46 om = iibet*10.0d0*deg2rad
48 xx = -dsin(al)*dcos(om)
49 yy = -dsin(al)*dsin(om)
51 omeg(2)=-datan2(zz,yy)
52 al_plot(i)=alph(2)*rad2deg
53 be_plot(i)=omeg(2)*rad2deg
54 ! write(2,*) alph(2)*rad2deg, omeg(2)*rad2deg
55 alph_plot(i) = al*rad2deg
56 beta_plot(i) = om*rad2deg
60 escloc_ene(i) = escloc
61 if (escloc_min.gt.escloc_ene(i)) escloc_min=escloc_ene(i)
64 ! write (2,*) "escloc_min = ", escloc_min
67 write (2,'(3f10.3,2i9,f12.5)') alph_plot(j), &
68 beta_plot(j),theta(3)*rad2deg, al_plot(j),be_plot(j),&
69 escloc_ene(j) !- escloc_min
72 end subroutine check_sc_map
73 !-----------------------------------------------------------------------------
75 !-----------------------------------------------------------------------------
78 use geometry, only:chainbuild,geom_to_var
80 use minimm, only:minimize
81 ! implicit real*8 (a-h,o-z)
82 ! include 'DIMENSIONS'
83 ! include 'COMMON.MAP'
84 ! include 'COMMON.VAR'
85 ! include 'COMMON.GEO'
86 ! include 'COMMON.DERIV'
87 ! include 'COMMON.IOUNITS'
88 ! include 'COMMON.NAMES'
89 ! include 'COMMON.CONTROL'
90 ! include 'COMMON.TORCNSTR'
91 real(kind=8) :: energia(0:n_ene)
92 character(len=5) :: angid(4)=reshape((/'PHI ','THETA','ALPHA',&
93 'OMEGA'/),shape(angid))
94 real(kind=8) :: ang_list(10)
95 !el real(kind=8),dimension(6*nres) :: g,x !(maxvar) (maxvar=6*maxres)
96 real(kind=8),dimension(:),allocatable :: g,x !(maxvar) (maxvar=6*maxres)
99 integer :: i,iii,ii,j,k,nmax,ntot,nf,iretcode,nfun
100 real(kind=8) :: etot,gnorm!,fdum
101 integer,dimension(1) :: uiparm
102 real(kind=8),dimension(1) :: urparm
103 allocate(x(6*nres),g(6*nres))
105 write (iout,'(a,i3,a)')'Energy map constructed in the following ',&
106 nmap,' groups of variables:'
108 write (iout,'(2a,i3,a,i3)') angid(kang(i)),' of residues ',&
109 res1(i),' to ',res2(i)
113 if (nmax.lt.nstep(i)) nmax=nstep(i)
117 write (istat,'(1h#,a14,29a15)') (" ",k=1,nmap),&
118 (ename(print_order(k)),k=1,nprint_ene),"ETOT","GNORM"
126 if (nn(j).gt.nstep(j)) goto 10
129 !d write (iout,*) i,iii,(nn(j),j=1,nmap)
131 ang_list(j)=ang_from(j) &
132 +(nn(j)-1)*(ang_to(j)-ang_from(j))/nstep(j)
134 goto (1,2,3,4), kang(j)
135 1 phi(k)=deg2rad*ang_list(j)
136 if (minim) phi0(k-res1(j)+1)=deg2rad*ang_list(j)
138 2 theta(k)=deg2rad*ang_list(j)
140 3 alph(k)=deg2rad*ang_list(j)
142 4 omeg(k)=deg2rad*ang_list(j)
148 call geom_to_var(nvar,x)
149 call minimize(etot,x,iretcode,nfun)
150 print *,'SUMSL return code is',iretcode,' eval ',nfun
154 call geom_to_var(nvar,x)
160 call gradient(nvar,x,nf,g,uiparm,urparm,fdum)
168 ! write (iout,'(6(1pe15.5))') (ang_list(k),k=1,nmap),etot,gnorm
169 write (istat,'(30e15.5)') (ang_list(k),k=1,nmap),&
170 (energia(print_order(ii)),ii=1,nprint_ene),etot,gnorm
171 ! write (iout,*) 'POINT',I,' ANGLES:',(ang_list(k),k=1,nmap)
173 ! call enerprint(energia)
179 !-----------------------------------------------------------------------------
180 subroutine alloc_map_arrays
184 allocate(kang(nmap),res1(nmap),res2(nmap),nstep(nmap)) !(maxvar)
185 allocate(ang_from(nmap),ang_to(nmap)) !(maxvar)
188 end subroutine alloc_map_arrays
189 !-----------------------------------------------------------------------------
190 !-----------------------------------------------------------------------------