#!/bin/bash
module load subversion
module load python3

export arch=X64_IRENE
export mode=prod

export build_dir=xios_test_suite/RUN_TEST_SUITE/build_${arch}_${mode}

echo "Start Building XIOS ... "
bash -c "cd ../.. && ./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --build_dir ${build_dir} --job 4"

export build_status=$?
if [[ ${build_status} == 0 ]]
then
  echo "XIOS Build Finished. Start Unit Tests"
  bash ./my_prod.sh
else
  echo "XIOS Build Failed. Skip Unit Tests"
fi




#ccc_msub -E "--wait" job_irene.sh 

#bash -c "python generate_test.py"
#mv _test_${xios_machine_name}_info.js test_${xios_machine_name}_info.js
#copy_to_thredds  test_${xios_machine_name}_info.js
#mv test_${xios_machine_name}_info.js _test_${xios_machine_name}_info.js
