Fixes to compile WHAM and CLUSTER on AIX (nostromo.icm.edu.pl)
authorAdam Liwo <adam@piasek4.chem.univ.gda.pl>
Sun, 28 Jun 2015 19:27:45 +0000 (21:27 +0200)
committerAdam Liwo <adam@piasek4.chem.univ.gda.pl>
Sun, 28 Jun 2015 19:27:45 +0000 (21:27 +0200)
25 files changed:
source/cluster/wham/src/COMMON.DFA
source/cluster/wham/src/dfa.F
source/cluster/wham/src/main_clust.F
source/cluster/wham/src/parmread.F
source/cluster/wham/src/probabl.F
source/cluster/wham/src/read_coords.F
source/cluster/wham/src/readpdb.F
source/cluster/wham/src/readrtns.F
source/cluster/wham/src/ssMD.F
source/cluster/wham/src/timing.F
source/cluster/wham/src/work_partition.F
source/cluster/wham/src/wrtclust.f
source/unres/src_MD/Makefile_MPICH_ifort
source/unres/src_MD/energy_p_new_barrier.F
source/unres/src_MD/timing.F
source/wham/src/COMMON.DFA
source/wham/src/Makefile_MPICH_ifort
source/wham/src/cxread.F
source/wham/src/cxread.F.org
source/wham/src/dfa.F
source/wham/src/enecalc1.F
source/wham/src/molread_zs.F
source/wham/src/readpdb.F
source/wham/src/ssMD.F
source/wham/src/timing.F

index c6add4f..3c74bc8 100644 (file)
@@ -94,8 +94,3 @@ c    &       ,DFAEXP
      &             WSHET(MAXRES,MAXRES), EDFABET, 
      &             CK(4),SCK(4),S1(4),S2(4)
 c    &             ,DFAEXP(15001),
-
-      DATA CK/1.0D0,1.58740105197D0,2.08008382305D0,2.51984209979D0/
-      DATA SCK/1.0D0,1.25992104989D0,1.44224957031D0,1.58740105197D0/
-      DATA S1/3.75D0,5.75D0,7.75D0,9.75D0/
-      DATA S2/4.25D0,6.25D0,8.25D0,10.25D0/
index 576910c..922f933 100644 (file)
@@ -1,3 +1,14 @@
+      block data dfadata
+      include 'DIMENSIONS'
+      include 'COMMON.INTERACT'
+      include 'COMMON.DFA'
+      DATA CK/1.0D0,1.58740105197D0,2.08008382305D0,2.51984209979D0/
+      DATA SCK/1.0D0,1.25992104989D0,1.44224957031D0,1.58740105197D0/
+      DATA S1/3.75D0,5.75D0,7.75D0,9.75D0/
+      DATA S2/4.25D0,6.25D0,8.25D0,10.25D0/
+      end
+c------------------------------------------------------------------------
+
       subroutine init_dfa_vars
 
       include 'DIMENSIONS'
index f4d63f8..b5124ac 100644 (file)
@@ -227,7 +227,11 @@ C
         write (iout,'(2i5,f10.5)') i,list_conf(i),totfree(i)
       enddo
 #endif
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       CALL HC(N,M,LEN,IOPT,IA,IB,CRIT,MEMBR,NN,DISNN,FLAG,DISS)
       LEV = N-1
       write (iout,*) "n",n," ncon_work",ncon_work," lev",lev
index b1a9a32..8ffeeb0 100644 (file)
@@ -246,7 +246,11 @@ C
           enddo
         enddo
       enddo
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       endif
 #endif
 
index 420d6f7..da1bf5c 100644 (file)
@@ -83,7 +83,11 @@ c      enddo
      &             dlog(dexp(quotl)+dexp(-quotl))
               enddo
 c              write (iout,*) 1.0d0/(beta_h(ib)*1.987D-3),ft
-              call flush(iout)
+c#ifdef AIX
+c      call flush_(iout)
+c#else
+c      call flush(iout)
+c#endif
             endif
 
 #ifdef MPI
@@ -94,7 +98,7 @@ c              write (iout,*) 1.0d0/(beta_h(ib)*1.987D-3),ft
         ii=i
 #endif
 c        write (iout,*) "i",i," ii",ii
-        call flush(iout)
+c        call flush(iout)
         if (ib.eq.1) then
           do j=1,nres
             do k=1,3
