#!/bin/sh

# This shel script creates compresses DOUAR output files
# that are contained in a given directory
# it uses the a2b compressor (written by Jean as a2b.f90)

#DIRECTORY=OUT
#LIMIT=513
#arg=504
#step=1

DIRECTORY=$1
LIMIT=$3
arg=$2
step=$4

while [ "$arg" -le $LIMIT ]
do
echo DOING $arg
echo $DIRECTORY > decompress.in
echo $arg >> decompress.in
echo "n" >> decompress.in
./b2ab < decompress.in
echo $arg DONE
let "arg+=step"
done
