Index: EXAMPLES/1bdd.seq
===================================================================
--- EXAMPLES/1bdd.seq	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ EXAMPLES/1bdd.seq	(revision e40e335d8909b50cd784019735fcdb0c28ee19bb)
@@ -5,3 +5,2 @@
   SER GLN SER ALA ASN LEU LEU ALA GLU ALA 
   LYS LYS LEU ASN ASP ALA
-
Index: EXAMPLES/Makefile
===================================================================
--- EXAMPLES/Makefile	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ EXAMPLES/Makefile	(revision e40e335d8909b50cd784019735fcdb0c28ee19bb)
@@ -38,5 +38,5 @@
 # F_FLAGS=-c -fPIC -O3 -funroll-loops -mmmx -msse2 -msse -march=i686 -malign-double -fomit-frame-pointer
 # Select your compiler
-# F90=gfortran
+#F90=gfortran
 F90=ifort
 #F90=pgf90
Index: EXAMPLES/multicanonical.f
===================================================================
--- EXAMPLES/multicanonical.f	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ EXAMPLES/multicanonical.f	(revision e40e335d8909b50cd784019735fcdb0c28ee19bb)
@@ -31,5 +31,5 @@
 !     Change the following directory path to where you want to put SMMP
 !     libraries of residues. 
-      libdir='../../SMMP/'
+      libdir='../SMMP/'
 
 !!     Choose energy type with the following switch
@@ -58,5 +58,5 @@
       iabin = 1  ! =0: read from PDB-file
                  ! =1: ab Initio from sequence (& variables)
-      seqfile='1vp.seq'
+      seqfile='enkefa.seq'
 !      varfile='EXAMPLES/enkefa.var'
       varfile = ' '
@@ -77,10 +77,10 @@
       temp=1000.0
 
-!      call mulcan_par(nsweeps, nup, temp, kmin, kmax, binWidth, l_iter)
+      call mulcan_par(nsweeps, nup, temp, kmin, kmax, binWidth, l_iter)
 ! Uncomment the following three lines to perform a multi canonical simulation with
 ! the parameters stored in muca.d
-       nmes = 1000
-       call mulcan_sim(nmes, nsweeps, nmes, nup, kmin, kmax, binWidth, 
-     &                l_iter)
+!       nmes = 1000
+!       call mulcan_sim(nmes, nsweeps, nmes, nup, kmin, kmax, binWidth, 
+!      &                l_iter)
       end program multicanonical_main
 
Index: EXAMPLES/multicanonical.mod
===================================================================
--- EXAMPLES/multicanonical.mod	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../multicanonical.mod
Index: EXAMPLES/parallel_tempering_p.f
===================================================================
--- EXAMPLES/parallel_tempering_p.f	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ EXAMPLES/parallel_tempering_p.f	(revision e40e335d8909b50cd784019735fcdb0c28ee19bb)
@@ -125,4 +125,6 @@
       upchswitch=1
       rndord=.true.
+      
+      if (ientyp.eq.2) call init_lundff
 !     =================================================================
 !     Distribute nodes to parallel tempering tasks
@@ -196,8 +198,5 @@
      &        fileNameMP(filebase, 6, 9, rep_id + 1))
       endif
-      call init_lund
-      if (ientyp.eq.2) call init_lundff
       if (ientyp.eq.3) call init_abgn
-
 
 !     ========================================  start of parallel tempering run
Index: EXAMPLES/parallel_tempering_s.f
===================================================================
--- EXAMPLES/parallel_tempering_s.f	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ EXAMPLES/parallel_tempering_s.f	(revision e40e335d8909b50cd784019735fcdb0c28ee19bb)
@@ -20,21 +20,21 @@
       integer switch
 
-! =================================================== Energy setup
+c =================================================== Energy setup
 
