NAO-Index create time array

From: Lena Frey <frey_l_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 01 2013 - 02:49:55 MDT
Hi,
 
I have calculated the NAO-Index. Now i would like to plot the results. My data range from the year 1978 to 2007. I would like to plot the index for this entire period, but it doesn't work. I use the following configuration and get the error message "2 subscripts used, 3 subscripts expected" for the last line. How can I create the time array for my plot? Thanks.
 
   ;**********************************************************************   
   ; calculate sea level pressure  
   ;**********************************************************************
      slp = pslec(tm1(:,30,:,:),phis,aps,press(:,30,:,:))
      copy_VarMeta(aps,slp)
      slp@long_name = "Sea Level Pressure"
      printVarSummary(slp)
      slp_flip = lonFlip(slp)
      printVarSummary(slp_flip)
   ;***********************************************************
   ; remove annual cycle
   ;***********************************************************
    slp_ann = rmMonAnnCycTLL(slp_flip)
   ;*****************************************************************
   ; calculate slp for season DJF
   ;****************************************************************
    season = "DJF"
    slp_seas = month_to_season(slp_ann,season)
    nyrs = dimsizes(slp_seas&time)
    printVarSummary(slp_seas)
   ;****************************************************************
   ; select stations
   ;***************************************************************
    ; select northern station
    latS1 = 64
    latN1 = 67
    lonL1 = -18
    lonR1 = -19
    slp1 = slp_seas(time|:,{lat|latS1:latN1},{lon|lonL1:lonR1})
    ; select southern station
    latS2 = 37
    latN2 = 38
    lonL2 = 24
    lonR2 = 26
    slp2 = slp_seas(time|:,{lat|latS2:latN2},{lon|lonL2:lonR2})
 
   ;***************************************************************
   ; calculate the standardize anomlaies for the season DJF
   ;***************************************************************
     slp1_std = dim_standardize_n_Wrap(slp1,1,0)
     slp2_std = dim_standardize_n_Wrap(slp2,1,0)
 
    ;****************************************************************
    ; calculate the difference
    ;****************************************************************
     Delta = slp2_std - slp1_std
     copy_VarCoords(slp1_std, Delta)

     if(any(ismissing(Delta))) then
       print("Your data contains some missing values. Beware.")
     end if
     if (any(isnan_ieee(Delta))) then
       value = -1.e34
       replace_ieeenan (Delta, value, 0)
       Delta@_FillValue = value
     end if
     printVarSummary(Delta)
     printMinMax(Delta,0)

    ;*****************************************************************
    ; Plot
    ;*****************************************************************
     yrStart = 1978
     yrLast   = 2007
     yyyymm = yyyymm_time(yrStart, yrLast, "integer")
     yyyyfrac = yyyymm_to_yyyyfrac(yyyymm,0.0) 
   
    wks = gsn_open_wks("pdf","time")
     res                                  = True
     res@trXMinF              = yrStart         ; starting point along X axis
     res@trXMaxF             = yrLast+1         ; ending point along X-axis
     res@vpWidthF           = .7           ; stretch the plot to be wider (in NDC units)
     res@vpHeightF           = .25          ; and not as tall
     res@vpXF                     = .15          ; set the start point along the X-axis in NDC units
   
     plot = gsn_csm_xy(wks,yyyyfrac,Delta,res)
 
 

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 1 02:50:06 2013

This archive was generated by hypermail 2.1.8 : Mon Jul 01 2013 - 12:35:42 MDT