#!/bin/bash

#NNETdat="/work/noaa/cpc-s2s/zewdu/seasonal/cAmerica/May2026"
#ccadat="./ccadat/"

workdir=$(pwd)
ccadat="${workdir}/ccadat/"
echo  $ccadat

#cp $NNETdat/paramsAllSkill.ncl .
#cp $NNETdat/templateShapeFileNames.ncl .

cat > myccadat << EOF

CCAdat   = "${ccadat}"
currentDir   = "${workdir}"

EOF

#cat myccadat 
#echo $workdir

cat myccadat paramsAllSkill.ncl templateShapeFileNames.ncl templateObjectiveFcst.ncl > finalObjectiveFcst.ncl
LoadManager="SLURM"

if [[ $LoadManager == "SLURM" ]]; then

echo "working for $LoadManager"
module purge
module load contrib pyncl
ncl finalObjectiveFcst.ncl

elif [[ $LoadManager == "QSUB" ]]; then
  echo "$LoadManager"


elif [[ $LoadManager == "LINUX" ]]; then
  echo "$LoadManager"

ncl finalObjectiveFcst.ncl

fi

