Created binaries and fixed bugs when compiling single-processor version of the multic...
[unres.git] / source / unres / src_MD-M / checkvar.f
diff --git a/source/unres/src_MD-M/checkvar.f b/source/unres/src_MD-M/checkvar.f
new file mode 100644 (file)
index 0000000..630bc15
--- /dev/null
@@ -0,0 +1,63 @@
+      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