copy src_MD-M-SAXS-homology src-HCD-5D
[unres.git] / source / unres / src-HCD-5D / checkvar.f
1       logical function check_var(var,info)
2       implicit real*8 (a-h,o-z)
3       include 'DIMENSIONS'
4       include 'COMMON.VAR'
5       include 'COMMON.IOUNITS'
6       include 'COMMON.GEO'
7       include 'COMMON.SETUP'
8       dimension var(maxvar)
9       dimension info(3)
10 C AL -------
11        check_var=.false.
12        do i=nphi+ntheta+1,nphi+ntheta+nside
13 ! Check the side chain "valence" angles alpha
14          if (var(i).lt.1.0d-7) then 
15            write (iout,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
16            write (iout,*) 'Processor',me,'received bad variables!!!!'
17            write (iout,*) 'Variables'
18            write (iout,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
19            write (iout,*) 'Continuing calculations at this point',
20      & ' could destroy the results obtained so far... ABORTING!!!!!!'
21            write (iout,'(a19,i5,f10.4,a4,2i4,a3,i3)') 
22      &     'valence angle alpha',i-nphi-ntheta,var(i),
23      &     'n it',info(1),info(2),'mv ',info(3)
24            write (*,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
25            write (*,*) 'Processor',me,'received bad variables!!!!'
26            write (*,*) 'Variables'
27            write (*,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
28            write (*,*) 'Continuing calculations at this point',
29      & ' could destroy the results obtained so far... ABORTING!!!!!!'
30            write (*,'(a19,i5,f10.4,a4,2i4,a3,i3)') 
31      &     'valence angle alpha',i-nphi-ntheta,var(i),
32      &     'n it',info(1),info(2),'mv ',info(3)
33            check_var=.true.
34            return
35          endif
36        enddo
37 ! Check the backbone "valence" angles theta
38        do i=nphi+1,nphi+ntheta
39          if (var(i).lt.1.0d-7) then
40            write (iout,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
41            write (iout,*) 'Processor',me,'received bad variables!!!!'
42            write (iout,*) 'Variables'
43            write (iout,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
44            write (iout,*) 'Continuing calculations at this point',
45      & ' could destroy the results obtained so far... ABORTING!!!!!!'
46            write (iout,'(a19,i5,f10.4,a4,2i4,a3,i3)') 
47      &     'valence angle theta',i-nphi,var(i),
48      &     'n it',info(1),info(2),'mv ',info(3)
49            write (*,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
50            write (*,*) 'Processor',me,'received bad variables!!!!'
51            write (*,*) 'Variables'
52            write (*,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
53            write (*,*) 'Continuing calculations at this point',
54      & ' could destroy the results obtained so far... ABORTING!!!!!!'
55            write (*,'(a19,i5,f10.4,a4,2i4,a3,i3)') 
56      &     'valence angle theta',i-nphi,var(i),
57      &     'n it',info(1),info(2),'mv ',info(3)
58            check_var=.true.
59            return
60          endif
61        enddo
62        return
63        end