-!            Directory for SMMP libraries
-!     Change the following directory path to where you want to put SMMP
-!     libraries of residues. 
+c            Directory for SMMP libraries
+c     Change the following directory path to where you want to put SMMP
+c     libraries of residues. 
       libdir='../SMMP/'
 
-!      The switch in the following line is now not used.
+c      The switch in the following line is now not used.
       flex=.false.        ! .true. for Flex  / .false. for ECEPP
 
-!     Choose energy type with the following switch instead ...
+c     Choose energy type with the following switch instead ...
       ientyp = 0
-!        0  => ECEPP2 or ECEPP3 depending on the value of sh2
-!        1  => FLEX 
-!        2  => Lund force field
-!        3  => ECEPP with Abagyan corrections
-!
+c        0  => ECEPP2 or ECEPP3 depending on the value of sh2
+c        1  => FLEX 
+c        2  => Lund force field
+c        3  => ECEPP with Abagyan corrections
+c
 
       sh2=.false.         ! .true. for ECEPP/2; .false. for ECEPP3
@@ -48,5 +48,5 @@
       call init_energy(libdir)
 
-! ================================================= Structure setup
+c ================================================= Structure setup
 
       grpn = 'nh2' ! N-terminal group
@@ -59,5 +59,5 @@
       ntlml = 0
       write (*,*) 'Solvent: ', itysol
-!     Initialize random number generator.
+c     Initialize random number generator.
       call sgrnd(31433)
       
@@ -69,8 +69,8 @@
 
       call init_molecule(iabin,grpn,grpc,seqfile,varfile)
-! Decide if and when to use BGS, and initialize Lund data structures 
+c Decide if and when to use BGS, and initialize Lund data structures 
       bgsprob=0.75   ! Prob for BGS, given that it is possible
-! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 
-! 2 => temperature dependent choice 
+c upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 
+c 2 => temperature dependent choice 
       upchswitch=1
       rndord=.true.
@@ -80,5 +80,5 @@
       
 
-! ========================================  Add your task down here
+c ========================================  Add your task down here
       num_rep = 5
       nequi = 100
@@ -87,5 +87,5 @@
       newsta = .true.
       switch = 1
-!     parallel tempering on a single CPU
+c     parallel tempering on a single CPU
       eol = energy()
       write (*,*) "Energy before randomization:", eol
@@ -94,4 +94,4 @@
       write (*,*) "Final energy:", eol
 
-! ========================================  End of main      
+c ========================================  End of main      
        end
Index: EXAMPLES/partem_p.f
===================================================================
--- EXAMPLES/partem_p.f	(revision 87ddcf7a314d90070d607f0ec7ac0a700b843abc)
+++ EXAMPLES/partem_p.f	(revision e40e335d8909b50cd784019735fcdb0c28ee19bb)
@@ -1,30 +1,30 @@
-!**************************************************************
-!     
-! This file contains the subroutines: partem_p 
-! Compared to the version in the main distribution, this
-! routine doesn't write the rmsd nor native contacts to the time
-! series.
-!     
-! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
-!                      Shura Hayryan, Chin-Ku Hu
-! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
-!                      Jan H. Meinke, Sandipan Mohanty
-!     
-!     **************************************************************
+c**************************************************************
+c     
+c This file contains the subroutines: partem_p 
+C Compared to the version in the main distribution, this
+C routine doesn't write the rmsd nor native contacts to the time
+C series.
+c     
+c Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
+c                      Shura Hayryan, Chin-Ku Hu
+c Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
+c                      Jan H. Meinke, Sandipan Mohanty
+c     
+c     **************************************************************
 
       subroutine  partem_p(num_rep, nequi, nswp, nmes, nsave, newsta,
      &                     switch, rep_id, partem_comm)
