problems with EOF_AAO

From: Vanúcia Schumacher <vanucia-schumacher_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 18 2014 - 16:05:44 MDT

Hi users,
I'm trying to plot the EOF_AAO the example of the NCL page and returns this=
 error, if someone can help.
fatal:Dimension size mismatch on subscript #1, left-hand and right-hand s=
ide dimensions do not matchfatal:["Execute.c":8567]:Execute: Error occurred=
 at or near line 90 in file eof_aao.ncl
Variable: xType: doubleTotal Size: 47436480 bytes 5929560 values=
Number of Dimensions: 3Dimensions and sizes: [TIME | 360] x [Y2DEG | 91] x =
[X2DEG | 181]Coordinates: TIME: [15.5..10934.5] Y2DE=
G: [ -90.. 90] X2DEG: [ 0.. 360]Number Of Attributes: 5 PLEV=
14_14 : 70000 missing_value : -9.999999999999999e+33 _FillValue : -9.9999=
99999999999e+33 long_name : ZG[GX=X2DEG,GY=Y2DEG] history : From zg=
.IPSL
Variable: xClmType: doubleTotal Size: 1581216 bytes 197652 value=
sNumber of Dimensions: 3Dimensions and sizes: [month | 12] x [Y2DEG | 91] x=
 [X2DEG | 181]Coordinates: month: [0..11] Y2DEG: [ -=
90.. 90] X2DEG: [ 0.. 360]Number Of Attributes: 7 _FillValue=
 : -9.999999999999999e+33 PLEV14_14 : 70000 long_name : ZG[GX=X2DEG,G=
Y=Y2DEG] history : From zg.IPSL missing_value : -9.999999999999999e+33 =
 time_op_ncl : Climatology: 30 years info : function clmMonLLT: contribute=
d.ncl
Variable: xAnomType: doubleTotal Size: 47436480 bytes 5929560 va=
luesNumber of Dimensions: 3Dimensions and sizes: [TIME | 360] x [Y2DEG | 91=
] x [X2DEG | 181]Coordinates: TIME: [15.5..10934.5] =
Y2DEG: [ -90.. 90] X2DEG: [ 0.. 360]Number Of Attributes: 6 =
PLEV14_14 : 70000 missing_value : -9.999999999999999e+33 _FillValue : -9.=
999999999999999e+33 long_name : ZG[GX=X2DEG,GY=Y2DEG] history : Fro=
m zg.IPSL anomaly_op_ncl : Anomalies from Annual Cycle: calcMonAnomTLL: co=
ntributed.ncl(0) (0) ZG[GX=X2DEG,GY=Y2DEG]: min=-230.4509485966109=
   max=295.5109758631793
Variable: clatType: doubleTotal Size: 728 bytes 91 valuesNumber =
of Dimensions: 1Dimensions and sizes: [Y2DEG | 91]Coordinates: Number Of At=
tributes: 4 standard_name : latitude axis : Y point_spacing : even unit=
s : degrees_north
Variable: eofType: doubleTotal Size: 131768 bytes 16471 valuesNu=
mber of Dimensions: 3Dimensions and sizes: [evn | 1] x [Y2DEG | 91] x [X2DE=
G | 181]Coordinates: evn: [1..1] Y2DEG: [ -90.. 90]=
            X2DEG: [ 0.. 360]Number Of Attributes: 7 eval_transpose : 47=
025.64585057087 eval : 2022102.771574547 pcvar : 21.81134 matrix : covar=
iance method : transpose _FillValue : -9.999999999999999e+33 long_name :=
        EOF: Wgt: ZG[GX=X2DEG,GY=Y2DEG]
