#!/bin/bash
### JOB_ID=$(sbatch --parsable zrunMain.sh) && sbatch --dependency=afterok:$JOB_ID zrunBestModel.sh

#SBATCH --account=cpc-s2s
#SBATCH --qos=batch
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1  # Only 1 core needed for aggregation
#SBATCH --mem=32G          # Ensure you have enough RAM to hold the big arrays
#SBATCH -J bestmod
#SBATCH --time=01:00:00         # Each task has the full 8 hours
#SBATCH -o zbestmodel.out
#SBATCH -e zbestmodel.err
#SBATCH --exclusive
#SBATCH --mail-user=zewdu.segele@noaa.gov
##SBATCH --mail-type=BEGIN,END,FAIL
#SBATCH --mail-type=FAIL

module purge
#module load spack-managed-x86-64_v3
module load spack-managed-x86-64_v3 r/4.4.0
module load contrib pyncl
module load netcdf-c/4.9.2
module load udunits/2.2.28

workingDir=`pwd`

Rscript $workingDir/templateBestModelFreq.R

