#!/bin/sh

NP=2
NK=2
NE=1
dvol=1
nvol=11
inivol=20

rm -f energy.data
rm -f log
echo -n 'start time:'>>log ; date >> log
for v in `seq 1 $nvol`; do
  vol=$( echo \($v-1\)*$dvol+$inivol | bc -l )
  a=$( echo e\(l\($vol\)/3\) | bc -l )
  mkdir -p vol$vol/
  echo -n $vol >> energy.data ; tail -1 vol$vol/nfefn.data >> energy.data
  if [ -f stop ]; then
    echo 'the stop file exists... exiting. '
    rm -f stop
    if [ "a" = "$na" ]; then
      echo ' ' >> energy.data
    fi
    echo -n 'end time:'>>log ; date >> log
    exit
  fi
done
echo -n 'end time:'>>log ; date >> log
