[ncl-talk] 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

Rahpeni Fajarianti rahpenifajarianti at gmail.com
Mon Dec 16 04:26:33 MST 2019


Ok, thanks!

On Sun, Dec 15, 2019 at 10:52 PM Rick Brownrigg <brownrig at ucar.edu> wrote:

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


More information about the ncl-talk mailing list