added source code
[unres.git] / source / unres / src_MD / old_F / check_sc_map.f
1        subroutine check_sc_map
2 C Subroutine is checking if the fitted function which describs sc_rot_pot
3 C is correct, printing, alpha,beta, energy, data - for some known theta. 
4 C theta angle is read from the input file. Sc_rot_pot are printed 
5 C for the second  residue in sequance.
6        include 'DIMENSIONS'
7        include 'COMMON.VAR'
8        include 'COMMON.GEO'
9        include 'COMMON.INTERACT'
10        real*8 xx,yy,zz,al,om
11        real*8 escloc, escloc_ene(50000), escloc_min, alph_plot(50000), 
12      & beta_plot(50000)
13        integer al_plot(5000),be_plot(5000)
14        integer iialph, iibet,it
15        write (2,*) "Side-chain-rotamer potential energy map!!!!" 
16        escloc_min = 1000000.00
17 C       it=itype(2)
18        i = 0 
19        do iialph=0,18
20          do iibet=-18,18
21            i = i + 1
22            al = iialph*10.0d0*deg2rad
23            om = iibet*10.0d0*deg2rad
24            zz = dcos(al)
25            xx = -dsin(al)*dcos(om)
26            yy = -dsin(al)*dsin(om)
27            alph(2)=dacos(xx)
28            omeg(2)=-datan2(zz,yy)
29            al_plot(i)=alph(2)*rad2deg
30            be_plot(i)=omeg(2)*rad2deg
31 C         write(2,*) alph(2)*rad2deg, omeg(2)*rad2deg
32            alph_plot(i) = al*rad2deg
33            beta_plot(i) = om*rad2deg
34            call chainbuild
35            call vec_and_deriv
36            call esc(escloc)
37            escloc_ene(i) = escloc
38            if (escloc_min.gt.escloc_ene(i)) escloc_min=escloc_ene(i)
39          enddo
40        enddo
41 C       write (2,*) "escloc_min = ", escloc_min
42        print *,"i",i
43        do j = 1,i
44           write (2,'(3f10.3,2i9,f12.5)') alph_plot(j), 
45      &         beta_plot(j),theta(3)*rad2deg, al_plot(j),be_plot(j),
46      &         escloc_ene(j) !- escloc_min
47        enddo
48        return
49        end