-!     
-!     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM 
-!     ON PARALLEL COMPUTERS USING MPI
-!     
-!     switch: Choses the starting configuration:
-!     -1 - stretched configuration
-!     0 - don't change anything
-!     1 - random start configuration
-!     
-!     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
-!     outvar,(rand),rgyr
-!     
+C     
+C     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM 
+C     ON PARALLEL COMPUTERS USING MPI
+C     
+C     switch: Choses the starting configuration:
+C     -1 - stretched configuration
+C     0 - don't change anything
+C     1 - random start configuration
+C     
+c     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
+c     outvar,(rand),rgyr
+C     
       include '../INCL.H'
       include '../INCP.H'
@@ -37,8 +37,8 @@
       external can_weight
 
-!     nequi:  number of Monte Carlo sweeps for thermalization
-!     nswp:   number of Monte Carlo sweeps
-!     nmes:   number of Monte Carlo sweeps between measurments
-!     newsta: .true. for new simulations, .false. for re-start
+C     nequi:  number of Monte Carlo sweeps for thermalization
+C     nswp:   number of Monte Carlo sweeps
+C     nmes:   number of Monte Carlo sweeps between measurments
+C     newsta: .true. for new simulations, .false. for re-start
 
       dimension  eavm(MAX_PROC),sph(MAX_PROC),intem(MAX_PROC),
@@ -50,23 +50,23 @@
       double precision    e_min, e_minp(MAX_PROC), e_minpt(MAX_PROC)
       integer   h_max, h_maxp(MAX_PROC)
-!     Order of replica exchange
+c     Order of replica exchange
       integer   odd
 !     Counter to keep random number generators in sync
       integer randomCount
       
-!     Collect partial energies. Only the root writes to disk. We have to
-!     collect the information from the different replicas and provide 
-!     arrays to store them.
-!     eyslr    storage array for solvent energy
-!     eyelp     -      "        - coulomb energy
-!     eyvwp     -      "        - van-der-Waals energy
-!     eyhbp     -      "        - hydrogen bonding energy
-!     eysmi    -      "        - intermolecular interaction energy
+c     Collect partial energies. Only the root writes to disk. We have to
+c     collect the information from the different replicas and provide 
+c     arrays to store them.
+c     eyslr    storage array for solvent energy
+c     eyelp     -      "        - coulomb energy
+c     eyvwp     -      "        - van-der-Waals energy
+c     eyhbp     -      "        - hydrogen bonding energy
+c     eysmi    -      "        - intermolecular interaction energy
       double precision eyslr(MAX_PROC)
       double precision eyelp(MAX_PROC),eyvwp(MAX_PROC),eyhbp(MAX_PROC), 
      &     eyvrp(MAX_PROC),eysmip(MAX_PROC)
-!     Collect information about accessible surface and van-der-Waals volume
-!     asap      storage array for solvent accessible surface
-!     vdvolp     storage array for van-der-Waals volume
+c     Collect information about accessible surface and van-der-Waals volume
+c     asap      storage array for solvent accessible surface
+c     vdvolp     storage array for van-der-Waals volume
       double precision asap(MAX_PROC), vdvolp(MAX_PROC)
 
@@ -75,11 +75,11 @@
       integer imhbp(MAX_PROC)
       character*80 filebase, fileNameMP, tbase0,tbase1
-!     frame     frame number for writing configurations
-!     trackID   configuration that should be tracked and written out
-!     dir          direction in random walk
-!     -1 - visited highest temperature last
-!     1 - visited lowest temperature last
-!     0 - haven't visited the boundaries yet.
-!     dirp      storage array for directions.
+c     frame     frame number for writing configurations
+c     trackID   configuration that should be tracked and written out
+c     dir          direction in random walk
+c     -1 - visited highest temperature last
+c     1 - visited lowest temperature last
+c     0 - haven't visited the boundaries yet.
+c     dirp      storage array for directions.
       integer frame, trackID, dir
       integer dirp(MAX_PROC)
@@ -92,7 +92,7 @@
      &            rep_id, num_rep, partem_comm, myrank
       call flush(6)
-!     
-!     
-!     File with temperatures 
+C     
+c     
+C     File with temperatures 
       open(11,file='temperatures_abeta',status='old')
       
