TITLE: T2m ACC prediction skill
VARNAME: TREFHT
COMPONENT: atm
COMMENT: |
    Following https://doi.org/10.5194/gmd-14-7073-2021 figure 19.
    But too much difference, need review.

ensmeanHind:
    Script: norcpm_ensmean_lyears_v2.sh
    ARCHIVEPATH: HINDPATH
    CASEPREFIX: HINDPRE
    CASENAME: HIND
    OUTPUTFILE: ensmean_hind_VARNAME_lyLYTAG_TIMETAG.nc

corHind:
    Script: yr_cor_leadyears.sh
    INPUTFILE: ensmean_hind_VARNAME_lyLYTAG_TIMETAG.nc
    INPUTVAR: VARNAME
    OUTPUTFILE: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc

plotHindCor:
    Script: plot_ncdif_map.ncl
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    FIGFILENAME: cor_hind-Obs_leadyrLYTAG_TIMETAG
    FIGTITLE: ACC LYLYTAG Hindcast-Obs TIMETAG
    PLOTRES: |
        res@gsnRightString = ""
        res@cnLevelSelectionMode = "ExplicitLevels"
        res@cnLevels = fspan(-.9,.9,19)
        res@mpCenterLonF = 210. ;; for ocean
        res@mpCenterLonF = 0.
        res@cnFillColors = tofloat((/(/11,99,126/), (/18,133,161/), (/27,174,197/), (/28,177,197/), (/28,182,196/), (/28,183,176/), (/84,193,190/), (/133,207,206/), (/188,226,226/), (/252,252,252/), (/252,252,252/), (/253,236,56/), (/253,224,49/), (/250,180,51/), (/245,149,48/), (/241,124,47/), (/239,102,46/), (/236,71,46/), (/228,38,44/), (/147,16,26/)/))/255.
        ;; color map from https://doi.org/10.5194/gmd-14-7073-2021
    BEFOREPLOT: |
        ;; BEFOREPLOT

## Observarion of 2m T anomaly
OBSFILE: /cluster/projects/nn9039k/NorCPM/Obs/AIR_TEM/HadCRUT5/HadCRUT.5.0.1.0.analysis.anomalies.ensemble_mean.nc
OBSVAR: tas_mean

LeadY0:
    LEADYEARS: 0
    LYTAG: 0
LeadY1:
    LEADYEARS: 1
    LYTAG: 1
LeadY25:
    LEADYEARS: 2,3,4,5
    LYTAG: 2-5
LeadY69:
    LEADYEARS: 6,7,8,9
    LYTAG: 6-9

Scripts:
-   ## ensmean for lead year 1
    varPack: ensmeanHind, LeadY1
-   ## ensmean for lead year 2-5
    varPack: ensmeanHind, LeadY25
-   ## ensmean for lead year 6-9
    varPack: ensmeanHind, LeadY69
-   ## cor for lead year 1
    varPack: corHind, LeadY1
-   ## cor for lead year 2-5
    varPack: corHind, LeadY25
-   ## cor for lead year 6-9
    varPack: corHind, LeadY69

-   ## gather historical run
    Script: norcpm_ensmean_year.sh
    scriptRename: ensmean_Tref_hist.sh
    ARCHIVEPATH: HISTPATH
    OUTPUTFILE: ensmean_hist_VARNAME_TIMETAG.nc
-   ## gather analysis run
    Script: norcpm_ensmean_year.sh
    scriptRename: ensmean_Tref_analysis.sh
    ARCHIVEPATH: ANAPATH
    OUTPUTFILE: ensmean_analysis_VARNAME_TIMETAG.nc

-   ## cor for hist
    varPack: LeadY0
    Script: yr_cor_leadyears.sh
    INPUTFILE: ensmean_hist_VARNAME_TIMETAG.nc
    INPUTVAR: VARNAME
    OUTPUTFILE: cor_hist_VARNAME_TIMETAG.nc
-   ## cor for analysis
    varPack: LeadY0
    Script: yr_cor_leadyears.sh
    INPUTFILE: ensmean_analysis_VARNAME_TIMETAG.nc
    INPUTVAR: VARNAME
    OUTPUTFILE: cor_ana_VARNAME_TIMETAG.nc

-   ## plot correlation hindcast leadyear 1
    varPack: plotHindCor, LeadY1
-   ## plot correlation hindcast leadyear 2-5
    varPack: plotHindCor, LeadY25
