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

Title: Sea surface height(zo) difference
Description: 
    Sea surface height.
COMMENT: Sea surface height.
COMPONENT:  mpiom
MODELN: 1
VARI: zo
VARIABLE: VARI
VN: SSH
GLOB: |
    res@mpLimitMode = "LatLon"
    res@mpMinLatF = -90.
    res@mpMaxLatF = 90.
    res@mpMinLonF = -330.
    res@mpMaxLonF =   30.
    res@pmTickMarkDisplayMode = "Always"
    res@mpCenterLonF =   -150.
NATL: |
    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@tiMainOffsetYF = 0.0
DIFRES: |
    res@cnLinesOn = False
    res@cnFillOn = True
    res@cnFillMode = "CellFill"
    res@lbOrientation = "Vertical"
    res@cnLevelSelectionMode = "ExplicitLevels"
    res@cnFillPalette = "BlAqGrWh2YeOrReVi22"

    title2 = str_split(title,"()")
    res@tiMainString = title2(0)
    res@tiMainOffsetYF = -.04
    res@gsnRightString = vardif@units
    res@gsnLeftString = title2(1)
    res@cnLevels = fspan(-0.1,0.1,21)
    REGRES

CTLRES: |
    res@cnLinesOn = False
    res@cnFillOn = True
    res@cnFillMode = "CellFill"
    res@lbOrientation = "Vertical"
    res@cnLevelSelectionMode = "ExplicitLevels"
    res@cnLevels = fspan(-1.5,1.5,21)

    title2 = str_split(title,"()")
    res@tiMainString = title2(0)
    res@tiMainOffsetYF = -.04
    res@gsnRightString = varens@units
    res@gsnLeftString = title2(1)
    ;; colormap
    cmap       = read_colormap_file("ncl_default")
    cmap(0,:) = 1. ;; change first to white
    res@cnFillPalette = cmap
    delete(cmap)
    REGRES



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

CAD: f08_5AGCMs_NASPG_sample
CND: CTL2
YBED: 1101,1250
NYD: 150

CASEDIR: /projects/NS9207K/pgchiu/CASE
    ## CASE define later
CAA: f08_5AGCMs_NASPG_average
CNA: IE-average
YBEA: 1101,1250
NYA: 150 
CAS: f09_5AGCMs_NASPG_sample
CNS: IE-sample
YBES: 1101,1250
NYS: 150


Scripts:
# global
-  # ANN
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    TITLE: "VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN
    PLOTRES: CTLRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    TITLE: "VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    TITLE: "VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    TITLE: "VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS
    PLOTRES: DIFRES
    REGRES: GLOB

-  # DJF
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "12,13,14"
    TITLE: "DJF VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_DJF
    PLOTRES: CTLRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "12,13,14"
    TITLE: "DJF VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_DJF
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "12,13,14"
    TITLE: "DJF VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_DJF
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "12,13,14"
    TITLE: "DJF VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_DJF
    PLOTRES: DIFRES
    REGRES: GLOB
-  # MAM
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "3,4,5"
    TITLE: "MAM VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_MAM
    PLOTRES: CTLRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "3,4,5"
    TITLE: "MAM VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_MAM
    PLOTRES: DIFRES
    REGRES: GLOB
-
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "3,4,5"
    TITLE: "MAM VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_MAM
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "3,4,5"
    TITLE: "MAM VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_MAM
    PLOTRES: DIFRES
    REGRES: GLOB
-  # JJA
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "6,7,8"
    TITLE: "JJA VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_JJA
    PLOTRES: CTLRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "6,7,8"
    TITLE: "JJA VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_JJA
    PLOTRES: DIFRES
    REGRES: GLOB
-
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "6,7,8"
    TITLE: "JJA VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_JJA
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "6,7,8"
    TITLE: "JJA VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_JJA
    PLOTRES: DIFRES
    REGRES: GLOB
-  # SON
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "9,10,11"
    TITLE: "SON VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_SON
    PLOTRES: CTLRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "9,10,11"
    TITLE: "SON VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_SON
    PLOTRES: DIFRES
    REGRES: GLOB
- 
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "9,10,11"
    TITLE: "SON VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_SON
    PLOTRES: DIFRES
    REGRES: GLOB
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "9,10,11"
    TITLE: "SON VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_SON
    PLOTRES: DIFRES
    REGRES: GLOB


# NAtl
-  # ANN
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    TITLE: "VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_natl
    CACHEFILENAME: cli_VARI_CTN
    PLOTRES: CTLRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    TITLE: "VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_natl
    CACHEFILENAME: dif_VARI_CAD
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    TITLE: "VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_natl
    CACHEFILENAME: dif_VARI_CAA
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    TITLE: "VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_natl
    CACHEFILENAME: dif_VARI_CAS
    PLOTRES: DIFRES
    REGRES: NATL

-  # DJF
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "12,13,14"
    TITLE: "DJF VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_DJF_natl
    CACHEFILENAME: cli_VARI_CTN_DJF
    PLOTRES: CTLRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "12,13,14"
    TITLE: "DJF VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_DJF_natl
    CACHEFILENAME: dif_VARI_CAD_DJF
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "12,13,14"
    TITLE: "DJF VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_DJF_natl
    CACHEFILENAME: dif_VARI_CAA_DJF
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "12,13,14"
    TITLE: "DJF VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_DJF_natl
    CACHEFILENAME: dif_VARI_CAS_DJF
    PLOTRES: DIFRES
    REGRES: NATL
