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