@@ -126,7 +130,7 @@ c        write (iout,*) "i",i," ii",ii
       enddo
 
 c          call intout
-          call flush(iout)
+c          call flush(iout)
 #endif
           do k=1,max_ene
             enetb(k,i)=energia(k)
index 15456a2..36e80e6 100644 (file)
@@ -129,7 +129,7 @@ C
    13 NCON=ICON-1
 
 #endif
-      call flush(iout)
+c      call flush(iout)
       jj_old=1
       open (icbase,file=bprotfiles,status="unknown",
      &   form="unformatted",access="direct",recl=lenrec)
@@ -162,7 +162,11 @@ c through a ring.
           if (iret.eq.0) then
             write (iout,*) "Error: coordinate file ",
      &       intinname(:ilen(intinname))," does not exist."
-            call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #ifdef MPI
             call MPI_ABORT(MPI_COMM_WORLD,IERROR,ERRCODE)
 #endif
@@ -170,7 +174,11 @@ c through a ring.
           endif
         else
           write (iout,*) "Error: coordinate format not specified"
-          call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #ifdef MPI
           call MPI_ABORT(MPI_COMM_WORLD,IERROR,ERRCODE)
 #else
@@ -181,7 +189,11 @@ c through a ring.
 #ifdef DEBUG
         write (iout,*) "Opening file ",intinname(:ilen(intinname))
         write (iout,*) "lenrec",lenrec_in
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #endif
 c        write (iout,*) "maxconf",maxconf
         i=0
@@ -247,7 +259,7 @@ c            call flush(iout)
             call xdrfint(ixdrf, nss, iret)
 c            write (iout,*) "iret",iret
 c            write (iout,*) "nss",nss
-            call flush(iout)
+c            call flush(iout)
             if (iret.eq.0) goto 101
             do k=1,nss
 cc              if (dyn_ss) then
@@ -297,7 +309,11 @@ cc         write(iout,*) 'refree=', refree,jj+1
           write (iout,*) "Conformation",jjj+1,jj+1
           write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
           write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
-          call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #endif
           call add_new_cconf(jjj,jj,jj_old,icount,Next)
         enddo
@@ -366,14 +382,22 @@ c Check if everyone has the same number of conformations
           write (iout,'(8i10)') i,ntot_all(i)
         enddo
         write (iout,*) "Calculation terminated."
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
         return1
       endif
       return
 #endif
  1111 write(iout,*) "Error opening coordinate file ",
      & intinname(:ilen(intinname))
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       return1
       end
 c------------------------------------------------------------------------------
@@ -529,8 +553,12 @@ c Write the structures to a scratch file
 c Master sends the portion of conformations that have been read in to the neighbor
 #ifdef DEBUG
       write (iout,*) "Processor",me," entered WRITE_AND_SEND_CONF"
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
 #endif
+#endif
       call MPI_Send(icount,1,MPI_INTEGER,Next,570,MPI_COMM_WORLD,IERROR)
       call MPI_Send(nss_all(1),icount,MPI_INTEGER,
      &    Next,571,MPI_COMM_WORLD,IERROR)
@@ -569,8 +597,12 @@ c------------------------------------------------------------------------------
       icount=1
 #ifdef DEBUG
       write (iout,*) "Processor",me," entered RECEIVE_AND_PASS_CONF"
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
 #endif
+#endif
       do while (icount.gt.0) 
       call MPI_Recv(icount,1,MPI_INTEGER,Previous,570,MPI_COMM_WORLD,
      &     STATUS,IERROR)
@@ -649,14 +681,22 @@ c
       inquire(unit=icbase,name=nam,recl=len,form=form,access=acc)
       write (iout,*) "len=",len," form=",form," acc=",acc
       write (iout,*) "nam=",nam
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
 #endif
+#endif
       do ii=istart_conf,iend_conf
         ij = ii - istart_conf + 1
         iii=list_conf(ii)
 #ifdef DEBUG
         write (iout,*) "Reading binary file, record",iii," ii",ii
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #endif
         if (dyn_ss) then
         read(icbase,rec=iii) ((allcart(j,i,ij),j=1,3),i=1,nres),
@@ -677,7 +717,11 @@ c     &    nss_all(ij),(ihpb_all(i,ij),jhpb_all(i,ij),i=1,nss),
         write (iout,'(2e15.5)') entfac(ij)
         write (iout,'(16i5)') nss_all(ij),(ihpb_all(i,ij),
      &    jhpb_all(i,ij),i=1,nss)
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #endif
       enddo
       return
