--- /dev/null
+ logical function check_var(var,info)
+ implicit real*8 (a-h,o-z)
+ include 'DIMENSIONS'
+ include 'COMMON.VAR'
+ include 'COMMON.IOUNITS'
+ include 'COMMON.GEO'
+ include 'COMMON.SETUP'
+ dimension var(maxvar)
+ dimension info(3)
+C AL -------
+ check_var=.false.
+ do i=nphi+ntheta+1,nphi+ntheta+nside
+! Check the side chain "valence" angles alpha
+ if (var(i).lt.1.0d-7) then
+ write (iout,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
+ write (iout,*) 'Processor',me,'received bad variables!!!!'
+ write (iout,*) 'Variables'
+ write (iout,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
+ write (iout,*) 'Continuing calculations at this point',
+ & ' could destroy the results obtained so far... ABORTING!!!!!!'
+ write (iout,'(a19,i5,f10.4,a4,2i4,a3,i3)')
+ & 'valence angle alpha',i-nphi-ntheta,var(i),
+ & 'n it',info(1),info(2),'mv ',info(3)
+ write (*,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
+ write (*,*) 'Processor',me,'received bad variables!!!!'
+ write (*,*) 'Variables'
+ write (*,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
+ write (*,*) 'Continuing calculations at this point',
+ & ' could destroy the results obtained so far... ABORTING!!!!!!'
+ write (*,'(a19,i5,f10.4,a4,2i4,a3,i3)')
+ & 'valence angle alpha',i-nphi-ntheta,var(i),
+ & 'n it',info(1),info(2),'mv ',info(3)
+ check_var=.true.
+ return
+ endif
+ enddo
+! Check the backbone "valence" angles theta
+ do i=nphi+1,nphi+ntheta
+ if (var(i).lt.1.0d-7) then
+ write (iout,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
+ write (iout,*) 'Processor',me,'received bad variables!!!!'
+ write (iout,*) 'Variables'
+ write (iout,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
+ write (iout,*) 'Continuing calculations at this point',
+ & ' could destroy the results obtained so far... ABORTING!!!!!!'
+ write (iout,'(a19,i5,f10.4,a4,2i4,a3,i3)')
+ & 'valence angle theta',i-nphi,var(i),
+ & 'n it',info(1),info(2),'mv ',info(3)
+ write (*,*) 'CHUJ NASTAPIL ABSOLUTNY!!!!!!!!!!!!'
+ write (*,*) 'Processor',me,'received bad variables!!!!'
+ write (*,*) 'Variables'
+ write (*,'(8f10.4)') (rad2deg*var(j),j=1,nvar)
+ write (*,*) 'Continuing calculations at this point',
+ & ' could destroy the results obtained so far... ABORTING!!!!!!'
+ write (*,'(a19,i5,f10.4,a4,2i4,a3,i3)')
+ & 'valence angle theta',i-nphi,var(i),
+ & 'n it',info(1),info(2),'mv ',info(3)
+ check_var=.true.
+ return
+ endif
+ enddo
+ return
+ end