[ncl-talk] Fwd: Taylor diagram

Dennis Shea shea at ucar.edu
Thu Jul 6 12:19:36 MDT 2017


---------- Forwarded message ----------
From: Sri Nandini <snandini at marum.de>
Date: Thu, Jul 6, 2017 at 6:17 AM
Subject: Re: [ncl-talk] Taylor diagram
To: shea at ucar.edu


Sorry for the late reply.

Yes it got resolved.
Attached is my script with my output plot.
It for global scale, i just have to specify my regions next to apply this
to the Caspian.

Thank you.


On Tue, Jun 6, 2017 at 8:05 AM, Sri Nandini <snandini at marum.de> wrote:

Hello

I am plotting multiple variables in Taylor diagram between model -
observations.
There are no errors but the 3rd variable is not plotting.
I have T2M and precip at same resolution [360 720] but my SLP is [192 288]
Now i have weighted it and performed taylor_stats, but it gives missing
values. Part of my script for the SLP is below:

;===========================================================
================================PSL
f= addfile("SLP_PHIS_Z3cam5.nc", "r") ;

 TIME   = f->time
  YYYY   = cd_calendar(TIME,-1)/100                 ; entire file
  iYYYY  = ind(YYYY461.ge.yrStrt .and. YYYY461.le.yrLast)
slpp    = f->PSL(iYYYY,:,:)
printVarSummary(slpp)                                ; (time, lat,lon)
 pm1 = slpp(:,::-1,:)                          ; make latitudes
monotonically increasing (NCL syntax)
printVarSummary(pm1)                                ; (time, lat,lon)
slp    = lonFlip( slpp )
  s3w=month_to_annual(slp,1)
   s3Clm = dim_avg_n_Wrap( s3w, 0)
   printVarSummary(s3Clm)                 ; (lat,lon)
   printMinMax(s3Clm, 0)
;===========================================================
========================
f6 = addfile ("slp.mon.mean.nc", "r")
  TIME46   = f6->time
  YYYY46   = cd_calendar(TIME46,-1)/100                 ; entire file
  iYYYY46  = ind(YYYY46.ge.yrStrt .and. YYYY46.le.yrLast)
  psl    = f6->slp(iYYYY46,:,:)
printVarSummary(psl)                                ; (time, lat,lon)
S3 = linint2_Wrap(psl&lon, psl&lat, psl, True,  pm1&lon, pm1&lat, 0)
 PSL=month_to_annual(S3,1)
   pslClm = dim_avg_n_Wrap( PSL, 0)
   printVarSummary(pslClm)                 ; (lat,lon)
   printMinMax(pslClm, 0)
;==================================================================
;Taylor diagram calculations
;===================================================================
 case      = (/ "CESM CAM5"/)
  nCase     = dimsizes(case )                 ; # of Cases [Cases]

var       = (/ "T2M(Wilmott)", "PRECIP(Wilmott)","SLP(NCEP)"/)
  nVar      = dimsizes(var)                   ; # of Variables
  SEASONS      = (/ "ANN" /)
  nSeason     = dimsizes( SEASONS )
;==================================================================
; create weights:  sqrt(cos(lat))   [or sqrt(gw) ]
; =================================================================
  rad    = 4.*atan(1.)/180.
 lat = f->lat
   if (typeof(lat).eq."double") then
       clat = sqrt( cos(rad*tofloat(lat)) )
   else
       clat = sqrt( cos(rad*lat) )
   end if
   copy_VarCoords(lat, clat) ; contributed
   printVarSummary(clat)

;==============================Taylorstats=============
stat_taylor     = taylor_stats(t4Clm, aClm, clat, 0)

stat_taylor2     = taylor_stats(p3Clm, pClm, clat, 0)
;===============Perform another weighting for the SLP since it is on a
different resolution

  rad    = 4.*atan(1.)/180.
 lat1 = f88->lat
   if (typeof(lat1).eq."double") then
       clat1 = sqrt( cos(rad*tofloat(lat1)) )
   else
       clat1 = sqrt( cos(rad*lat1) )
   end if
   copy_VarCoords(lat1, clat1) ; contributed
   printVarSummary(clat1)
w=clat1

stat_taylor3     = taylor_stats(s3Clm, pslClm, w, 0)
print(stat_taylor3)

CA_cc = (/stat_taylor(0), stat_taylor2(0), stat_taylor3(0)/) ; pattern_cor
of t2CLM and of p1CLM and SLP
CA_rat = (/stat_taylor(1), stat_taylor2(1), stat_taylor3(1)/) ; ratio of
t2CLM and of p1CLM and SLP
CA_bias = (/stat_taylor(2), stat_taylor2(2), stat_taylor3(2)/) ; bias of
t2CLM and of p1CLM and SLP

;**********************************
; 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)  )

ratio(0,:) = CA_rat
cc(0,:)    = CA_cc
bias(0,:)  = CA_bias

print(bias)
print(cc)
print(ratio)
;================================
; PLOTS
;================================

res   = True                           ; default taylor diagram

  res at Markers      = (/16,16,16/)               ; make all solid fill
  res at Colors       = (/"red","blue","black"/)
  res at varLabels    = var
  res at caseLabels   = case
res at varLabelsYloc = 0.6              ; Move location of variable labels
;;[default 0.45]
 res at caseLabelsFontHeightF = 0.14       ; make slight larger
[default=0.12 ]
 res at varLabelsFontHeightF  = 0.011      ; make slight smaller
[default=0.013]
 res at stnRad = (/0.5, 1.25 /) ;
res at tiMainString = "Annual Taylor Diagram"
  wks   = gsn_open_wks("png","TaylorCAM5all")        ; send graphics to PNG
file
  plot  = taylor_diagram_cam(wks,ratio,cc,bias,res)



 end



Did i misunderstand and that all variables plotted should be of same
resolution?
Would deeply appreciate

Variable: stat_taylor3
Type: float
Total Size: 12 bytes
            3 values
Number of Dimensions: 1
Dimensions and sizes:    [3]
Coordinates:
Number Of Attributes: 2
  _FillValue :    9.96921e+36
  long_name :    0-pattern_cor; 1-ratio; 2-bias (%)
(0)    -9.96921e+36
(1)    nan
(2)    -nan


_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170706/4898eb70/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TaylorCAM5DJF.png
Type: image/png
Size: 107947 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170706/4898eb70/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CAM5Taylor_DJF.ncl
Type: undefined
Size: 10457 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170706/4898eb70/attachment.pl 


More information about the ncl-talk mailing list