#!/bin/bash

## remove all previously generated files
./clean -f

## make an archive from the sources
./dobackup > BACKUP.log

if [ ! -e genesis ]; then
  ln -s ../src/genesis .
fi
if [ ! -e rescal ]; then
  ln -s ../src/rescal .
fi

## parameters file (input)
PAR_FILE="dun_veg.par"
echo PAR_FILE=$PAR_FILE

### number of OpenMP threads
export OMP_NUM_THREADS=2
echo OMP_NUM_THREADS=$OMP_NUM_THREADS

## general log files (output)
GENESIS_LOG_FILE="GENESIS.log"
RESCAL_LOG_FILE="RESCAL.log"

## generation of binary cellular space
#./genesis -f $PAR_FILE > $GENESIS_LOG_FILE

## generation of png images, data files and logs, then stop 
nice ./rescal $PAR_FILE -cv0 -lc -ls 45 -vel -dlog 500t0 -dpng 500t0 -dcsp 2000t0 -stop 50000t0 >> $RESCAL_LOG_FILE


