taylor/01.ncl
changeset 1 4be95183fbcd
equal deleted inserted replaced
-1:000000000000 0:02d285e79cb7
       
     1 ;**********************************
       
     2 ; taylor_3.ncl
       
     3 ;**********************************
       
     4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"   
       
     5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"   
       
     6 load "./taylor_diagram.ncl"
       
     7 ;**********************************
       
     8 begin
       
     9 ;**********************************
       
    10 ; Assume the following have already been computed:
       
    11 ;   _ratio are the ratio:  Case_Variance/Reference_Variance
       
    12 ;   _cc    are the cross correlation coef of Case to Reference
       
    13 ;**********************************
       
    14 
       
    15 ; Cases [Model]
       
    16   case      = (/ "Case A", "Case B" /) 
       
    17   nCase     = dimsizes(case )                 ; # of Cases [Cases]
       
    18 
       
    19 ; variables compared
       
    20   var       = (/ "SLP","Tsfc","Prc","Prc 30S-30N","LW","SW", "U300", "Guess" /) 
       
    21   nVar      = dimsizes(var)                   ; # of Variables
       
    22 
       
    23 ; "Case A"                        
       
    24   CA_ratio   = (/1.230, 0.988, 1.092, 1.172, 1.064, 0.966, 1.079, 0.781/)
       
    25   CA_cc      = (/0.958, 0.973, 0.740, 0.743, 0.922, 0.982, 0.952, 0.433/)
       
    26 
       
    27 ; "Case B" 
       
    28   CB_ratio   = (/1.129, 0.996, 1.016, 1.134, 1.023, 0.962, 1.048, 0.852 /)
       
    29   CB_cc      = (/0.963, 0.975, 0.801, 0.814, 0.946, 0.984, 0.968, 0.647 /)
       
    30 
       
    31 ; arrays to be passed to taylor plot 
       
    32   ratio      = new ((/nCase, nVar/),typeof(CA_cc) )  
       
    33   cc         = new ((/nCase, nVar/),typeof(CA_cc) ) 
       
    34 
       
    35   ratio(0,:) = CA_ratio 
       
    36   ratio(1,:) = CB_ratio
       
    37 
       
    38   cc(0,:)    = CA_cc 
       
    39   cc(1,:)    = CB_cc
       
    40 
       
    41 ;**********************************
       
    42 ; create plot
       
    43 ;**********************************
       
    44 
       
    45   res   = True                           ; default taylor diagram
       
    46         
       
    47   res@Markers      = (/16, 16/)               ; make all solid fill
       
    48   res@Colors       = (/"red", "blue" /)          
       
    49   res@varLabels    = var
       
    50   res@caseLabels   = case
       
    51  
       
    52   wks   = gsn_open_wks("ps","taylor") 
       
    53   plot  = taylor_diagram(wks,ratio,cc,res)
       
    54 
       
    55   frame(wks)
       
    56 
       
    57 end