-  # MAM
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "3,4,5"
    TITLE: "MAM VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_MAM_natl
    CACHEFILENAME: cli_VARI_CTN_MAM
    PLOTRES: CTLRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "3,4,5"
    TITLE: "MAM VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_MAM_natl
    CACHEFILENAME: dif_VARI_CAD_MAM
    PLOTRES: DIFRES
    REGRES: NATL
-
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "3,4,5"
    TITLE: "MAM VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_MAM_natl
    CACHEFILENAME: dif_VARI_CAA_MAM
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "3,4,5"
    TITLE: "MAM VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_MAM_natl
    CACHEFILENAME: dif_VARI_CAS_MAM
    PLOTRES: DIFRES
    REGRES: NATL
-  # JJA
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "6,7,8"
    TITLE: "JJA VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_JJA_natl
    CACHEFILENAME: cli_VARI_CTN_JJA
    PLOTRES: CTLRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "6,7,8"
    TITLE: "JJA VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_JJA_natl
    CACHEFILENAME: dif_VARI_CAD_JJA
    PLOTRES: DIFRES
    REGRES: NATL
-
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "6,7,8"
    TITLE: "JJA VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_JJA_natl
    CACHEFILENAME: dif_VARI_CAA_JJA
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "6,7,8"
    TITLE: "JJA VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_JJA_natl
    CACHEFILENAME: dif_VARI_CAS_JJA
    PLOTRES: DIFRES
    REGRES: NATL
-  # SON
    plotScript: mpiexm/plot_mpiexm_climatology.ncl
    CASE: CTN
    YEARBE: YBEC
    MONTHS: "9,10,11"
    TITLE: "SON VN mean CTL (model year: NYC)"
    FIGFILENAME: cli_VARI_CTN_SON_natl
    CACHEFILENAME: cli_VARI_CTN_SON
    PLOTRES: CTLRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAD
    YEARBE: YBED
    MONTHS: "9,10,11"
    TITLE: "SON VN dif. CND - CTL (model year: CND=NYD, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAD_SON_natl
    CACHEFILENAME: dif_VARI_CAD_SON
    PLOTRES: DIFRES
    REGRES: NATL
- 
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAA
    YEARBE: YBEA
    MONTHS: "9,10,11"
    TITLE: "SON VN dif. CNA - CTL (model year: IE=NYA, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAA_SON_natl
    CACHEFILENAME: dif_VARI_CAA_SON
    PLOTRES: DIFRES
    REGRES: NATL
-  
    plotScript: mpiexm/plot_mpiexm_difference.ncl
    CASE: CAS
    YEARBE: YBES
    MONTHS: "9,10,11"
    TITLE: "SON VN dif. CNS - CTL (model year: IE=NYS, CTL=NYC)"
    FIGFILENAME: dif_VARI_CAS_SON_natl
    CACHEFILENAME: dif_VARI_CAS_SON
    PLOTRES: DIFRES
    REGRES: NATL

-  
    plotScript: mk_html_page.sh
    FIGFILES: 
        cli_VARI_CTN
        dif_VARI_CAD
        dif_VARI_CAS
        dif_VARI_CAA
        cli_VARI_CTN_DJF
        dif_VARI_CAD_DJF
        dif_VARI_CAS_DJF
        dif_VARI_CAA_DJF
        cli_VARI_CTN_MAM
        dif_VARI_CAD_MAM
        dif_VARI_CAS_MAM
        dif_VARI_CAA_MAM
        cli_VARI_CTN_JJA
        dif_VARI_CAD_JJA
        dif_VARI_CAS_JJA
        dif_VARI_CAA_JJA
        cli_VARI_CTN_SON
        dif_VARI_CAD_SON
        dif_VARI_CAS_SON
        dif_VARI_CAA_SON
        
        cli_VARI_CTN_natl
        dif_VARI_CAD_natl
        dif_VARI_CAS_natl
        dif_VARI_CAA_natl
        cli_VARI_CTN_DJF_natl
        dif_VARI_CAD_DJF_natl
        dif_VARI_CAS_DJF_natl
        dif_VARI_CAA_DJF_natl
        cli_VARI_CTN_MAM_natl
        dif_VARI_CAD_MAM_natl
        dif_VARI_CAS_MAM_natl
        dif_VARI_CAA_MAM_natl
        cli_VARI_CTN_JJA_natl
        dif_VARI_CAD_JJA_natl
        dif_VARI_CAS_JJA_natl
        dif_VARI_CAA_JJA_natl
        cli_VARI_CTN_SON_natl
        dif_VARI_CAD_SON_natl
        dif_VARI_CAS_SON_natl
        dif_VARI_CAA_SON_natl
    COLUMN: figures CTL CTL2 CNS CNA 'tr' ANN 4 DJF 4 MAM 4 JJA 4 SON 4 ANN 4 DJF 4 MAM 4 JJA 4 SON 4
