#!/usr/bin/env bash

#edit these lines as needed
BGW_BIN="$HOME/BerkeleyGW/bin"
BGW_VIS="$HOME/BerkeleyGW/Visual"

# put argument for number of procs here too if needed, e.g. -n 8
MPIRUN="mpirun"
###############################################################################
EPSILON="$BGW_BIN/epsilon.cplx.x"
SIGMA="$BGW_BIN/sigma.cplx.x"
EQP="$BGW_BIN/eqp.py"
KERNEL="$BGW_BIN/kernel.cplx.x"
ABSORPTION="$BGW_BIN/absorption.cplx.x"
PLOTXCT="$BGW_BIN/plotxct.cplx.x"
VOLUME="$BGW_VIS/volume.py"
SURFACE="$BGW_BIN/surface.x"
#
cd ./5-epsilon
$MPIRUN $EPSILON &> ./OUT.eps
cd ..
#
cd ./6-sigma
$MPIRUN $SIGMA &> ./OUT.sig
cd ..
#
$EQP eqp1 ./6-sigma/sigma_hp.log ./8-absorption/eqp_co.dat
#
cd ./7-kernel
$MPIRUN $KERNEL &> ./OUT.krn
cd ..
#
cd ./8-absorption
$MPIRUN $ABSORPTION &> ./OUT.abs
ln -s WFN_fi WFNq_fi
$MPIRUN $PLOTXCT &> ./OUT.plo
$VOLUME ../ESPRESSO/1-scf/in espresso xct.000020_s1.a3Dr a3dr xct000020.cube cube false abs2 true
# Alternate form:
#$VOLUME ../PARATEC/1-scf/input paratec xct.000020_s1.a3Dr a3dr xct000020.cube cube false abs2 true
$SURFACE xct000020.par
cd ..
#
