#!/bin/bash
#SBATCH --qos=gp_debug
#SBATCH -A bsc32
#SBATCH --cpus-per-task=1
#SBATCH -n 4
#SBATCH -t 00:10:00
#SBATCH -J NES-test
#SBATCH --output=log_NES-tests_mn5_%j.out
#SBATCH --error=log_NES-tests_mn5_%j.err
#SBATCH --exclusive

set -xuve

module purge
module load anaconda
source /apps/GPP/ANACONDA/2023.07/etc/profile.d/conda.sh
conda deactivate
conda activate /gpfs/projects/bsc32/repository/apps/conda_envs/NES_dev
export PYTHONPATH=/gpfs/projects/bsc32/repository/apps/conda_envs/NES_dev/lib/python3.12/site-packages
export SLURM_CPU_BIND=none
export PYTHONPATH=/gpfs/scratch/bsc32/bsc032538/AC_PostProcess/NES:$PYTHONPATH


#conda activate /gpfs/projects/bsc32/repository/apps/conda_envs/NES_v1.1.4
##export PYTHONPATH=/gpfs/projects/bsc32/repository/apps/conda_envs/NES_v1.1.4/lib/python3.12/site-packages:$PYTHONPATH
#export PYTHONPATH=/gpfs/projects/bsc32/repository/apps/conda_envs/NES_v1.1.4/lib/python3.12/site-packages
#export SLURM_CPU_BIND=none

cd /gpfs/scratch/bsc32/bsc032538/AC_PostProcess/NES/tests || exit

mpirun -np 4 python 1.1-test_read_write_projection.py
mpirun -np 4 python 1.2-test_create_projection.py
mpirun -np 4 python 1.3-test_selecting.py

mpirun -np 4 python 2.1-test_spatial_join.py
mpirun -np 4 python 2.2-test_create_shapefile.py
mpirun -np 4 python 2.3-test_bounds.py
mpirun -np 4 python 2.4-test_cell_area.py

mpirun -np 4 python 3.1-test_vertical_interp.py
mpirun -np 4 python 3.2-test_horiz_interp_bilinear.py
mpirun -np 4 python 3.3-test_horiz_interp_conservative.py

mpirun -np 4 python 4.1-test_stats.py
mpirun -np 4 python 4.2-test_sum.py
mpirun -np 4 python 4.3-test_write_timestep.py
