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 temperature and 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 ; ============================================================== f = addfile("E-OBS_1961-1990_tas_sm.nc", "r") ; TO = f->tas(:,:,:) ;printVarSummary(TO) ; (time, lat,lon) ; ============================================================== ; compute desired regional seasonal climatology (4,nlat,mlon) ;============================================================ f1= addfile("CNRM_control_tas_sm.nc", "r") ; T1 = f1->tas(:,:,:) ;printVarSummary(T1) ; (time, lat,lon) ;============================================================ f2= addfile("DMI_control_tas_sm.nc", "r") ; T2 = f2->tas(:,:,:) ;printVarSummary(T2) ;============================================================ f3= addfile("ICTP_control_tas_sm.nc", "r") ; T3 = f3->tas(:,:,:) ;printVarSummary(T3) ; (time, lat,lon) ;============================================================ f4= addfile("KNMI_control_tas_sm.nc", "r") ; T4 = f4->tas(:,:,:) ;printVarSummary(T4) ;============================================================ f5= addfile("SMHI_control_tas_sm.nc", "r") ; T5 = f5->tas(:,:,:) ;printVarSummary(T5) ;================================================================== ;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 = TO(0,75:91,182:222) t1A = T1(0,75:91,182:222) t2A = T2(0,75:91,182:222) t3A = T3(0,75:91,182:222) t4A = T4(0,75:91,182:222) t5A = T5(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 = TO(0,99:135,122:170) t1B = T1(0,99:135,122:170) t2B = T2(0,99:135,122:170) t3B = T3(0,99:135,122:170) t4B = T4(0,99:135,122:170) t5B = T5(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 = TO(0,76:119,227:282) t1E = T1(0,76:119,227:282) t2E = T2(0,76:119,227:282) t3E = T3(0,76:119,227:282) t4E = T4(0,76:119,227:282) t5E = T5(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 = TO(0,75:99,142:182) t1F = T1(0,75:99,142:182) t2F = T2(0,75:99,142:182) t3F = T3(0,75:99,142:182) t4F = T4(0,75:99,142:182) t5F = T5(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 = TO(0,44:75,123:147) t1I = T1(0,44:75,123:147) t2I = T2(0,44:75,123:147) t3I = T3(0,44:75,123:147) t4I = T4(0,44:75,123:147) t5I = T5(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 = TO(0,44:75,175:262) t1MD = T1(0,44:75,175:262) t2MD = T2(0,44:75,175:262) t3MD = T3(0,44:75,175:262) t4MD = T4(0,44:75,175:262) t5MD = T5(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 = TO(0,92:119,171:276) t1ME = T1(0,92:119,171:276) t2ME = T2(0,92:119,171:276) t3ME = T3(0,92:119,171:276) t4ME = T4(0,92:119,171:276) t5ME = T5(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 = TO(0,120:179,183:282) t1S = T1(0,120:179,183:282) t2S = T2(0,120:179,183:282) t3S = T3(0,120:179,183:282) t4S = T4(0,120:179,183:282) t5S = T5(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 = TO(2,75:91,182:222) t11A = T1(2,75:91,182:222) t12A = T2(2,75:91,182:222) t13A = T3(2,75:91,182:222) t14A = T4(2,75:91,182:222) t15A = T5(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 = TO(2,99:135,122:170) ;JJA t11B = T1(2,99:135,122:170) t12B = T2(2,99:135,122:170) t13B = T3(2,99:135,122:170) t14B = T4(2,99:135,122:170) t15B = T5(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 = TO(2,76:119,227:282) ;JJA t11E = T1(2,76:119,227:282) t12E = T2(2,76:119,227:282) t13E = T3(2,76:119,227:282) t14E = T4(2,76:119,227:282) t15E = T5(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 = TO(2,75:99,142:182) t11F = T1(2,75:99,142:182) t12F = T2(2,75:99,142:182) t13F = T3(2,75:99,142:182) t14F = T4(2,75:99,142:182) t15F = T5(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 = TO(2,44:75,123:147) t11I = T1(2,44:75,123:147) t12I = T2(2,44:75,123:147) t13I = T3(2,44:75,123:147) t14I = T4(2,44:75,123:147) t15I = T5(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 = TO(2,44:75,175:262) t11MD = T1(2,44:75,175:262) t12MD = T2(2,44:75,175:262) t13MD = T3(2,44:75,175:262) t14MD = T4(2,44:75,175:262) t15MD = T5(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 = TO(2,92:119,171:276) t11ME = T1(2,92:119,171:276) t12ME = T2(2,92:119,171:276) t13ME = T3(2,92:119,171:276) t14ME = T4(2,92:119,171:276) t15ME = T5(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 = TO(2,120:179,183:282) t11S = T1(2,120:179,183:282) t12S = T2(2,120:179,183:282) t13S = T3(2,120:179,183:282) t14S = T4(2,120:179,183:282) t15S = T5(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 = "temp bias((~S~o~N~C))" 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_tas_control_celsius", var,case,season, table, tt_opt) end