#!/bin/bash

########################################
## Simulation of an elongating lineaar dune
## -------------------------------------
## Average duration: ~1h
########################################

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

## make an archive from the sources
#./dobackup


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

## parameters file (input)
PAR_FILE="dun_linear.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 -s 2000 > $GENESIS_LOG_FILE

## run simulation without GUI (no window mode)
#./rescal $PAR_FILE -cv0 -ls 45 -vel -dlog 100t0 -dpng 1000t0 -dcsp 1000t0 -stop 100000t0 -nv >> $RESCAL_LOG_FILE

## run simulation with GUI (window mode)
./rescal $PAR_FILE -cv0 -ls 45 -vel -dlog 100t0 -dpng 1000t0 -dcsp 1000t0 -stop 100000t0 >> $RESCAL_LOG_FILE