Variable: eof_tsType: doubleTotal Size: 2880 bytes 360 valuesNum=
ber of Dimensions: 2Dimensions and sizes: [evn | 1] x [TIME | 360]Coordinat=
es: evn: [1..1] TIME: [15.5..10934.5]Number Of Attri=
butes: 4 ts_mean : -5.431704468921655e-13 matrix : covariance _FillValue=
 : -9.999999999999999e+33 long_name : EOF: Amplitude: Wgt: ZG[GX=X2DEG=
,GY=Y2DEG]

;=========================
==========================
=============; Match the AAO pattern at: ; =
http://www.cpc.ncep.noaa.gov/products/precip/CWlink/daily_ao_index/aao/aao.=
loading.shtml;; Use method: ; http://www.cpc.ncep.noaa.gov/products=
/precip/CWlink/daily_ao_index/aao/aao.shtml;==========
==========================
==========================
===; Data source was Reanalysis-2 geopotential height.; http://w=
ww.esrl.noaa.gov/psd/data/gridded/;data.ncep.reanalysis2.pressure.html =
;=========================
==========================
=============
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"load "$NCARG_ROOT/l=
ib/ncarg/nclscripts/csm/gsn_csm.ncl"load "$NCARG_ROOT/lib/ncarg/nclscripts/=
csm/contributed.ncl"
; ========================
==========================
==============; User defined parameters that =
specify region of globe and; ===============
==========================
======================= latS=
   = -90. latN = -20. plev = 700
  yrStrt = 1981 yrLast = 2010
  var = "ZG_NEW" title = str_upper(var)+": "+plev+"hPa "
  ymStrt = yrStrt*100 + 1 ymLast = yrLast*100 + 12
  neof = 1 ; Leading EOF only optEO=
F = True optETS = False
; ========================
==========================
==============; Open the file: ; ====
==========================
==========================
========= f = addfile ("zg.IPSL.2g.nc", "r") x=
=f->ZG_NEW(:,0,:,:) printVarSummary(x) ;=
 =========================
==========================
=============; compute climatology and Anomalie=
s; ========================
==========================
============== xClm = clmMonTLL(x) =
                     ; (12,lat,lon) printVarSummary(xClm)
  xAnom = calcMonAnomTLL ( x, xClm) ; (time, lat,=
lon) printVarSummary(xAnom) printMinMax(xAnom, True)
; ========================
==========================
=================; create weights: sqr=
t(cos(lat)) [or sqrt(gw) ]; ===============
==========================
==========================
= rad = 4.*atan(1.)/180. clat = xAnom&Y2DEG clat =
  = sqrt( cos(rad*clat) ) ; gw for gaussian grid print=
VarSummary(clat)
; ========================
==========================
=================; weight all observati=
ons ; =======================
==========================
================== xw = xAnom*co=
nform(xAnom, clat, 1) copy_VarMeta(x, xw) xw@long_name = "Wgt: "+=
x@long_name
; ========================
==========================
=================; Reorder (lat,lon=
,time) the *weighted* input data; Compute EOFs & Standardize time serie=
s; ========================
==========================
================= wx = xw(Y2DEG|:=
,X2DEG|:,TIME|:) ; convenience, cleaner code delete=
(xw)
  eof = eofunc_Wrap(wx, neof, optEOF) eof = -1*eof =
                            ; *special* match sign of CPC
  eof_ts = eofunc_ts_Wrap (wx, eof, optETS)
  printVarSummary( eof ) ; examine EOF variables =
 printVarSummary( eof_ts )
  eof_ts = dim_standardize_n( eof_ts, 0, 1) ; normalize
; ========================
==========================
=================; Regress; ====
==========================
==========================
============
  eof_regres = eof ; create an array w me=
ta data do ne=0,neof-1 eof_regres(ne,:,:) = (/ regCoef(eof_t=
s(ne,:), xAnom(X2DEG|:,Y2DEG|:,TIME|:)) /) ->>>>>>>>> error this =
line end do
; ========================
==========================
=================; Extract the YYYYMM f=
rom the time coordinate ; associated with eof_ts [same as x&time] ; ==
==========================
==========================
==============
  yyyymm = cd_calendar(eof_ts&TIME,-1) yrfrac = yyyymm_to_yyyyfrac=
