#!/bin/bash

echo `date`
#select one of them; QSUB is still on going
#LoadManager="QSUB"   # PBS (qsub) for parallel run on multiple nodes
LoadManager="SLURM"  # SLURM (sbatch) for parallel run on multiple nodes
LoadManager="LINUX"  # single node run (no load manager)

#################################
##### for target domains (country or regional) in Africa

region="eafrica"  # All (Dont do it), eafrica, wafrica,cafrica, safrica 
isstate=False   # isstate=True will override region
             # if True, add lat lon and country name below

#######################################################

if [[ $region == "All" ]]; then
latS=-30.0
latN=30.0
lonW=340.0  #-20 + 360
lonE=55.0   # This is going to need some adjustment
elif [[ $region == "eafrica" ]]; then
latS=-13.5
latN=24.5
lonW=20.5
lonE=53.0
elif [[ $region == "wafrica" ]]; then
latS=9.0
latN=22.0
lonW=270.0  # 
lonE=300.0  # -
elif [[ $region == "safrica" ]]; then
latS=10.0
latN=22.0
lonW=290.0  # -70 + 360
lonE=302.0  # + 360

elif [[ $region == "cafrica" ]]; then
latS=17.0
latN=24.0
lonW=275.0  # -85+ 360
lonE=297.0  # -63 + 360

fi

##################
if [[ $isstate == "True" ]]; then
mycountry="ETH"
latS=2.5
latN=16.0
lonW=32.5
lonE=48.
fi

#### SST Domain for Indian Ocean to the Atlantic
lonWeof=50.
lonEeof=340.
latSeof=-20.
latNeof=20.

#### Model intitial date and forecast period
currentyr=2026
startmon=5
sznlen=4
ilead=1
seasonname="JJAS"

#### For R
testLength=5
#obst="LOCAL"
#obst="ENACT"
obst="MSWEP"

masklev=15
shaderain=True

#### For ploting  and climate
yrsstsc=1991
yrsstec=2020
WMOshpfiles="/work/noaa/cpc-s2s/zewdu/shpfiles/WMO_basemap.shp" #shpfile loc
allcolors="/work/noaa/cpc-s2s/zewdu"    # color and shapefile location
#WMOshpfiles="/cpc/int_desk/IndianOcean/shpfiles/WMO_basemap.shp" #shpfile loc
#allcolors="/cpc/int_desk/IndianOcean"    # color and shapefile location

### For obsevations
firstyr=1991
endyr=2025
monthly=True
obsres=0.25
obsprecip="prec${seasonname}_${firstyr}-${endyr}${obst}.nc"


#############################
allmodelNames=(canesm5 gem5nemo nasa ccsm4 cfsv2 cesm1 ensmean)

###### Select from these
#allprdctors=(MGI ATL3 rNino34 Nino34 WVG IOD SIOD PCS1 PCS2 PCS3 PCS4 PCS5 PCS6 PCR1 PCR2 PCR3 PCR4 PCR5 PCR6 ALLP_INT)

slctprdctors=(MGI ATL3 rNino34 Nino34 WVG IOD SIOD PCS1 PCS2 PCS3 PCS4 PCS5 PCS6 PCR1 PCR2 PCR3 PCR4 PCR5 PCR6 ALLP_INT)

#slctprdctors=(ATL3 rNino34 PCS4 PCR1 ALLP_INT)

allprdctors=$slctprdctors
##############################################
### Diagnostics
printProb=False
printProbRaw=False
#Diagnostic Domain for Costa Rica
tlats=9.
tlatn=10.
tlonw=40.0 
tlone=41.0 

###############################
####### No edit needed below this line
###############################
#### For both R and NCL
###########
obsstartmon=$((ilead + startmon))
obsendmon=$((obsstartmon + sznlen - 1))
if [[ $sznlen = 4 ]]; then
szn4mon=True
else
szn4mon=False
fi

leadi=$ilead
leadf=$((ilead + sznlen - 1))

##### Number of SST and Precip EOFs
numeof=6

leave3Out=TRUE
runserial=FALSE

##############################################
