<div dir="ltr">It is always best to examine the variable's structure via printVarSummary(...)<br><br>[1]<br>  o3x = f[:]->O3<br>  printVarSummary(o3x)        ; I speculate 4 dimensions (time,level,lat,lon)<br><br>[2]<br>  o3x_surf = o3x(0,55,:,:)<br>  printVarSummary(o3x_surf)   ; TWO dimension (lat,lon);  NO 'time' dimension<br><br>  I think you want<br>     o3x_surf = o3x(:,55,:,:) ; (time,lat,lon)<br><br>[3]<br>; seasons average at surface<br>  xDJF = month_to_seasonN(o3x,(/"DJF","MAM","JJA","SON"/))<br>  printVarSummary(xDJF)       ; I speculate  (4,lat,lon)<br><br>The name xDJF implies a one season mean for DJF but it is not.<br>I think it should contain 4 seasonal means<br><br>I think you should name it xSea for 'season'<br>  xSea_surf = month_to_seasonN(o3x_surf,(/"DJF","MAM","JJA","SON"/))<br>  printVarSummary(xSea_surf)       ; I speculate  (4,lat,lon)<br><br>[4]<br>   The following creates a scalar variable of type string<br>   o3x_surf1 = "DJF"<br>   print(03x_surf1)<br><br>   I have no idea why you are doing this.<br>   ***This has no spatial information.*** It cannot be plotted on a map.<br><br><br>[5]<br>The rest is too confusing to explain.<br><br>To get to the 'answer'<br>   xSea_surf(4,lat,lon)<br><br>has spatial coordinates:<br>            lat: [ -90..  90]<br>            lon: [   0..358.75]<br><br>You must use <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml"><b>lonFlip</b></a> to get longitudes to get the -180->180 range<br>   xSea_surf :=<a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml"><b> lonFlip</b></a>(xSea_surf)<br><div>   printVarSummary(xSea_surf)        ; look at 'new' coordinates</div><div><br></div><div>--</div><div>   res@gsnLeftString = "DJF_dry cold"<br>  plot1 = gsn_csm_contour_map_ce(wks,xSea_surf(0,{-35:35},{-30:60}),res)</div><div><br></div><div>   res@gsnLeftString = "MAM_dry warm"<br>  plot2 = gsn_csm_contour_map_ce(wks,xSea_surf2(1,:,:),res)</div><div><br></div><div>etc  <br></div><div>=======</div><div><br></div><div>I did this VERY QUICKLY. there may be errors but you shuld have the idea of how to proceed.</div><div><br></div><div>Good Luck<br></div><div>   </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 26, 2022 at 6:59 AM Najib Yusuf via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.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><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px"><div dir="ltr">Dear NCL experts and colleagues,</div><div dir="ltr"><br></div><div dir="ltr">I have an error with the subscripting in the attached script while trying to plot spatial distribution month_to_season surface Ozone model data.  I did try to change my subscripting to solve the error but seems beyond my little understanding of subscripting in ncl. Kindly assist.</div><div dir="ltr"><br></div><div dir="ltr"><div><div>Variable: o3x_surf</div><div>Type: float</div><div>Total Size: 221184 bytes</div><div>            55296 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes:   [lat | 192] x [lon | 288]</div><div>Coordinates:</div><div>            lat: [ -90..  90]</div><div>            lon: [   0..358.75]</div><div>Number Of Attributes: 6</div><div>  lev : 992.5000106104562</div><div>  time :        2953</div><div>  cell_methods :        time: mean</div><div>  long_name :   O3 concentration</div><div>  units :       mol/mol</div><div>  mdims :       1</div><div>(0)     O3 concentration (mol/mol) : min=3.61245   max=77.7517</div><div><br></div><div>Variable: xMon</div><div>Type: integer</div><div>Total Size: 48 bytes</div><div>            12 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes:   [time | 12]</div><div>Coordinates:</div><div>            time: [2953..3287]</div><div>Number Of Attributes: 1</div><div>  long_name :   current date (YYYYMMDD)</div><div><br></div><div><br></div><div>Variable: xMon</div><div>Type: integer</div><div>Total Size: 48 bytes</div><div>            12 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes:   [time | 12]</div><div>Coordinates:</div><div>            time: [2953..3287]</div><div>Number Of Attributes: 1</div><div>  long_name :   current date (YYYYMMDD)</div><div>(0)     20130201</div><div>(1)     20130301</div><div>(2)     20130401</div><div>(3)     20130501</div><div>(4)     20130601</div><div>(5)     20130701</div><div>(6)     20130801</div><div>(7)     20130901</div><div>(8)     20131001</div><div>(9)     20131101</div><div>(10)    20131201</div><div>(11)    20140101</div><div>fatal:Number of subscripts do not match number of dimensions of variable,(2) Subscripts used, (1) Subscripts expected</div><div>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 137 in file month_to_seasO3.ncl</div><div><br></div></div><br></div><div><br></div><div><div dir="ltr" style="font-family:Helvetica,Arial,sans-serif;font-size:16px"><div><p style="font-family:Helvetica,Arial,sans-serif;margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial"><font size="2" color="#5b8828"><b><span style="background-color:rgb(255,255,255)"><span lang="EN-ZA">---------------------</span><span id="gmail-m_4856345064671843630ydp766c7059yiv5048509013ydp2fa15795yiv8158744610yMail_cursorElementTracker_1626107004843">-------------</span>--</span></b></font></p><p style="font-family:Helvetica,Arial,sans-serif;margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span id="gmail-m_4856345064671843630ydp766c7059yiv5048509013ydp2fa15795yiv8158744610ydpe5107903yiv2904767006yMail_cursorElementTracker_1625609058231"><span style="background-color:rgb(255,255,255)" lang="EN-ZA"><font style="background-color:inherit" size="2" color="#5b8828"><b>Najib Yusuf Galadanci Ph.D.</b></font></span></span></p><p style="font-family:Helvetica,Arial,sans-serif;margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span id="gmail-m_4856345064671843630ydp766c7059yiv5048509013ydp2fa15795yiv8158744610ydpe5107903yiv2904767006yMail_cursorElementTracker_1625609090665"><span style="background-color:rgb(255,255,255)" lang="EN-ZA"><font style="background-color:inherit" size="2" color="#5b8828"><b>Assistant Director (R & D)</b></font></span></span></p><span id="gmail-m_4856345064671843630ydp766c7059yiv5048509013ydp2fa15795yiv8158744610yMail_cursorElementTracker_1626106986344" style="font-family:Helvetica,Arial,sans-serif;background-color:rgb(91,136,40)"><b><font size="2" color="#5b8828"><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span lang="EN-ZA">Lower Atmospheric Dynamics</span></p><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span lang="EN-ZA">(Aerosol radiative forcing, air quality observations and modeling)</span></p><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span lang="EN-ZA">Centre for Atmospheric Research</span></p><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span lang="EN-ZA">National Space Research and Development Agency. Kogi State</span></p><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span lang="EN-ZA">University Campus, Anyigba. Kogi State. Nigeria</span></p><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial;background-size:auto"><span id="gmail-m_4856345064671843630ydp766c7059yiv5048509013ydp2fa15795yiv8158744610ydpe5107903yiv2904767006yMail_cursorElementTracker_1625609053689"><span lang="EN-ZA">+234 80 3871 4158</span></span></p><div style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial"><span lang="EN-ZA">------------------------------------</span></div><div style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial">Know that Victory comes with Patience, </div><div style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial">Relief with Affliction, and Ease with Hardship.</div><p style="margin:0in 0in 0.0001pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial">Prophet Muhammad Rasulullah</p><p style="margin-bottom:0.0001pt;text-align:justify;line-height:normal"><span> </span></p></font></b></span></div><br></div></div></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>