@@ -100,9 +100,9 @@
       open(18,file=fileNameMP(tbase0,5,9,rep_id),status='unknown')
       if (rep_id.eq.0.and.myrank.eq.0) then
-!     File with time series of simulation
+c     File with time series of simulation
          open(14,file='ts.d',status='unknown')
       endif
       
-!     READ IN TEMPERATURES
+C     READ IN TEMPERATURES
       do i=1,num_rep
          read(11,*) j,temp
@@ -111,8 +111,8 @@
       close(11)
 
-!     nresi:  number of residues
+c     nresi:  number of residues
       nresi=irsml2(1)-irsml1(1)+1
-!     
-!     Initialize variables
+C     
+C     Initialize variables
       do i=1,num_rep      
          acx1(i) = 0.0d0
@@ -132,5 +132,5 @@
       dir = dirp(rep_id + 1)
 
-!     _________________________________ Initialize Variables
+c     _________________________________ Initialize Variables
       if(newsta) then
          iold=0
@@ -139,5 +139,5 @@
             intem(i) = i
          end do
-!     _________________________________ initialize starting configuration
+c     _________________________________ initialize starting configuration
          if (switch.ne.0) then
             do i=1,nvr
@@ -173,9 +173,9 @@
          CALL MPI_BCAST(INODE,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,IERR)
          CALL MPI_BCAST(YOL,num_rep,MPI_DOUBLE_PRECISION,0,
-     &        MPI_COMM_WORLD,IERR)
+     #        MPI_COMM_WORLD,IERR)
          CALL MPI_BCAST(E_MINP, num_rep, MPI_DOUBLE_PRECISION, 0, 
-     &        MPI_COMM_WORLD, IERR)
+     #        MPI_COMM_WORLD, IERR)
          CALL MPI_BCAST(h_maxp,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
-     &        IERR)
+     $        IERR)
       end if
       
@@ -189,8 +189,8 @@
          write(*,*) rep_id, yol(rep_id + 1), eol
       endif
-!     Start of simulation
+C     Start of simulation
       write (*,*) '[',rep_id, myrank, beta, partem_comm,
      &            '] Energy before equilibration:', eol
-!     =====================Equilibration by canonical Metropolis
+c     =====================Equilibration by canonical Metropolis
       do nsw=1,nequi
          call metropolis(eol,acz,can_weight)
@@ -199,9 +199,9 @@
       write (*,*) '[',rep_id,'] Energy after equilibration:', eol
       call flush(6)
-!     
-!======================Multiple Markov Chains
+C     
+C======================Multiple Markov Chains
       acz = 0
       do nsw=1,nswp
-!------------First ordinary Metropolis 
+c------------First ordinary Metropolis 
          call metropolis(eol,acz,can_weight)
          iold = iold + 1	
@@ -214,10 +214,10 @@
             endif
             acz0 = acz
-!     Measure global radius of gyration
+C     Measure global radius of gyration
             call rgyr(0,rgy,ee)  
             rgyp = rgy
-!     Measure Helicity and Sheetness
+C     Measure Helicity and Sheetness
             call helix(nhel,mhel,nbet,mbet)
-!     Measure Number of hydrogen bonds
+C     Measure Number of hydrogen bonds
             mhb = 0
             do i = 1, ntlml
@@ -226,10 +226,10 @@
             enddo
             call interhbond(imhb) 
-!     Measure total number of contacts (NCTOT) and number of
-!     native contacts (NCNAT)
+C     Measure total number of contacts (NCTOT) and number of
+C     native contacts (NCNAT)
             call contacts(nctot,ncnat,dham)
-!     Add tracking of lowest energy configuration
+c     Add tracking of lowest energy configuration
             if (eol.lt.e_min) then
-!     Write out configuration
+c     Write out configuration
                i=rep_id+1
                j=inode(i)
@@ -248,7 +248,7 @@
                close(15)
             endif
