#!/bin/bash
#
# -- Author: F. Massonnet 
# -- Date  : 20 Jan 2015
# -- Place : IC3, Barcelona
# -- Adapted: November 2017, UCL
#
# -- Purpose: Computes scores of EC-Earth
#             Equivalent to running successively:
#                1. preprocess.sh
#                2. postprocess.sh
#                3. scores.sh

set -o nounset  # Prevents use of unset variables
set -o errexit  # Prevents snowballing

# -------------
# Dry run
if [[ $# -ne 4 ]]; then
  echo "wrapper EXP MEMBER YEARB YEARE"
  echo "Example:"
  echo "./wrapper.sh m069 fc1 1854 1858"
  exit
fi
#
#-------------
[ -d log ] || mkdir log

./preprocess.sh   $1 $2 $3 $4 &> log/log_${1}_${2}_${3}_${4}
./postprocess.sh  $1 $2 $3 $4 &> log/log_${1}_${2}_${3}_${4}
./scores.sh       $1 $2 $3 $4 &> log/log_${1}_${2}_${3}_${4}
