#!/bin/bash

HPCARCH=$1

cd ../lib/src/cmor
if [[ -f compilation_${HPCARCH}.sh ]]; then
  ./compilation_${HPCARCH}.sh
else
  echo "Compilation script compilation_${HPCARCH}.sh not found!"
  echo "Check that you are executing CMOR on a platform you are allowed to"
  exit
fi

cd ../../../models/ecearth/src

if [[ -f compilation_${HPCARCH}.cmd ]]; then
  ./compilation_${HPCARCH}.cmd
else
  echo "Compilation script compilation_${HPCARCH}.cmd not found! "
  echo "Check that you are executing CMOR on a platform you are allowed to"
  exit
fi