(yyyymm, 0.0); not used here
;=========================
==========================
===========; PLOTS;===========
==========================
==========================
  wks = gsn_open_wks("ps","eof") gsn_define_colormap(wks,"BlueWhiteO=
rangeRed") plot = new(neof,graphic) =
 ; create graphic array ; only=
 needed if paneling; EOF patterns
  res = True res@gsnAddCyclic = False =
       res@gsnDraw = False ; don't draw yet res@gs=
nFrame = False ; don't advance frame yet res@gsnPol=
ar = "SH" res@gsnSpreadColors = True ; spre=
ad out color table res@mpFillOn = False ; turn off=
 map fill res@mpMaxLatF = latN res@mpCenterLonF = =
180
  res@cnFillOn = True ; turn on color fill res@cnL=
inesOn = False ; True is default res@cnLineLabelsOn =
      = False ; True is default res@lbLabelBarOn = Fa=
lse ; turn off individual lb's
                                          ; set symmetric plot min/max s=
ymMinMaxPlt(eof_regres, 16, False, res) ; contributed.ncl re=
s@cnLevelSpacingF = 5.0 ; *special* match CPC
; panel plot only resources
  resP = True ; modify the panel plot resP=
@gsnMaximize = True ; large format resP@gsnPanelLabelB=
ar = True ; add common colorbar resP@gsnPaperOrientation =
= "portrait" ; force portraitorbar resP@lbLabelAutoStride = True=
         ; auto stride on labels
  resP@txString = title+": "+yrStrt+"-"+yrLast
;*******************************************; first plot;************=
******************************* do n=0,neof-1 res@gsnLeftString =
= "EOF "+(n+1) res@gsnRightString = sprintf("%5.1f", eof@pcvar(n)=
) +"%" plot(n)=gsn_csm_contour_map_polar(wks,eof_regres(n,:,:)=
,res) end do gsn_panel(wks,plot,(/neof,1/),resP) ; now dr=
aw as one plot
;*******************************************; second plot;***********=
********************************; EOF time series [bar form]
  rts = True rts@gsnDraw = False ; don't draw yet =
 rts@gsnFrame = False ; don't advance frame yet rts@gsnScale =
= True ; force text scaling
; these four rtsources allow the user to stretch the plot size, and; =
decide exactly where on the page to draw it.
  rts@vpHeightF = 0.40 ; Changes the aspect ratio rts@vpWidthF =
 = 0.85 rts@vpXF = 0.10 ; change start locations rts@vp=
YF = 0.75 ; the plot

  rts@tiYAxisString = "Standardized" ; y-axis label
  rts@gsnYRefLine = 0. ; reference line rts@=
gsnXYBarChart = True ; create bar chart rts@gsnAbo=
veYRefLineColor = "red" ; above ref line fill red rts@gsnBel=
owYRefLineColor = "blue" ; below ref line fill blue
; panel plot only resources rtsP = True =
  ; modify the panel plot rtsP@gsnMaximize = True =
; large format rtsP@txString = title+": "+yrStrt+"-"+yrLast
; create individual plots do n=0,neof-1 rts@gsnLeftString = "=
EOF "+(n+1) rts@gsnRightString = sprintf("%5.1f", eof_regres@pcvar(=
n)) +"%" plot(n) = gsn_csm_xy (wks,yrfrac,eof_ts(n,:),rts) e=
nd do gsn_panel(wks,plot,(/neof,1/),rtsP) ; now draw as one =
plot


---Vanúcia SchumacherMestranda em Meteorologia - UFVMeteorologista -UFPel
Departamento de Meteorologia Agrícola - DEACel: (31) 9978 2522 DEA: (31) =
3899 1890 =


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


Received on Fri Jul 18 10:05:50 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2014 - 15:10:55 MDT