<div dir="ltr"><div>Dear  All; Trying to plot 3 seasons MAM,OND,JJA together. My data has 3dimension ordered like (time,lat,lon)</div><div><br></div><div>This is the complain from this line ....<strong>res@gsnCenterString   = season(ns)+&quot;:&quot;+time(0)/100 +&quot;-&quot;+ time(ntim-1)/100</strong></div><div><br></div><div><em>fatal:Number of subscripts do not match number of dimensions of variable,(1) Subscripts used, (2) Subscripts expected<br>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 160 in file trial</em></div><div><em>Below is the script..</em></div><div><em><br></em></div><div><em><br></em></div><div><em><br></em></div><div><em>;***********************************************<br>; climo_3.ncl<br>;<br>; Concepts illustrated:<br>;   - Calculating monthly climatologies<br>;   - Calculating interannual variability<br>;   - Calculating standard deviations of monthly means<br>;   - Creating a color map using named colors<br>;   - Paneling four plots on a page<br>;   - Adding a common labelbar to paneled plots<br>;   - Explicitly setting contour levels<br>;   - Changing the center longitude for a cylindrical equidistant projection<br>;   - Turning off the individual contour labelbar<br>;   - Adding a common title to paneled plots<br>;   - Turning off map fill<br>;   - Creating a center subtitle<br>;<br>;***********************************************<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</em></div><div><em>begin<br>;************************************************<br>; Read the file<br>;************************************************<br>  a    = addfile(&quot;GPCP.nc&quot;,&quot;r&quot;)<br>  prec = a-&gt;precip(0:431,:,:)                                 ; (time,lat,lon)<br>  printVarSummary(prec)<br>  time = a-&gt;time                                ; (time) ==&gt; YYMM<br>  ntim = dimsizes(time)<br>  <br>  ymStrt  = 198001                           ; start yyyymm<br>   ymLast  = 199912                           ; last  <br>   yrStrt  = ymStrt/100<br>   yrLast  = ymLast/100                           ; start yyyymm<br>   <br>   <br>   wksType = &quot;x11&quot;<br>   wksName = &quot;test&quot;                          ; &quot;: &quot;+yrStrt+&quot;_&quot;+yrLast<br>  <br>   <br>;************************************************<br>; plots ; Compute 3-month climatologies<br>;************************************************<br>                                              ; (2,6)<br>  season   = (/ (/ 2, 3, 4/) \       ; March-May[MAM]<br>              , (/ 5, 6, 7/)   \      ; June-August [JJA]<br>       , (/ 9, 10, 11/) /)         ; Oct-Dec [OND]<br>  i_season = season - 1                       ; NCL indices<br>  season_label = (/ &quot;March-May&quot;, &quot;June-August&quot;,&quot;October-December&quot;/)<br> plot = new ( 3, &quot;graphic&quot;)<br>  wks = gsn_open_wks(wksType, wksName)        <br>  gsn_define_colormap(wks,&quot;BlueYellowRed&quot;)<br>       <br>     <br>;************************************************<br>; Compute the MAM,JJA,OND climatology using a function in contributed.ncl<br>;************************************************<br>;  precClm = month_to_season(prec)            ; monthly climatology<br>  ;************************************************<br>; create colors<br>;*************************************************<br>  wks = gsn_open_wks(&quot;x11&quot;,&quot;test&quot;)             ; open a workstation<br>    <br>      <br> colors = (/ (/255,255,255/),(/0,0,0/),(/255,255,255/), (/244,255,244/), \<br>  (/217,255,217/), (/163,255,163/), (/106,255,106/), \<br>  (/43,255,106/), (/0,224,0/), (/0,134,0/),(/255,255,0/),\<br>  (/255,127,0/) /) * 1.0 ; we multiply by 1 to make colors float<br>  <br>  colors = colors/255.               ; normalize (required by NCL)</em></div><div><em><br> ;colors = (/&quot;white&quot;,&quot;Balck&quot;,&quot;White&quot;,&quot;RoyalBlue&quot;\      ; back/fore ground<br>  ;           ,&quot;lightSkyblue&quot;,&quot;lightseagreen&quot;,&quot;palegreen&quot;/)         ; choose colors for color map<br>                <br>  gsn_define_colormap(wks, colors)              ; generate new color map<br>;************************************************<br>; create panel plots<br>;*************************************************<br>  plot   = new ( 3, graphic)                    ; create graphical array</em></div><p><br></p><p>  res                      = True               ; plot options desired</p><p>  res@cnFillOn             = True               ; turn on color fill<br>  res@cnInfoLabelOn        = False              ; turn off contour info label<br>  res@cnLinesOn            = False              ; turn off contour lines<br>  res@cnLineLabelsOn       = False              ; turn off line labels<br>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;   ; set explicit contour levels<br>  res@cnLevels             = (/0.0,0.5,1.0,5.0,10,15,20,25\  ; set unequal contour levels<br>                              ,30,35/)<br>                             <br>  res@mpFillOn             = False              ; turn off gray continents<br>  res@mpCenterLonF         = 180                ; Centers the plot at 180 <br> <br>  res@lbLabelBarOn         = False              ; No single label bar</p><p>  res@gsnDraw              = False<br>  res@gsnFrame             = False</p><p>  resP                     = True               ; panel options<br>  resP@txString            = &quot;GPCC Observation&quot;   ; common title<br>  resP@gsnMaximize         = True               ; maximize image<br>  resP@gsnPanelLabelBar    = True               ; Add common label bar <br>  <br>  ;****************ZOOM INTO YOUR LOCATION*********************<br>  <br>  res@mpLimitMode           = &quot;LatLon&quot;<br>  mpOutlineOn    =True<br>  mpOutlineSpecifiers     =True<br>  res@mpMinLonF            = 21.               ; select a subregion<br>  res@mpMaxLonF            = 54.<br>  res@mpMinLatF            = -12. <br>  res@mpMaxLatF            = 22.5<br>  <br>  <br>  res@mpLandFillColor      = &quot;background&quot;       ; color of land<br>  res@cnFillDrawOrder      = &quot;Predraw&quot;    <br>  ;*********************Masking*********************************<br>  res@mpAreaMaskingOn = True  <br>   res@mpMaskAreaSpecifiers = &quot;Land&quot; <br>   res@mpOceanFillColor = 0 <br>   res@mpFillDrawOrder = &quot;Postdraw&quot;  <br>    <br>  <br>      resMap= True <br>      resMap@mpPerimOn = False <br>     resMap@mpGridAndLimbOn = False <br>    resMap@gsnTickMarksOn = False <br>    resMap@mpDataSetName = &quot;Earth..3&quot; <br>   resMap@mpDataBaseVersion = &quot;MediumRes&quot; <br>   resMap@mpOutlineOn = True <br>   <br>   res                             = True<br>  res@mpFillOn                    = False        ; turn off gray fill<br>  res@mpOutlineBoundarySets       = &quot;National&quot;   ; turn on country boundaries<br>  ;res@mpGeophysicalLineColor      = &quot;Navy&quot;       ; color of cont. outlines</p><p> <br>  resMap@mpFillOn = True </p><p>  resMap@mpOceanFillColor = &quot;transparent&quot; <br>  resMap@mpLandFillColor = &quot;transparent&quot; <br>  resMap@mpInlandWaterFillColor = &quot;transparent&quot; <br>  <br>   res@mpDataBaseVersion = &quot;MediumRes&quot;            ; choose higher resolution<br>  </p><p><br>;delete(precClm@long_name)                       ; do not want<br>       <br>       do ns =0,1<br>      </p><p><br></p><p><br>  do ns=0,1                                 ; loop over the months<br>         <strong>res@gsnCenterString   = season(ns)+&quot;:&quot;+time(0)/100 +&quot;-&quot;+ time(ntim-1)/100</strong><br>     plot(i) = gsn_csm_contour_map_ce(wks,precClm(ns,:,:), res)  ; create plot<br>  end do</p><p>  gsn_panel(wks,plot,(/2,2/),resP)<br>;************************************************<br>; create second panel plot<br>;*************************************************<br> delete(precStd@long_name) <br>                                         ; Std Deviations<br>  do ns=0,1                                 ; loop over the months<br>     <br>     res@gsnCenterString   = season(ns)+&quot;:&quot;+time(0)/100 +&quot;-&quot;+ time(ntim-1)/100<br>     plot(i) = gsn_csm_contour_map_ce(wks,precStd(ns,:,:), res)  ; create plot<br>  end do</p><p>  gsn_panel(wks,plot,(/2,2/),resP)</p><p>end do<br> end</p><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br><br><br><span style="font-family:arial,helvetica,sans-serif">Best Regards<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">George Otieno</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Intergrated Climate System Modelling Lab.<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Department of Environmental Atmospheric Sciences<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">608-737, Room 4302, Chungmu-Building</span></div><div><span style="font-family:arial,helvetica,sans-serif">Pukyong National University,<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">45,Yongso-ro,Nam-gu, Busan, South Korea<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Tel. +82-51-629-6643<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Fax+82-51-629-7991</span><b><span style="font-family:times new roman,serif"><br></span></b></div></div></div></div></div></div></div></div></div></div></div></div>
</div>