@@ -713,14 +757,22 @@ c
       inquire(unit=unit_out,name=nam,recl=len,form=form,access=acc)
       write (iout,*) "len=",len," form=",form," acc=",acc
       write (iout,*) "nam=",nam
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
 #endif
+#endif
       do ii=istart_conf,iend_conf
         iii=list_conf(ii)
         ij = ii - istart_conf + 1
 #ifdef DEBUG
         write (iout,*) "Writing binary file, record",iii," ii",ii
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #endif
        if (dyn_ss) then
         write(unit_out,rec=iii) ((allcart(j,i,ij),j=1,3),i=1,nres),
@@ -740,7 +792,11 @@ c     &    nss_all(ij),(ihpb_all(i,ij),jhpb_all(i,ij),i=1,nss_all(ij))
         write (iout,'(2e15.5)') entfac(ij)
         write (iout,'(16i5)') nss_all(ij),(ihpb(i,ij),jhpb(i,ij),i=1,
      &   nss_all(ij))
-        call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
 #endif
       enddo
       return
index a7b024f..8351702 100644 (file)
@@ -24,6 +24,7 @@ c    &  ishift_pdb
       character*80 card
       double precision sccor(3,20)
       integer rescode
+      logical lsecondary
       efree_temp=0.0d0
       ibeg=1
       ishift1=0
index e68a9d3..0201841 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)
@@ -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
index 70ed6fd..e4ab2a9 100644 (file)
@@ -406,7 +406,7 @@ c     &         "SSBOND_E_FORM",totT,t_bath,i,j
 c        endif
 #endif
 #endif
-      write(iout,*), 'DYN_SS_BOND',i,j,eij
+      write(iout,*)  'DYN_SS_BOND',i,j,eij
         dyn_ssbond_ij(i,j)=eij
       else if (.not.havebond .and. dyn_ssbond_ij(i,j).lt.1.0d300) then
         dyn_ssbond_ij(i,j)=1.0d300
index ecab9b4..11cad72 100644 (file)
@@ -153,7 +153,7 @@ C Next definitions for RS6000
        i1 = mclock()
        tcpu = (i1+0.0D0)/100.0D0
 #endif
-#ifdef LINUX
+#if defined(LINUX) && !defined(AIX)
 ****************************
 C Next definitions for Linux 
       real :: timar(2)
index e31db53..a7a3cd5 100644 (file)
@@ -68,7 +68,11 @@ c        print *,"N",n," NCON_WORK",ncon_work
         if (N.ne.ncon_work) then
           write (iout,*) "!!! Checksum error on processor",me,
      &      n,ncon_work
-          call flush(iout)
+#ifdef AIX
+      call flush_(iout)
+#else
+      call flush(iout)
+#endif
           call MPI_Abort( MPI_COMM_WORLD, Ierror, Errcode )
         endif
 
index 97592b7..8303f0c 100644 (file)
@@ -28,7 +28,7 @@
 c      print *,"calling WRTCLUST",ncon
 c      write (iout,*) "ICUT",icut," PRINTPDB ",PRINTPDB(icut)
       rewind 80
-      call flush(iout)
+c      call flush(iout)
       temper=1.0d0/(beta_h(ib)*1.987d-3)
       if (temper.lt.100.0d0) then
         write(ctemper,'(f3.0)') temper
@@ -97,7 +97,7 @@ c      write (iout,*) "ecut",ecut
           endif
 c          write (iout,*) " ncon",ncon,"i",i," j",j," ii",ii," jj",jj,
 c     &     " ind",ind
-          call flush(iout)
+c          call flush(iout)
           curr_dist=dabs(diss(ind)+0.0d0)
 c          write(iout,'(i10,4i4,f12.4)') ind,ii,jj,list_conf(ii),
 c     &      list_conf(jj),curr_dist
@@ -192,7 +192,7 @@ c            write (iout,*) i,ncon_out,nconf(i,ncon_out),
 c     &        totfree(nconf(i,ncon_out)),emin1,ecut
           enddo
 c          write (iout,*) "ncon_out",ncon_out
-          call flush(iout)
+c          call flush(iout)
           do j=1,nres
             tempfac(1,j)=5.0d0
             tempfac(2,j)=5.0d0
