#!/usr/bin/env bash
# Wenchang Yang (wenchang@princeton.edu)
# Tue Dec  5 11:33:01 EST 2023
##SBATCH --nodes=1                # node count
##SBATCH --ntasks-per-node=1      # number of tasks per node
# 
#SBATCH --ntasks=1               # total number of tasks across all nodes = nodes x ntasks-per-node
#SBATCH --cpus-per-task=1        # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=16G         # memory per cpu-core (4G is default)
#SBATCH --time=24:00:00          # total run time limit (HH:MM:SS)
#SBATCH --mail-type=all          # send email when job begins/ends/fails
#SBATCH --mail-user=wenchang@princeton.edu
# 
##SBATCH --array=1-100#%32        # job array with index values 1, 2, ...,; max job # is 32 if specified
##SBATCH --output=slurm-%A.%a.out # stdout file
##SBATCH --error=slurm-%A.%a.err  # stderr file
#set -ev
##env settings
#export PATH=/tigress/wenchang/miniconda3/bin:$PATH
#export PYTHONPATH=/tigress/wenchang/wython
#export PYTHONUNBUFFERED=TRUE # see https://stackoverflow.com/questions/230751/how-to-flush-output-of-print-function
#export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK #for multi-threaded job
#ii_job=$SLURM_ARRAY_TASK_ID #for job array

active monitor
d=/tigress/wenchang/analysis/active_monitor
#d=/projects2/GEOCLIM/wenchang/analysis/active_monitor
cd $d
echo "** $d **"
./main.sh
echo " "

#numerical experiment list
d=/tigress/wenchang/analysis/numerical_experiments_list
#d=/projects2/GEOCLIM/wenchang/analysis/numerical_experiments_list
cd $d
echo "** $d **"
./main.sh
echo " "

#backup data on tiger3 scratch
d=/tigress/wenchang/tiger3
cd $d
echo "** $d **"
./rsync_from_tiger3scratch.sh
echo " "

#backup data on tiger3 scratch analysis
d=/tigress/wenchang/analysis
cd $d
echo "** $d **"
./wy_rsync_from_tiger3scratch.sh
echo " "

#SRM_1990
d=/scratch/gpfs/GEOCLIM/wenchang/analysis/active_work/SRM_2020
cd $d
echo "** $d **"
./main.sh
echo " "

#fy4182
#d=/tigress/wenchang/public_html/fy4182/monitor
#cd $d
#./main.sh

##yang
#d=/projects/GEOCLIM/public_html/yang/SWA_hypoxia
#cd $d
#./main.sh
#d=/projects/GEOCLIM/public_html/yang/global_dead_zones
#cd $d
#./main.sh
