<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div style="" class=""><br style=""></div><div style="" class=""><span style="" class="">Mary,</span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">Thank
you very much for pointing me to the wrfgsn page. I tried the first two
examples and they work perfectly. These will serve all my purposes and
the way they are presented will give me a lot of learning examples. Thanks to all who looked at my post.<br></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">I really appreciate your patience and efforts Mary. Thanks very much to all on ncl-talk.</span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">Zilore</span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica,
Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="" class="" dir="ltr"> <font style="" class="" face="Arial" size="2"> On Monday, August 4, 2014 8:00 PM, "ncl-talk-request@ucar.edu" <ncl-talk-request@ucar.edu> wrote:<br style="" class=""> </font> </div> <br style="" class=""><br style="" class=""> <div style="" class="">Send ncl-talk mailing list submissions to<br style="" class=""> <a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br style="" class=""><br style="" class="">To subscribe or unsubscribe via the World Wide Web, visit<br style="" class=""> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">or, via email, send a message with subject or body 'help' to<br style="" class=""> <a style="" class=""
ymailto="mailto:ncl-talk-request@ucar.edu" href="mailto:ncl-talk-request@ucar.edu">ncl-talk-request@ucar.edu</a><br style="" class=""><br style="" class="">You can reach the person managing the list at<br style="" class=""> <a style="" class="" ymailto="mailto:ncl-talk-owner@ucar.edu" href="mailto:ncl-talk-owner@ucar.edu">ncl-talk-owner@ucar.edu</a><br style="" class=""><br style="" class="">When replying, please edit your Subject line so it is more specific<br style="" class="">than "Re: Contents of ncl-talk digest..."<br style="" class=""><br style="" class=""><br style="" class="">Today's Topics:<br style="" class=""><br style="" class=""> 1. Re: triple2grid (Dennis Shea)<br style="" class=""> 2. Re: How to create two y axis with a common x axis in bar plot<br style="" class=""> (Mary Haley)<br style="" class=""> 3. Re: (no subject) (Dennis Shea)<br style="" class="">
4. Re: Running example scripts for beginners (Mary Haley)<br style="" class=""> 5. Re: read separated files (Dennis Shea)<br style="" class=""> 6. Using a loop to find values greater than 0 (calculate PDD)<br style="" class=""> (Lauren Jean Vargo)<br style="" class=""> 7. Re: Using a loop to find values greater than 0 (calculate<br style="" class=""> PDD) (Dennis Shea)<br style="" class=""> 8. Re: Using a loop to find values greater than 0 (calculate<br style="" class=""> PDD) (Kyle Griffin)<br style="" class=""> 9. Re: Strange white lines across plot (Mary Haley)<br style="" class=""> 10. Re: Fwd: Masking a U.S. county from a netcdf file (Mary Haley)<br style="" class=""><br style="" class=""><br style="" class="">----------------------------------------------------------------------<br style=""
class=""><br style="" class="">Message: 1<br style="" class="">Date: Mon, 4 Aug 2014 07:17:29 -0600<br style="" class="">From: Dennis Shea <<a style="" class="" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] triple2grid<br style="" class="">To: Manisha Ganeshan <<a style="" class="" ymailto="mailto:manisha.ganeshan86@gmail.com" href="mailto:manisha.ganeshan86@gmail.com">manisha.ganeshan86@gmail.com</a>><br style="" class="">Cc: NCL-talk <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CAOF1d_4pLjOOnFbXb-7ju2BQbkXwbx=iCVsuVWjiUM=<a style="" class="" ymailto="mailto:wyR_Efw@mail.gmail.com" href="mailto:wyR_Efw@mail.gmail.com">wyR_Efw@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br
style="" class=""><br style="" class="">Not that I am aware of. Sorry.<br style="" class=""><br style="" class=""><br style="" class="">On Fri, Aug 1, 2014 at 4:10 PM, Manisha Ganeshan <<br style="" class=""><a style="" class="" ymailto="mailto:manisha.ganeshan86@gmail.com" href="mailto:manisha.ganeshan86@gmail.com">manisha.ganeshan86@gmail.com</a>> wrote:<br style="" class=""><br style="" class="">> Thanks, Dennis. Is there a function that calculates the mean or saves the<br style="" class="">> total number of nearest neighbor source points for each grid point in the<br style="" class="">> destination grid?<br style="" class="">><br style="" class="">> Regards,<br style="" class="">> Nisha<br style="" class="">><br style="" class="">><br style="" class="">> On Fri, Aug 1, 2014 at 6:03 PM, Dennis Shea <<a style="" class="" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br
style="" class="">><br style="" class="">>> It does not calculate the mean. New 'nearest neighbor' values overwrite<br style="" class="">>> previous values.<br style="" class="">>><br style="" class="">>><br style="" class="">>> On Fri, Aug 1, 2014 at 3:59 PM, Manisha Ganeshan <<br style="" class="">>> <a style="" class="" ymailto="mailto:manisha.ganeshan86@gmail.com" href="mailto:manisha.ganeshan86@gmail.com">manisha.ganeshan86@gmail.com</a>> wrote:<br style="" class="">>><br style="" class="">>>> Hello,<br style="" class="">>>><br style="" class="">>>> I have a question about the *triple2grid* function. The description<br style="" class="">>>> says that the function does not perform interpolation but instead assigns<br style="" class="">>>> each unstructured (source) data point to the nearest grid point<br style="" class="">>>> (destination). How
does it treat multiple unstructured data points (source)<br style="" class="">>>> that have a common nearest grid point (destination)? Does it calculate the<br style="" class="">>>> mean value (after ignoring missing values)?<br style="" class="">>>><br style="" class="">>>> Thanks,<br style="" class="">>>> Nisha<br style="" class="">>>><br style="" class="">>>> _______________________________________________<br style="" class="">>>> ncl-talk mailing list<br style="" class="">>>> List instructions, subscriber options, unsubscribe:<br style="" class="">>>> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">>>><br style="" class="">>>><br style="" class="">>><br style="" class="">><br style="" class="">-------------- next
part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/81cbd948/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/81cbd948/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 2<br style="" class="">Date: Mon, 4 Aug 2014 08:29:44 -0600<br style="" class="">From: Mary Haley <<a style="" class="" ymailto="mailto:haley@ucar.edu" href="mailto:haley@ucar.edu">haley@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] How to create two y axis with a common x axis<br style="" class=""> in bar plot<br style="" class="">To: Ipshita Majhi <<a style="" class="" ymailto="mailto:ipmajhi@alaska.edu"
href="mailto:ipmajhi@alaska.edu">ipmajhi@alaska.edu</a>><br style="" class="">Cc: NCL USERS <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CACNN_CKd2OjK7wbauhLmC01QPRpsCMfMq2aYC1CDzqh=<a style="" class="" ymailto="mailto:UQeVog@mail.gmail.com" href="mailto:UQeVog@mail.gmail.com">UQeVog@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">Ipsita,<br style="" class=""><br style="" class="">In order to overlay a bunch of bar charts, it works best if you can shift<br style="" class="">each of the bars by a certain bar width, and then you can draw them<br style="" class="">side-by-side. I think you may have used part of bar_11.ncl on our bar<br style="" class="">examples page, and this is a good one to work with. However, you
want to<br style="" class="">add some overlay code in there, which will make all the plots part of the<br style="" class="">same plot.<br style="" class=""><br style="" class="">The key is to draw each set of bars with a slightly shifted set of X<br style="" class="">values, so the bars are drawn next to each other.<br style="" class=""><br style="" class="">See the attached example and script.<br style="" class=""><br style="" class="">--Mary<br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">On Fri, Aug 1, 2014 at 4:27 PM, Ipshita Majhi <<a style="" class="" ymailto="mailto:ipmajhi@alaska.edu" href="mailto:ipmajhi@alaska.edu">ipmajhi@alaska.edu</a>> wrote:<br style="" class=""><br style="" class="">> Hi,<br style="" class="">> I want to plot trend values and monthly means in one plot. Both are an<br style="" class="">> array of size 12 .<br style="" class="">> The program gives no error but the
plot are overlapping. I am not sure how<br style="" class="">> to fix it. I realized that if I use the below mentioned method they overlap<br style="" class="">> is there a way to have two y axis in bar plots. Since the trends are much<br style="" class="">> smaller then avgs.<br style="" class="">><br style="" class="">> ;*****************************************************<br style="" class="">> ;Trend and monthly climatology together in one bar plot<br style="" class="">> ;*******************************************************<br style="" class="">><br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br style="" class="">><br style="" class="">> months=(/1,2,3,4,5,6,7,8,9,10,11,12/)<br style="" class="">><br style="" class="">><br style=""
class="">> monthly_avg=asciiread("~/Documents/PhD_June_2015/NCL_Moonsoon/Data_output/Monthly_avg_air.txt",-1,<br style="" class="">> "float")<br style="" class="">><br style="" class="">> monthly_Trend=asciiread("~/Documents/PhD_June_2015/NCL_Moonsoon/Data_output/trend_air.txt",<br style="" class="">> -1, "float")<br style="" class="">> printVarSummary(monthly_avg)<br style="" class="">><br style="" class="">> wks = gsn_open_wks("ps","Trend_Avg")<br style="" class="">><br style="" class="">><br style="" class="">> sres = True<br style="" class="">> <a style="" class="" ymailto="mailto:sres@vpWidthF" href="mailto:sres@vpWidthF">sres@vpWidthF</a> = 0.7<br style="" class="">> <a style="" class="" ymailto="mailto:sres@vpHeightF" href="mailto:sres@vpHeightF">sres@vpHeightF</a> = 0.5<br style="" class="">>
<a style="" class="" ymailto="mailto:sres@gsnDraw" href="mailto:sres@gsnDraw">sres@gsnDraw</a> = True<br style="" class="">> <a style="" class="" ymailto="mailto:sres@gsnFrame" href="mailto:sres@gsnFrame">sres@gsnFrame</a> = False<br style="" class="">> <a style="" class="" ymailto="mailto:sres@gsnXYBarChart" href="mailto:sres@gsnXYBarChart">sres@gsnXYBarChart</a> = True<br style="" class="">> <a style="" class="" ymailto="mailto:sres@gsnXYBarChartBarWidth" href="mailto:sres@gsnXYBarChartBarWidth">sres@gsnXYBarChartBarWidth</a> = 0.15 ; change bar widths<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tmXBMode" href="mailto:sres@tmXBMode">sres@tmXBMode</a> = "Explicit" ; explicit labels<br style="" class="">> <a style=""
class="" ymailto="mailto:sres@tmXBValues" href="mailto:sres@tmXBValues">sres@tmXBValues</a> = (/1,2,3,4,5,6,7,8,9,10,11,12/)<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tmXBLabels" href="mailto:sres@tmXBLabels">sres@tmXBLabels</a> =<br style="" class="">> (/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"/)<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tmXBLabelFontHeightF" href="mailto:sres@tmXBLabelFontHeightF">sres@tmXBLabelFontHeightF</a> = 0.0205<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tmXTLabelFontHeightF" href="mailto:sres@tmXTLabelFontHeightF">sres@tmXTLabelFontHeightF</a> = 0.0205<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tmYLLabelFontHeightF" href="mailto:sres@tmYLLabelFontHeightF">sres@tmYLLabelFontHeightF</a> =
0.0225<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tiMainFontHeightF" href="mailto:sres@tiMainFontHeightF">sres@tiMainFontHeightF</a> = 0.025<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tiMainFont" href="mailto:sres@tiMainFont">sres@tiMainFont</a> = "helvetica"<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tiMainString" href="mailto:sres@tiMainString">sres@tiMainString</a> = "All India Rainfall Climatology and Trend<br style="" class="">> 1880-2012"<br style="" class="">> <a style="" class="" ymailto="mailto:sres@tiYAxisString" href="mailto:sres@tiYAxisString">sres@tiYAxisString</a> = "(mm)"<br style="" class="">><br style="" class="">> plot1 = gsn_csm_xy (wks,months,monthly_avg,sres)<br style="" class="">> <a style="" class=""
ymailto="mailto:sres@gsnXYBarChartColors" href="mailto:sres@gsnXYBarChartColors">sres@gsnXYBarChartColors</a> = (/"red"/) ;<br style="" class="">> seperately, not<br style="" class="">> plot2 = gsn_csm_xy(wks,months,monthly_Trend,sres)<br style="" class="">> ; advancing the frame<br style="" class="">> <a style="" class="" ymailto="mailto:sres@gsnXYBarChartColors" href="mailto:sres@gsnXYBarChartColors">sres@gsnXYBarChartColors</a> = (/"blue"/) ; but<br style="" class="">> tweaking where<br style="" class="">><br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions,
subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/b04f1178/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/b04f1178/attachment-0001.html </a><br style="" class="">-------------- next part --------------<br style="" class="">A non-text attachment was scrubbed...<br style="" class="">Name: bar.png<br style="" class="">Type: image/png<br style="" class="">Size: 42598 bytes<br style="" class="">Desc: not available<br style="" class="">Url : <a style="" class=""
href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/b04f1178/attachment-0001.png" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/b04f1178/attachment-0001.png </a><br style="" class="">-------------- next part --------------<br style="" class="">A non-text attachment was scrubbed...<br style="" class="">Name: bar_11.ncl<br style="" class="">Type: application/octet-stream<br style="" class="">Size: 3061 bytes<br style="" class="">Desc: not available<br style="" class="">Url : <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/b04f1178/attachment-0001.obj" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/b04f1178/attachment-0001.obj </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 3<br style="" class="">Date: Mon, 4 Aug 2014 08:44:26 -0600<br style=""
class="">From: Dennis Shea <<a style="" class="" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] (no subject)<br style="" class="">To: Modise Wiston <<a style="" class="" ymailto="mailto:modise.wiston@postgrad.manchester.ac.uk" href="mailto:modise.wiston@postgrad.manchester.ac.uk">modise.wiston@postgrad.manchester.ac.uk</a>><br style="" class="">Cc: "<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CAOF1d_4GEj90MZ04-u1vemt3UbnH+<a style="" class="" ymailto="mailto:vd--oWt1Ax73BAP2poQag@mail.gmail.com" href="mailto:vd--oWt1Ax73BAP2poQag@mail.gmail.com">vd--oWt1Ax73BAP2poQag@mail.gmail.com</a>><br style=""
class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">While not WRF, the last example at:<br style="" class=""><a style="" class="" href="http://www.ncl.ucar.edu/Applications/iso.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/iso.shtml</a><br style="" class=""><br style="" class="">may give you an idea of how to approach the issue.<br style="" class=""><br style="" class="">===<br style="" class="">Also, please send *all* WRF questions to <a style="" class="" ymailto="mailto:wrfhelp@ucar.edu" href="mailto:wrfhelp@ucar.edu">wrfhelp@ucar.edu</a><br style="" class="">The know the WRF model best.<br style="" class="">You can cc <a style="" class="" ymailto="mailto:ncl-talk@ucar" href="mailto:ncl-talk@ucar">ncl-talk@ucar</a> but, really, wrfhelp should be your primary<br style="" class="">contact for assorted WRF related issues.<br style="" class=""><br style="" class="">Good luck<br style="" class=""><br
style="" class=""><br style="" class=""><br style="" class="">On Sat, Aug 2, 2014 at 12:06 PM, Modise Wiston <<br style="" class=""><a style="" class="" ymailto="mailto:modise.wiston@postgrad.manchester.ac.uk" href="mailto:modise.wiston@postgrad.manchester.ac.uk">modise.wiston@postgrad.manchester.ac.uk</a>> wrote:<br style="" class=""><br style="" class="">> *To whom it may concern*<br style="" class="">><br style="" class="">> *Hi all,*<br style="" class="">><br style="" class="">> *I am trying to determine the cloud droplet number<br style="" class="">> concentration (QNDROP) from my [WRF-Chem] model simulation. The script [see<br style="" class="">> the code below] is such that the code loops through the x-y-z (i-j-k)<br style="" class="">> planes and finds the max (& min) QNDROP along the vertical (model levels).<br style="" class="">> The code is such that it exits/stops just after the first
cloud band only<br style="" class="">> -without continuing through all the layers above the first cloud band. This<br style="" class="">> also calculates CCN number concentrations below the cloud base.*<br style="" class="">><br style="" class="">> *How can I make it (or write a function/code) to calculate the height at<br style="" class="">> which the max QNDROP occurs..? I have been trying to go through several NCL<br style="" class="">> examples (functions) but couldn't figure out out how to do this.. (I would<br style="" class="">> like to plot 'height vs max QNDROP' on the horizontal lat-lon domain) *<br style="" class="">><br style="" class="">> *Any help is appreciated please..*<br style="" class="">> *Thank you,*<br style="" class="">> *M. Wiston*<br style="" class="">> *The University of Manchester *<br style="" class="">><br style="" class="">>
-----------------------------------------------------------------------------------------------------------<br style="" class="">> dt = 6<br style="" class="">> do ifil = 0, 0; numFILES-48, dt<br style="" class="">> a = addfile(FILES(ifil)+".nc","r")<br style="" class="">> ;list time step to output data<br style="" class="">> times = wrf_user_list_times(a)<br style="" class="">> ntimes = dimsizes(times)<br style="" class="">><br style="" class="">> do it = 0,ntimes-1,2<br style="" class="">> do ispec = 0, nspec-1<br style="" class="">> species = speclist(ispec)<br style="" class="">><br style="" class="">> ;Obtain the variables from the file<br style="" class="">> if(isfilevar(a,"QNDROP"))<br style="" class="">> N = wrf_user_getvar(a,"QNDROP",it)<br style="" class="">> Nd
= (N*1.2923)/1e6 ; convert from /kg to /sm^3 then<br style="" class="">> to /scm^3<br style="" class="">> <a style="" class="" ymailto="mailto:Nd@units" href="mailto:Nd@units">Nd@units</a> = "/cm^3" ; converted units<br style="" class="">> end if<br style="" class="">><br style="" class="">> ;define an array to hold data<br style="" class="">> dimsNd = dimsizes(Nd)<br style="" class="">> print(dimsNd)<br style="" class="">><br style="" class="">> ;----------------Determine the domain size (grid points and<br style="" class="">> vert. levels)----------------;<br style="" class="">> ; (321 x 251)
; grid points along "i"<br style="" class="">> (hor) by "j" (vert) direction ;<br style="" class="">> ; (e_we:lat, e_sn:lon)<br style="" class="">> ;<br style="" class="">> ; 40 vert levels:(k) ; model levels<br style="" class="">> ;<br style="" class="">> ; Print output gives: k = 40 ;NB: this is read starting from<br style="" class="">> zero (i.e. 0-39) ;<br style="" class="">> ;
j = 250<br style="" class="">> ;<br style="" class="">> ; i = 320<br style="" class="">> ;<br style="" class="">><br style="" class="">> ;------------------------------------------------------------------------------------------------;<br style="" class="">> min_Nd = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> max_Nd = new( (/dimsNd(1),dimsNd(2)/),float
)<br style="" class="">> c_btm = new( (/dimsNd(1),dimsNd(2)/),integer )<br style="" class="">> c_top = new( (/dimsNd(1),dimsNd(2)/),integer )<br style="" class="">><br style="" class="">> do j = 0, dimsNd(1)-1 ; loop along j<br style="" class="">> do i = 0, dimsNd(2)-1 ; loop along i<br style="" class="">> ; cldfrc = (i*j)<br style="" class="">> c_btm(j,i) = -1 ;define cloud base and<br style="" class="">> cloud top limits to confine the execution<br style="" class="">> c_top(j,i) = -1<br style="" class="">> do k = 0, dimsNd(0)-2
; loop [vertically] through<br style="" class="">> levels<br style="" class="">> ; print("k= "+k)<br style="" class="">> if(Nd(k,j,i) .le. cut_pnt .and. Nd((k+1),j,i) .gt. cut_pnt)<br style="" class="">> c_btm(j,i) = (k+1)<br style="" class="">> ;[cloud base]<br style="" class="">> ; print("c_btm = "+c_btm(j,i))<br style="" class="">><br style="" class="">> else if (Nd(k,j,i) .gt. cut_pnt .and. Nd((k+1),j,i) .le. cut_pnt) then<br style="" class="">> c_top(j,i) = k<br style="" class="">> ;[cloud top]<br style="" class="">> break ; exit the the process after the first<br style="" class="">> cloud band<br style="" class="">> end if<br style="" class="">>
end if<br style="" class="">> end do<br style="" class="">> ; min_Nd(i) = min(Nd(:,i))<br style="" class="">> ; max_Nd(i) = max(Nd(:,i))<br style="" class="">> ; min_Nd(j) = min(Nd(:,j))<br style="" class="">> ; max_Nd(j) = max(Nd(:,j))<br style="" class="">> ; min_Nd(j,i) = min(Nd(:,j,i))<br style="" class="">> ; max_Nd(j,i) = max(Nd(0:3,j,i))<br style="" class="">><br style="" class="">> if(c_btm(j,i) .eq. -1 .and. c_top(j,i) .eq. -1)<br style="" class="">> max_Nd(j,i) = 0.0<br style="" class="">><br style="" class="">> else if (c_btm(j,i) .gt. -1 .and. c_top(j,i) .gt. -1) then<br style="" class="">>
max_Nd(j,i) = max( Nd(c_btm(j,i):c_top(j,i),j,i) )<br style="" class="">> ;print(min_Nd(j,i))<br style="" class="">> ;print("max_Nd = " +max_Nd(j,i))<br style="" class="">> print("| "+sprintf("%5.3f",max_Nd(j,i))+ " | "+sprintf("%2.1f",<br style="" class="">> c_btm(j,i))+" | "+sprintf("%2.1f", c_btm(j,i))+" |" )<br style="" class="">> end if<br style="" class="">> end if<br style="" class="">> end do<br style="" class="">> end do<br style="" class="">><br style="" class="">> ;------------------------------------------------------------------------------------------<br style="" class="">><br style="" class="">> ;;get the CCN number concentration from the file<br
style="" class="">> Cn1 = wrf_user_getvar(a,"CCN1",it)<br style="" class="">> Cn2 = wrf_user_getvar(a,"CCN2",it)<br style="" class="">> Cn3 = wrf_user_getvar(a,"CCN3",it)<br style="" class="">> Cn4 = wrf_user_getvar(a,"CCN4",it)<br style="" class="">> Cn5 = wrf_user_getvar(a,"CCN5",it)<br style="" class="">> Cn6 = wrf_user_getvar(a,"CCN6",it)<br style="" class="">> z = wrf_user_getvar(a,"z",it)<br style="" class="">> w = wrf_user_getvar(a,"wa",it) ; vertical<br style="" class="">> [updraft..??] velocity<br style="" class="">> <a style="" class="" ymailto="mailto:w@units" href="mailto:w@units">w@units</a> = "m/s"<br style="" class="">><br style="" class="">> p = wrf_user_getvar(a, "p",it)
;extract p and tk to<br style="" class="">> convert to STP<br style="" class="">> tk = wrf_user_getvar(a,"tk",it)<br style="" class="">> C1 = Cn1*((tk/p)*(P_std/T_std))<br style="" class="">> C2 = Cn2*((tk/p)*(P_std/T_std))<br style="" class="">> C3 = Cn3*((tk/p)*(P_std/T_std))<br style="" class="">> C4 = Cn4*((tk/p)*(P_std/T_std))<br style="" class="">> C5 = Cn5*((tk/p)*(P_std/T_std))<br style="" class="">> C6 = Cn6*((tk/p)*(P_std/T_std))<br style="" class="">> <a style="" class="" ymailto="mailto:C1@units" href="mailto:C1@units">C1@units</a> = "/cm^3"<br style="" class="">><br style="" class="">> C1_btm = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> C2_btm = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> C3_btm = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> C4_btm = new(
(/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> C5_btm = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> C6_btm = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">> SS = new( (/dimsNd(1),dimsNd(2)/),float )<br style="" class="">><br style="" class="">> do j = 0, dimsNd(1)-1<br style="" class="">> do i = 0, dimsNd(2)-1<br style="" class="">> if(c_btm(j,i) .eq. -1)<br style="" class="">> C1_btm(j,i) = 0.0<br style="" class="">> C2_btm(j,i) = 0.0<br style="" class="">> C3_btm(j,i) = 0.0<br style="" class="">> C4_btm(j,i) = 0.0<br style="" class="">> C5_btm(j,i) = 0.0<br style="" class="">>
C6_btm(j,i) = 0.0<br style="" class="">><br style="" class="">> else if(c_btm(j,i) .ne. -1) then<br style="" class="">> C1_btm(j,i) = ( C1(c_btm(j,i),j,i) )<br style="" class="">> C2_btm(j,i) = ( C2(c_btm(j,i),j,i) )<br style="" class="">> C3_btm(j,i) = ( C3(c_btm(j,i),j,i) )<br style="" class="">> C4_btm(j,i) = ( C4(c_btm(j,i),j,i) )<br style="" class="">> C5_btm(j,i) = ( C5(c_btm(j,i),j,i) )<br style="" class="">> C6_btm(j,i) = ( C6(c_btm(j,i),j,i) )<br style="" class="">><br style="" class="">> ; print("Cn1 = "
+C1_btm(j,i))<br style="" class="">> ; print("Cn2 = " +C2_btm(j,i))<br style="" class="">> ; print("Cn3 = " +C3_btm(j,i))<br style="" class="">> ; print("Cn4 = " +C4_btm(j,i))<br style="" class="">> ; print("Cn5 = " +C5_btm(j,i))<br style="" class="">> ; print("Cn6 = " +C6_btm(j,i))<br style="" class="">> print("| "+sprintf("%4.3f", C1_btm(j,i))+" | "+sprintf("%4.3f",<br style="" class="">> C2_btm(j,i))+" | "+sprintf("%4.3f", C3_btm(j,i))+" | "+\<br style="" class="">> sprintf("%4.3f", C4_btm(j,i))+" | "+sprintf("%4.3f", C5_btm(j,i))+" |<br style="" class="">> "+sprintf("%4.3f", C6_btm(j,i))+" |" )<br style="" class="">> end if<br style=""
class="">> end if<br style="" class="">> end do<br style="" class="">> end do<br style="" class="">><br style="" class="">> ;`````````````````````````````````````````````````````````````````````````````````<br style="" class="">><br style="" class="">> ; if(max_Nd(j,i) .le. C1_btm(j,i))<br style="" class="">> ; SS(j,i) = 0.01<br style="" class="">><br style="" class="">> ; else if(max_Nd(j,i) .gt. C1_btm(j,i) .and.<br style="" class="">> max_Nd(j,i) .le. C2_btm(j,i))<br style="" class="">> ; SS(j,i) = "0.02%"<br
style="" class="">><br style="" class="">> ; else if(max_Nd(j,i) .gt. C2_btm(j,i) .and.<br style="" class="">> max_Nd(j,i) .le. C3_btm(j,i))<br style="" class="">> ; SS(j,i) = "0.1%"<br style="" class="">><br style="" class="">> ; else if (max_Nd(j,i) .gt. C3_btm(j,i) .and.<br style="" class="">> max_Nd(j,i) .le. C4_btm(j,i))<br style="" class="">> ; SS(j,i) = "0.2%"<br style="" class="">><br style="" class="">> ; else if (max_Nd(j,i) .gt. C4_btm(j,i) .and.<br style="" class="">> max_Nd(j,i) .le. C5_btm(j,i))<br style="" class="">>
; SS(j,i) = "0.5%"<br style="" class="">><br style="" class="">> ; else if (max_Nd(j,i) .gt. C5_btm(j,i) .and.<br style="" class="">> max_Nd(j,i) .le. C6_btm(j,i))<br style="" class="">> ; SS(j,i) = "1.0%"<br style="" class="">> ; end if<br style="" class="">> ; end if<br style="" class="">> ; end if<br style="" class="">> ; end if<br style="" class="">>
; end if<br style="" class="">> ; end if<br style="" class="">><br style="" class="">> ;-------------------------------------------------------------------------------------------<br style="" class="">> ;Set some Basic Plot options<br style="" class="">> res = True<br style="" class="">> <a style="" class="" ymailto="mailto:res@tiMainString" href="mailto:res@tiMainString">res@tiMainString</a> = "CCN nmbr @: " +times(it) ; main<br style="" class="">> field title<br style="" class="">> mpres = True<br style="" class="">>
pltres = True<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnMaximize" href="mailto:res@gsnMaximize">res@gsnMaximize</a> = False<br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnFrame" href="mailto:res@gsnFrame">res@gsnFrame</a> = False<br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnDraw" href="mailto:res@gsnDraw">res@gsnDraw</a> = False<br style="" class="">> <a style="" class="" ymailto="mailto:res@cnFillOn"
href="mailto:res@cnFillOn">res@cnFillOn</a> = True<br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLinesOn" href="mailto:res@cnLinesOn">res@cnLinesOn</a> = False ; turn off contour<br style="" class="">> lines<br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLineLabelsOn" href="mailto:res@cnLineLabelsOn">res@cnLineLabelsOn</a> = False ; lables the data<br style="" class="">> on contours/map grids<br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColors" href="mailto:res@gsnSpreadColors">res@gsnSpreadColors</a> = True<br
style="" class="">> <a style="" class="" ymailto="mailto:res@lbOrientation" href="mailto:res@lbOrientation">res@lbOrientation</a> = "Horizontal" ;<br style="" class="">> orientates the linear scale<br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSelectionMode" href="mailto:res@cnLevelSelectionMode">res@cnLevelSelectionMode</a> = "ExplicitLevels"<br style="" class="">><br style="" class="">> ;-------------------------------------------------------------------------------------------<br style="" class="">> <a style="" class="" ymailto="mailto:res@tiYAxisString" href="mailto:res@tiYAxisString">res@tiYAxisString</a> = ""<br style="" class="">> <a style="" class=""
ymailto="mailto:res@tiXAxisString" href="mailto:res@tiXAxisString">res@tiXAxisString</a> = "Nmbr cont'n (/cm^3)"<br style="" class="">> <a style="" class="" ymailto="mailto:res@tiXAxisSide" href="mailto:res@tiXAxisSide">res@tiXAxisSide</a> = "Bottom"<br style="" class="">><br style="" class="">> ;<a style="" class="" ymailto="mailto:res@tiMainString" href="mailto:res@tiMainString">res@tiMainString</a> = "Droplet nmbr at: " +times(it)<br style="" class="">> contour_Nd = wrf_contour(a,wks,max_Nd,res)<br style="" class="">><br style="" class="">> plot_Nd = wrf_map_overlays(a,wks,(/contour_Nd/),pltres,res)<br style="" class="">> ; plots data on a map backgrnd<br style="" class="">> ; contour_Cn1 = wrf_contour(a,wks,C1_btm,res)<br
style="" class="">> ; plot_Cn1 = wrf_map_overlays(a,wks,(/contour_Cn1/),pltres,res)<br style="" class="">> ; contour_Cn2 = wrf_contour(a,wks,C2_btm,res)<br style="" class="">> ; plot_Cn2 = wrf_map_overlays(a,wks,(/contour_Cn2/),pltres,res)<br style="" class="">> ; contour_Cn3 = wrf_contour(a,wks,C3_btm,res)<br style="" class="">> ; plot_Cn3 = wrf_map_overlays(a,wks,(/contour_Cn3/),pltres,res)<br style="" class="">> ; contour_Cn4 = wrf_contour(a,wks,C4_btm,res)<br style="" class="">> ; plot_Cn4 = wrf_map_overlays(a,wks,(/contour_Cn4/),pltres,res)<br style="" class="">> ; contour_Cn5 = wrf_contour(a,wks,C5_btm,res)<br style="" class="">> ; plot_Cn5 =
wrf_map_overlays(a,wks,(/contour_Cn5/),pltres,res)<br style="" class="">> ; contour_Cn6 = wrf_contour(a,wks,C6_btm,res)<br style="" class="">> ; plot_Cn6 = wrf_map_overlays(a,wks,(/contour_Cn6/),pltres,res)<br style="" class="">><br style="" class="">> ; delete(contour_Nd)<br style="" class="">> ; delete(contour_Cn1)<br style="" class="">><br style="" class="">> ; map = wrf_map(wks,a,res)<br style="" class="">> ; overlay(map,contour_Nd)<br style="" class="">> ; overlay(map,contour_Cn1)<br style="" class="">> ; overlay(plot0,plot3)<br style="" class="">> ; gsn_panel(wks,plots,(/3,2/),True)<br style="" class="">> ; draw(plot)<br style="" class="">>
; frame(wks)<br style="" class="">> end do<br style="" class="">> end do<br style="" class="">><br style="" class="">> end<br style="" class="">><br style="" class="">> ---------------------------------------------------------------------------------------------------------------<br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions, subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a
style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/be554295/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/be554295/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 4<br style="" class="">Date: Mon, 4 Aug 2014 08:52:43 -0600<br style="" class="">From: Mary Haley <<a style="" class="" ymailto="mailto:haley@ucar.edu" href="mailto:haley@ucar.edu">haley@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] Running example scripts for beginners<br style="" class="">To: zilore mumba <<a style="" class="" ymailto="mailto:zmumba@yahoo.com" href="mailto:zmumba@yahoo.com">zmumba@yahoo.com</a>><br style="" class="">Cc: "<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a style="" class=""
ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CACNN_CJySFTTZvaJQbpnCE+<a style="" class="" ymailto="mailto:N3mBi3BncJCF7RxZHxgMmDd41nQ@mail.gmail.com" href="mailto:N3mBi3BncJCF7RxZHxgMmDd41nQ@mail.gmail.com">N3mBi3BncJCF7RxZHxgMmDd41nQ@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">?Zilore,<br style="" class=""><br style="" class="">WRF data is on a curvilinear grid, which means each data point is<br style="" class="">represented by a unique lat/lon value. You said that "wrf_map_overlays"<br style="" class="">didn't work for you, but it would help if you explain how it didn't work.<br style="" class=""> Did you get an error message? If so, include the error message. Did you<br style="" class="">get the wrong plot? If so, indicate this. The wrf_xxxx
scripts are tailored<br style="" class="">for WRF ARW data, so they should work pretty well.<br style="" class=""><br style="" class="">If you want to use the gsn_csm_xxxx scripts, you have to provide lat/lon<br style="" class="">information, because the gsn_csm_xxxx scripts are *not* tailored for WRF<br style="" class="">data. Otherwise NCL will have no way of knowing what map projection or<br style="" class="">where your data is supposed to be overlaid on the map.<br style="" class=""><br style="" class="">If you are trying to use gsn_csm_contour_map and gsn_csm_contour to contour<br style="" class="">WRF data, then I suggest visiting this page:<br style="" class=""><br style="" class="">?<a style="" class="" href="http://www.ncl.ucar.edu/Applications/wrfgsn.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/wrfgsn.shtml</a><br style="" class=""><br style="" class="">The first example, wrf_gsn_1.ncl, is the simplest one, but it only draws<br
style="" class="">one field on a map.<br style="" class=""><br style="" class="">The last example, wrf_gsn_5.ncl, shows how to overlay multiple fields on<br style="" class="">one plot. It shows how to use both gsn_csm_xxx scripts, or wrf_xxxx<br style="" class="">scripts. It's up to you which one you want.<br style="" class=""><br style="" class="">Please look at these examples and try one of them. If you continue to have<br style="" class="">problems, include your script again, but this time include more information<br style="" class="">about what is wrong.<br style="" class=""><br style="" class="">Thanks,<br style="" class=""><br style="" class="">--Mary<br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">On Fri, Aug 1, 2014 at 4:05 PM, zilore mumba <<a style="" class="" ymailto="mailto:zmumba@yahoo.com" href="mailto:zmumba@yahoo.com">zmumba@yahoo.com</a>> wrote:<br style="" class=""><br
style="" class="">> My sincere apologies for posting very basic issues. I have been trying to<br style="" class="">> make headway in learning ncl with very little progress. All the examples I<br style="" class="">> try do not seem to work. Examples,<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> wrfout_d01_2014-07-29_00^%00^%00.nc<br style="" class="">> <<a style="" class="" href="https://www.dropbox.com/s/aeoqmfgrk6pbd99/wrfout_d01_2014-07-29_00%5E%2500%5E%2500.nc" target="_blank">https://www.dropbox.com/s/aeoqmfgrk6pbd99/wrfout_d01_2014-07-29_00%5E%2500%5E%2500.nc</a>><br style="" class="">> zilore mumba shared from Dropbox<br style="" class="">> View on www.dropbox.com<br style="" class="">> <<a style="" class=""
href="https://www.dropbox.com/s/aeoqmfgrk6pbd99/wrfout_d01_2014-07-29_00%5E%2500%5E%2500.nc" target="_blank">https://www.dropbox.com/s/aeoqmfgrk6pbd99/wrfout_d01_2014-07-29_00%5E%2500%5E%2500.nc</a>><br style="" class="">> Preview by Yahoo<br style="" class="">><br style="" class="">><br style="" class="">> 1. I have tried the two examples on "wrf_map_overlay" examples found at<br style="" class="">> wrf_map_overlays<br style="" class="">> <<a style="" class="" href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml</a>> both<br style="" class="">> don't work for me, only modification being the filename (which works in<br style="" class="">> grads)<br style="" class="">> 2. I have tried the "Getting_started example 5"found at Getting started<br style="" class="">> using NCL - example 5 -
contour plots over maps<br style="" class="">> <<a style="" class="" href="https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml</a>>,<br style="" class="">> it does not work for me.<br style="" class="">> 3. I have tried *overlay_*" examples found at<br style="" class="">> <a style="" class="" href="https://www.ncl.ucar.edu/Applications/Scripts/overlay_1.ncl," target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/overlay_1.ncl, </a>they do not<br style="" class="">> work for me.<br style="" class="">> I would appreciate if someone can make overlay_1.ncl (below) work for me.<br style="" class="">> Modifications are a) my filename and longitude and latitude of my domain.<br style="" class="">> The wrf output file is attached if allowed since it is too large (through<br style="" class="">>
dropbox). I moved to Windows which does not allow : in file names.<br style="" class="">> The error I get is:<br style="" class="">> fatal:Dimension (bottom_top) of file (wrfout_d01_2014-07-29_00:00:00) does<br style="" class="">> not have an associated coordinate variable<br style="" class="">> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 16 in<br style="" class="">> file overlay_1.ncl<br style="" class="">><br style="" class="">> ;*************************************************<br style="" class="">> ; overlay_1.ncl<br style="" class="">> ;<br style="" class="">> ; Concepts illustrated:<br style="" class="">> ; - Overlaying line contours on filled contours<br style="" class="">> ; - Explicitly setting contour levels<br style="" class="">> ; - Selecting a different color map<br style="" class="">> ;<br style="" class="">>
;*************************************************<br style="" class="">><br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br style="" class="">><br style="" class="">> begin<br style="" class="">> a = addfile("wrfout_d01_2014-07-29_00:00:00.nc","r")<br style="" class="">> temp = a->T(0,{500},:,:)<br style="" class="">> uwnd = a->U(0,{500},:,:)<br style="" class="">><br style="" class="">> wks = gsn_open_wks("ps","overlay")<br style="" class="">> gsn_define_colormap(wks,"BlueDarkRed18") ; use the BlueDarkRed18<br style="" class="">> colormap<br style="" class="">><br style="" class="">> res = True<br style="" class="">> <a style="" class="" ymailto="mailto:res@mpFillOn" href="mailto:res@mpFillOn">res@mpFillOn</a> = False<br style=""
class="">> <a style="" class="" ymailto="mailto:res@mpMaxLatF" href="mailto:res@mpMaxLatF">res@mpMaxLatF</a> = -4.07 ; specify the plot domain<br style="" class="">> <a style="" class="" ymailto="mailto:res@mpMinLatF" href="mailto:res@mpMinLatF">res@mpMinLatF</a> = -21.9 ;<br style="" class="">> <a style="" class="" ymailto="mailto:res@mpMinLonF" href="mailto:res@mpMinLonF">res@mpMinLonF</a> = 17.25 ;<br style="" class="">> <a style="" class="" ymailto="mailto:res@mpMaxLonF" href="mailto:res@mpMaxLonF">res@mpMaxLonF</a> = 38.44 ;<br style="" class="">> <a style="" class=""
ymailto="mailto:sres@gsnFrame" href="mailto:sres@gsnFrame">sres@gsnFrame</a> = False ; do not advance the frame<br style="" class="">> <a style="" class="" ymailto="mailto:sres@cnLevelSelectionMode" href="mailto:sres@cnLevelSelectionMode">sres@cnLevelSelectionMode</a> = "ExplicitLevels" ; use explicit levels<br style="" class="">> <a style="" class="" ymailto="mailto:sres@cnLevels" href="mailto:sres@cnLevels">sres@cnLevels</a> = ispan(-5,35,5) ; set the contour levels<br style="" class="">><br style="" class="">> plot = gsn_csm_contour_map(wks,temp,res) ; create the temperature plot<br style="" class="">> plot_ov = gsn_csm_contour(wks,uwnd,sres) ; create the U-wind plot<br style="" class="">> overlay(plot,plot_ov)
; overlay the U-wind plot on<br style="" class="">> the temperature plot<br style="" class="">> draw(plot) ; draw the temperature plot<br style="" class="">> (with the U-wind plot overlaid)<br style="" class="">> frame(wks) ; advance the frame<br style="" class="">> end<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@mpOutlineOn" href="mailto:res@mpOutlineOn">res@mpOutlineOn</a> = True ; turn the map<br style="" class="">> outline on<br style="" class="">> <a style="" class=""
ymailto="mailto:res@gsnDraw" href="mailto:res@gsnDraw">res@gsnDraw</a> = False ; do not draw the plot<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> [image: image]<br style="" class="">> <<a style="" class="" href="https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml</a>><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> Getting started using NCL - example 5 - contour plots ov...<br style="" class="">> <<a style="" class="" href="https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml"
target="_blank">https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml</a>><br style="" class="">> NCL Home > Documentation > Manuals > Getting Started GSUN > Examples > 1 |<br style="" class="">> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11<br style="" class="">> View on www.ncl.ucar.edu<br style="" class="">> <<a style="" class="" href="https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml</a>><br style="" class="">> Preview by Yahoo<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> wrf_map_overlays<br style="" class="">> <<a style="" class=""
href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml</a>><br style="" class="">> NCL WRFUserARW.ncl functions (graphics routines)<br style="" class="">> View on www.ncl.ucar.edu<br style="" class="">> <<a style="" class="" href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml</a>><br style="" class="">> Preview by Yahoo<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions, subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk"
target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/2718eee8/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/2718eee8/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 5<br style="" class="">Date: Mon, 4 Aug 2014 08:55:42 -0600<br style="" class="">From: Dennis Shea <<a style="" class="" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] read separated files<br style="" class="">To: Yuqiang Zhang <<a style="" class=""
ymailto="mailto:yuqiangzhang.thu@gmail.com" href="mailto:yuqiangzhang.thu@gmail.com">yuqiangzhang.thu@gmail.com</a>><br style="" class="">Cc: NCL <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CAOF1d_4_aU1aywjH6CZvfAskDg276GTDvL+<a style="" class="" ymailto="mailto:3c6hhZeDPHYM2RQ@mail.gmail.com" href="mailto:3c6hhZeDPHYM2RQ@mail.gmail.com">3c6hhZeDPHYM2RQ@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">"ListSet Type" could be used but the following may be easier.<br style="" class=""><a style="" class="" href="https://www.ncl.ucar.edu/Document/Functions/Built-in/ListSetType.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/ListSetType.shtml</a><br style="" class=""><br style="" class="">Also,
your dats is type "short"<br style="" class=""><a style="" class="" href="https://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml</a><br style="" class=""><br style="" class="">========<br style="" class="">Please see 'addfiles'<br style="" class=""><br style="" class=""><a style="" class="" href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml</a><br style="" class=""><br style="" class="">===<br style="" class=""> scrDir0 = "/d1/zhangg/prec/"<br style="" class=""> scrFile0= systemfunc("cd "+ scrDir0 +" ; ls<br style="" class="">TPCAS-CMFD_V0105_B-01_"+year+".nc"<br style="" class=""> print(srcFile0)<br style="" class=""><br style="" class=""> na = addfiles(srcDir0+srcFile0, "r")<br style="" class=""><br style=""
class="">* pp = short2flt( na[:}->prec(:,107,302))*<br style="" class=""><br style="" class="">* printVarSummary(pp)*<br style="" class=""><br style="" class=""><br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">On Sat, Aug 2, 2014 at 10:35 AM, Yuqiang Zhang <<a style="" class="" ymailto="mailto:yuqiangzhang.thu@gmail.com" href="mailto:yuqiangzhang.thu@gmail.com">yuqiangzhang.thu@gmail.com</a>><br style="" class="">wrote:<br style="" class=""><br style="" class="">> Hi,<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> You can use this function ?ListSetType? to read different dimensions data<br style="" class="">> from multi files.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> Regards,<br style="" class="">><br style="" class="">> Yuqiang<br style="" class="">><br
style="" class="">><br style="" class="">><br style="" class="">> *From:* <a style="" class="" ymailto="mailto:ncl-talk-bounces@ucar.edu" href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a> [mailto:<a style="" class="" ymailto="mailto:ncl-talk-bounces@ucar.edu" href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a>] *On<br style="" class="">> Behalf Of *guozfruit<br style="" class="">> *Sent:* Saturday, August 02, 2014 11:38 AM<br style="" class="">> *To:* NCL<br style="" class="">> *Subject:* [ncl-talk] read separated files<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> Hi all,<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> I have 3-hr netcdf data in 12 separated files (ie for 12 months). I'm<br style="" class="">> trying to extract one grid preciptation for the whole year. I have
the<br style="" class="">> problem about how to define one variable with different dimensions when I<br style="" class="">> read data from different files. Could you please help me with it? Thanks.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> As below are the data info, and my script:<br style="" class="">><br style="" class="">> dimensions:<br style="" class="">><br style="" class="">> lon = 700 ;<br style="" class="">><br style="" class="">> lat = 400 ;<br style="" class="">><br style="" class="">> time = UNLIMITED ;<br style="" class="">><br style="" class="">> short prec(time, lat, lon) ;<br style="" class="">><br style="" class="">> prec:scale_factor = 0.002f ;<br style="" class="">><br style="" class="">> prec:add_offset = 50.f ;<br style="" class="">><br style="" class="">> prec:_Fill_Value =
-32767s ;<br style="" class="">><br style="" class="">> prec:missing_value = -32767s ;<br style="" class="">><br style="" class="">> prec:units = "mm hr-1" ;<br style="" class="">><br style="" class="">> prec:long_name = "Precipitation rate" ;<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> year = 2008<br style="" class="">><br style="" class="">> mon = 12<br style="" class="">><br style="" class="">> nhour = new(mon,integer)<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> if(year .eq. 2008) then<br style="" class="">><br style="" class="">> day_leap = (/31,29,31,30,31,30,31,31,30,31,30,31/)<br style="" class="">><br style="" class="">> do i =
0,mon-1<br style="" class="">><br style="" class="">> nhour(i) = day_leap(i)*8<br style="" class="">><br style="" class="">> end do<br style="" class="">><br style="" class="">> else<br style="" class="">><br style="" class="">> day_nonleap = (/31,28,31,30,31,30,31,31,30,31,30,31/)<br style="" class="">><br style="" class="">> do i = 0,mon-1<br style="" class="">><br style="" class="">> nhour(i) = day_nonleap(i)*8<br style="" class="">><br style="" class="">> end do<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> *pp = new((/12,nhour/),float)*<br style="" class="">><br style="" class="">> do imon = 1,12<br style="" class="">><br style="" class="">>
if(imon.lt.10) then<br style="" class="">><br style="" class="">> mon3 = "0"+imon<br style="" class="">><br style="" class="">> else<br style="" class="">><br style="" class="">> mon3 = ""+imon<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> scrDir0 = "/d1/zhangg/prec/"<br style="" class="">><br style="" class="">> do ifl = 0,nhour(imon-1)-1<br style="" class="">><br style="" class="">> na =<br style="" class="">> addfile(scrDir0+"prec_ITPCAS-CMFD_V0105_B-01_"+year+mon3+".nc","r")<br style="" class="">><br style="" class="">> * pp(imon-1,ifl) = na->prec(:,107,302)*<br style="" class="">><br style="" class="">> end do<br style="" class="">><br style=""
class="">> end do<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> X<br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions, subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/5bf2441c/attachment-0001.html"
target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/5bf2441c/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 6<br style="" class="">Date: Mon, 4 Aug 2014 15:16:12 +0000<br style="" class="">From: Lauren Jean Vargo <<a style="" class="" ymailto="mailto:lvargo@unm.edu" href="mailto:lvargo@unm.edu">lvargo@unm.edu</a>><br style="" class="">Subject: [ncl-talk] Using a loop to find values greater than 0<br style="" class=""> (calculate PDD)<br style="" class="">To: "<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID: <<a style="" class=""
ymailto="mailto:70D79029-3BC6-4860-8081-E5C280D91F93@unm.edu" href="mailto:70D79029-3BC6-4860-8081-E5C280D91F93@unm.edu">70D79029-3BC6-4860-8081-E5C280D91F93@unm.edu</a>><br style="" class="">Content-Type: text/plain; charset="Windows-1252"<br style="" class=""><br style="" class="">Hello, <br style="" class=""><br style="" class="">I?m having trouble doing a calculation with NCL, ultimately I am trying to calculate the Positive degree-day (PDD) sum. I?ve read in daily temperature data (which is 3D [time,lat,lon]). What I am trying to do is calculate the sum of the temperatures that are greater than 0C for 1 year. <br style="" class=""><br style="" class="">The way I was trying to do this was with a loop, and to first set any temperature less than or equal to zero, just to zero. Next I want to sum all the temperatures over 365 days at each lat & lon point. If there is an easier way to do this using NCL functions, that would be great. <br style=""
class=""><br style="" class="">The error message that I am getting is that the ?loop must be scalar". However, I?m not sure how to specify that I want the temperature value to be analyzed when tasC is (time,lat,lon).<br style="" class=""><br style="" class="">I?ve uploaded the file "tas_day_CCSM4_lgm_r2i1p1_18700101-19001231.nc? to the ftp account. <br style="" class=""><br style="" class="">I?m running ncl version 6.1.2, and the system is Darwin Kernel Version 13.3.0<br style="" class=""><br style="" class=""><br style="" class="">Here is the script: <br style="" class=""><br style="" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br style="" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br style="" class="">load ?$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br style="" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" <br style="" class=""><br style="" class="">begin<br
style="" class=""><br style="" class="">; Read in near surface air temperature (Ta) <br style="" class=""><br style="" class=""> a = addfile("tas_day_CCSM4_lgm_r2i1p1_18700101-19001231.nc","r") <br style="" class=""> tasL = a->tas(0:364,:,:) <br style="" class=""> tasC = tasL - 273.15 ; Convert K to C<br style="" class=""> print (tasC) <br style="" class=""> printVarSummary (tasC)<br style="" class=""><br style="" class=""> do tasC = 0,364<br style="" class=""> if (tasC .le. 0)<br style="" class=""> H = 0<br style="" class="">
end if<br style="" class=""> end do<br style="" class=""><br style="" class=""> PDD_sum = dim_cumsum_n_Wrap(tasC)<br style="" class=""><br style="" class="">end <br style="" class=""><br style="" class=""><br style="" class="">Any help would be greatly appreciated. <br style="" class=""><br style="" class="">Thanks, <br style="" class=""><br style="" class="">Lauren Vargo<br style="" class="">M.S. Candidate<br style="" class="">The University of New Mexico<br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 7<br style="" class="">Date: Mon, 4 Aug 2014 10:11:24 -0600<br style="" class="">From: Dennis Shea <<a style="" class="" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] Using a loop to
find values greater than 0<br style="" class=""> (calculate PDD)<br style="" class="">To: Lauren Jean Vargo <<a style="" class="" ymailto="mailto:lvargo@unm.edu" href="mailto:lvargo@unm.edu">lvargo@unm.edu</a>><br style="" class="">Cc: "<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CAOF1d_5=0d_Fd0HP_1aOnzafkOmiScwouqZhZbD=<a style="" class="" ymailto="mailto:dSzzozwDbw@mail.gmail.com" href="mailto:dSzzozwDbw@mail.gmail.com">dSzzozwDbw@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">The variable, tasC, is an *array *<br style="" class=""><br style="" class=""> tasC = tasL - 273.15 ;
Convert K to C<br style="" class=""> printVarSummary(tasC)<br style="" class=""><br style="" class="">You can not use an array as a loop variable ... in any language.<br style="" class=""><br style="" class=""> do tasC = 0,364<br style="" class=""><br style="" class="">could be, say,<br style="" class=""><br style="" class=""> do day = 0,364<br style="" class=""><br style="" class="">See:<br style="" class=""><a style="" class="" href="https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Loops" target="_blank">https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Loops</a><br style="" class=""><br style="" class="">Specifically:<br style="" class=""><br style="" class=""> do *loop_identifier* = *scalar_start_expr* ,<br style="" class=""><br style="" class="">*end_expr*<br style="" class=""><br style="" class="">*T*he "scalar_start_expr , end_expr" are scalar.<br style="" class=""><br
style="" class=""><br style="" class=""><br style="" class="">===<br style="" class=""><br style="" class=""> a = addfile("tas_day_CCSM4_lgm_<br style="" class="">r2i1p1_18700101-19001231.nc","r")<br style="" class=""> tasL = a->tas(0:364,:,:)<br style="" class=""><br style="" class=""> TIME = cd_calendar(tasL&time,0) ; TIME(ntim,6)<br style="" class=""> print(TIME)<br style="" class=""><br style="" class=""> tasC = tasL - 273.15 ; Convert K to C<br style="" class=""> tasC = where(tasC.gt.0.0, tasc, 0.0)<br style="" class=""> pdd =
dim_sum_n_Wrap(tasC, 0) ; (lat,lon)<br style="" class=""> <a style="" class="" ymailto="mailto:pdd@long_name" href="mailto:pdd@long_name">pdd@long_name</a> = "degree days for year="+toint(TIME(0,0))<br style="" class=""> <a style="" class="" ymailto="mailto:pdd@units" href="mailto:pdd@units">pdd@units</a> = "degC"<br style="" class=""><br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">On Mon, Aug 4, 2014 at 9:16 AM, Lauren Jean Vargo <<a style="" class="" ymailto="mailto:lvargo@unm.edu" href="mailto:lvargo@unm.edu">lvargo@unm.edu</a>> wrote:<br style="" class=""><br style="" class="">> Hello,<br style="" class="">><br style="" class="">> I?m having trouble doing a calculation with NCL, ultimately I am trying to<br style="" class="">> calculate the Positive degree-day
(PDD) sum. I?ve read in daily temperature<br style="" class="">> data (which is 3D [time,lat,lon]). What I am trying to do is calculate the<br style="" class="">> sum of the temperatures that are greater than 0C for 1 year.<br style="" class="">><br style="" class="">> The way I was trying to do this was with a loop, and to first set any<br style="" class="">> temperature less than or equal to zero, just to zero. Next I want to sum<br style="" class="">> all the temperatures over 365 days at each lat & lon point. If there is an<br style="" class="">> easier way to do this using NCL functions, that would be great.<br style="" class="">><br style="" class="">> The error message that I am getting is that the ?loop must be scalar".<br style="" class="">> However, I?m not sure how to specify that I want the temperature value to<br style="" class="">> be analyzed when tasC is (time,lat,lon).<br style="" class="">><br
style="" class="">> I?ve uploaded the file "tas_day_CCSM4_lgm_r2i1p1_18700101-19001231.nc? to<br style="" class="">> the ftp account.<br style="" class="">><br style="" class="">> I?m running ncl version 6.1.2, and the system is Darwin Kernel Version<br style="" class="">> 13.3.0<br style="" class="">><br style="" class="">><br style="" class="">> Here is the script:<br style="" class="">><br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br style="" class="">> load ?$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br style="" class="">> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br style="" class="">><br style="" class="">> begin<br style="" class="">><br style="" class="">> ; Read in near surface air temperature (Ta)<br style="" class="">><br style="" class="">>
a =<br style="" class="">> addfile("tas_day_CCSM4_lgm_r2i1p1_18700101-19001231.nc","r")<br style="" class="">> tasL = a->tas(0:364,:,:)<br style="" class="">> tasC = tasL - 273.15 ; Convert K to C<br style="" class="">> print (tasC)<br style="" class="">> printVarSummary (tasC)<br style="" class="">><br style="" class="">> do tasC = 0,364<br style="" class="">> if (tasC .le. 0)<br style="" class="">> H =
0<br style="" class="">> end if<br style="" class="">> end do<br style="" class="">><br style="" class="">> PDD_sum = dim_cumsum_n_Wrap(tasC)<br style="" class="">><br style="" class="">> end<br style="" class="">><br style="" class="">><br style="" class="">> Any help would be greatly appreciated.<br style="" class="">><br style="" class="">> Thanks,<br style="" class="">><br style="" class="">> Lauren Vargo<br style="" class="">> M.S. Candidate<br style="" class="">> The University of New Mexico<br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions, subscriber options, unsubscribe:<br style=""
class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/571eb834/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/571eb834/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 8<br style="" class="">Date: Mon, 4 Aug 2014 11:36:03 -0500<br style="" class="">From: Kyle Griffin <<a style="" class="" ymailto="mailto:ksgriffin2@wisc.edu" href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>><br style="" class="">Subject: Re: [ncl-talk]
Using a loop to find values greater than 0<br style="" class=""> (calculate PDD)<br style="" class="">To: Lauren Jean Vargo <<a style="" class="" ymailto="mailto:lvargo@unm.edu" href="mailto:lvargo@unm.edu">lvargo@unm.edu</a>><br style="" class="">Cc: "<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CAKt9o=gyy9Wtwyuv3J32VTubo9zrZVmFFh5LAuN5oju5F6=<a style="" class="" ymailto="mailto:8bg@mail.gmail.com" href="mailto:8bg@mail.gmail.com">8bg@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">This also sounds like an ideal spot for implementing the 'where' function.<br style="" class=""><br style=""
class=""><a style="" class="" href="https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml</a><br style="" class=""><br style="" class="">pos_dd = where(tasC.ge.0,tasC,<a style="" class="" ymailto="mailto:tasC@_FillValue" href="mailto:tasC@_FillValue">tasC@_FillValue</a>)<br style="" class="">total_pos_dd = dim_sum_n_Wrap(pos_dd,0)<br style="" class=""><br style="" class="">This will assign the missing value of tasC to any location in the array<br style="" class="">that is greater than or equal to zero and have each point less than zero<br style="" class="">assigned to the missing value (usually in the _FillValue attribute. If<br style="" class=""><a style="" class="" ymailto="mailto:tasC@_FillValue" href="mailto:tasC@_FillValue">tasC@_FillValue</a><br style="" class="">is not set, you can set it to anything). You can then add up the values<br style=""
class="">over the 0th dimension (time) to get a total at each lat/lon point.<br style="" class=""><br style="" class="">Hope that helps,<br style="" class=""><br style="" class=""><br style="" class="">Kyle<br style="" class=""><br style="" class="">----------------------------------------<br style="" class="">Kyle S. Griffin<br style="" class="">Department of Atmospheric and Oceanic Sciences<br style="" class="">University of Wisconsin - Madison<br style="" class="">Room 1421<br style="" class="">1225 W Dayton St, Madison, WI 53706<br style="" class="">Email: <a style="" class="" ymailto="mailto:ksgriffin2@wisc.edu" href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br style="" class=""><br style="" class=""><br style="" class="">On Mon, Aug 4, 2014 at 11:11 AM, Dennis Shea <<a style="" class="" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br style="" class=""><br style="" class="">> The variable,
tasC, is an *array *<br style="" class="">><br style="" class="">> tasC = tasL - 273.15 ; Convert K to C<br style="" class="">> printVarSummary(tasC)<br style="" class="">><br style="" class="">> You can not use an array as a loop variable ... in any language.<br style="" class="">><br style="" class="">> do tasC = 0,364<br style="" class="">><br style="" class="">> could be, say,<br style="" class="">><br style="" class="">> do day = 0,364<br style="" class="">><br style="" class="">> See:<br style="" class="">><br style="" class="">> <a style="" class="" href="https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Loops" target="_blank">https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Loops</a><br style="" class="">><br style="" class="">> Specifically:<br style="" class="">><br style="" class="">> do
*loop_identifier* = *scalar_start_expr* ,<br style="" class="">><br style="" class="">> *end_expr*<br style="" class="">><br style="" class="">> *T*he "scalar_start_expr , end_expr" are scalar.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> ===<br style="" class="">><br style="" class="">> a = addfile("tas_day_CCSM4_lgm_<br style="" class="">> r2i1p1_18700101-19001231.nc","r")<br style="" class="">> tasL = a->tas(0:364,:,:)<br style="" class="">><br style="" class="">> TIME = cd_calendar(tasL&time,0) ; TIME(ntim,6)<br style="" class="">> print(TIME)<br style="" class="">><br style="" class="">>
tasC = tasL - 273.15 ; Convert K to C<br style="" class="">> tasC = where(tasC.gt.0.0, tasc, 0.0)<br style="" class="">> pdd = dim_sum_n_Wrap(tasC, 0) ; (lat,lon)<br style="" class="">> <a style="" class="" ymailto="mailto:pdd@long_name" href="mailto:pdd@long_name">pdd@long_name</a> = "degree days for year="+toint(TIME(0,0))<br style="" class="">> <a style="" class="" ymailto="mailto:pdd@units" href="mailto:pdd@units">pdd@units</a> = "degC"<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> On Mon, Aug 4, 2014 at 9:16 AM, Lauren Jean Vargo <<a style="" class=""
ymailto="mailto:lvargo@unm.edu" href="mailto:lvargo@unm.edu">lvargo@unm.edu</a>> wrote:<br style="" class="">><br style="" class="">>> Hello,<br style="" class="">>><br style="" class="">>> I?m having trouble doing a calculation with NCL, ultimately I am trying<br style="" class="">>> to calculate the Positive degree-day (PDD) sum. I?ve read in daily<br style="" class="">>> temperature data (which is 3D [time,lat,lon]). What I am trying to do is<br style="" class="">>> calculate the sum of the temperatures that are greater than 0C for 1 year.<br style="" class="">>><br style="" class="">>> The way I was trying to do this was with a loop, and to first set any<br style="" class="">>> temperature less than or equal to zero, just to zero. Next I want to sum<br style="" class="">>> all the temperatures over 365 days at each lat & lon point. If there is an<br style="" class="">>>
easier way to do this using NCL functions, that would be great.<br style="" class="">>><br style="" class="">>> The error message that I am getting is that the ?loop must be scalar".<br style="" class="">>> However, I?m not sure how to specify that I want the temperature value to<br style="" class="">>> be analyzed when tasC is (time,lat,lon).<br style="" class="">>><br style="" class="">>> I?ve uploaded the file "tas_day_CCSM4_lgm_r2i1p1_18700101-19001231.nc? to<br style="" class="">>> the ftp account.<br style="" class="">>><br style="" class="">>> I?m running ncl version 6.1.2, and the system is Darwin Kernel Version<br style="" class="">>> 13.3.0<br style="" class="">>><br style="" class="">>><br style="" class="">>> Here is the script:<br style="" class="">>><br style="" class="">>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br style=""
class="">>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br style="" class="">>> load ?$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br style="" class="">>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br style="" class="">>><br style="" class="">>> begin<br style="" class="">>><br style="" class="">>> ; Read in near surface air temperature (Ta)<br style="" class="">>><br style="" class="">>> a =<br style="" class="">>> addfile("tas_day_CCSM4_lgm_r2i1p1_18700101-19001231.nc","r")<br style="" class="">>> tasL = a->tas(0:364,:,:)<br style="" class="">>> tasC = tasL - 273.15 ; Convert K to C<br style="" class="">>> print
(tasC)<br style="" class="">>> printVarSummary (tasC)<br style="" class="">>><br style="" class="">>> do tasC = 0,364<br style="" class="">>> if (tasC .le. 0)<br style="" class="">>> H = 0<br style="" class="">>> end if<br style="" class="">>> end do<br style="" class="">>><br style="" class="">>> PDD_sum = dim_cumsum_n_Wrap(tasC)<br style="" class="">>><br style="" class="">>> end<br style=""
class="">>><br style="" class="">>><br style="" class="">>> Any help would be greatly appreciated.<br style="" class="">>><br style="" class="">>> Thanks,<br style="" class="">>><br style="" class="">>> Lauren Vargo<br style="" class="">>> M.S. Candidate<br style="" class="">>> The University of New Mexico<br style="" class="">>> _______________________________________________<br style="" class="">>> ncl-talk mailing list<br style="" class="">>> List instructions, subscriber options, unsubscribe:<br style="" class="">>> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">>><br style="" class="">><br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style=""
class="">> List instructions, subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/17872935/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/17872935/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 9<br style="" class="">Date: Mon, 4 Aug 2014 10:52:57 -0600<br style="" class="">From: Mary Haley <<a style="" class="" ymailto="mailto:haley@ucar.edu"
href="mailto:haley@ucar.edu">haley@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] Strange white lines across plot<br style="" class="">To: Michael Notaro <<a style="" class="" ymailto="mailto:mnotaro@wisc.edu" href="mailto:mnotaro@wisc.edu">mnotaro@wisc.edu</a>><br style="" class="">Cc: "<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <<a style="" class="" ymailto="mailto:CACNN_CJk8ojmqz8L3oqZiTw2ERjJF6S3xmwprTO--fT7jtnTSQ@mail.gmail.com" href="mailto:CACNN_CJk8ojmqz8L3oqZiTw2ERjJF6S3xmwprTO--fT7jtnTSQ@mail.gmail.com">CACNN_CJk8ojmqz8L3oqZiTw2ERjJF6S3xmwprTO--fT7jtnTSQ@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br
style="" class="">Hi Michael,<br style="" class=""><br style="" class="">I really don't have any idea about this one. We did fix a bug in V6.1.2<br style="" class="">that caused thin white lines to show up, but this doesn't look like a case<br style="" class="">of that.<br style="" class=""><br style="" class="">Can you provide your VAR3 variable, say in a NetCDF file, so we can try<br style="" class="">running your script here?<br style="" class=""><br style="" class="">--Mary<br style="" class=""><br style="" class=""><br style="" class="">On Fri, Aug 1, 2014 at 4:10 PM, Michael Notaro <<a style="" class="" ymailto="mailto:mnotaro@wisc.edu" href="mailto:mnotaro@wisc.edu">mnotaro@wisc.edu</a>> wrote:<br style="" class=""><br style="" class="">><br style="" class="">> I am using NCL 6.1.2. Please see the attached plot<br style="" class="">><br style="" class="">> and note the odd white lines across the figure. Any<br style=""
class="">><br style="" class="">> idea what caused it and how to remove it?<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> The plotting lines are listed below.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> If I change the data values in the plot to some<br style="" class="">><br style="" class="">> arbitrary value, sometimes the lines go away.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> Michael<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> wks=gsn_open_wks("ps","bar_revised2")<br style="" class="">><br style="" class="">>
gsn_define_colormap(wks, "NCV_blue_red")<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> res = True<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnDraw" href="mailto:res@gsnDraw">res@gsnDraw</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnFrame" href="mailto:res@gsnFrame">res@gsnFrame</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnRasterModeOn" href="mailto:res@cnRasterModeOn">res@cnRasterModeOn</a>=True<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnFillDrawOrder" href="mailto:res@cnFillDrawOrder">res@cnFillDrawOrder</a> = "PreDraw"<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmXTOn"
href="mailto:res@tmXTOn">res@tmXTOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmXTBorderOn" href="mailto:res@tmXTBorderOn">res@tmXTBorderOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmYROn" href="mailto:res@tmYROn">res@tmYROn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmYRBorderOn" href="mailto:res@tmYRBorderOn">res@tmYRBorderOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmXBOn" href="mailto:res@tmXBOn">res@tmXBOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmXBBorderOn" href="mailto:res@tmXBBorderOn">res@tmXBBorderOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmYLOn"
href="mailto:res@tmYLOn">res@tmYLOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@tmYLBorderOn" href="mailto:res@tmYLBorderOn">res@tmYLBorderOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@lbLabelFont" href="mailto:res@lbLabelFont">res@lbLabelFont</a> = 25<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@lbLabelFontHeightF" href="mailto:res@lbLabelFontHeightF">res@lbLabelFontHeightF</a> = 0.012<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@lbBottomMarginF" href="mailto:res@lbBottomMarginF">res@lbBottomMarginF</a> = 0.5<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@lbTopMarginF" href="mailto:res@lbTopMarginF">res@lbTopMarginF</a> = 0.25<br style="" class="">><br style="" class="">> <a style=""
class="" ymailto="mailto:res@cnFillOn" href="mailto:res@cnFillOn">res@cnFillOn</a> = True<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLinesOn" href="mailto:res@cnLinesOn">res@cnLinesOn</a> = False<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSelectionMode" href="mailto:res@cnLevelSelectionMode">res@cnLevelSelectionMode</a> = "ManualLevels"<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> lower=int2flt(floattointeger(min(VAR3)*100.))/100.<br style="" class="">><br style="" class="">> upper=int2flt(floattointeger(max(VAR3)*100.))/100.<br style="" class="">><br style="" class="">> delta=fabs(lower-upper)<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> <a style="" class=""
ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=0.01<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> if ( (delta.ge.0.).and.(delta.lt.0.0025) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=0.00001<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if ( (delta.ge.0.0025).and.(delta.lt.0.025) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=0.0001<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if ( (delta.ge.0.025).and.(delta.lt.0.25) ) then<br
style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=0.001<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if ( (delta.ge.0.25).and.(delta.lt.2.5) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=0.01<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if ( (delta.ge.2.5).and.(delta.lt.25.0) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=0.1<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if (
(delta.ge.25.).and.(delta.lt.250) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=1.0<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if ( (delta.ge.250.).and.(delta.lt.2500.) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnLevelSpacingF" href="mailto:res@cnLevelSpacingF">res@cnLevelSpacingF</a>=10.0<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColors" href="mailto:res@gsnSpreadColors">res@gsnSpreadColors</a>=True<br style="" class="">><br style="" class="">><br style="" class="">><br style=""
class="">><br style="" class="">> if ( (lower.ge.0.).and.(upper.ge.0.) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColorStart" href="mailto:res@gsnSpreadColorStart">res@gsnSpreadColorStart</a>=120<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColorEnd" href="mailto:res@gsnSpreadColorEnd">res@gsnSpreadColorEnd</a>=2<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">> if ( (lower.le.0.).and.(upper.le.0.) ) then<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColorStart" href="mailto:res@gsnSpreadColorStart">res@gsnSpreadColorStart</a>=255<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColorEnd"
href="mailto:res@gsnSpreadColorEnd">res@gsnSpreadColorEnd</a>=137<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> if ( (lower.lt.0.).and.(upper.gt.0.) ) then<br style="" class="">><br style="" class="">> ratio=fabs(lower)/fabs(upper)<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColorStart" href="mailto:res@gsnSpreadColorStart">res@gsnSpreadColorStart</a>=255<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@gsnSpreadColorEnd" href="mailto:res@gsnSpreadColorEnd">res@gsnSpreadColorEnd</a>=128-floattointeger(128./ratio)<br style="" class="">><br style="" class="">> end if<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style=""
class="">> <a style="" class="" ymailto="mailto:res@cnMinLevelValF" href="mailto:res@cnMinLevelValF">res@cnMinLevelValF</a>=lower<br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@cnMaxLevelValF" href="mailto:res@cnMaxLevelValF">res@cnMaxLevelValF</a>=upper<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> <a style="" class="" ymailto="mailto:res@lbBoxLinesOn" href="mailto:res@lbBoxLinesOn">res@lbBoxLinesOn</a>=False<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> plot = gsn_csm_contour(wks, VAR3, res)<br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions,
subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/8f82b7fe/attachment-0001.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/8f82b7fe/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">Message: 10<br style="" class="">Date: Mon, 4 Aug 2014 10:58:51 -0600<br style="" class="">From: Mary Haley <<a style="" class="" ymailto="mailto:haley@ucar.edu"
href="mailto:haley@ucar.edu">haley@ucar.edu</a>><br style="" class="">Subject: Re: [ncl-talk] Fwd: Masking a U.S. county from a netcdf file<br style="" class="">To: Mohammadhassan Mohegh <<a style="" class="" ymailto="mailto:mohegh@usc.edu" href="mailto:mohegh@usc.edu">mohegh@usc.edu</a>><br style="" class="">Cc: ncl-talk <<a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br style="" class="">Message-ID:<br style="" class=""> <CACNN_CLmsqp6fP8Q50GDM=ebG+<a style="" class="" ymailto="mailto:4RZhFgugzK8c04fHkeExH-3A@mail.gmail.com" href="mailto:4RZhFgugzK8c04fHkeExH-3A@mail.gmail.com">4RZhFgugzK8c04fHkeExH-3A@mail.gmail.com</a>><br style="" class="">Content-Type: text/plain; charset="utf-8"<br style="" class=""><br style="" class="">Hi,<br style="" class=""><br style="" class="">You can use a combination of shapefiles and the "gc_inout" function in<br
style="" class="">order to collect values for a given county and get an average.<br style="" class=""><br style="" class="">My suggestion is to use the USA_adm2.shp shapefile downloaded from<br style="" class="">gadm.org/country, and then look at example "shapefiles_13.ncl" at:<br style="" class=""><br style="" class=""><a style="" class="" href="http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex13" target="_blank">http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex13</a><br style="" class=""><br style="" class="">You can also look at the example right after that, which does the same<br style="" class="">thing for the coastal counties of Germany, "<br style="" class="">Germany_coastal_counties_DEU_adm.ncl<br style="" class=""><<a style="" class="" href="http://www.ncl.ucar.edu/Applications/Scripts/Germany_coastal_counties_DEU_adm.ncl"
target="_blank">http://www.ncl.ucar.edu/Applications/Scripts/Germany_coastal_counties_DEU_adm.ncl</a>><br style="" class="">".<br style="" class=""><br style="" class="">The "shapefiles_13.ncl" example only does the counties of Georgia. Let me<br style="" class="">know if you need help extending it to do all the counties of the US. It<br style="" class="">would help, however, if you could provide me with your two WRF output files.<br style="" class=""><br style="" class="">--Mary<br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">On Thu, Jul 31, 2014 at 5:09 PM, Mohammadhassan Mohegh <<a style="" class="" ymailto="mailto:mohegh@usc.edu" href="mailto:mohegh@usc.edu">mohegh@usc.edu</a>><br style="" class="">wrote:<br style="" class=""><br style="" class="">><br style="" class="">> Hi<br style="" class="">><br style="" class="">> I'm working with WRF model output and I need to average the
differences of<br style="" class="">> 2 outputs within a county. Is there any way to do this? Are there<br style="" class="">> shapefiles or netcdf files available for US counties that NCL recognizes?<br style="" class="">><br style="" class="">> I have created a netcdf file containing these counties using ARCGIS. The<br style="" class="">> problem is that it does not have the same grid and I can't use the mask()<br style="" class="">> function with it. Does any one know of a<br style="" class="">><br style="" class="">> Thanks in advance for your help.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> --<br style="" class="">> Mohammadhassan Mohegh, PhD student<br style="" class="">> Astani Dept of Civil and Environmental Engineering<br style="" class="">> University of Southern California<br style="" class="">> 3620 South Vermont Ave, KAP227<br style=""
class="">> Los Angeles, CA<br style="" class="">> <a style="" class="" ymailto="mailto:mohegh@usc.edu" href="mailto:mohegh@usc.edu">mohegh@usc.edu</a><br style="" class="">><br style="" class="">> _______________________________________________<br style="" class="">> ncl-talk mailing list<br style="" class="">> List instructions, subscriber options, unsubscribe:<br style="" class="">> <a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class="">><br style="" class="">><br style="" class="">-------------- next part --------------<br style="" class="">An HTML attachment was scrubbed...<br style="" class="">URL: <a style="" class="" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/8992036d/attachment-0001.html"
target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/8992036d/attachment-0001.html </a><br style="" class=""><br style="" class="">------------------------------<br style="" class=""><br style="" class="">_______________________________________________<br style="" class="">ncl-talk mailing list<br style="" class=""><a style="" class="" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br style="" class=""><a style="" class="" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br style="" class=""><br style="" class=""><br style="" class="">End of ncl-talk Digest, Vol 129, Issue 4<br style="" class="">****************************************<br style="" class=""><br style="" class=""><br style="" class=""></div> </div> </div> </div> </div></body></html>