@@ -435,7 +435,7 @@ c      write (iout,*) "jcon",jcon," rms",rms," rmsmin",rmsmin
       endif
       ENDDO ! K
 c      write (iout,*) "rmsmin",rmsmin," rms",rms
-      call flush(iout)
+c      call flush(iout)
       do i=1,2*nres
         do j=1,3
           c(j,i)=allcart(j,i,jconmin)
index b02dd05..298cff3 100644 (file)
@@ -69,7 +69,7 @@ GAB: ${object} xdrf/libxdrf.a
 E0LL2Y: CPPFLAGS = -DPROCOR -DLINUX -DPGI -DAMD64 -DUNRES -DISNAN -DMP -DMPI \
        -DSPLITELE -DLANG0
 #E0LL2Y: BIN = ../../../bin/unres/MD/unres_ifort_MPICH2_E0LL2Y.exe
-E0LL2Y: BIN = ../../../bin/unres/MD/unres_ifort_MPICH_E0LL2Y.exe
+E0LL2Y: BIN = ../../../bin/unres/MD/unres_ifort_MPICH_E0LL2Y-200.exe
 E0LL2Y: ${object} xdrf/libxdrf.a
        cc -o compinfo compinfo.c
        ./compinfo | true
index 5d46bbb..5be1ec5 100644 (file)
@@ -28,12 +28,6 @@ cMS$ATTRIBUTES C ::  proc_proc
 c      print*,"ETOTAL Processor",fg_rank," absolute rank",myrank,
 c     & " nfgtasks",nfgtasks
       call flush(iout)
-#ifndef DFA
-      edfadis=0.0d0
-      edfator=0.0d0
-      edfanei=0.0d0
-      edfabet=0.0d0
-#endif
       if (nfgtasks.gt.1) then
 #ifdef MPI
         time00=MPI_Wtime()
@@ -105,6 +99,12 @@ c      if (modecalc.eq.12.or.modecalc.eq.14) then
 c        call int_from_cart1(.false.)
 c      endif
 #endif     
+#ifndef DFA
+      edfadis=0.0d0
+      edfator=0.0d0
+      edfanei=0.0d0
+      edfabet=0.0d0
+#endif
 #ifdef TIMING
 #ifdef MPI
       time00=MPI_Wtime()
@@ -6343,9 +6343,6 @@ c
 c        sgtheta=-gtheta(k)*theta_diff(k)*sigma_theta(k,i)*waga_theta ! right functional form?
           sum_sgtheta=sum_sgtheta+sgtheta ! cum variable
         enddo
