<div dir="ltr">[a] You are constantly over writing the variable &#39;prClm&#39;<br><br>[b] you constantly repeat code such as:<br>      months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /) <br>    Why are you doing this redundant code?<br><br>[c] <br><br>---<br>[1] <br>Rather than:<br><br>   fili    = &quot;CCCma91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                         <br><br>   pr     = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon<br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon<br><br>Use<br>; NCL imports all the meta data. <br>   fili    = &quot;CCCma91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                         <br>   pr      = f-&gt;pr       ; (time,lat,lon)<br>   printVarSummary(pr)<br>   printMinMax(pr,0)<br><br>   pr     = pr*86400    ; change units after importing the varible<br>   pr@unit= &quot;mm/day&quot;<br>   printVarSummary(pr)<br>   printMinMax(pr,0)<br><br>   prClm_0  = clmMonTLL( pr) <br>   printVarSummary(prClm_0)<br>   printMinMax(prClm_0,0)<br><br>Do the same for the other files except name them: pr_clm_1 and prClm_2<br><br><br>[2] Looking at your printVarSummary, it is clear that that the data are on a rectilinear grid. <br>The &#39;lat&#39; and &#39;lon&#39; are coordinate variables.<br><br>Coordinates:<br>            month: [0..11]<br>            lat: [-46.25..42.75]   &lt;==== rectilinear<br>            lon: [-25.25..60.75]   &lt;====     &quot;<br><br>Hence, you do *NOT* need. Delete these lines<br><br>  res@sfXArray          = lon   ; Only necessary if x doesn&#39;t<br>  res@sfYArray          = lat   ; contain 1D coordinate arrays<br><br>[3]<br>nmo = 0   ; January<br>plot(0) = gsn_csm_contour_map_ce(wks,prClm_0(nmo,:,:), res)  ; create plot<br>plot(1) = gsn_csm_contour_map_ce(wks,prClm_1(nmo,:,:), res)  ; create plot<br>plot(2) = gsn_csm_contour_map_ce(wks,prClm_2(nmo,:,:), res)  ; create plot<br><br>[4]<br>Change:<br>gsn_panel(wks,plot,(/3,1/),resP)<br>To:<br>gsn_panel(wks,(/prClm_0,prClm_1,prClm_2/),(/3,1/),resP)<br>or<br>gsn_panel(wks,(/prClm_0,prClm_1,prClm_2/),(/1,3/),resP)<br><br>[5]<br>In the future please do not send scripts which contain many code lines which are commented out. Please send &#39;clean&#39; scripts only.<br><br>Good Luck<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 3, 2017 at 9:11 AM, Kwesi Quagraine <span dir="ltr">&lt;<a href="mailto:starskykwesi@gmail.com" target="_blank">starskykwesi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:large">Hello NCl Users, I am new to ncl and I have a problem. I am trying to make a  plot similar to the one attached with a common color bar and the file contains precipitation data from 1991-2005. Here&#39;s what I have done so far. <br><br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;  <br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot;  <br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot; <br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl&quot; <br><br>wksType = &quot;pdf&quot;<br>   wksName = &quot;climo123&quot;                    <wbr>      ; &quot;: &quot;+yrStrt+&quot;_&quot;+yrLast<br>  <br>   diri    = &quot;/media/kwesi/Maxtor/paper/&quot;  <wbr>       ; input directory   <br><br><br>;*****************************<wbr>******************************<br>; Read first file; Create climatology for desired period<br>;*****************************<wbr>******************************<br><br>   fili    = &quot;CCCma91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                          <br><br>   pr     = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon <br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon<br>              <br>   months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /)                       <br>   prClm  = clmMonTLL( pr)                  ; Climatology<br>                              <wbr>                <br>   delete(time)<br>   delete(pr)<br><br>   printVarSummary( prClm )<br>   printMinMax( prClm, True )<br><br>;*****************************<wbr>******************************<br>; Read second file ; Create climatology for desired period<br>; <br>;*****************************<wbr>******************************<br><br>   fili    = &quot;Cnrm91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                          <br>   pr      = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon <br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon <br>   months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /)                         <br><br>   prClm  = clmMonTLL( pr)                  ; Climatology<br>                              <wbr>                <br>   delete(time)<br>   delete(pr)<br><br>   printVarSummary( prClm )<br>   printMinMax( prClm, True )<br><br>;*****************************<wbr>******************************<br>; Read third file; Create climatology for desired period<br>;*****************************<wbr>******************************<br><br>   fili    = &quot;Ichec91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                          <br><br>   pr      = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon <br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon                        <br><br>   months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /)<br>   prClm  = clmMonTLL( pr)                  ; Climatology<br>                              <wbr>                <br>   ;delete(time)<br>   delete(pr)<br><br>   printVarSummary( prClm )<br>   printMinMax( prClm, True )<br><br>;*****************************<wbr>********************<br>; create colors<br>;*****************************<wbr>********************<br> <br><br>  colors = (/&quot;white&quot;,&quot;black&quot;             \      ; back/fore ground<br>            ,&quot;azure1&quot;,&quot;beige&quot;,&quot;lavender&quot; \<br>            ,&quot;PaleGreen&quot;,&quot;SeaGreen3&quot;,&quot;<wbr>LightYellow&quot; \<br>            ,&quot;Yellow&quot;,&quot;HotPink&quot;,&quot;Red&quot;/)   <wbr>      ; choose colors for color map<br>            wks = gsn_open_wks(wksType, wksName)<br>  gsn_define_colormap(wks, colors)              ; generate new color map<br><br>;*****************************<wbr>*******************<br>; create panel plots<br>;*****************************<wbr>********************<br>  plot   = new (3 , graphic)                    ; create graphical array<br><br>  res                      = True               ; plot options desired<br><br>  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             = (/ 2.0, 2.5 \ ; set unequal contour levels<br>                              , 3.0, 3.5, 4.0, 4.5, 5.0 \<br>                              ,5.5, 6.0, 6.5, 7.0, 7.5,10.0 /)<br><br>                             <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<br><br>  res@gsnDraw              = False<br>  res@gsnFrame             = False<br><br>  resP                     = True               ; panel options<br>  resP@txString            = &quot;GPCC Precipitation: Climatology&quot;   ; common title<br>  resP@gsnMaximize         = True               ; maximize image<br>  resP@gsnPanelLabelBar    = True               ; Add common label bar <br><br>;---Set to False if plotting regional data or setting sfXArray/sfYArray<br>  res@gsnAddCyclic      =False<br><br>  res@sfXArray          = lon   ; Only necessary if x doesn&#39;t <br>  res@sfYArray          = lat   ; contain 1D coordinate arrays<br>;<br>; Zoom in on map if desired. There are other ways to zoom in on<br>; map if you have a different projection, like lambert conformal.<br>;<br>  res@mpMinLatF         = -60<br>  res@mpMaxLatF         = 0<br>  res@mpMinLonF         = -20<br>  res@mpMaxLonF         = 60<br>  ;res@mpCenterLonF      = (res@mpMinLonF + res@mpMaxLonF) / 2.<br><br>  ;i = -1                            <wbr>            ; Climatologies<br>  ;do nmo=0,180                     <wbr>            ; loop over the months<br>     ;i = i+1<br>     ;res@gsnCenterString   = months(nmo)+&quot;:&quot;+time(0)/100 +&quot;-&quot;+ time(ntim-1)/100<br>     ;plot(i) = gsn_csm_contour_map_ce(wks,<wbr>prClm(nmo,:,:), res)  ; create plot<br>  ;end do<br>plot = gsn_csm_contour_map_ce(wks,<wbr>prClm(0,:,:), res)  ; create plot<br>  gsn_panel(wks,plot,(/3,1/),<wbr>resP)<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:large">-------After running the script I get<br clear="all"></div>Variable: prClm<br>Type: float<br>Total Size: 1486416 bytes<br>            371604 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [month | 12] x [lat | 179] x [lon | 173]<br>Coordinates: <br>            month: [0..11]<br>            lat: [-46.25..42.75]<br>            lon: [-25.25..60.75]<br>Number Of Attributes: 3<br>  _FillValue :    1e+20<br>  time_op_ncl :    Climatology: 15 years<br>  info :    function clmMonLLT: contributed.ncl<br>(0)     <br>(0)    min=0   max=63.1759<br><br>Variable: prClm<br>Type: float<br>Total Size: 1486416 bytes<br>            371604 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [month | 12] x [lat | 179] x [lon | 173]<br>Coordinates: <br>            month: [0..11]<br>            lat: [-46.25..42.75]<br>            lon: [-25.25..60.75]<br>Number Of Attributes: 3<br>  info :    function clmMonLLT: contributed.ncl<br>  time_op_ncl :    Climatology: 15 years<br>  _FillValue :    1e+20<br>(0)     <br>(0)    min=0   max=69.7658<br><br>Variable: prClm<br>Type: float<br>Total Size: 1486416 bytes<br>            371604 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [month | 12] x [lat | 179] x [lon | 173]<br>Coordinates: <br>            month: [0..11]<br>            lat: [-46.25..42.75]<br>            lon: [-25.25..60.75]<br>Number Of Attributes: 3<br>  info :    function clmMonLLT: contributed.ncl<br>  time_op_ncl :    Climatology: 15 years<br>  _FillValue :    1e+20<br>(0)     <br>(0)    min=0   max=53.8587<br><div style="font-family:trebuchet ms,sans-serif;font-size:large" class="gmail_default">​ and the file named climo123 as attached.​ Any help will be much appreciated.</div><span class="HOEnZb"><font color="#888888"><br>-- <br><div class="m_-2662625413926132514gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Try not to become a man of success but rather a man of value-Albert Einstein</font></div><div><font color="#0000ff" face="trebuchet ms, sans-serif"><br></font></div><div><font color="#0000ff"><font face="trebuchet ms, sans-serif">University of Cape Coast|</font><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px">College of Agriculture and Natural Sciences|</span><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px">Department of Physics|</span></font></div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Team Leader|Recycle Up! Ghana|Technology Without Borders|</font></div><div><font color="#0000ff"><font face="trebuchet ms, sans-serif">Other emails: </font><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px"><a href="mailto:kwesi.quagraine@ucc.edu.gh" target="_blank">kwesi.quagraine@ucc.<wbr>edu.gh</a>|</span><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px"><a href="mailto:kwesi.quagraine@teog.de" target="_blank">kwesi.quagraine@teog.de</a><wbr>|</span></font></div><div><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px"><font color="#0000ff">Mobile: <a href="tel:+233%2026%20617%203582" value="+233266173582" target="_blank">+233266173582</a></font></span></div></div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Skype: quagraine_cwasi</font></div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Twitter: @Pkdilly</font></div><div><br><img src="cid:ii_1596513231e8f873" alt="Inline image 1" height="334" width="387"></div></div></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>