-   ## plot correlation hindcast leadyear 6-9
    varPack: plotHindCor, LeadY69

-   ## plot correlation analysis
    varPack: plotHindCor
    NETCDFFILEA: cor_ana_VARNAME_TIMETAG.nc
    VARIABLEA: OBSVAR
    FIGFILENAME: cor_ana-Obs_TIMETAG
    FIGTITLE: ACC Analysis-Obs TIMETAG
-   ## plot correlation historical run
    varPack: plotHindCor
    NETCDFFILEA: cor_hist_VARNAME_TIMETAG.nc
    VARIABLEA: OBSVAR
    FIGFILENAME: cor_hist-Obs_TIMETAG
    FIGTITLE: ACC Histroical-Obs TIMETAG
-   ## plot correlation Hind - hist LY1
    varPack: plotHindCor, LeadY1
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    NETCDFFILEB: cor_hist_VARNAME_TIMETAG.nc
    VARIABLEB: OBSVAR
    FIGFILENAME: cor_obs_dif_lyLYTAG_hind-hist_TIMETAG
    FIGTITLE: dACC hind-hist LYLYTAG TIMETAG
-   ## plot correlation Hind - hist LY2-5
    varPack: plotHindCor, LeadY25
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    NETCDFFILEB: cor_hist_VARNAME_TIMETAG.nc
    VARIABLEB: OBSVAR
    FIGFILENAME: cor_obs_dif_lyLYTAG_hind-hist_TIMETAG
    FIGTITLE: dACC hind-hist LYLYTAG TIMETAG
-   ## plot correlation Hind - hist LY6-9
    varPack: plotHindCor, LeadY69
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    NETCDFFILEB: cor_hist_VARNAME_TIMETAG.nc
    VARIABLEB: OBSVAR
    FIGFILENAME: cor_obs_dif_lyLYTAG_hind-hist_TIMETAG
    FIGTITLE: dACC hind-hist LYLYTAG TIMETAG
-   ## plot correlation Hind - ana LY1
    varPack: plotHindCor, LeadY1
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    NETCDFFILEB: cor_ana_VARNAME_TIMETAG.nc
    VARIABLEB: OBSVAR
    FIGFILENAME: cor_obs_dif_lyLYTAG_hind-ana_TIMETAG
    FIGTITLE: dACC hind-ana LYLYTAG TIMETAG
-   ## plot correlation Hind - ana LY2-5
    varPack: plotHindCor, LeadY25
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    NETCDFFILEB: cor_ana_VARNAME_TIMETAG.nc
    VARIABLEB: OBSVAR
    FIGFILENAME: cor_obs_dif_lyLYTAG_hind-ana_TIMETAG
    FIGTITLE: dACC hind-ana LYLYTAG TIMETAG
-   ## plot correlation Hind - ana LY6-9
    varPack: plotHindCor, LeadY69
    NETCDFFILEA: cor_hind_VARNAME_lyLYTAG_TIMETAG.nc
    VARIABLEA: OBSVAR
    NETCDFFILEB: cor_ana_VARNAME_TIMETAG.nc
    VARIABLEB: OBSVAR
    FIGFILENAME: cor_obs_dif_lyLYTAG_hind-ana_TIMETAG
    FIGTITLE: dACC hind-ana LYLYTAG TIMETAG

-   ## convert figs and make html page
    Script: mk_html_page.sh
    FIGFILES:
        cor_ana-Obs_TIMETAG
        cor_hist-Obs_TIMETAG

        cor_hind-Obs_leadyr1_TIMETAG
        cor_hind-Obs_leadyr2-5_TIMETAG
        cor_hind-Obs_leadyr6-9_TIMETAG

        cor_obs_dif_ly1_hind-ana_TIMETAG
        cor_obs_dif_ly2-5_hind-ana_TIMETAG
        cor_obs_dif_ly6-9_hind-ana_TIMETAG

        cor_obs_dif_ly1_hind-hist_TIMETAG
        cor_obs_dif_ly2-5_hind-hist_TIMETAG
        cor_obs_dif_ly6-9_hind-hist_TIMETAG

    COLUMN: |
        'ACC skill' tr
        Analysis Historical tr
        2
        'Hindcasts ACC skill' tr
        'Lead year 1' '2-5' '6-9' tr
        3
        'dACC, Hindcast - Analysis' tr
        3
        'dACC, Hindcast - Historical' tr
        3
