<div dir="ltr">Ok, thanks! <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 15, 2019 at 10:52 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Well, its virtually impossible to tell from the information given. But I will say that the error message means exactly what it says -- an attempt to index into an array beyond its dimensions. Try putting some print/printVarSummary statements before the call to read_rename at line 75 (or perhaps even better, inside of read_rename before line #20, since there are several calls to this function); you'll likely see the problem then. Recall that NCL uses zero-based indexing, so for an array of dimension N, valid indices are 0...(N-1)</div><div><br></div><div>Rick<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 15, 2019 at 7:38 AM Rahpeni Fajarianti via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Halo NCL, i have a problem when i run the data like this<br></div><div>fatal:["NclFile.c":2100]:Subscript out of range, error in subscript #0 fatal:["Execute.c":8635]:Execute: Error occurred at or near line 20 fatal:["Execute.c":8635]:Execute: Error occurred at or near line 75</div><div>Thanks for help!<br></div><div><br></div><div>This is my script:<br></div><div>ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"</div>ncl 1> ;******************************************************<br>ncl 2> ;<br>ncl 3> ; mjoclivar_14.ncl<br>ncl 4> ;<br>ncl 5> ;***********************************************************<br>ncl 6> ; Combined EOFs<br>ncl 7> ; Latest Update: July, 2016: Eun-Pa Lim; Bureau of Meteorology, Australia<br>ncl 8> ;***********************************************************<br>ncl 9> ;;<br>ncl 10> ;; The following are automatically loaded from 6.2.0 onward<br>ncl 11> ;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" <br>ncl 12> ;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br>ncl 13> ;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" <br>ncl 14> <br>ncl 15> undef("read_rename")<br>ncl 16> function read_rename(f[1]:file, varName[1]:string \<br>ncl 16> ,iStrt[1]:integer, iLast[1]:integer \<br>ncl 16> ,latS[1]:numeric , latN[1]:numeric )<br>ncl 17> ; Utility to force specific named dimensions<br>ncl 18> ; This is done for historical reasons (convenience) <br>ncl 19> begin<br>ncl 20> work = f->$varName$(iStrt:iLast,{latS:latN},:) ; (time,lat,lon)<br>ncl 21> work!0 = "time" ; CAM model names<br>ncl 22> work!1 = "lat"<br>ncl 23> work!2 = "lon"<br>ncl 24> return(work)<br>ncl 25> end<br>ncl 26> ; =========================> MAIN <==============================<br>ncl 27> begin<br>ncl 28> neof = 2<br>ncl 29> <br>ncl 30> latS = -15<br>ncl 31> latN = 15<br>ncl 32> <br>ncl 33> ymdStrt = 20180101 ; start yyyymmdd<br>ncl 34> ymdLast = 20181231 ; last <br>ncl 35> <br>ncl 36> yrStrt = ymdStrt/10000<br>ncl 37> yrLast = ymdLast/10000<br>ncl 38> <br>ncl 39> pltDir = "/home/peni/" ; plot directory<br>ncl 40> pltType = "png" <br>ncl 41> pltName = "mjoclivar" <br>ncl 42> <br>ncl 43> diri = "/home/peni/" ; input directory<br>ncl 44> <br>ncl 45> filolr = "<a href="http://anomolr.nc" target="_blank">anomolr.nc</a>"<br>ncl 46> filu200 = "<a href="http://uanom2.nc" target="_blank">uanom2.nc</a>"<br>ncl 47> filu850 = "<a href="http://uanom.nc" target="_blank">uanom.nc</a>"<br>ncl 48> <br>ncl 49> ;************************************************<br>ncl 50> ; create BandPass Filter<br>ncl 51> ;************************************************<br>ncl 52> ihp = 2 ; bpf=>band pass filter<br>ncl 53> nWgt = 201<br>ncl 54> sigma = 1.0 ; Lanczos sigma<br>ncl 55> fca = 1./100.<br>ncl 56> fcb = 1./20.<br>ncl 57> wgt = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )<br>ncl 58> <br> ncl 59> ;***********************************************************<br>ncl 60> ; Find the indices corresponding to the start/end times<br>ncl 61> ;***********************************************************<br>ncl 62> f = addfile (diri+filolr , "r") <br>ncl 63> TIME = f->time ; days since ...<br>ncl 64> <br>)ncl 65> YMD = cd_calendar(TIME, -2) ; entire (time,6)<br>ncl 66> <br>tncl 67> iStrt = ind(YMD.eq.ymdStrt) ; index start<br>ncl 68> iLast = ind(YMD.eq.ymdLast) ; index last <br>ncl 69> delete([/ TIME, YMD /])<br>ncl 70> <br>nncl 71> ;***********************************************************<br>ncl 72> ; Read anomalies<br>ncl 73> ;***********************************************************<br>ncl 74> <br>ncl 75> work = read_rename(f,"anomolr",iStrt,iLast,latS,latN) ; (time,lat,lon) <br>ncl 76> OLR = dim_avg_n_Wrap(work, 1) ; (time,lon)<br>ncl 77> <br>ncl 78> f = addfile (diri+filu850 , "r") <br>ncl 79> work = read_rename(f,"uanom",iStrt,iLast,latS,latN) ; (time,lat,lon) <br>ncl 80> U850 = dim_avg_n_Wrap(work, 1) ; (time,lon)<br>ncl 81> <br>ncl 82> f = addfile (diri+filu200 , "r") <br>ncl 83> work = read_rename(f,"uanom2",iStrt,iLast,latS,latN) ; (time,lat,lon) <br>ncl 84> U200 = dim_avg_n_Wrap(work, 1) ; (time,lon)<br>ncl 85> <br>^ncl 86> dimw = dimsizes( work )<br>ncl 87> ntim = dimw(0)<br>ncl 88> nlat = dimw(1)<br>ncl 89> mlon = dimw(2)<br>ncl 90> delete(work)<br>ncl 91> <br>ncl 92> lon = OLR&lon <br>ncl 93> time = OLR&time <br>ncl 94> date = cd_calendar(time, -2) ; yyyymmdd<br>ncl 95> <br>ncl 96> ;************************************************<br>ncl 97> ; Apply the band pass filter to the original anomalies<br>ncl 98> ;************************************************<br>ncl 99> olr = wgt_runave_n_Wrap ( OLR, wgt, 0, 0) ; (time,lon)<br>ncl 100> u850 = wgt_runave_n_Wrap (U850, wgt, 0, 0)<br>ncl 101> u200 = wgt_runave_n_Wrap (U200, wgt, 0, 0)<br>ncl 102> <br>ancl 103> ;************************************************<br>ncl 104> ; remove temporal means of band pass series: *not* necessary <br>ncl 105> ;************************************************<br>ncl 106> olr = dim_rmvmean_n( olr, 0) ; (time,lon)<br>ncl 107> u850 = dim_rmvmean_n(u850, 0)<br>ncl 108> u200 = dim_rmvmean_n(u200, 0)<br>ncl 109> <br>;ncl 110> ;************************************************<br>ncl 111> ; Compute the temporal variance at each lon<br>ncl 112> ;************************************************<br>ncl 113> var_olr = dim_variance_n_Wrap( olr, 0) ; (lon)<br>ncl 114> var_u850 = dim_variance_n_Wrap(u850, 0)<br>ncl 115> var_u200 = dim_variance_n_Wrap(u200, 0)<br>ncl 116> <br>incl 117> ;************************************************<br>ncl 118> ; Compute the zonal mean of the temporal variance<br>ncl 119> ;************************************************<br>ncl 120> zavg_var_olr = dim_avg_n_Wrap( var_olr , 0) <br>ncl 121> zavg_var_u850 = dim_avg_n_Wrap( var_u850, 0)<br>ncl 122> zavg_var_u200 = dim_avg_n_Wrap( var_u200, 0)<br>ncl 123> <br>*ncl 124> ;************************************************<br>ncl 125> ; Normalize by sqrt(avg_var*)<br>ncl 126> ;************************************************<br>ncl 127> olr = olr/sqrt(zavg_var_olr ) ; (time,lon)<br>ncl 128> u850 = u850/sqrt(zavg_var_u850)<br>ncl 129> u200 = u200/sqrt(zavg_var_u200)<br>ncl 130> <br>ncl 131> ;************************************************<br>ncl 132> ; Combine the normalized data into one variable<br>ncl 133> ;************************************************<br>ncl 134> cdata = new ( (/3*mlon,ntim/), typeof(olr), getFillValue(olr))<br>ncl 135> do ml=0,mlon-1<br>ncl 136> cdata(ml ,:) = (/ olr(:,ml) /)<br>ncl 137> cdata(ml+ mlon,:) = (/ u850(:,ml) /)<br>ncl 138> cdata(ml+2*mlon,:) = (/ u200(:,ml) /)<br>ncl 139> end do<br>ncl 140> <br>=ncl 141> ;************************************************<br>ncl 142> ; Compute **combined** EOF; Sign of EOF is arbitrary<br>ncl 143> ;************************************************<br>ncl 144> eof_cdata = eofunc(cdata , neof, False) ; (neof,3*mlon)<br>ncl 145> print("==============")<br>ncl 146> printVarSummary(eof_cdata)<br>ncl 147> printMinMax(eof_cdata, True)<br>ncl 148> <br>)ncl 149> eof_ts_cdata = eofunc_ts(cdata,eof_cdata,False) ; (neof,3*ntim)<br>ncl 150> print("==============") <br>ncl 151> printVarSummary(eof_ts_cdata)<br>ncl 152> printMinMax(eof_ts_cdata, True)<br>ncl 153> <br>ncl 154> ;************************************************<br>ncl 155> ; For clarity, explicitly extract each variable. Create time series <br>ncl 156> ;************************************************<br>ncl 157> <br>tncl 158> nvar = 3 ; "olr", "u850", "u200"<br>ncl 159> ceof = new( (/nvar,neof,mlon/), typeof(cdata), getFillValue(cdata))<br>ncl 160> <br>dncl 161> do n=0,neof-1<br>ncl 162> ceof(0,n,:) = eof_cdata(n,0:mlon-1) ; olr<br>ncl 163> ceof(1,n,:) = eof_cdata(n,mlon:2*mlon-1) ; u850<br>ncl 164> ceof(2,n,:) = eof_cdata(n,2*mlon:) ; u200<br>ncl 165> end do<br>ncl 166> <br>ncl 167> ceof!0 = "var"<br>ncl 168> ceof!1 = "eof"<br>ncl 169> ceof!2 = "lon" <br>ncl 170> ceof&lon = olr&lon<br>ncl 171> <br>ncl 172> ceof_ts = new( (/nvar,neof,ntim/), typeof(cdata), getFillValue(cdata))<br>ncl 173> ceof_ts(0,:,:) = eofunc_ts_Wrap( olr(lon|:,time|:),ceof(0,:,:),False) ; (0,neof,ntim)<br>ncl 174> ceof_ts(1,:,:) = eofunc_ts_Wrap(u850(lon|:,time|:),ceof(1,:,:),False) ; (1,neof,ntim)<br>ncl 175> ceof_ts(2,:,:) = eofunc_ts_Wrap(u200(lon|:,time|:),ceof(2,:,:),False) ; (2,neof,ntim)<br>ncl 176> <br>ncl 177> ;**********************************************t*<br>ncl 178> ; Add code contributed by Marcus N. Morgan, Florida Institute of Technology; Feb 2015<br>ncl 179> ; Calculate % variance (pcv_ )accounted for by OLR, U850 and U200<br>ncl 180> ;************************************************<br>ncl 181> <br> ncl 182> pcv_eof_olr = new(neof,typeof(ceof))<br>ncl 183> pcv_eof_u850 = new(neof,typeof(ceof))<br>ncl 184> pcv_eof_u200 = new(neof,typeof(ceof))<br>ncl 185> <br>ncl 186> do n=0,neof-1<br>ncl 187> pcv_eof_olr(n) = avg((ceof(0,n,:)*sqrt(ceof@eval(n)))^2)*100<br>ncl 188> pcv_eof_u850(n) = avg((ceof(1,n,:)*sqrt(ceof@eval(n)))^2)*100<br>ncl 189> pcv_eof_u200(n) = avg((ceof(2,n,:)*sqrt(ceof@eval(n)))^2)*100<br>ncl 190> ;;print("pcv: neof="+(n+1)+": "+pcv_eof_olr(n)+" "+pcv_eof_u850(n)+" "+pcv_eof_u200(n))<br>ncl 191> end do<br>ncl 192> <br>ncl 193> ;************************************************<br>ncl 194> ; Change sign of EOFs for spatial structures of PC1 and PC2 <br>ncl 195> ; to represent convection over the tropical Indian Ocean and the tropical western Pacific Ocean, respectively <br>ncl 196> ; (Ad hoc approach) <br>ncl 197> ;************************************************<br>ncl 198> <br>ncl 199> imax_olr_eof1 = maxind(ceof(0,0,:)) <br>ncl 200> imax_olr_eof2 = maxind(ceof(0,1,:)) <br>ncl 201> <br>)ncl 202> lonmax_eof1 = ceof&lon(imax_olr_eof1) ; longitude of max value (i.e. suppressed convection)<br>ncl 203> lonmax_eof2 = ceof&lon(imax_olr_eof2)<br>ncl 204> <br>ncl 205> if (lonmax_eof1.ge.60 .and. lonmax_eof1.lt.180) then ; Change the sign of EOF1 <br>ncl 206> ceof(:,0,:) = -ceof(:,0,:) ; if OLR is positive<br>ncl 207> ceof_ts(:,0,:) = -ceof_ts(:,0,:) ; over the tropical Indian Ocean<br>ncl 208> eof_cdata(0,:) = -eof_cdata(0,:)<br>ncl 209> eof_ts_cdata(0,:) = -eof_ts_cdata(0,:)<br>ncl 210> end if<br>ncl 211> <br>ncl 212> if (lonmax_eof2.ge.120 .and. lonmax_eof2.lt.180) then ; Change the sign of EOF2<br>ncl 213> ceof(:,1,:) = -ceof(:,1,:) ; if OLR is positive <br>ncl 214> ceof_ts(:,1,:) = -ceof_ts(:,1,:) ; over the tropical western Pacific Ocean<br>ncl 215> eof_cdata(1,:) = -eof_cdata(1,:)<br>ncl 216> eof_ts_cdata(1,:) = -eof_ts_cdata(1,:)<br>ncl 217> end if<br>ncl 218> <br>ncl 219> print("==============")<br>ncl 220> printVarSummary(eof_cdata)<br>ncl 221> printMinMax(eof_cdata, True)<br>ncl 222> <br>ncl 223> ;************************************************<br>ncl 224> ; Compute cross correlation of each variable's EOF time series at zero-lag<br>ncl 225> ;************************************************<br>ncl 226> r_olr_u850 = escorc(ceof_ts(0,:,:) , ceof_ts(1,:,:) ) ; (neof)<br>ncl 227> r_olr_u200 = escorc(ceof_ts(0,:,:) , ceof_ts(2,:,:) )<br>ncl 228> r_u850_u200 = escorc(ceof_ts(1,:,:) , ceof_ts(2,:,:) )<br>ncl 229> <br>sncl 230> print("==============")<br>ncl 231> do n=0,neof-1<br> ncl 232> print("neof="+n \<br>ncl 232> +" r_olr_u850=" +sprintf("%4.3f",r_olr_u850(n)) \<br> ncl 232> +" r_olr_u200=" +sprintf("%4.3f",r_olr_u200(n)) \<br>ncl 232> +" r_u850_u200="+sprintf("%4.3f",r_u850_u200(n)) )<br>ncl 233> end do<br>ncl 234> print("==============")<br>ncl 235> <br>ncl 236> ;************************************************<br>ncl 237> ; Compute cross correlation of the multivariate EOF; EOF 1 vs EOF 2<br>ncl 238> ;************************************************<br>ncl 239> <br>ncl 240> mxlag = 25<br>ncl 241> rlag_01 = esccr(eof_ts_cdata(0,:),eof_ts_cdata(1,:), mxlag) ; (N,mxlag+1)<br>ncl 242> rlag_10 = esccr(eof_ts_cdata(1,:),eof_ts_cdata(0,:), mxlag) ; (N,mxlag+1)<br>ncl 243> ccr_12 = new ( (/2*mxlag+1/), float) <br>ncl 244> <br>cncl 245> ccr_12(mxlag:) = rlag_10(0:mxlag) <br>ncl 246> ccr_12(0:mxlag) = rlag_01(::-1) ; reverse order<br>ncl 247> ;;print(ccr_12)<br>ncl 248> <br>ncl 249> <br>ncl 250> ;************************************************<br>ncl 251> ; Normalize the multivariate EOF 1&2 component time series<br>ncl 252> ; Compute (PC1^2+PC2^2): values > 1 indicate "strong" periods<br>ncl 253> ;************************************************<br>ncl 254> eof_ts_cdata(0,:) = eof_ts_cdata(0,:)/stddev(eof_ts_cdata(0,:))<br>ncl 255> eof_ts_cdata(1,:) = eof_ts_cdata(1,:)/stddev(eof_ts_cdata(1,:))<br>ode \<br> , rts@xyLineThicknesses , rts@gsnLncl 256> <br>encl 257> mjo_ts_index = eof_ts_cdata(0,:)^2 + eof_ts_cdata(1,:)^2 <br>ncl 258> mjo_ts_index_smt = runave(mjo_ts_index, 91, 0) ; 91-day running mean<br>ncl 259> <br> ncl 260> nGood = num(.not.ismissing(mjo_ts_index)) ; # non-missing<br>ncl 261> nStrong = num(mjo_ts_index .ge. 1.0)<br>ncl 262> print("nGood="+nGood+" nStrong="+nStrong+" nOther="+(nGood-nStrong))<br>ncl 263> <br>rncl 264> ;************************************************<br>ncl 265> ; Write PC results to netCDF for use in another example.<br>ncl 266> ;************************************************<br>ncl 267> mjo_ts_index!0 = "time"<br>ncl 268> mjo_ts_index&time = time <br>ncl 269> mjo_ts_index@long_name = "MJO PC INDEX" <br>ncl 270> mjo_ts_index@info = "(PC1^2 + PC2^2)" <br>ncl 271> <br>ncl 272> PC1 = eof_ts_cdata(0,:)<br>ncl 273> PC1!0 = "time"<br>ncl 274> PC1&time = time<br>ncl 275> PC1@long_name = "PC1"<br>ncl 276> PC1@info = "PC1/stddev(PC1)"<br>ncl 277> <br>ncl 278> PC2 = eof_ts_cdata(1,:)<br>ncl 279> PC2!0 = "time"<br>ncl 280> PC2&time = time<br>ncl 281> PC2@long_name = "PC2"<br>ncl 282> PC2@info = "PC2/stddev(PC2)"<br>ncl 283> <br> ncl 284> diro = "./"<br>ncl 285> filo = "MJO_PC_INDEX.nc"<br>ncl 286> system("/bin/rm -f "+diro+filo) ; remove any pre-existing file<br>ncl 287> ncdf = addfile(diro+filo,"c") ; open output netCDF file<br>ncl 288> ; make time an UNLIMITED dimension <br>ncl 289> filedimdef(ncdf,"time",-1,True) ; recommended for most applications<br>ncl 290> ; output variables directly<br>ncl 291> ncdf->MJO_INDEX = mjo_ts_index <br>ncl 292> ncdf->PC1 = PC1 <br>ncl 293> ncdf->PC2 = PC2 <br>ncl 294> <br>ncl 295> ;------------------------------------------------------------<br>ncl 296> ; PLOTS<br>ncl 297> ;------------------------------------------------------------<br>ncl 298> <br>ncl 299> yyyymmdd = cd_calendar(time, -2)<br>ncl 300> yrfrac = yyyymmdd_to_yyyyfrac(yyyymmdd, 0.0)<br>ncl 301> delete([/ yrfrac@long_name, lon@long_name /])<br>ncl 302> <br>ncl 303> day = ispan(-mxlag, mxlag, 1)<br>ncl 304> ;day@long_name = "lag (day)"<br>ncl 305> <br>ncl 306> pltPath = pltDir+pltName<br>ncl 307> <br>ncl 308> wks = gsn_open_wks(pltType,pltPath)<br>ncl 309> gsn_define_colormap(wks,"default")<br>ncl 310> plot = new(3,graphic) <br>ncl 311> <br>ncl 312> ;************************************************<br>ncl 313> ; Multivariate EOF plots<br>ncl 314> ;************************************************<br>ncl 315> rts = True<br>ncl 316> rts@gsnDraw = False ; don't draw yet<br>ncl 317> rts@gsnFrame = False ; don't advance frame yet<br>ncl 318> rts@gsnScale = True ; force text scaling <br>ncl 319> <br>ncl 320> rts@vpHeightF = 0.40 ; Changes the aspect ratio<br>ncl 321> rts@vpWidthF = 0.85<br>ncl 322> rts@vpXF = 0.10 ; change start locations<br>ncl 323> rts@vpYF = 0.75 ; the plot<br>ncl 324> rts@xyLineThicknesses = (/2, 2, 2/)<br>ncl 325> rts@xyLineColors = (/"black","red","blue"/)<br>ncl 326> rts@gsnYRefLine = 0. ; reference line <br>ncl 327> rts@trXMaxF = max(lon)<br>ncl 328> rts@trXMinF = min(lon)<br>ncl 329> <br>ncl 330> rts@pmLegendDisplayMode = "Always" ; turn on legend<br>ncl 331> rts@pmLegendSide = "Top" ; Change location of <br>ncl 332> rts@pmLegendParallelPosF = 1.16 ; move units right<br>ncl 333> rts@pmLegendOrthogonalPosF = -0.50 ; move units down<br>ncl 334> rts@pmLegendWidthF = 0.15 ; Change width and<br>ncl 335> rts@pmLegendHeightF = 0.15 ; height of legend.<br>ncl 336> rts@lgLabelFontHeightF = 0.0175<br>ncl 337> <br>ncl 338> <br>ncl 339> rtsP = True ; modify the panel plot<br>ncl 340> ; rtsP@gsnMaximize = True ; large format<br>ncl 341> rtsP@gsnPanelMainString = "Multivariate EOF: 15S-15N: "+yrStrt+"-"+yrLast <br>ncl 342> <br>ncl 343> do n=0,neof-1<br>ncl 344> rts@xyExplicitLegendLabels = (/"OLR: "+sprintf("%4.1f", pcv_eof_u200(n)) +"%" \<br>ncl 344> ,"U850: "+sprintf("%4.1f", pcv_eof_u850(n))+"%" \<br>ncl 344> ,"U200: "+sprintf("%4.1f", pcv_eof_olr(n))+"%" /)<br>ncl 345> rts@gsnLeftString = "EOF "+(n+1)<br>ncl 346> rts@gsnRightString = sprintf("%3.1f",ceof@pcvar(n)) +"%"<br>ncl 347> plot(n) = gsn_csm_xy (wks,lon,ceof(:,n,:),rts)<br>ncl 348> end do<br>ncl 349> gsn_panel(wks,plot(0:1),(/2,1/),rtsP) ; now draw as one plot<br>ncl 350> <br>ncl 351> ;-----------------------------------------<br>ncl 352> ; The following doesn't work with some older versions of NCL<br>ncl 353> ; With old versions, the user must delete each individually.<br>ncl 354> ;----------------------------------------- <br>ncl 355> delete([/ rts@xyExplicitLegendLabels, rts@pmLegendDisplayMode \<br>ncl 355> , rts@xyLineThicknesses , rts@gsnLeftString \<br>ncl 355> , rts@gsnRightString , rts@xyLineColors \<br>ncl 355> , rts@trXMaxF , rts@trXMinF /] )<br>ncl 356> <br>ncl 357> lag = ispan(-mxlag,mxlag,1)<br>ncl 358> lag@long_name = "lag (days)"<br>ncl 359> <br>ncl 360> plot(0) = gsn_csm_xy (wks, lag ,ccr_12,rts)<br>ncl 361> rtsP@gsnPanelMainString = "Cross Correlation: Multivariate EOF: 15S-15N: " \<br>ncl 361> + yrStrt+"-"+yrLast <br>ncl 362> rtsP@gsnPaperOrientation = "portrait" ; force portrait<br>ncl 363> gsn_panel(wks,plot(0),(/1,1/),rtsP) ; now draw as one plot<br>ncl 364> <br>ncl 365> ;************************************************<br>ncl 366> ; MJO "strong" index <br>ncl 367> ;************************************************<br>ncl 368> rts@gsnYRefLine = 1.0<br>ncl 369> rts@gsnYRefLineColor = "black"<br>ncl 370> rts@xyMonoDashPattern = True<br>ncl 371> rts@xyLineColors = (/"black", "blue"/)<br>ncl 372> rts@xyLineThicknesses = (/1, 2/)<br>ncl 373> rts@pmLegendDisplayMode = "Always" ; turn on legend<br>ncl 374> rts@pmLegendWidthF = 0.12 ; Change width and<br>ncl 375> rts@pmLegendHeightF = 0.10 ; height of legend.<br>ncl 376> rts@pmLegendParallelPosF = 0.86 ; move units right<br>ncl 377> rts@pmLegendOrthogonalPosF = -0.40 ; move units down<br>ncl 378> rts@xyExplicitLegendLabels = (/"daily", "91-day runavg" /)<br>ncl 379> <br>ncl 380> mjo_ind_plt = new ( (/2,ntim/), typeof(mjo_ts_index))<br>ncl 381> mjo_ind_plt(0,:) = mjo_ts_index<br>ncl 382> mjo_ind_plt(1,:) = (/ mjo_ts_index_smt /)<br>ncl 383> plot(0) = gsn_csm_xy(wks, yrfrac,mjo_ind_plt,rts)<br>ncl 384> <br>ncl 385> rtsP@gsnPanelMainString = "MJO Index: (PC1^2+ PC2^2) : 15S-15N: "+yrStrt+"-"+yrLast <br>ncl 386> gsn_panel(wks,plot(0),(/1,1/),rtsP) ; now draw as one plot<br>ncl 387> <br>ncl 388> end<br></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>