#!/bin/bash

  cd /uufs/chpc.utah.edu/common/home/u0818159/gaac/a2/curves/2000ns/decay
  pwd
  rm -rf data
  mkdir data
  rm *.cda
  rm *.lis

start=0

for i in {1..400};
do

  echo "////////////////////////////////////"
  echo "Processing curves with start: $start"
  echo "////////////////////////////////////"
  let end=$start+1

~/scripts/curves/Cur+ << EOF
 &inp 
    file=../GAAC-strip-noions-2000ns.trj, 
    ftop=../../invacuo.topo,
    lib=/uufs/chpc.utah.edu/common/home/u0181375/src/Curves-plus/standard,
    lis=curves-info_$start-$end,
    itst=$start,
    itnd=$end,
    itdel=1,
 &end
2 1 -1 0 0
1:18
36:19
EOF

  echo "Running canal for curves-info_$start-$end"

for ((i=1; i<=18; i += 1)); do

RES=$i

echo '---'
echo 'Basepair' $RES

~/scripts/curves/canal <<!
   &inp 
     lis=$RES.cn_out_$start-$end,
     seq=*,
     series=.f.,
     histo=.f.,
     lev1=$RES,
     lev2=$RES,
   &end
curves-info_$start-$end GCACGAACGAACGAACGC
!

echo 'Moving'

mv $RES.cn_out_$start-$end.lis data/


echo 'CANAL done'

done


    let "start +=1"

done
