[ncl-talk] Interpolation for taylor diagram

Sri Nandini snandini at marum.de
Thu Feb 23 09:03:56 MST 2017


Dear NCL community,
Greetings!

I am trying to plot seasonal (DJF) Taylor diagrams and have errors in interpolation my datasets on same grid.
(a) read 2 data sets with different resolutions and regrid 
(modelled and obs temperature for a test)
(b) calculate a pattern correlation


My script is attached below ::

;==================================================================
;Taylor diagram calculations
;================================ interpolation onto common grid (of observational data)
;ncl pattern_cor between different size arrays
 t2mw = f->t2mw(0,0,:,{0:360}); remove cyclic point
  lon = f->lon({0:360})
;************************************************
; interpolate to new grid
;***********************************************
  newlat = fspan(-60.,60,24)
  newlon = fspan(0.,355.,72)

 newt2mw = linint2_Wrap(lon,t2mw&lat,t2mw,True,newlon,newlat,0)

  newt2mw!0   ="lat"
  newt2mw!1   = "lon"
  newt2mw&lat = newlat
  newt2mw&lon = newlon
;======================================================================centered Pattern correlation (coslat weighting has been done previously above)
re=escorc(airw,newt2mw)
 ;cor1 = dim_avg_n_Wrap(pattern_cor( t2mw, airw, clat, 0), 0);rc = pattern_cor(x, y,gw, 0)      ; gaussian weighting, centered
 mmd= (/cor1/)
 printVarSummary(mmd)
;================================Standard deviation ;================================

;pre0_Std = dim_avg_n_Wrap( dim_stddev_n_Wrap( t2mw, (/1,2/)), 0)
 ;std1 = dim_rmsd_Wrap(airw,t2mw, 0);computes rootmean square difference
;std1 = dim_rmsd_n(t2mw, airw, 0);
    std1 = dim_rmsd( t2mw(lat|:,lon|:,time|:), airw(lat|:,lon|:,time|:) )    ; ==> rmsdTime(nlat,nlon)

    ;rmsdTime = dim_rmsd_n( x, y, 0 )                                       ; ==> no reordering needed
================================================================

I had a look at other interpolation functions for correlations between different grids such a s:

      Assume fi is a 4D array dimensioned ntim x
      nlvl x nlat x mlon (ntim=50,
      nlvl=30, nlat=64, mlon=128), and that
      the
      rightmost dimension is to be treated as cyclic (the user should
      not
      add a cyclic point for the rightmost dimension).
    
      All times and levels will be interpolated and returned in a new
      array
      fo dimensioned ntim x nlvl x 73
      x
      144:
    
      lon = (0., 2.8125, .... , 357,0125)
  lat = (-87.8638, ... ,87.8638)

  LON = (0., 2.5, ... , 357.5)    ; length 144
  LAT = (-90.,87.5,...90.)        ; length 73

  fo = linint2_Wrap (lon,lat,fi, True, LON,LAT, 0)
Error: 

Deeply appreciated

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170223/0d59ead9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exampletay_diag.ncl
Type: undefined
Size: 7222 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170223/0d59ead9/attachment.pl 


More information about the ncl-talk mailing list