<div dir="ltr"><div dir="ltr">Dear all,<div>I would like to have climatology precipitation like temperature climatology discussed through previous emails. However, there are precipitation files for each year from 1979- 2015 (<a href="ftp://ftp.cdc.noaa.gov/Datasets/cpc_global_precip/" target="_blank">ftp://ftp.cdc.noaa.gov/Datasets/cpc_global_precip/</a>). In the first step, I tried to merge all those files as one, and then use Dennis script to plot a map. I faced some errors and need your advice please. the script I am running has been attached.<span style="color:rgb(80,0,80)">Many thanks in advance,</span></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><span style="color:rgb(80,0,80)">Best regards</span>n Sat, Oct 26, 2019 at 3:20 PM zoe jacobs <<a href="mailto:zoejacobs1990@gmail.com">zoejacobs1990@gmail.com</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 dir="ltr">I just noticed that I could use <span style="color:rgb(0,0,0);white-space:pre-wrap">res@gsnRightString = " deg C" .</span><div><font color="#000000"><span style="white-space:pre-wrap">Once again, many thanks for your guide.</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">Best wishes,<br></span></font><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 25, 2019 at 11:07 PM Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@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 dir="ltr"><div>I forgot to mention that plots can be done in 'portrait' [default] or 'landscape' mode.</div><div><br></div><div>You should experiment to see which is appropriate for your needs.<br></div><div><br></div><div>resP@gsnPaperOrientation = "landscape" ; "portrait" is default</div><div><br></div><div> do nmo=0,11 ; loop over the months<br> res@gsnLeftString = months(nmo)<br> plot(nmo) = gsn_csm_contour_map(wks,tmpClm(nmo,:,:), res) ; create plot<br> end do<br><br> if (resP@gsnPaperOrientation .eq."landscape") then<br> gsn_panel(wks,plot,(/3,4/),resP) ; 3 rows x 4 columns<br> else<br> gsn_panel(wks,plot,(/4,3/),resP) ; portrait ; 4 rows x 3 columns<br> end if<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 25, 2019 at 12:15 PM Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@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 dir="ltr"><div>Hello,</div><div><br></div><div>We do not usually do this but this is offline from ncl-talk.<br></div><div><br></div><div>[1] <br></div><div>Conventional subscripts start at 1 for Fortran and Matlab. Hence, for 12 months [nmos=12]</div><div> Fortran: do nmo=1,nmos <br></div><div> Matlab: for 1:nmos or 1:1:nmos [I am not a Matlab user so this is a guess.]<br></div><div>NCL 'conventional' subscripts start at 0 [like C/C++/IDL/Python]</div><div> NCL: do nmo=0,ntim-1</div><div><br></div><div>[2] Dave illustrated 'coordinate subscripting' which uses the <span style="color:rgb(0,0,255)"><b>{</b></span>...<span style="color:rgb(0,0,255)"><b>}</b></span> syntax.</div><div><br></div><div>The script I am attaching uses conventional subscripting. Just like Matlab/Fortran except it uses a range fro 0 to 11 [12 elements].</div><div><br></div><div>[3] Please carefully read the documentation for <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/clmMonTLL.shtml" target="_blank"><b>clmMonTLL</b></a>, <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml" target="_blank"><b>cd_calendar</b></a>,<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ind.shtml" target="_blank"><b> ind</b></a></div><div><br></div><div>[4] Look at the output from '<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/printVarSummary.shtml" target="_blank"><b>printVarSummary</b></a>'. USE <b>printVarSummary </b>frequently.<br></div><div> Note the dimensions and added attributes: <br></div><div> time_op_ncl : Climatology: 29 years<br> info : function clmMonTLL: contributed.ncl</div><div><br></div><div>[5] NCL offer a large number of color tables [palettes]:</div><div> <a href="http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml" target="_blank"><b>http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml</b></a></div><div> Using a color map that emphasizes features can be very useful.</div><div><br></div><div>[6] You must invest the time to learn any new language. <br></div><div>Karin Meier-Fliesher and Michael Bottinger [DKRZ] wrote a wonderful tutorial. <br></div><div><br></div><div><a href="http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/" target="_blank"><b>http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/</b></a></div><div><br></div><div>I suggest you read it.</div><div><br></div><div>Good luck</div><div>==============<br></div><div><b>%></b> ncl zoe_jacobs.hgcn_cams.ncl</div><div><br></div><div>will produce a png file.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 25, 2019 at 11:16 AM Dave Allured - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@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 dir="ltr"><div dir="ltr"><div dir="ltr"><div>1. In your example, please notice that the month loop has a stride of 3. Therefore it is making plots for only four months: January, April, July, and October.</div><div><br></div><div>If you want all 12 months, remove the stride. Then make sure the array "plot" is dimensioned 12. I think you can interchangeably use either a 1-D or 2-D plot array (i.e. 3*4), your choice.</div><div><br></div><div>The secondary index "i" is used to write the four plots into positions 0, 1, 2, 3 in the "plot" graphics array. If you are making 12 plots, you do not really need to use a secondary index.</div><div><br></div><div>Panel plotting uses a graphics array containing multiple plots. Please study basic examples and documentation for making panel plots.</div><div><br></div><div>2. That data file has full coordinates. Therefore you can use either conventional or coordinate subscripting, or mixed, your choice.</div><div><br></div>I suggest using one of the date functions with coordinate subscripting, to index the time subset that you want. Something like this:<br><br> time_units = f->air&time@units<br> time1 = cd_inv_calendar (year1, 1, 1, 0, 0, 0, time_units, 0)<br> time2 = cd_inv_calendar (year2, 12, 31, 23, 0, 0, time_units, 0)</div><div dir="ltr"> air_subset = f->air({time1:time2},:,:)<br><div><br></div><div>Use printVarSummary to ensure that the subset has the dimension sizes that you expect. Then you can proceed to compute the climatology.</div><div><br></div><div><br></div><div>On Fri, Oct 25, 2019 at 10:14 AM zoe jacobs via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font face="arial, sans-serif">Hi all,</font><div><font face="arial, sans-serif">regarding climo_3.ncl (<a href="https://www.ncl.ucar.edu/Applications/Scripts/climo_3.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/climo_3.ncl</a>) ,</font></div><div><font face="arial, sans-serif">I have 2 questions:</font></div><div><font face="arial, sans-serif">1. I need to plot all months on one panel (say 3*4), and cannot understand the logic behind the below loop, which used in the climo_3.ncl script :</font></div><div><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font style="background-color:rgb(241,194,50)" face="arial, sans-serif">i = -1 ; Climatologies
do nmo=0,11,3 ; loop over the months
i = i+1
res@gsnCenterString = months(nmo)+":"+time(0)/100 +"-"+ time(ntim-1)/100
plot(i) = gsn_csm_contour_map(wks,prcClm(nmo,:,:), res) ; create plot
end do</font></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font style="background-color:rgb(241,194,50)" face="arial, sans-serif">How does it work??/</font></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, sans-serif">2. I would like to show climotology temperature from 1987- 2015. Data which I am using is<span style="background-color:rgb(180,167,214)"> <a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a> </span><span style="background-color:rgb(255,255,255)"> ( </span><a href="https://www.esrl.noaa.gov/psd/data/gridded/data.ghcncams.html" target="_blank">https://www.esrl.noaa.gov/psd/data/gridded/data.ghcncams.html</a>) <span style="background-color:rgb(255,255,255)"> and it is </span>using conventional subscripts. I am not familiar with conventional subscripts. So how can I convert coordinate subscripting to conventional subscripts?!!</font></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, sans-serif">Please kindly advice me .</font></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, sans-serif">Many thanks in advance,</font></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, sans-serif">Best regards,</font></pre></div></div></blockquote></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>