#!/usr/bin/env bash
# Wenchang Yang (wenchang@princeton.edu)
# Mon Sep 11 17:45:16 EDT 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 -e #v
##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
#./wyplot_lines_gmst_ctls.py s o notshowfig
#./wyplot_lines_gmst_perturb_from_CM2.1CTL1860.py s o notshowfig

thisdir=$(pwd)
for pyscript in \
    wyplot_lines_gmst_ctls_tiger3.py \
    ; do
    python $pyscript s o notshowfig
    #wyplot_lines_gmst_ctls_ESM4.py \
    #wyplot_lines_gmsat_ctls_ESM4.py \
    #wyplot_lines_gmst_ctls_FA.py \
    #wyplot_lines_gmst_ctls.py \
    #wyplot_lines_gmst_perturb_from_CM2.1CTL1860.py \
    #wyplot_lines_gmst_perturb_from_FLORCTL1860_newdiag.py \
    #wyplot_lines_gmst_perturb_from_FLORCTL1990_v201905.py \
    #wyplot_lines_netrad_toa_ctls.py \
    #wyplot_lines_netrad_toa_perturb_from_FLORCTL1860_newdiag.py \
    #wyplot_lines_gmst_perturb_from_FLORCTL1860_newdiag_vs_CM2.1CTL1860.py \
    #wyplot_lines_gmst_ctls_FA_2xCO2.py \
    #wyplot_lines_gmst_FLOR_HistRCP45_FA.py \
    #wyplot_lines_gmst_FLOR_HistRCP45_CM2p1.py \
done
make_html

: '
#cd tropoceanmean
#pyscript=wyplot_lines_tmsst_perturb_from_FLORCTL1990_v201905.py
#python $pyscript s o notshowfig
#make_html
#cd $thisdir

#cd TC
#pyscript=wyplot_lines_ntc.py
#python $pyscript s o notshowfig 
#python $pyscript s o notshowfig HU
##
#pyscript=wyplot_lines_ntc_ctls.py
#python $pyscript s o notshowfig 
#make_html
#cd $thisdir

#cd TC/flux_adjust
#pyscript=wyplot_lines_ntc_ctls_FA.py
#python $pyscript s o notshowfig 
#make_html
#cd $thisdir

cd nino34
#pyscript=wyplot_lines_nino34_ctls_FA.py
pyscript=wyplot_lines_nino34_ctls_FA_PI.py
python $pyscript s o notshowfig 
#pyscript=wyplot_lines_nino34_FLOR_HistRCP45_FA.py
#python $pyscript s o notshowfig 
make_html
cd $thisdir

cd nino3
pyscript=wyplot_lines_nino3_FLOR_HistRCP45_FA.py
#python $pyscript s o notshowfig 
#make_html
cd $thisdir

cd indexNS
pyscript=wyplot_lines_indexNS_FLOR_HistRCP45_FA.py
#python $pyscript s o notshowfig 
#python $pyscript s o notshowfig anom
pyscript=wyplot_lines_indexNS_ctls_FA_2xCO2.py
#python $pyscript s o notshowfig 
#make_html
cd $thisdir

cd indexEW
pyscript=wyplot_lines_indexEW_FLOR_HistRCP45_FA.py
#python $pyscript s o notshowfig 
#python $pyscript s o notshowfig anom
pyscript=wyplot_lines_indexEW_ctls_FA_2xCO2.py
#python $pyscript s o notshowfig 
#make_html
cd $thisdir

cd annualmean
pyscript=wyplot_maps_anom.py
python $pyscript s o notshowfig daname=t_surf
python $pyscript s o notshowfig daname=slp
python $pyscript s o notshowfig daname=precip
pyscript=wyplot_maps_anom_2xCO2.py
#python $pyscript s o notshowfig daname=t_surf
make_html
cd $thisdir

cd amoc
pyscript=wyplot_lines_amoc_ctls_FA.py
#python $pyscript s o notshowfig
make_html
cd $thisdir

cd seasonmean
pyscript=wyplot_maps_anom.py
python $pyscript s o notshowfig
make_html
cd $thisdir
'
