#!/bin/bash
#
# tresol.sh - batch script for running the tresol simulation
#
# author: Richard Jones, University of Connecticut
# version: Dec. 14, 2010

if [ $# != 2 ]; then
    echo "Usage: tresol.sh <process_number> <noise_rate_Hz>"
    exit 1
fi

tar zxf pawlibs.tgz
export LD_LIBRARY_PATH=./lib:./usr/lib:$LD_LIBRARY_PATH
ldd pawX11

echo $1 >randomseed
cat >run.kumac <<EoI
exec tresol Nrep=1000 R=1.e5 Rnoise=$2
exec tresol#archive 10 14 100
exec tresol Nrep=100 R=1.e6 Rnoise=$2
exec tresol#archive 10 14 110
exec tresol Nrep=67 R=1.5e6 Rnoise=$2
exec tresol#archive 10 14 115
exec tresol Nrep=50 R=2.e6 Rnoise=$2
exec tresol#archive 10 14 120
exec tresol Nrep=40 R=2.5e6 Rnoise=$2
exec tresol#archive 10 14 125
exec tresol Nrep=33 R=3.e6 Rnoise=$2
exec tresol#archive 10 14 130
exec tresol Nrep=28 R=3.5e6 Rnoise=$2
exec tresol#archive 10 14 135
exec tresol Nrep=25 R=4.e6 Rnoise=$2
exec tresol#archive 10 14 140
exec tresol Nrep=23 R=4.5e6 Rnoise=$2
exec tresol#archive 10 14 145
exec tresol Nrep=20 R=5.e6 Rnoise=$2
exec tresol#archive 10 14 150
h/file 1 $1.hbook ! n
hrout 0
exit
EoI
exec ./pawX11 -b run.kumac
