#!/bin/bash

############ AUTOSUBMIT INPUTS ############
projdir=%PROJDIR%
outdir=%common.OUTDIR%
script=%common.SCRIPT%
tmpdir=%common.TMPDIR%
SPLIT=%SPLIT%
###############################

if [ -d $projdir ]; then
  cd $projdir
  srcdir=${outdir}
else
  cd ${tmpdir}/sunset/$(basename ${outdir})/
  srcdir=${tmpdir}/$(basename ${outdir})
fi

atomic_recipe=${srcdir}/logs/recipes/multimodel/atomic_recipe_sys-Multimodel${recipe}.yml

set +eu
source MODULES
set -eu

Rscript ${script} ${atomic_recipe}