-!     Add tracking of configuration with larges hydrogen contents.
+c     Add tracking of configuration with larges hydrogen contents.
             if ((mhb + imhb).gt.h_max) then
-!     Write out configuration
+c     Write out configuration
                i = rep_id + 1
                j = inode(i)
@@ -268,6 +268,6 @@
             endif
 
-!     
-!--------------------Gather measurement data
+C     
+C--------------------Gather measurement data
 ! I only use the master node of each replica for data collection. The
 ! variable partem_comm provides the appropriate communicator.
@@ -310,10 +310,10 @@
      &              MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
 
-!     Write trajectory
+c     Write trajectory
                write (18,*) '@@@',iold,inode(rep_id+1)
                call outvbs(0,18)
                write (18,*) '###'
 !                call flush(18)
-!     Write current configuration
+c     Write current configuration
                if ((mod(iold, nsave).eq.0)) then
                   filebase = "conf_0000.var"
@@ -324,15 +324,15 @@
             if(rep_id.eq.0.and.myrank.eq.0) then
                randomCount = 0
-!  Update acceptance, temperature wise average of E and E^2 used to calculate
-!  specific heat. 
+c  Update acceptance, temperature wise average of E and E^2 used to calculate
+c  specific heat. 
                do i=1,num_rep
                   j=intem(i)
                   acy(i)=0.0
-!  Above: contents of acy1 are added to acy(i) a few lines down. 
-!  acy1(intem(i)) contains information received from the node at temperature
-!  i, on how many updates have been accepted in node intem(i). Since acz
-!  is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there 
-!  will be serious double counting and the values of acceptance printed 
-!  will be simply wrong.
+c  Above: contents of acy1 are added to acy(i) a few lines down. 
+c  acy1(intem(i)) contains information received from the node at temperature
+c  i, on how many updates have been accepted in node intem(i). Since acz
+c  is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there 
+c  will be serious double counting and the values of acceptance printed 
+c  will be simply wrong.
                   e_minpt(i)=e_minp(intem(i))
                end do
@@ -346,5 +346,5 @@
 
 
-!     Write measurements to the time series file ts.d
+C     Write measurements to the time series file ts.d
                do i=1,num_rep
                   j=intem(i)
@@ -354,5 +354,5 @@
                       
                end do
-!     Write the current parallel tempering information into par_R.in
+c     Write the current parallel tempering information into par_R.in
                if ((mod(iold, nsave).eq.0))
      &         then
@@ -363,6 +363,6 @@
      &                    h_maxp(i)
                   end do
-!     -------------------------- Various statistics of current run
-!               swp=nswp-nequi
+C     -------------------------- Various statistics of current run
+c               swp=nswp-nequi
                   swp=nsw
                   write(13,*) 'Acceptance rate for change of chains:'
@@ -370,7 +370,7 @@
                      temp=1.0d0/pbe(k1)/0.00198773
                      write(13,*) temp, acx1(k1)*2.0d0*nmes/swp 
-!  Above: it's the acceptance rate of exchange of replicas. Since a 
-!  replica exchange is attempted only once every nmes sweeps, the 
-!  rate should be normalized with (nmes/swp).
+c  Above: it's the acceptance rate of exchange of replicas. Since a 
+c  replica exchange is attempted only once every nmes sweeps, the 
+c  rate should be normalized with (nmes/swp).
                   end do 
                   write(13,*)
@@ -381,12 +381,12 @@
                      geavm(k1) = nmes*eavm(k1)/swp
                      gsph(k1)  = (nmes*sph(k1)/swp-geavm(k1)**2)
-     &                    *beta*beta/nresi
+     #                    *beta*beta/nresi
                      write(13,'(a,2f9.2,i4,f12.3)') 
      &                    'Temperature, Node,local acceptance rate:',
      &                    beta,temp,k,acy(k1)/dble(nsw*nvr)
