do_ga=.false.
endif
-c End of "fisrst time here?" code
+c End of "first time here?" code
endif
c
write(tmptext,'(F7.5)') avrd
call write2log("Average distance between individuals in initial&
& bank is "//trim(tmptext))
+c
+c Cutoff
+c
csacutoff=(maxco*avrd)-generation*avrd*(maxco-minco)/maxgen
write(tmptext,'(F7.5)') csacutoff
call write2log("CSA cutoff is now set to "//trim(tmptext))
endif
case('cluster')
- write(*,*) "Some stuff here in the future"
+ write(*,*) "Well this is not implemented yet"
goto 2010
end select
end subroutine
c ======================================================================
+c WriteBankHistory subroutine
+c ======================================================================
+c Writes CSA BANK History to file
+c ----------------------------------------------------------------------
+ subroutine WriteBankHistory(b)
+ include 'io.inc'
+ include 'common.inc'
+ real*8,dimension(banksize,21) :: b
+ character*250 :: tmptext
+ character*250 :: header
+
+
+ header="# WLONG WSCP WELEC WBOND WANG WSC&
+ &LOC WTOR WTORD WCORRH WCORR4 WCORR5 WCORR6 &
+ &WEL_LOC WTURN3 WTURN4 WTURN6 WVDWPP WHPB WSCCO&
+ &R FFV FITNESS"
+
+ call write2log("Writing Bank history to file "//obankhfn)
+ open(obankh, file = obankhfn)
+ write(iobank, "(A)") trim(adjustl(header))
+
+ do i=1,banksize
+ write(obankh,'(19F10.5,E15.7,F10.5)') (b(i,j),j=1,21)
+ write(tmptext,'(19F10.5,E15.7,F10.5)') (b(i,j),j=1,21)
+ call write2log(trim(tmptext))
+ enddo
+ close(iobank)
+ end subroutine
+
+c
+c ======================================================================
c ReadBank subroutine
c ======================================================================
c Read CSA BANK from file
real*8 :: minco = 0.0 ! minimal CSA cutoff factor
real*8 :: maxco = 0.0 ! maximal CSA cutoff factor
real*8 :: avrd = 0.0 ! average distance between ind in first bank
- logical :: do_optima = .false.
- logical :: do_ga = .false.
- logical :: do_fs = .false.
- character*32 :: pdbfiles(maxnpdb)
- character*32 :: scripts(maxscripts)
- character*32 :: whamtemplate(maxnpdb)
- character*32 :: mremdtemplate(maxnpdb)
- character*16 :: alg
+ logical :: do_optima = .false. ! do optimization in this step (internal variable)
+ logical :: do_ga = .false. ! do genetic algotithm in this step (internal variable)
+ logical :: do_fs = .false. ! do first step (internal variable)
+ character*32 :: pdbfiles(maxnpdb) ! PDB filenames
+ character*32 :: scripts(maxscripts) ! shell scripts filenames
+ character*32 :: whamtemplate(maxnpdb) ! WHAM template filenames
+ character*32 :: mremdtemplate(maxnpdb) ! MREMD template filenames
+ character*32 :: zscoretemplate ! ZSCORE template filename
+ character*16 :: alg ! algorithm type (internal variable)
common /inputy/ npdb,nscripts,ntwham,ntmremd,maxgen,banksize,csacu&
&toff,avrd,minco,maxco,alg,pdbfiles,scripts,whamtemplate,mremdtempl&
&ate,generation,maxminstep,do_optima, do_ga
- character*7 :: version = "1.1.1"
- character*50 :: info = "= Last modified by Lightnir 09/03/2012"
+ character*7 :: version = "1.1.2"
+ character*50 :: info = "= Last modified by Lightnir 04/07/2012"
real*8,allocatable :: bank(:,:),populacja(:,:),temppopulacja(:,:)
integer*4, allocatable :: pairs(:)
integer :: izsoptw = 16 ! zscore optimized weights files
integer :: izenergy = 17
integer :: iobank = 18
+ integer :: obankh = 19 ! csa bank history file
c -- I/O filenames
character*20 :: owfn = "weights"
character*20 :: opopsumfn = "population.summary"
character*20 :: ostatefn = "unresga.state" ! unresga state file
character*20 :: izenergyfn = "zscore.out_par" ! zscore generated output prefix
- character*20 :: iobankfn = "unresga.bank" ! csa bank file
+ character*20 :: iobankfn = "unresga.bank" ! csa current bank file
+ character*20 :: obankhfn = "unresga.bank.history" ! csa bank history file