-c       grad_theta3=sum_sgtheta/sum_gtheta 1/*theta(i)? s. line below
-c       grad_theta3=sum_sgtheta/sum_gtheta
-c
 c       Final value of gradient using same var as in Econstr_back
         gloc(nphi+i-2,icg)=gloc(nphi+i-2,icg)
      &      +sum_sgtheta/sum_gtheta*waga_theta
index 5a81655..acd3804 100644 (file)
@@ -205,17 +205,17 @@ C      syssec = timar(2)
 ****************************
 #endif
 
-#ifdef LINUX
+c#ifdef LINUX
 c****************************
-C Next definitions for sgi
-      real timar(2), etime
-      seconds = etime(timar)
+cC Next definitions for sgi
+c      real timar(2), etime
+c      seconds = etime(timar)
 Cd    print *,'seconds=',seconds,' stime=',stime
-      usrsec = timar(1)
-      syssec = timar(2)
-      tcpu=seconds - stime
+C      usrsec = timar(1)
+C      syssec = timar(2)
+c      tcpu=seconds - stime
 c****************************
-#endif
+c#endif
 
 
 #ifdef CRAY
index c6add4f..3c74bc8 100644 (file)
@@ -94,8 +94,3 @@ c    &       ,DFAEXP
      &             WSHET(MAXRES,MAXRES), EDFABET, 
      &             CK(4),SCK(4),S1(4),S2(4)
 c    &             ,DFAEXP(15001),
-
-      DATA CK/1.0D0,1.58740105197D0,2.08008382305D0,2.51984209979D0/
-      DATA SCK/1.0D0,1.25992104989D0,1.44224957031D0,1.58740105197D0/
-      DATA S1/3.75D0,5.75D0,7.75D0,9.75D0/
-      DATA S2/4.25D0,6.25D0,8.25D0,10.25D0/
index 711b6c7..6e2ba17 100644 (file)
@@ -71,7 +71,7 @@ E0LL2Y: ${objects} ${objects_compar} xdrf/libxdrf.a
        ./compinfo
        ${FC} -c ${FFLAGS} cinfo.f
        $(FC) ${OPT} ${objects} ${objects_compar} cinfo.o \
-       ${LIBS} -static-intel -o ${BIN}/wham_ifort_MPICH-restr-DFA_E0LL2Y-test.exe
+       ${LIBS} -static-intel -o ${BIN}/wham_ifort_MPICH-restr-DFA_E0LL2Y.exe
 
 xdrf/libxdrf.a:
        cd xdrf && make
index 7c7ae50..5c6d751 100644 (file)
@@ -84,7 +84,7 @@ c      print *,"bumbum"
       call xdrfint_(ixdrf, nprop, iret)
       if (umbrella(iparm) .or. homol_nset.gt.1 .or. read_iset(iparm) 
      &  .or. hamil_rep) 
-     &  call xdrfint(ixdrf, iset, iret)
+     &  call xdrfint_(ixdrf, iset, iret)
       do i=1,nprop
         call xdrffloat_(ixdrf, rprop(i), iret)
       enddo
index 80bc1a0..7c7ae50 100644 (file)
@@ -5,6 +5,7 @@
       include 'DIMENSIONS.FREE'
       integer MaxTraj
       parameter (MaxTraj=2050)
+      include 'COMMON.CONTROL'
       include 'COMMON.CHAIN'
       include 'COMMON.INTERACT'
       include 'COMMON.NAMES'
@@ -29,6 +30,7 @@
       integer is(MaxSlice),ie(MaxSlice),nrec_slice
       double precision ts(MaxSlice),te(MaxSlice),time_slice
       integer slice
+      logical conf_check
       call set_slices(is,ie,ts,te,iR,ib,iparm)
 
       do i=1,nQ
@@ -53,53 +55,98 @@ c      print *,"bumbum"
       do while (iret.gt.0) 
 
 #if (defined(AIX) && !defined(JUBL))
+#ifdef DEBUG
+      write (iout,*) "ii",ii," itraj",itraj," it",it
+#endif
       call xdrffloat_(ixdrf, rtime, iret)
-c      print *,"rtime",rtime," iret",iret
       call xdrffloat_(ixdrf, rpotE, iret)
-c      write (iout,*) "rpotE",rpotE," iret",iret
+#ifdef DEBUG
+      write (iout,*) "rtime",rtime," rpotE",rpotE," iret",iret
+#endif
       call flush(iout)
       call xdrffloat_(ixdrf, ruconst, iret)
       call xdrffloat_(ixdrf, rt_bath, iret)
       call xdrfint_(ixdrf, nss, iret)
+#ifdef DEBUG
+      write (iout,*) "ruconst",ruconst," rt_bath",rt_bath," nss",nss
+#endif
       do j=1,nss
+       if (dyn_ss) then
+        call xdrfint_(ixdrf, idssb(j), iret)
+        call xdrfint_(ixdrf, jdssb(j), iret)
+       idssb(j)=idssb(j)-nres
+       jdssb(j)=jdssb(j)-nres
+       else
         call xdrfint_(ixdrf, ihpb(j), iret)
         call xdrfint_(ixdrf, jhpb(j), iret)
+       endif
       enddo
       call xdrfint_(ixdrf, nprop, iret)
+      if (umbrella(iparm) .or. homol_nset.gt.1 .or. read_iset(iparm) 
+     &  .or. hamil_rep) 
+     &  call xdrfint(ixdrf, iset, iret)
       do i=1,nprop
         call xdrffloat_(ixdrf, rprop(i), iret)
       enddo
 #else
+#ifdef DEBUG
+      write (iout,*) "ii",ii," itraj",itraj," it",it
+#endif
       call xdrffloat(ixdrf, rtime, iret)
       call xdrffloat(ixdrf, rpotE, iret)
-c      write (iout,*) "rpotE",rpotE," iret",iret
+#ifdef DEBUG
+      write (iout,*) "rtime",rtime," rpotE",rpotE," iret",iret
+#endif
       call flush(iout)
       call xdrffloat(ixdrf, ruconst, iret)
       call xdrffloat(ixdrf, rt_bath, iret)
       call xdrfint(ixdrf, nss, iret)
+#ifdef DEBUG
+      write (iout,*) "ruconst",ruconst," rt_bath",rt_bath," nss",nss
+#endif
       do j=1,nss
+       if (dyn_ss) then
+        call xdrfint(ixdrf, idssb(j), iret)
+        call xdrfint(ixdrf, jdssb(j), iret)
+cc        idssb(j)=idssb(j)-nres
+cc        jdssb(j)=jdssb(j)-nres
+cc        write(iout,*) idssb(j),jdssb(j)
+       else
         call xdrfint(ixdrf, ihpb(j), iret)
         call xdrfint(ixdrf, jhpb(j), iret)
+       endif
       enddo
       call xdrfint(ixdrf, nprop, iret)
 c      write (iout,*) "nprop",nprop
+      if (it.gt.0 .and. nprop.ne.nprop_prev) then
+        write (iout,*) "Warning previous nprop",nprop_prev,
+     &   " current",nprop
+        nprop=nprop_prev
+      else
+        nprop_prev=nprop
+      endif
       call flush(iout)
+      if (umbrella(iparm) .or. homol_nset.gt.1 .or. read_iset(iparm) 
+     &  .or. hamil_rep) 
+     &  call xdrfint(ixdrf, iset, iret)
       do i=1,nprop
         call xdrffloat(ixdrf, rprop(i), iret)
       enddo
 #endif
       if (iret.eq.0) exit
       itraj=mod(it,totraj(iR,iparm))
-#ifdef DEBUG
-      write (iout,*) "ii",ii," itraj",itraj
-#endif
+      if (iset.eq.0) iset = 1
       call flush(iout)
       it=it+1
       if (itraj.gt.ntraj) ntraj=itraj
       nstep(itraj)=nstep(itraj)+1
+c      rprop(2)=dsqrt(rprop(2))
+c      rprop(3)=dsqrt(rprop(3))
 #ifdef DEBUG
+       write (iout,*) "umbrella ",umbrella
        write (iout,*) rtime,rpotE,rt_bath,nss,
      &     (ihpb(j),jhpb(j),j=1,nss),(rprop(j),j=1,nprop)
+       write (iout,*) "nprop",nprop," iset",iset," myparm",myparm
        call flush(iout)
 #endif
       prec=10000.0
@@ -127,105 +174,137 @@ c      call flush(iout)
 c      write (iout,*) "islice",islice
 c      call flush(iout)
 
-      if (islice.gt.0 .and. islice.le.nslice) then
+      do i=1,nres
+        do j=1,3
+          c(j,i)=xoord(j,i)
+        enddo
+      enddo
+      do i=1,nct-nnt+1
+        do j=1,3
+          c(j,i+nres+nnt-1)=xoord(j,i+nres)
+        enddo
+      enddo
+
+      if (islice.gt.0 .and. islice.le.nslice .and. (.not.separate_parset
+     &    .or. iset.eq.myparm)) then
         ii=ii+1
         kk(islice)=kk(islice)+1
         mm(islice)=mm(islice)+1
-        if (mod(nstep(itraj),isampl(iparm)).eq.0) then
-            if (replica(iparm)) then
-               rt_bath=1.0d0/(rt_bath*1.987D-3)
-               do i=1,nT_h(iparm)
-                 if (abs(real(beta_h(i,iparm))-rt_bath).lt.1.0e-4) then
-                   iib = i
-                   goto 22
-                 endif
-               enddo
-  22           continue
-               if (i.gt.nT_h(iparm)) then
-                 write (iout,*) "Error - temperature of conformation",
-     &           ii,1.0d0/(rt_bath*1.987D-3),
-     &           " does not match any of the list"
-                 write (iout,*)
-     &            1.0d0/(rt_bath*1.987D-3),
-     &            (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
-                 call flush(iout)
-                 exit
-                 call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
+        if (mod(nstep(itraj),isampl(iparm)).eq.0 .and. 
+     &     conf_check(ll(islice)+1,1)) then
+          if (replica(iparm)) then
+             rt_bath=1.0d0/(rt_bath*1.987D-3)
+             do i=1,nT_h(iparm)
+               if (abs(real(beta_h(i,iparm))-rt_bath).lt.1.0e-4) then
+                 iib = i
+                 goto 22
                endif
-            else
-                iib = ib
-            endif
+             enddo
+  22         continue
+             if (i.gt.nT_h(iparm)) then
+               write (iout,*) "Error - temperature of conformation",
+     &         ii,1.0d0/(rt_bath*1.987D-3),
+     &         " does not match any of the list"
+               write (iout,*)
+     &          1.0d0/(rt_bath*1.987D-3),
+     &          (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
+               call flush(iout)
+c               exit
+c               call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
+               ii=ii-1
+               kk(islice)=kk(islice)-1
+               mm(islice)=mm(islice)-1
+               goto 112
+             endif
+          else
+            iib = ib
+          endif
 
-            efree=0.0d0
-            jj(islice)=jj(islice)+1
+          efree=0.0d0
+          jj(islice)=jj(islice)+1
+          if (umbrella(iparm)) then
+            snk(iset,iib,iparm,islice)=snk(iset,iib,iparm,islice)+1
+          else if (hamil_rep) then
+            snk(1,iib,iparm,islice)=snk(1,iib,iparm,islice)+1
+          else
             snk(iR,iib,iparm,islice)=snk(iR,iib,iparm,islice)+1
-            ll(islice)=ll(islice)+1
+          endif
+          ll(islice)=ll(islice)+1
 #ifdef DEBUG
-            write (iout,*) "Writing conformation, record",ll(islice)
-            write (iout,*) "ib",ib," iib",iib
-            write (iout,*) "ntraj",ntraj," itraj",itraj,
-     &        " nstep",nstep(itraj)
-            write (iout,*) "pote",rpotE," time",rtime
-c            if (replica(iparm)) then
-c              write (iout,*) "TEMP",1.0d0/(rt_bath*1.987D-3)
-c              write (iout,*) "TEMP list"
-c              write (iout,*)
-c     &         (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
-c            endif
-            write (iout,*) "iparm",iparm," ib",ib," iR",iR," nQ",nQ
-c            write (iout,*) "nres",nres," nnt",nnt," nct",nct," nss",nss
-c            write (iout,*) "length",nres*4+(nct-nnt+1)*4+4+2*nss*4
-            call flush(iout)
+          write (iout,*) "Writing conformation, record",ll(islice)
+          write (iout,*) "ib",ib," iib",iib
+          write (iout,*) "ntraj",ntraj," itraj",itraj,
+     &      " nstep",nstep(itraj)
+          write (iout,*) "pote",rpotE," time",rtime
+c          if (replica(iparm)) then
+c            write (iout,*) "TEMP",1.0d0/(rt_bath*1.987D-3)
+c            write (iout,*) "TEMP list"
+c            write (iout,*)
+c     &       (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
+c          endif
+          write (iout,*) "iparm",iparm," ib",ib," iR",iR," nQ",nQ
+c          write (iout,*) "nres",nres," nnt",nnt," nct",nct," nss",nss
+c          write (iout,*) "length",nres*4+(nct-nnt+1)*4+4+2*nss*4
+          call flush(iout)
 #endif
-            if (islice.ne.islice1) then
-c              write (iout,*) "islice",islice," islice1",islice1
-              close(ientout) 
-c              write (iout,*) "Closing file ",
-c     &            bprotfile_temp(:ilen(bprotfile_temp))
-              call opentmp(islice,ientout,bprotfile_temp)
-c              write (iout,*) "Opening file ",
-c     &            bprotfile_temp(:ilen(bprotfile_temp))
-              islice1=islice
-            endif
+          if (islice.ne.islice1) then
+c            write (iout,*) "islice",islice," islice1",islice1
+            close(ientout) 
+c            write (iout,*) "Closing file ",
+c     &          bprotfile_temp(:ilen(bprotfile_temp))
+            call opentmp(islice,ientout,bprotfile_temp)
+c            write (iout,*) "Opening file ",
+c     &          bprotfile_temp(:ilen(bprotfile_temp))
+            islice1=islice
+          endif
+          if (umbrella(iparm) .or. homol_nset.gt.1) then
+            write(ientout,rec=ll(islice))
+     &        ((xoord(l,k),l=1,3),k=1,nres),
+     &        ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
+     &        nss,(ihpb(k),jhpb(k),k=1,nss),
+     &        rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
+     &        iset,iib,iparm
+          else if (hamil_rep) then
+            write(ientout,rec=ll(islice))
+     &        ((xoord(l,k),l=1,3),k=1,nres),
+     &        ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
+     &        nss,(ihpb(k),jhpb(k),k=1,nss),
+     &        rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
+     &        iR,iib,iset
+          else
             write(ientout,rec=ll(islice))
      &        ((xoord(l,k),l=1,3),k=1,nres),
      &        ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
      &        nss,(ihpb(k),jhpb(k),k=1,nss),
      &        rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
      &        iR,iib,iparm
+          endif
 #ifdef DEBUG
-            do i=1,nres
-              do j=1,3
-                c(j,i)=xoord(j,i)
-              enddo
-            enddo
-            do i=1,nct-nnt+1
-              do j=1,3
-                c(j,i+nres+nnt-1)=xoord(j,i+nres)
-              enddo
-            enddo
-            call int_from_cart1(.false.)
-            write (iout,*) "Writing conformation, record",ll(islice)
-            write (iout,*) "Cartesian coordinates"
-            write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
-            write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
-            write (iout,*) "Internal coordinates"
-            write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
-            write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
-            write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
-            write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
-            write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
-            write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
-            write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
-c            write (iout,'(8f10.5)') (rprop(j),j=1,nQ)
-            write (iout,'(16i5)') iscor
-            call flush(iout)
+          write (iout,*) " constr_homology",constr_homology,
+     &      " ll",ll(islice)," iset",iset
+          call int_from_cart1(.false.)
+          write (iout,*) "Writing conformation, record",ll(islice)
+          write (iout,*) "Cartesian coordinates"
+          write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
+          write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
+          write (iout,*) "Internal coordinates"
+          write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
+          write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
+          write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
+          write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
+          write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
+          write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
+          write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
+c          write (iout,'(8f10.5)') (rprop(j),j=1,nQ)
+          write (iout,'(16i5)') iscor
+          call flush(iout)
 #endif
         endif 
       endif
 
-      enddo
   112 continue
+
+      enddo
       close(ientout)
 #if (defined(AIX) && !defined(JUBL))
       call xdrfclose_(ixdrf, iret)
index 576910c..922f933 100644 (file)
@@ -1,3 +1,14 @@
+      block data dfadata
+      include 'DIMENSIONS'
+      include 'COMMON.INTERACT'
+      include 'COMMON.DFA'
+      DATA CK/1.0D0,1.58740105197D0,2.08008382305D0,2.51984209979D0/
+      DATA SCK/1.0D0,1.25992104989D0,1.44224957031D0,1.58740105197D0/
+      DATA S1/3.75D0,5.75D0,7.75D0,9.75D0/
+      DATA S2/4.25D0,6.25D0,8.25D0,10.25D0/
+      end
+c------------------------------------------------------------------------
+
       subroutine init_dfa_vars
 
       include 'DIMENSIONS'
index 0f7d34c..3d878ad 100644 (file)
@@ -167,6 +167,8 @@ c     &   " kfac",kfac,"quot",quot," fT",fT
         call etotal(energia(0),fT)
         if (constr_homology) energia(0)=energia(0)+
      &   waga_homology(iset)*energia(22)
+        write (iout,*) "constr_homology",constr_homology," iset",iset,
+     &   " waga_homology",waga_homology(iset)
 #ifdef DEBUG
         write (iout,*) "Conformation",i
         call enerprint(energia(0),fT)
index 278018a..a736e9c 100644 (file)
@@ -509,6 +509,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
index 6261f50..e90d954 100644 (file)
@@ -25,6 +25,7 @@ c    &  ishift_pdb
       character*80 card
       double precision sccor(3,20)
       integer rescode
+      logical lsecondary
       efree_temp=0.0d0
       ibeg=1
       ishift1=0
index 2a4a5b0..9d859c5 100644 (file)
@@ -406,7 +406,7 @@ c     &         "SSBOND_E_FORM",totT,t_bath,i,j
 c        endif
 #endif
 #endif
-      write(iout,*), 'DYN_SS_BOND',i,j,eij
+      write(iout,*)'DYN_SS_BOND',i,j,eij
         dyn_ssbond_ij(i,j)=eij
       else if (.not.havebond .and. dyn_ssbond_ij(i,j).lt.1.0d300) then
         dyn_ssbond_ij(i,j)=1.0d300
index 1012457..0713190 100644 (file)
@@ -98,7 +98,7 @@ C      syssec = timar(2)
 ****************************
 #endif
 
-#ifdef LINUX
+#if defined(LINUX) && ! defined(AIX)
 ****************************
 C Next definitions for sgi
       real timar(2), etime, seconds