# plot data difference in mpiexm
# mpiexm contains multiple atm(echam6) and one ocn(mpiom) coupling

Title: SST difference
Description: 
    SST diference between interactive ensemble and control run.
COMMENT: |
    SST diference between interactive ensemble and control run.
COMPONENT:  mpiom
MODELN: 1
VARI: SSTC
VARIABLE: VARI
VN: SST
NAtlRegion: 
    REGNAME: natl
    CACHEFILENAME: cli_VARI_CASE_TSEA_global
    REGRES: |
        res@mpLimitMode = "LatLon"
        res@mpMinLatF = 20.
        res@mpMaxLatF = 70.
        res@mpMinLonF = -80.
        res@mpMaxLonF =  10.
        res@pmTickMarkDisplayMode = "Always"
        res@mpCenterLatF = 50.
        res@mpCenterLonF =  -35.
        res@mpProjection = "LambertConformal"
        res@mpGridAndLimbOn = True
        res@gsnMaskLambertConformal = True
        res@gsnRightString = "~F34~0~F~C"
        res@gsnDraw = False
        res@gsnFrame = False
Global: 
    REGNAME: global
    REGRES: |
        res@mpLimitMode = "LatLon"
        res@mpMinLatF = -90.
        res@mpMaxLatF = 90.
        res@mpMinLonF = -330.
        res@mpMaxLonF =   30.
        res@pmTickMarkDisplayMode = "Always"
        res@mpCenterLonF =   -150.
        res@gsnFrame = False
        res@gsnDraw = False
AddAtl3Box:
    POSTPLOT: |  ## add box
        latbe = (/-3.,3./)
        lonbe = (/-20.,0./)
        boxx = (/min(lonbe),max(lonbe),max(lonbe),min(lonbe),min(lonbe)/)
        boxy = (/min(latbe),min(latbe),max(latbe),max(latbe),min(latbe)/)
        lres = True
            lres@gsLineThicknessF = 3.0
        b = gsn_add_polyline(wks,plot,boxx,boxy,lres)
DifferPlotRes:
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    TITLE: "VN dif. TNAME - CTL (model year: TNAME=NYEAR, CTL=NYC)"
    FIGFILENAME: dif_VARI_CASE_TSEA_REGNAME
    PLOTRES: |
        res@cnLinesOn = False
        res@cnFillOn = True
        res@lbOrientation = "Vertical"
        res@cnLevelSelectionMode = "ExplicitLevels"
        res@cnLevels = fspan(-.6,.6,13)
        res@cnFillPalette = "BlAqGrWh2YeOrReVi22"
        REGRES
ClimatePlotRes: 
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    TITLE: "VN mean CTL TSEA (model year: NYC)"
    FIGFILENAME: cli_VARI_CASE_TSEA_REGNAME
    PLOTRES: |
        res@cnLinesOn = False
        res@cnFillOn = True
        res@lbOrientation = "Vertical"
        res@cnLevelSelectionMode = "ExplicitLevels"
        res@cnLevels = fspan(2.,30.,29)
        REGRES

YEARBE: 1101,1250
NYEAR: 150 

CTN: f08_1AGCM
    ## proxy of CCASE 'control case'
CCASE: CTN
CONTROLDIR: /projects/NS9207K/pgchiu/CCASE
YBEC: 1101,1250
CONTROLYEARBE: YBEC
NYC: 150

Case_CTL2:
    CASE: f08_5AGCMs_NASPG_sample
    TNAME: CTL2
    NYEAR: 150

CASEDIR: /projects/NS9207K/pgchiu/CASE
    ## CASE define later
Case_IEave:
    CASE: f08_5AGCMs_NASPG_average
    TNAME: IE-average
Case_IEave_glob:
    CASE: f09_5AGCMs_Global_average
    TNAME: IEGave
Case_IEsam:
    CASE: f09_5AGCMs_NASPG_sample
    TNAME: IE-sample
Month_ANN:
    MONTHS: 0
    TSEA: ANN
Month_DJF:
    MONTHS: "12,13,14"
    TSEA: DJF
Month_MAM:
    MONTHS: "3,4,5"
    TSEA: MAM
Month_JJA:
    MONTHS: "6,7,8"
    TSEA: JJA
Month_SON:
    MONTHS: "9,10,11"
    TSEA: SON
