<div dir="ltr"><div><div><div>Hi Melissa,<br><br></div>A few comments in addition to what Karin advises:<br><br></div><div>It appears the intent is to loop over the 36 models, generate a plot from each, which at the end you want portrayed in 3 panel plots (correct?)<br></div><br></div>If so, then all of the code involving defining the variables "plot" and "plot1", opening the workstation, setting the resources that are the same for each plot, etc., should be performed just once, before the do-loop. Additionally, these three lines after the do-loop:<br><br><div>    gsn_panel(wks,plot(:15),(/4,4/<wbr>),panres)    ; panel 16 models at a time.</div>
<div>    gsn_panel(wks,plot(16:),(/4,4/<wbr>),panres)</div>
<div>    gsn_panel(wks,plot(32:),(/4,4/<wbr>),panres)<br><br></div><div>I *think* should be:<br><br><div>    gsn_panel(wks,plot(:15),(/4,4/<wbr>),panres)    ; panel 16 models at a time.</div>
<div>    gsn_panel(wks,plot(16<span style="color:rgb(255,0,0)">:31</span>),(/4,4/<wbr>),panres)</div>
<div>    gsn_panel(wks,plot(32:),(/<span style="color:rgb(255,0,0)">2,2</span>/<wbr>),panres)</div>
<div><br><br></div><div>I hope that helps...<br></div><div>Rick<br>
</div></div>
<div><br>
</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 4, 2018 at 8:39 AM, Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Melissa,<div><br></div><div>you have to set </div><div><br></div><div><font face="Courier New">  res@gsnDraw    = False</font></div><div><font face="Courier New">  res@gsnFrame   = False</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New">and</font></div><div><font face="Courier New"><br></font></div><div><div><font face="Courier New">  wpres@gsnDraw  = False</font></div><div><font face="Courier New">  wpres@gsnFrame = False</font></div></div><div><font face="Courier New"><br></font></div><div>Bye,</div><div>Karin</div><div><br><div><blockquote type="cite"><div><div class="h5"><div>Am 04.07.2018 um 15:37 schrieb Melissa Lazenby <<a href="mailto:M.Lazenby@sussex.ac.uk" target="_blank">M.Lazenby@sussex.ac.uk</a>>:</div><br class="m_1653526625429951874Apple-interchange-newline"></div></div><div><div><div class="h5"><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;direction:ltr;font-family:Tahoma;font-size:10pt"><div>Dear NCL Users</div><div><br></div><div>I am not able to plot a panel plot of 36 CMIP5 models (lat vs time plots).</div><div>They plot individually however I think I am missing something when it comes to plotting it as a panel plot.</div><div><br></div><div>Any suggestions as to what could be wrong with the code would be very much appreciated.</div><div><br></div><div>Kindest Regards</div><div>Melissa</div><div><br></div><div>CODE BELOW</div><div><br></div><div><br></div><div>;*****************************<wbr>****************</div><div>; lat_time_bw.ncl</div><div>;*****************************<wbr>****************</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"</div><div><br></div><div><br></div><div>begin</div><div><br></div><div>model = (/"ACCESS1-0","ACCESS1-3","<wbr>bcc-csm1-1","bcc-csm1-1-m","<wbr>BNU-ESM","CanESM2","CCSM4","<wbr>CESM1-BGC","CESM1-CAM5","CMCC-<wbr>CMS","CNRM-CM5","CSIRO-Mk3-6-<wbr>0","EC-EARTH","FGOALS-g2","<wbr>FGOALS-s2","FIO-ESM","GFDL-<wbr>CM3","GFDL-ESM2G","GFDL-ESM2M"<wbr>,"GISS-E2-R_p1","GISS-E2-H-CC"<wbr>,"GISS-E2-R-CC","HadGEM2-AO","<wbr>HadGEM2-CC","HadGEM2-ES","<wbr>inmcm4","IPSL-CM5A-LR","IPSL-<wbr>CM5A-MR","MIROC5","MIROC-ESM",<wbr>"MIROC-ESM-CHEM","MPI-ESM-LR",<wbr>"MPI-ESM-MR","MRI-CGCM3","<wbr>NorESM1-M","NorESM1-ME"/)</div><div><br></div><div><span style="font-size:10pt">do gg = 0,dimsizes(model)-1</span></div><div><br></div><div> fili  = "/mnt/geog/ml382/ml382_<wbr>sals000408_home_dir/melsicz/<wbr>dPhov/pr_Amon_"+model(gg)+"_<wbr>dP_hov.nc"                   </div><div> fili2  = "/mnt/geog/ml382/ml382_<wbr>sals000408_home_dir/melsicz/<wbr>dPhov/pr_Amon_"+model(gg)+"_<a href="http://climhov_1971-2000.nc" target="_blank">cl<wbr>imhov_1971-2000.nc</a>" </div><div><br></div><div> f     = addfile (fili , "r")                         ; add file</div><div> lat   = f->lat                                       ; get lat</div><div> lon   = f->lon                                       ; get lon </div><div> time  = f->time                                      ; get time                          </div><div> ;precip    = f->pr                                ; get precip</div><div> ;precip2   = precip(:,0,:,:)</div><div><br></div><div> f1     = addfile (fili2 , "r")                         ; add file</div><div> lat1   = f->lat                                       ; get lat</div><div> lon1   = f->lon                                       ; get lon </div><div> time1  = f->time                                      ; get time          </div><div><br></div><div>if ((gg.eq.13) .or. (gg.eq.17) .or. (gg.eq.18)) then</div><div>  precip = f1->pr(:,:,:)</div><div> else</div><div>  precip = f1->pr(:,0,:,:)</div><div>    end if</div><div><br></div><div><br></div><div>if ((gg.eq.3) .or. (gg.eq.13) .or. (gg.eq.17) .or. (gg.eq.18) .or. (gg.eq.20) .or. (gg.eq.21)) then</div><div>  precip2 = f->pr(:,:,:)</div><div> else</div><div>  precip2 = f->pr(:,0,:,:)</div><div>    end if</div><div><br></div><div><br></div><div> printVarSummary(precip2)</div><div><br></div><div> latS      = -30.</div><div> latN      =  30.</div><div><span style="font-size:10pt"> shov      = precip2(:,{-30:30},{30:40})</span></div><div>shov1      = precip(:,{-30:30},{30:40})</div><div> dims      = dimsizes(shov)                   ; shov=3D array=(12,40,37)</div><div><span style="font-size:10pt"> sdemo     = dim_avg_Wrap(shov)   ;sdemo(time,lat)</span></div><div>sdemo4     = dim_avg_Wrap(shov1)   ;sdemo(time,lat)</div><div> </div><div><br></div><div>  </div><div> sdemo1 = sdemo(lat|:,time|:)                              </div><div> sdemo1 = smth9 (sdemo1,0.5, 0.25, False)               ; 2D smoother</div><div> sdemo2 = sdemo4(lat|:,time|:)                              </div><div> sdemo2 = smth9 (sdemo2,0.5, 0.25, False)  </div><div> sdemo1@units     = "mm/day"</div><div> sdemo1@long_name = "dP Hov "+model(gg)+" (lon 30E-40E)"</div><div> gtPat = 17                                           ; stiple</div><div> ltPat = 3  </div><div>sdemo2@units     = ""</div><div> sdemo2@long_name = ""</div><div>                                           ; hatch</div><div>;*************************</div><div>; plotting parameters</div><div>;*************************</div><div> wks   = gsn_open_wks ("X11", "dPhov_ALL_models_lon30-40" ) ; open workstation </div><div><span style="font-size:10pt"> gsn_define_colormap(wks,"<wbr>BlueDarkRed18")  ; choose color map</span></div><div> gsn_reverse_colormap(wks)</div><div><br></div><div>  plot = new (36,"graphic")</div><div>  plot1= new (36,"graphic")</div><div><br></div><div><br></div><div> res                  = True               ; plot mods desired</div><div> res@cnFillOn         = True               ; color on</div><div> res@gsnDraw          = True              ; don't draw yet</div><div> res@gsnAddCyclic      = False</div><div> res@lbLabelStride    = 2                   ; every other label</div><div> res@lbOrientation    = "Horizontal"          ; vertical label bar</div><div> res@pmLabelBarOrthogonalPosF = -0.04       ; move label bar closer to axis</div><div> res@cnLinesOn        = False               ; turn off contour lines</div><div> res@gsnSpreadColors  = True                ; use full range of color map</div><div> res@gsnFrame         = True             ; don't advance frame yet</div><div><br></div><div><span style="font-size:10pt"> res@vpXF             = 0.12               ; default is 0.2 change aspect</span></div><div> res@vpYF             = 0.8                ; default is 0.8 ration</div><div> res@vpHeightF        = 0.4                ; default is 0.6</div><div> res@vpWidthF         = 0.8                ; default is 0.6</div><div><br></div><div> res@cnLevelSelectionMode = "ManualLevels"  ; manual levels</div><div> res@cnMinLevelValF       =  -1.5              ; min level</div><div> res@cnMaxLevelValF       =  1.5            ; max level</div><div> res@cnLevelSpacingF      =  0.25           ; contour spacing</div><div><br></div><div><br></div><div> res@tmXBMode      = "Explicit"     ; Define own tick mark labels.</div><div> res@tmXBValues    = (/  0.,  1.,  2.,  3., 4., 5., 6., 7., 8., 9., 10., 11. /)</div><div> res@tmXBLabels    = (/"D","J","F","M" ,"A","M", "J", "J", "A", "S", "O", "N" /)</div><div><br></div><div><br></div><div> wpres                  = True               ; plot mods desired</div><div> wpres@cnFillOn         = False               ; color on</div><div> wpres@gsnDraw          = True              ; don't draw yet</div><div> wpres@gsnFrame         = True     </div><div> wpres@gsnAddCyclic      = False</div><div> wpres@lbLabelStride    = 2                   ; every other label</div><div> wpres@cnLinesOn        = True </div><div> wpres@cnLineLabelsOn   = True </div><div> wpres@cnLineThicknessF = 1.5</div><div> wpres@cnInfoLabelOn     = False</div><div><br></div><div><br></div><div>wpres@cnLevelSelectionMode = "ManualLevels"  ; manual levels</div><div> wpres@cnMinLevelValF       =  0              ; min level</div><div> wpres@cnMaxLevelValF       =  10            ; max level</div><div> wpres@cnLevelSpacingF      =  1           ; contour spacing</div><div><br></div><div>        </div><div> plot(gg) = gsn_csm_lat_time(wks, sdemo1({-30:30},:),res ) </div><div> plot1(gg) = gsn_csm_lat_time(wks, sdemo2({-30:30},:),wpres )</div><div><br></div><div> overlay(plot(gg),plot1(gg)) </div><div><br></div><div><br></div><div>delete(sdemo1)</div><div>delete(sdemo2)</div><div><br></div><div><br></div><div>end do</div><div>panres                = True              ; mod panel plot</div><div>panres@gsnPanelLabelBar    = True                ; add common colorbar</div><div>panres@lbLabelFontHeightF =.012                 ; make labels larger</div><div>panres@gsnMaximize = True ; Maximize plot in frame. </div><div><br></div><div>gsn_panel(wks,plot(:15),(/4,4/<wbr>),panres)    ; panel 16 models at a time.</div><div>gsn_panel(wks,plot(16:),(/4,4/<wbr>),panres)</div><div>gsn_panel(wks,plot(32:),(/4,4/<wbr>),panres)</div><div><br></div><div>end</div><div><br></div></div></div></div><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">ncl-talk mailing list</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:ncl-talk@ucar.edu" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">ncl-talk@ucar.edu</a><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">List instructions, subscriber options, unsubscribe:</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a></div></blockquote></div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">______________________________<wbr>______<br>Dipl. Geophys. Karin Meier-Fleischer</div><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br>Visualisierung, NCL, CDO<br>Abteilung Anwendungen<br><br>Deutsches Klimarechenzentrum GmbH (DKRZ)<br>Bundesstrasse 45a * D-20146 Hamburg                          <br>Germany                                <br><br>Phone:<span class="m_1653526625429951874Apple-tab-span" style="white-space:pre-wrap">    </span>+49 (0)40 460094 126<br>Fax:<span class="m_1653526625429951874Apple-tab-span" style="white-space:pre-wrap">        </span>+49 (0)40 460094 270<br>E-Mail:<span class="m_1653526625429951874Apple-tab-span" style="white-space:pre-wrap">     </span><a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a><br>URL:<span class="m_1653526625429951874Apple-tab-span" style="white-space:pre-wrap">        </span><a href="http://www.dkrz.de/" target="_blank">http://www.dkrz.de/</a><br><br>Geschäftsführer: Prof. Dr. Thomas Ludwig<br>Sitz der Gesellschaft: Hamburg<br>Amtsgericht Hamburg HRB 39784<br><br><br><br></div>
</div>
<br></div></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>