Skip to content
Snippets Groups Projects
scheduleScenarios.sh 788 B
Newer Older
#!/bin/sh

if [ "$#" -lt 1  ]; then
   echo "Need to specify scenario table file"
   exit
fi


filename="$1"
Peter Alexander's avatar
Peter Alexander committed
output_dir=/exports/csce/eddie/geos/groups/LURG/models/PLUM/output
echo "Starting scenarios in $output_dir"

Peter Alexander's avatar
Peter Alexander committed
while read -r datarow
do
  IFS=',' read -r -a array <<< "$datarow"

  if [ -z "$header" ]; then
     header=( "${array[@]}" )
  else
     scenario="${array[0]}"
Peter Alexander's avatar
Peter Alexander committed
     scenario_dir=$output_dir/$scenario
     echo $scenario

     if [ ! -d "$scenario_dir" ]; then
        echo "Scenario $scenario dir is missing, so skipping"
        continue;
     fi

Peter Alexander's avatar
Peter Alexander committed
     echo "qsub /exports/csce/eddie/geos/groups/LURG/models/PLUM/plumv2/scripts/runPlum.sh $scenario"
     qsub /exports/csce/eddie/geos/groups/LURG/models/PLUM/plumv2/scripts/runPlum.sh $scenario