-!  Above: Changed (nswp-nequi) in the denominator of acceptance as 
-!  acceptance values are initialized to 0 after equilibration cycles are
-!  finished. Note also that since this is being written in the middle of
-!  the simulation, it is normalized to nsw instead of nswp.
+c  Above: Changed (nswp-nequi) in the denominator of acceptance as 
+c  acceptance values are initialized to 0 after equilibration cycles are
+c  finished. Note also that since this is being written in the middle of
+c  the simulation, it is normalized to nsw instead of nswp.
                      write(13,'(a,3f12.2)') 
      &                    'Last Energy, Average Energy, Spec. Heat:', 
@@ -401,10 +401,10 @@
                end if   
 
-!--------------------Parallel Tempering  update
-!     Swap with right neighbor (odd, even)            
+C--------------------Parallel Tempering  update
+c     Swap with right neighbor (odd, even)            
                if(odd.eq.1) then
                   nu=1
                   no1 = num_rep-1
-!     Swap with left neighbor (even, odd)
+c     Swap with left neighbor (even, odd)
                else
                   nu = 2
@@ -413,5 +413,5 @@
                do i=nu,no1,2
                   j=i+1
-!     Periodic bc for swaps
+c     Periodic bc for swaps
                   if(i.eq.num_rep) j=1
                   iidx=intem(i)
@@ -429,13 +429,13 @@
                   end if
                end do
-!     ---------------- End Loop over nodes which creates a new temperature
-!     map for all nodes, at the node with rank 0. 
-!     
+c     ---------------- End Loop over nodes which creates a new temperature
+c     map for all nodes, at the node with rank 0. 
+c     
                odd = 1 - odd
             end if
-!     End of "if (myrank.eq.0) ...". The block above includes PT update and 
-!     writing of observables into the time series file etc. 
+c     End of "if (myrank.eq.0) ...". The block above includes PT update and 
+c     writing of observables into the time series file etc. 
            
-!     Below: Communicate new temperature-node map to all nodes
+c     Below: Communicate new temperature-node map to all nodes
             CALL MPI_BCAST(INTEM,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
      &           IERR)
@@ -446,5 +446,5 @@
             CALL MPI_BCAST(H_MAXP,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,
      &           IERR)
-! Synchronize random number generators for replica 0
+c Synchronize random number generators for replica 0
             if (rep_id.eq.0) then
                CALL MPI_BCAST(randomCount,1,MPI_INTEGER,0,my_mpi_comm,
@@ -467,10 +467,10 @@
 
          endif
-!        End of "if (mod(iold,nmes).eq.0) ..."
+c        End of "if (mod(iold,nmes).eq.0) ..."
       end do
-!-----------End Loop over sweeps
-!     
-!     OUTPUT:
-!--------------------For Re-starts:
+c-----------End Loop over sweeps
+c     
+C     OUTPUT:
+C--------------------For Re-starts:
       nu = rep_id + 1
       filebase = "conf_0000.var"
@@ -484,7 +484,7 @@
       if (partem_comm.ne.MPI_COMM_NULL) then
          CALL MPI_GATHER(EOL0,1,MPI_DOUBLE_PRECISION,YOL,1,
-     &        MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
+     #        MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
          CALL MPI_GATHER(acz0,1,MPI_DOUBLE_PRECISION,acy1,1,
-     &     MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
+     #     MPI_DOUBLE_PRECISION,0,partem_comm,IERR)
       endif
       
@@ -496,5 +496,5 @@
             write(13,*) i,inode(i),intem(i),yol(i),e_minp(i),h_maxp(i)
          end do
-!     -------------------------- Various statistics of current run
+C     -------------------------- Various statistics of current run
          swp=nswp
          write(13,*) 'Acceptance rate for change of chains:'
@@ -519,9 +519,9 @@
          end do
          close(13)
-!         close(16)
+c         close(16)
       end if
       close(18)
 
-!     =====================
+c     =====================
       CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)
 
