Adam's changes to avoid wrong XG.. or ..GX sequence input
[unres.git] / source / cluster / wham / src / readrtns.F
index 7f72e00..be830b5 100644 (file)
@@ -70,7 +70,11 @@ C
       write (iout,*) "with_homology_constr ",with_dihed_constr,
      & " CONSTR_HOMOLOGY",constr_homology
 
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       if (min_var) iopt=1
       return
       end
@@ -247,7 +251,11 @@ C 12/1/95 Added weight for the multi-body term WCORR
         bad(i,2)=scalscp*bad(i,2)
       enddo
 
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       print *,'indpdb=',indpdb,' pdbref=',pdbref
 
 C Read sequence if not taken from the pdb file.
@@ -325,14 +333,32 @@ C     both routines should be in dfa.F file!!
 
       if (.not. (wdfa_dist.eq.0.0 .and. wdfa_tor.eq.0.0 .and.
      &            wdfa_nei.eq.0.0 .and. wdfa_beta.eq.0.0)) then
+#ifdef DEBUG
        write (iout,*) "Calling init_dfa_vars"
-       call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
+#endif
        call init_dfa_vars
+#ifdef DEBUG
        write (iout,*) 'init_dfa_vars finished!'
-       call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
+#endif
        call read_dfa_info
+#ifdef DEBUG
        write (iout,*) 'read_dfa_info finished!'
-       call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
+#endif
       endif
 
       if (constr_homology.gt.0) then
@@ -751,7 +777,11 @@ c      write (iout,'(a)') controlcard
       do i=1,npair_
         write (iout,*) i,ipair_(1,i),ipair_(2,i),wpair_(i)
       enddo
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       if (.not.refstr .and. nfrag_.gt.0) then
         write (iout,*) 
      &  "ERROR: no reference structure to compute distance restraints"
@@ -764,13 +794,17 @@ c      write (iout,'(a)') controlcard
      &   " but distance restraints between pairs requested"
         stop 
       endif 
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       do i=1,nfrag_
         if (ifrag_(1,i).lt.nstart_sup) ifrag_(1,i)=nstart_sup
         if (ifrag_(2,i).gt.nstart_sup+nsup-1)
      &    ifrag_(2,i)=nstart_sup+nsup-1
 c        write (iout,*) i,ifrag_(1,i),ifrag_(2,i),wfrag_(i)
-        call flush(iout)
+c        call flush(iout)
         if (wfrag_(i).gt.0.0d0) then
         do j=ifrag_(1,i),ifrag_(2,i)-1
           do k=j+1,ifrag_(2,i)
@@ -842,7 +876,11 @@ c        write (iout,*) i,ifrag_(1,i),ifrag_(2,i),wfrag_(i)
           write (iout,'(a,3i5,2f8.2,i2,f10.1)') "+dist.constr ",
      &     i,ihpb(i),jhpb(i),dhpb(i),dhpb1(i),ibecarb(i),forcon(i)
       enddo
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       return
       end
 
@@ -876,6 +914,7 @@ c    &    sigma_odl_temp(maxres,maxres,max_template)
       character*500 controlcard
       integer ki, i, j, k, l
       logical lprn /.true./
+      logical unres_pdb
 c
 c     FP - Nov. 2014 Temporary specifications for new vars
 c
@@ -890,8 +929,14 @@ c -----------------------------------------------------------------
 c
 c
 c Alternative: reading from input
+#ifdef DEBUG
       write (iout,*) "BEGIN READ HOMOLOGY INFO"
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
+#endif
       call card_concat(controlcard)
       call reada(controlcard,"HOMOL_DIST",waga_dist,1.0d0)
       call reada(controlcard,"HOMOL_ANGLE",waga_angle,1.0d0)
@@ -901,7 +946,7 @@ c Alternative: reading from input
 
       call readi(controlcard,"HOMOL_NSET",homol_nset,1)
       if (homol_nset.gt.1)then
-         call readi(controlcard,"ISET",iset,homol_nset)
+         call readi(controlcard,"ISET",iset,1)
          call card_concat(controlcard)
          read(controlcard,*) (waga_homology(i),i=1,homol_nset)
       else
@@ -909,11 +954,15 @@ c Alternative: reading from input
         waga_homology(1)=1.0
       endif
 c
+#ifdef DEBUG
       write(iout,*) "read_constr_homology iset",iset
       write(iout,*) "waga_homology(",iset,")",waga_homology(iset)
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
-
-
+#endif
+#endif
 cd      write (iout,*) "nnt",nnt," nct",nct
 cd      call flush(iout)
 
@@ -986,7 +1035,11 @@ c       tpl_k_sigma_d="template"//kic2//".sigma_d"
         write (iout,*) "waga_theta",waga_theta
         write (iout,*) "waga_d",waga_d
         write (iout,*) "dist_cut",dist_cut
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 
 c
 c     Distance restraints
@@ -1066,9 +1119,13 @@ c
               sigma_odl(k,ii)=rescore(k,i)+rescore(k,j) ! other exprs possible
 c             sigma_odl(k,ii)=hmscore(k)*rescore(k,i)*rescore(k,j)
             else
-              sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))* ! sigma ~ rescore ~ error 
+#ifdef OLDSIGMA
+              sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))* ! sigma ~ rescore ~ error
+     &                      dexp(0.5d0*(odl(k,ii)/dist_cut)**2)
+#else
+              sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))* ! sigma ~ rescore ~ error
      &                      dexp(0.5d0*(odl(k,ii)/dist_cut)**2-0.5d0)
-
+#endif
 c   Following expr replaced by a positive exp argument
 c             sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))*
 c    &                      dexp(-0.5d0*(odl(k,ii)/dist_cut)**2)