Month_Mon01:
    MONTHS: 1
    TSEA: Mon01
Month_Mon02:
    MONTHS: 2
    TSEA: Mon02
Month_Mon03:
    MONTHS: 3
    TSEA: Mon03
Month_Mon04:
    MONTHS: 4
    TSEA: Mon04
Month_Mon05:
    MONTHS: 5
    TSEA: Mon05
Month_Mon06:
    MONTHS: 6
    TSEA: Mon06
Month_Mon07:
    MONTHS: 7
    TSEA: Mon07
Month_Mon08:
    MONTHS: 8
    TSEA: Mon08
Month_Mon09:
    MONTHS: 9
    TSEA: Mon09
Month_Mon10:
    MONTHS: 3
    TSEA: Mon10
Month_Mon11:
    MONTHS: 3
    TSEA: Mon11
Month_Mon12:
    MONTHS: 3
    TSEA: Mon12
    

Scripts:
-  # Remove figfilelist.txt which is for mk_html_page.sh at bottom
    plotScript: mk_runcode.sh
    RUNTHESECODES: |
        rm -f figfilelist.txt
- varPack: ClimatePlotRes, Month_ANN, Global
- varPack: DifferPlotRes, Month_ANN, Global, Case_CTL2
- varPack: DifferPlotRes, Month_ANN, Global, Case_IEsam
- varPack: DifferPlotRes, Month_ANN, Global, Case_IEave
- varPack: DifferPlotRes, Month_ANN, Global, Case_IEave_glob
# DJF
- varPack: ClimatePlotRes, Month_DJF, Global
- varPack: DifferPlotRes, Month_DJF, Global, Case_CTL2
- varPack: DifferPlotRes, Month_DJF, Global, Case_IEsam
- varPack: DifferPlotRes, Month_DJF, Global, Case_IEave
- varPack: DifferPlotRes, Month_DJF, Global, Case_IEave_glob
# MAM
- varPack: ClimatePlotRes, Month_MAM, Global
- varPack: DifferPlotRes, Month_MAM, Global, Case_CTL2
- varPack: DifferPlotRes, Month_MAM, Global, Case_IEsam
- varPack: DifferPlotRes, Month_MAM, Global, Case_IEave
- varPack: DifferPlotRes, Month_MAM, Global, Case_IEave_glob
# JJA
- varPack: ClimatePlotRes, Month_JJA, Global
- varPack: DifferPlotRes, Month_JJA, Global, Case_CTL2
- varPack: DifferPlotRes, Month_JJA, Global, Case_IEsam
- varPack: DifferPlotRes, Month_JJA, Global, Case_IEave
- varPack: DifferPlotRes, Month_JJA, Global, Case_IEave_glob
# SON
- varPack: ClimatePlotRes, Month_SON, Global
- varPack: DifferPlotRes, Month_SON, Global, Case_CTL2
- varPack: DifferPlotRes, Month_SON, Global, Case_IEsam
- varPack: DifferPlotRes, Month_SON, Global, Case_IEave
- varPack: DifferPlotRes, Month_SON, Global, Case_IEave_glob

# NAtl
- varPack: ClimatePlotRes, Month_ANN, NAtlRegion
- varPack: DifferPlotRes, Month_ANN, NAtlRegion, Case_CTL2
- varPack: DifferPlotRes, Month_ANN, NAtlRegion, Case_IEsam
- varPack: DifferPlotRes, Month_ANN, NAtlRegion, Case_IEave
- varPack: DifferPlotRes, Month_ANN, NAtlRegion, Case_IEave_glob
# DJF
- varPack: ClimatePlotRes, Month_DJF, NAtlRegion
- varPack: DifferPlotRes, Month_DJF, NAtlRegion, Case_CTL2
- varPack: DifferPlotRes, Month_DJF, NAtlRegion, Case_IEsam
- varPack: DifferPlotRes, Month_DJF, NAtlRegion, Case_IEave
- varPack: DifferPlotRes, Month_DJF, NAtlRegion, Case_IEave_glob
# MAM
- varPack: ClimatePlotRes, Month_MAM, NAtlRegion
- varPack: DifferPlotRes, Month_MAM, NAtlRegion, Case_CTL2
- varPack: DifferPlotRes, Month_MAM, NAtlRegion, Case_IEsam
- varPack: DifferPlotRes, Month_MAM, NAtlRegion, Case_IEave
- varPack: DifferPlotRes, Month_MAM, NAtlRegion, Case_IEave_glob
# JJA
- varPack: ClimatePlotRes, Month_JJA, NAtlRegion
- varPack: DifferPlotRes, Month_JJA, NAtlRegion, Case_CTL2
- varPack: DifferPlotRes, Month_JJA, NAtlRegion, Case_IEsam
- varPack: DifferPlotRes, Month_JJA, NAtlRegion, Case_IEave
- varPack: DifferPlotRes, Month_JJA, NAtlRegion, Case_IEave_glob
# SON
- varPack: ClimatePlotRes, Month_SON, NAtlRegion
- varPack: DifferPlotRes, Month_SON, NAtlRegion, Case_CTL2
- varPack: DifferPlotRes, Month_SON, NAtlRegion, Case_IEsam
- varPack: DifferPlotRes, Month_SON, NAtlRegion, Case_IEave
- varPack: DifferPlotRes, Month_SON, NAtlRegion, Case_IEave_glob

