#!/bin/bash
    #
    # This script is an example for running Delft3D-FLOW
    # Adapt and use it for your own purpose
    #
    # adri.mourits@deltares.nl
    # 27 Dec 2010
    # 
    #
    # This script starts a single-domain Delft3D-FLOW computation on Linux
    #


    #
    # Set the config file here
    # 
#argfile=config_flow2d3d.xml
argfile=config_d_hydro.xml
ncores=$1
if [ "$ncores" = "" ]; then
	ncores=5
fi



    #
    # Set the directory containing delftflow.exe here
    #
export ARCH=lnx64
export D3D_HOME=/home/critechuser/DELFT3D/INTEL/5740/bin/$ARCH
#export D3D_HOME=/home/critechuser/DELFT3D/5740/bin/$ARCH
exedir=$D3D_HOME/flow2d3d/bin
libdir=$D3D_HOME/flow2d3d/bin
mpidir=/home/critechuser/DELFT3D/INTEL/MPICH_INTEL/bin
#mpidir=/home/critechuser/DELFT3D/MPICH_GNU/bin
LD_LIBRARY_PATH="-L/home/critechuser/DELFT3D/INTEL/HDF5/lib -L/home/critechuser/DELFT3D/INTEL/NETCDF_INTEL -L/home/critechuser/DELFT3D/INTEL/MPICH_INTEL/lib"
#LD_LIBRARY_PATH="-L/home/critechuser/DELFT3D/MPICH_GNU/lib"
 
    #
    # No adaptions needed below
    #

    # Set some (environment) parameters
export LD_LIBRARY_PATH=$exedir:$libdir:$LD_LIBRARY_PATH 

    # Run
echo "launching case: "$mpidir"/mpiexec -np "$ncores" "$exedir"/d_hydro.exe "$argfile
$mpidir/mpiexec -np $ncores $exedir/d_hydro.exe $argfile
#$mpidir/mpiexec -np 4 $exedir/d_hydro.exe $argfile
#$mpidir/mpiexec -np 8 $exedir/d_hydro.exe $argfile
#$mpidir/mpiexec -np 16 $exedir/d_hydro.exe $argfile
#$mpidir/mpiexec -np 32 $exedir/d_hydro.exe $argfile
#$mpidir/mpiexec -np 64 $exedir/d_hydro.exe $argfile
#$mpidir/mpiexec -np 128 $exedir/d_hydro.exe $argfile
