load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" ; load "taylor_diagram_lh.ncl" load "taylor_metrics_table.ncl" load "./taylor_stats.ncl" ;load "./taylor_diagram_cam.ncl" begin ; ============================================================== ; ENSEMBLES precipitation without bias correction ; ============================================================== ; yrStrt = 1961 ; modification from 1970 ; yrLast = 1990 ; modification from 1999 ; ============================================================== ; Open the file: Read only the user specified period first observations then model ; ============================================================== ;==================================================================precip ;================================================================== f6 = addfile ("E-OBS_1961-1990_pr_sm.nc", "r"); pm = f6->pr(:,:,:) ;printVarSummary(pm) ; (time, lat,lon) ;=================================================================== f7= addfile("CNRM_control_pr_sm.nc", "r") ; P1 = f7->pr(:,:,:) ;printVarSummary(P1) ; (time, lat,lon) ;============================================================ f8= addfile("DMI_control_pr_sm.nc", "r") ; P2 = f8->pr(:,:,:) ;printVarSummary(P2) ;============================================================ f9= addfile("ICTP_control_pr_sm.nc", "r") ; P3 = f9->pr(:,:,:) ;printVarSummary(P3) ; (time, lat,lon) ;============================================================ f10= addfile("KNMI_control_pr_sm.nc", "r") ; P4 = f10->pr(:,:,:) ;printVarSummary(P4) ;============================================================ f11= addfile("SMHI_control_pr_sm.nc", "r") ; P5 = f11->pr(:,:,:) ;printVarSummary(P5) ;================================================================== ;Taylor diagram calculations ;=================================================================== case = (/ "ALADIN", "HIRHAM" , "RegCM", "RACMO2", "RCA"/) nCase = dimsizes(case ) ; # of Cases [Cases] var = (/ "AL", "BI", "EA", "FR", "IP", "MD", "ME", "SC" /) nVar = dimsizes(var) ; # of Variables SEASONS = (/ "DJF", "JJA" /) nSeason = dimsizes( SEASONS ) ;==============================taylorstats============= ;DJF AL ;====================================================== tA = pm(0,75:91,182:222) t1A = P1(0,75:91,182:222) t2A = P2(0,75:91,182:222) t3A = P3(0,75:91,182:222) t4A = P4(0,75:91,182:222) t5A = P5(0,75:91,182:222) w = 1.0 stat_taylor1A = taylor_stats(t1A, tA, w, 0) stat_taylor2A = taylor_stats(t2A, tA, w, 0) stat_taylor3A = taylor_stats(t3A, tA, w, 0) stat_taylor4A = taylor_stats(t4A, tA, w, 0) stat_taylor5A = taylor_stats(t5A, tA, w, 0) ;==============================taylorstats============= ;DJF BI ;====================================================== tB = pm(0,99:135,122:170) t1B = P1(0,99:135,122:170) t2B = P2(0,99:135,122:170) t3B = P3(0,99:135,122:170) t4B = P4(0,99:135,122:170) t5B = P5(0,99:135,122:170) stat_taylor1B = taylor_stats(t1B, tB, w, 0) stat_taylor2B = taylor_stats(t2B, tB, w, 0) stat_taylor3B = taylor_stats(t3B, tB, w, 0) stat_taylor4B = taylor_stats(t4B, tB, w, 0) stat_taylor5B = taylor_stats(t5B, tB, w, 0) ;==============================taylorstats============= ;DJF EA ;====================================================== tE = pm(0,76:119,227:282) t1E = P1(0,76:119,227:282) t2E = P2(0,76:119,227:282) t3E = P3(0,76:119,227:282) t4E = P4(0,76:119,227:282) t5E = P5(0,76:119,227:282) stat_taylor1E = taylor_stats(t1E, tE, w, 0) stat_taylor2E = taylor_stats(t2E, tE, w, 0) stat_taylor3E = taylor_stats(t3E, tE, w, 0) stat_taylor4E = taylor_stats(t4E, tE, w, 0) stat_taylor5E = taylor_stats(t5E, tE, w, 0) ;==============================taylorstats============= ;DJF FR ;====================================================== tF = pm(0,75:99,142:182) t1F = P1(0,75:99,142:182) t2F = P2(0,75:99,142:182) t3F = P3(0,75:99,142:182) t4F = P4(0,75:99,142:182) t5F = P5(0,75:99,142:182) stat_taylor1F = taylor_stats(t1F, tF, w, 0) stat_taylor2F = taylor_stats(t2F, tF, w, 0) stat_taylor3F = taylor_stats(t3F, tF, w, 0) stat_taylor4F = taylor_stats(t4F, tF, w, 0) stat_taylor5F = taylor_stats(t5F, tF, w, 0) ;==============================taylorstats============= ;DJF IP ;====================================================== tI = pm(0,44:75,123:147) t1I = P1(0,44:75,123:147) t2I = P2(0,44:75,123:147) t3I = P3(0,44:75,123:147) t4I = P4(0,44:75,123:147) t5I = P5(0,44:75,123:147) stat_taylor1I = taylor_stats(t1I, tI, w, 0) stat_taylor2I = taylor_stats(t2I, tI, w, 0) stat_taylor3I = taylor_stats(t3I, tI, w, 0) stat_taylor4I = taylor_stats(t4I, tI, w, 0) stat_taylor5I = taylor_stats(t5I, tI, w, 0) ;==============================taylorstats============= ;DJF MD ;====================================================== tMD = pm(0,44:75,175:262) t1MD = P1(0,44:75,175:262) t2MD = P2(0,44:75,175:262) t3MD = P3(0,44:75,175:262) t4MD = P4(0,44:75,175:262) t5MD = P5(0,44:75,175:262) stat_taylor1MD = taylor_stats(t1MD, tMD, w, 0) stat_taylor2MD = taylor_stats(t2MD, tMD, w, 0) stat_taylor3MD = taylor_stats(t3MD, tMD, w, 0) stat_taylor4MD = taylor_stats(t4MD, tMD, w, 0) stat_taylor5MD = taylor_stats(t5MD, tMD, w, 0) ;==============================taylorstats============= ;DJF ME ;====================================================== tME = pm(0,92:119,171:276) t1ME = P1(0,92:119,171:276) t2ME = P2(0,92:119,171:276) t3ME = P3(0,92:119,171:276) t4ME = P4(0,92:119,171:276) t5ME = P5(0,92:119,171:276) stat_taylor1ME = taylor_stats(t1ME, tME, w, 0) stat_taylor2ME = taylor_stats(t2ME, tME, w, 0) stat_taylor3ME = taylor_stats(t3ME, tME, w, 0) stat_taylor4ME = taylor_stats(t4ME, tME, w, 0) stat_taylor5ME = taylor_stats(t5ME, tME, w, 0) ;==============================taylorstats============= ;DJF SC ;====================================================== tS = pm(0,120:179,183:282) t1S = P1(0,120:179,183:282) t2S = P2(0,120:179,183:282) t3S = P3(0,120:179,183:282) t4S = P4(0,120:179,183:282) t5S = P5(0,120:179,183:282) stat_taylor1S = taylor_stats(t1S, tS, w, 0) stat_taylor2S = taylor_stats(t2S, tS, w, 0) stat_taylor3S = taylor_stats(t3S, tS, w, 0) stat_taylor4S = taylor_stats(t4S, tS, w, 0) stat_taylor5S = taylor_stats(t5S, tS, w, 0) ;==============================taylorstats============= ;JJA AL ;====================================================== ttA = pm(2,75:91,182:222) t11A = P1(2,75:91,182:222) t12A = P2(2,75:91,182:222) t13A = P3(2,75:91,182:222) t14A = P4(2,75:91,182:222) t15A = P5(2,75:91,182:222) stat_taylor11A = taylor_stats(t11A, ttA, w, 0) stat_taylor12A = taylor_stats(t12A, ttA, w, 0) stat_taylor13A = taylor_stats(t13A, ttA, w, 0) stat_taylor14A = taylor_stats(t14A, ttA, w, 0) stat_taylor15A = taylor_stats(t15A, ttA, w, 0) ;==============================taylorstats============= ;JJA BI ;====================================================== ttB = pm(2,99:135,122:170) ;JJA t11B = P1(2,99:135,122:170) t12B = P2(2,99:135,122:170) t13B = P3(2,99:135,122:170) t14B = P4(2,99:135,122:170) t15B = P5(2,99:135,122:170) stat_taylor11B = taylor_stats(t11B, ttB, w, 0) stat_taylor12B = taylor_stats(t12B, ttB, w, 0) stat_taylor13B = taylor_stats(t13B, ttB, w, 0) stat_taylor14B = taylor_stats(t14B, ttB, w, 0) stat_taylor15B = taylor_stats(t15B, ttB, w, 0) ;==============================taylorstats============= ;JJA EA ;====================================================== ttE = pm(2,76:119,227:282) ;JJA t11E = P1(2,76:119,227:282) t12E = P2(2,76:119,227:282) t13E = P3(2,76:119,227:282) t14E = P4(2,76:119,227:282) t15E = P5(2,76:119,227:282) stat_taylor11E = taylor_stats(t11E, ttE, w, 0) stat_taylor12E = taylor_stats(t12E, ttE, w, 0) stat_taylor13E = taylor_stats(t13E, ttE, w, 0) stat_taylor14E = taylor_stats(t14E, ttE, w, 0) stat_taylor15E = taylor_stats(t15E, ttE, w, 0) ;==============================taylorstats============= ;JJA FR ;====================================================== ttF = pm(2,75:99,142:182) t11F = P1(2,75:99,142:182) t12F = P2(2,75:99,142:182) t13F = P3(2,75:99,142:182) t14F = P4(2,75:99,142:182) t15F = P5(2,75:99,142:182) stat_taylor11F = taylor_stats(t11F, ttF, w, 0) stat_taylor12F = taylor_stats(t12F, ttF, w, 0) stat_taylor13F = taylor_stats(t13F, ttF, w, 0) stat_taylor14F = taylor_stats(t14F, ttF, w, 0) stat_taylor15F = taylor_stats(t15F, ttF, w, 0) ;==============================taylorstats============= ;JJA IP ;====================================================== ttI = pm(2,44:75,123:147) t11I = P1(2,44:75,123:147) t12I = P2(2,44:75,123:147) t13I = P3(2,44:75,123:147) t14I = P4(2,44:75,123:147) t15I = P5(2,44:75,123:147) stat_taylor11I = taylor_stats(t11I, ttI, w, 0) stat_taylor12I = taylor_stats(t12I, ttI, w, 0) stat_taylor13I = taylor_stats(t13I, ttI, w, 0) stat_taylor14I = taylor_stats(t14I, ttI, w, 0) stat_taylor15I = taylor_stats(t15I, ttI, w, 0) ;==============================taylorstats============= ;JJA MD ;====================================================== ttMD = pm(2,44:75,175:262) t11MD = P1(2,44:75,175:262) t12MD = P2(2,44:75,175:262) t13MD = P3(2,44:75,175:262) t14MD = P4(2,44:75,175:262) t15MD = P5(2,44:75,175:262) stat_taylor11MD = taylor_stats(t11MD, ttMD, w, 0) stat_taylor12MD = taylor_stats(t12MD, ttMD, w, 0) stat_taylor13MD = taylor_stats(t13MD, ttMD, w, 0) stat_taylor14MD = taylor_stats(t14MD, ttMD, w, 0) stat_taylor15MD = taylor_stats(t15MD, ttMD, w, 0) ;==============================taylorstats============= ;JJA ME ;====================================================== ttME = pm(2,92:119,171:276) t11ME = P1(2,92:119,171:276) t12ME = P2(2,92:119,171:276) t13ME = P3(2,92:119,171:276) t14ME = P4(2,92:119,171:276) t15ME = P5(2,92:119,171:276) stat_taylor11ME = taylor_stats(t11ME, ttME, w, 0) stat_taylor12ME = taylor_stats(t12ME, ttME, w, 0) stat_taylor13ME = taylor_stats(t13ME, ttME, w, 0) stat_taylor14ME = taylor_stats(t14ME, ttME, w, 0) stat_taylor15ME = taylor_stats(t15ME, ttME, w, 0) ;==============================taylorstats============= ;JJA SC ;====================================================== ttS = pm(2,120:179,183:282) t11S = P1(2,120:179,183:282) t12S = P2(2,120:179,183:282) t13S = P3(2,120:179,183:282) t14S = P4(2,120:179,183:282) t15S = P5(2,120:179,183:282) stat_taylor11S = taylor_stats(t11S, ttS, w, 0) stat_taylor12S = taylor_stats(t12S, ttS, w, 0) stat_taylor13S = taylor_stats(t13S, ttS, w, 0) stat_taylor14S = taylor_stats(t14S, ttS, w, 0) stat_taylor15S = taylor_stats(t15S, ttS, w, 0) ;=====DJF================================================================ CA_cc = (/stat_taylor1A(0), stat_taylor1B(0), stat_taylor1E(0),stat_taylor1F(0),\ stat_taylor1I(0),stat_taylor1MD(0),stat_taylor1ME(0),stat_taylor1S(0) /) CA_cc1 = (/stat_taylor2A(0), stat_taylor2B(0), stat_taylor2E(0),stat_taylor2F(0),\ stat_taylor2I(0),stat_taylor2MD(0),stat_taylor2ME(0),stat_taylor2S(0)/) CA_cc2 = (/stat_taylor3A(0), stat_taylor3B(0), stat_taylor3E(0),stat_taylor3F(0),\ stat_taylor3I(0),stat_taylor3MD(0),stat_taylor3ME(0),stat_taylor3S(0)/) CA_cc3 = (/stat_taylor4A(0), stat_taylor4B(0), stat_taylor4E(0),stat_taylor4F(0),\ stat_taylor4I(0),stat_taylor4MD(0),stat_taylor4ME(0),stat_taylor4S(0)/) CA_cc4 = (/stat_taylor5A(0), stat_taylor5B(0), stat_taylor5E(0),stat_taylor5F(0),\ stat_taylor5I(0),stat_taylor5MD(0),stat_taylor5ME(0),stat_taylor5S(0)/) CA_rat = (/stat_taylor1A(1), stat_taylor1B(1), stat_taylor1E(1),stat_taylor1F(1),\ stat_taylor1I(1),stat_taylor1MD(1),stat_taylor1ME(1),stat_taylor1S(1) /) CA_rat1 = (/stat_taylor2A(1), stat_taylor2B(1), stat_taylor2E(1),stat_taylor2F(1),\ stat_taylor2I(1),stat_taylor2MD(1),stat_taylor2ME(1),stat_taylor2S(1)/) CA_rat2 = (/stat_taylor3A(1), stat_taylor3B(1), stat_taylor3E(1),stat_taylor3F(1),\ stat_taylor3I(1),stat_taylor3MD(1),stat_taylor3ME(1),stat_taylor3S(1)/) CA_rat3 = (/stat_taylor4A(1), stat_taylor4B(1), stat_taylor4E(1),stat_taylor4F(1),\ stat_taylor4I(1),stat_taylor4MD(1),stat_taylor4ME(1),stat_taylor4S(1)/) CA_rat4 = (/stat_taylor5A(1), stat_taylor5B(1), stat_taylor5E(1),stat_taylor5F(1),\ stat_taylor5I(1),stat_taylor5MD(1),stat_taylor5ME(1),stat_taylor5S(1)/) CA_bias = (/stat_taylor1A(2), stat_taylor1B(2), stat_taylor1E(2),stat_taylor1F(2),\ stat_taylor1I(2),stat_taylor1MD(2),stat_taylor1ME(2),stat_taylor1S(2)/) CA_bias1 = (/stat_taylor2A(2), stat_taylor2B(2), stat_taylor2E(2),stat_taylor2F(2),\ stat_taylor2I(2),stat_taylor2MD(2),stat_taylor2ME(2),stat_taylor2S(2)/) CA_bias2 = (/stat_taylor3A(2), stat_taylor3B(2), stat_taylor3E(2),stat_taylor3F(2),\ stat_taylor3I(2),stat_taylor3MD(2),stat_taylor3ME(2),stat_taylor3S(2)/) CA_bias3 = (/stat_taylor4A(2), stat_taylor4B(2), stat_taylor4E(2),stat_taylor4F(2),\ stat_taylor4I(2),stat_taylor4MD(2),stat_taylor4ME(2),stat_taylor4S(2)/) CA_bias4 = (/stat_taylor5A(2), stat_taylor5B(2), stat_taylor5E(2),stat_taylor5F(2),\ stat_taylor5I(2),stat_taylor5MD(2),stat_taylor5ME(2),stat_taylor5S(2)/) ;====JJA=================================================================== CA_ccn = (/stat_taylor11A(0), stat_taylor11B(0), stat_taylor11E(0),stat_taylor11F(0),\ stat_taylor11I(0),stat_taylor11MD(0),stat_taylor11ME(0),stat_taylor11S(0)/) CA_cc1n = (/stat_taylor12A(0), stat_taylor12B(0), stat_taylor12E(0),stat_taylor12F(0),\ stat_taylor12I(0),stat_taylor12MD(0),stat_taylor12ME(0),stat_taylor12S(0)/) CA_cc2n = (/stat_taylor13A(0), stat_taylor13B(0), stat_taylor13E(0),stat_taylor13F(0),\ stat_taylor13I(0),stat_taylor13MD(0),stat_taylor13ME(0),stat_taylor13S(0)/) CA_cc3n = (/stat_taylor14A(0), stat_taylor14B(0), stat_taylor14E(0),stat_taylor14F(0),\ stat_taylor14I(0),stat_taylor14MD(0),stat_taylor14ME(0),stat_taylor14S(0)/) CA_cc4n = (/stat_taylor15A(0), stat_taylor15B(0), stat_taylor15E(0),stat_taylor15F(0),\ stat_taylor15I(0),stat_taylor15MD(0),stat_taylor15ME(0),stat_taylor15S(0)/) CA_ratn = (/stat_taylor11A(1), stat_taylor11B(1), stat_taylor11E(1),stat_taylor11F(1),\ stat_taylor11I(1),stat_taylor11MD(1),stat_taylor11ME(1),stat_taylor11S(1)/) CA_rat1n = (/stat_taylor12A(1), stat_taylor12B(1), stat_taylor12E(1),stat_taylor12F(1),\ stat_taylor12I(1),stat_taylor12MD(1),stat_taylor12ME(1),stat_taylor12S(1)/) CA_rat2n = (/stat_taylor13A(1), stat_taylor13B(1), stat_taylor13E(1),stat_taylor13F(1),\ stat_taylor13I(1),stat_taylor13MD(1),stat_taylor13ME(1),stat_taylor13S(1)/) CA_rat3n = (/stat_taylor14A(1), stat_taylor14B(1), stat_taylor14E(1),stat_taylor14F(1),\ stat_taylor14I(1),stat_taylor14MD(1),stat_taylor14ME(1),stat_taylor14S(1)/) CA_rat4n = (/stat_taylor15A(1), stat_taylor15B(1), stat_taylor15E(1),stat_taylor15F(1),\ stat_taylor15I(1),stat_taylor15MD(1),stat_taylor15ME(1),stat_taylor15S(1)/) CA_biasn = (/stat_taylor11A(2), stat_taylor11B(2), stat_taylor11E(2),stat_taylor11F(2),\ stat_taylor11I(2),stat_taylor11MD(2),stat_taylor11ME(2),stat_taylor11S(2)/) CA_bias1n = (/stat_taylor12A(2), stat_taylor12B(2), stat_taylor12E(2),stat_taylor12F(2),\ stat_taylor12I(2),stat_taylor12MD(2),stat_taylor12ME(2),stat_taylor12S(2)/) CA_bias2n = (/stat_taylor13A(2), stat_taylor13B(2), stat_taylor13E(2),stat_taylor13F(2),\ stat_taylor13I(2),stat_taylor13MD(2),stat_taylor13ME(2),stat_taylor13S(2)/) CA_bias3n = (/stat_taylor14A(2), stat_taylor14B(2), stat_taylor14E(2),stat_taylor14F(2),\ stat_taylor14I(2),stat_taylor14MD(2),stat_taylor14ME(2),stat_taylor14S(2)/) CA_bias4n = (/stat_taylor15A(2), stat_taylor15B(2), stat_taylor15E(2),stat_taylor15F(2),\ stat_taylor15I(2),stat_taylor15MD(2),stat_taylor15ME(2),stat_taylor15S(2)/) ;********************************** ; Put the ratios and pattern correlations into ; arrays for plotting ;********************************** ; arrays to be passed to taylor_diagram. It will calculate the x xnd y coordinates. ; ratio = new ((/nCase, nVar/), typeof(CA_cc) ) ; cc = new ((/nCase, nVar/), typeof(CA_cc) ) bias = new ((/nCase, nVar/), typeof(CA_cc) ) ; ration = new ((/nCase, nVar/), typeof(CA_cc) ) ; ccn = new ((/nCase, nVar/), typeof(CA_cc) ) biasn = new ((/nCase, nVar/), typeof(CA_cc) ) ; ratio(0,:) = CA_rat ; ratio(1,:) = CA_rat1 ; ratio(2,:) = CA_rat2 ; ratio(3,:) = CA_rat3 ; ratio(4,:) = CA_rat4 ; cc(0,:) = CA_cc ; cc(1,:) = CA_cc1 ; cc(2,:) = CA_cc2 ; cc(3,:) = CA_cc3 ; cc(4,:) = CA_cc4 bias(0,:) = CA_bias bias(1,:) = CA_bias1 bias(2,:) = CA_bias2 bias(3,:) = CA_bias3 bias(4,:) = CA_bias4 ; ration(0,:) = CA_ratn ; ration(1,:) = CA_rat1n ; ration(2,:) = CA_rat2n ; ration(3,:) = CA_rat3n ; ration(4,:) = CA_rat4n ; ccn(0,:) = CA_ccn ; ccn(1,:) = CA_cc1n ; ccn(2,:) = CA_cc2n ; ccn(3,:) = CA_cc3n ; ccn(4,:) = CA_cc4n biasn(0,:) = CA_biasn biasn(1,:) = CA_bias1n biasn(2,:) = CA_bias2n biasn(3,:) = CA_bias3n biasn(4,:) = CA_bias4n ;print(bias) ;print(cc) ;print(ratio) ;************************************************** ; fill an array for a "taylor metrics table" ;************************************************** season = (/ "DJF","JJA" /) nSeason = dimsizes(season) case = (/ "ALADIN", "HIRHAM" , "RegCM", "RACMO2", "RCA"/) nCase = dimsizes(case ) ; # of Cases [Cases] var = (/ "AL", "BI", "EA", "FR", "IP", "MD", "ME", "SC" /) nVar = dimsizes(var) table = new ( (/nCase,nSeason,nVar/), typeof(bias) ) table(0,:,:) = (/CA_bias, CA_biasn/) table(1,:,:) = (/CA_bias1, CA_bias1n/) table(2,:,:) = (/CA_bias2, CA_bias2n/) table(3,:,:) = (/CA_bias3, CA_bias3n/) table(4,:,:) = (/CA_bias4, CA_bias4n/) tabled = dimsizes(table) print(tabled) tt_opt = True tt_opt@tableTitle = "pr bias(mm)" tt_opt@pltType= "png" ; "eps" [default], "pdf", "ps" ; "png", "gif" [if you have ImageMajik 'convert'] tt_opt@color0 = "cadetblue1" tt_opt@color1 = "red" taylor_metrics_table("Taylor_bias_pr_control_mm", var,case,season, table, tt_opt) end