# Mon01
- varPack: ClimatePlotRes, Month_Mon01, Global 
- varPack: DifferPlotRes, Month_Mon01, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon01, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon01, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon01, Global, AddAtl3Box, Case_IEave_glob
# Mon02
- varPack: ClimatePlotRes, Month_Mon02, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon02, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon02, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon02, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon02, Global, AddAtl3Box, Case_IEave_glob
# Mon03
- varPack: ClimatePlotRes, Month_Mon03, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon03, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon03, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon03, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon03, Global, AddAtl3Box, Case_IEave_glob
# Mon04
- varPack: ClimatePlotRes, Month_Mon04, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon04, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon04, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon04, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon04, Global, AddAtl3Box, Case_IEave_glob
# Mon05
- varPack: ClimatePlotRes, Month_Mon05, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon05, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon05, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon05, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon05, Global, AddAtl3Box, Case_IEave_glob
# Mon06
- varPack: ClimatePlotRes, Month_Mon06, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon06, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon06, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon06, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon06, Global, AddAtl3Box, Case_IEave_glob
# Mon07
- varPack: ClimatePlotRes, Month_Mon07, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon07, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon07, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon07, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon07, Global, AddAtl3Box, Case_IEave_glob
# Mon08
- varPack: ClimatePlotRes, Month_Mon08, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon08, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon08, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon08, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon08, Global, AddAtl3Box, Case_IEave_glob
# Mon09
- varPack: ClimatePlotRes, Month_Mon09, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon09, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon09, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon09, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon09, Global, AddAtl3Box, Case_IEave_glob
# Mon10
- varPack: ClimatePlotRes, Month_Mon10, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon10, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon10, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon10, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon10, Global, AddAtl3Box, Case_IEave_glob
# Mon11
- varPack: ClimatePlotRes, Month_Mon11, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon11, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon11, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon11, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon11, Global, AddAtl3Box, Case_IEave_glob
# Mon12
- varPack: ClimatePlotRes, Month_Mon12, Global, AddAtl3Box
- varPack: DifferPlotRes, Month_Mon12, Global, AddAtl3Box, Case_CTL2
- varPack: DifferPlotRes, Month_Mon12, Global, AddAtl3Box, Case_IEsam
- varPack: DifferPlotRes, Month_Mon12, Global, AddAtl3Box, Case_IEave
- varPack: DifferPlotRes, Month_Mon12, Global, AddAtl3Box, Case_IEave_glob

-  # 
    plotScript: mk_html_page.sh
    FIGFILES: '$(cat figfilelist.txt)'
    COLUMN: >
        figures CTL CTL2 IEsam IEave IEave_global tr 
        ANN 5 
        DJF 5 
        MAM 5 
        JJA 5 
        SON 5 
        NAtl tr
        ANN 5 
        DJF 5 
        MAM 5 
        JJA 5 
        SON 5
        figures CTL CTL2 IEsam IEave IEave_global tr 
        Jan 5 
        Feb 5 
        Mar 5 
        Apr 5 
        May 5 
        Jun 5 
        Jul 5 
        Aug 5 
        Sep 5 
        Oct 5 
        Nov 5 
        Dec 5 
