<div dir="ltr"><div>Different ... how?<br><br></div>You must provide more information. How is ncl-talk to know what the issue is?<br>You should put in print statements and track the program flow. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 4:04 AM, Ramchandra Karki <span dir="ltr"><<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hi<div>thank you. now file name is different but same data is outputed in all files? I wonder what could be the reason for this?<br><br><br><div><hr>Date: Mon, 9 May 2016 11:42:02 -0600<div><div class="h5"><br>Subject: Re: [ncl-talk] multiple ascii file outputs<br>From: <a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a><br>To: <a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a><br>CC: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br><br><div dir="ltr"><div style="font-size:small">I had an error. This line:</div><div style="font-size:small"><br></div><div style="font-size:small"><div style="font-size:12.8px"><div style="font-size:12.8px"><font face="monospace, monospace"> asciiwrite (fName , data)</font></div><div><font face="monospace, monospace"><br></font></div><span style="font-size:12.8px"></span></div><div style="font-size:12.8px"><font face="monospace, monospace"><br></font></div><div style="font-size:12.8px"><font face="monospace, monospace">Need to be just before the first "end do":</font></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div style="font-size:12.8px"><font face="monospace, monospace"> asciiwrite (fName , data)</font></div><span style="font-size:12.8px"></span></div><div style="font-size:12.8px"><div style="font-size:12.8px"><font face="monospace, monospace"> end do ; end of "ip" loop</font></div><div style="font-size:12.8px"><span style="font-family:monospace,monospace;color:rgb(80,0,80);font-size:12.8px">end do ; end of time loop</span><br></div><div style="font-size:12.8px"><font face="monospace, monospace">en</font>d</div></div><div style="font-size:12.8px"><font face="monospace, monospace"><br></font></div></div></div><div><br><div>On Mon, May 9, 2016 at 11:07 AM, Ramchandra Karki <span dir="ltr"><<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><div>Dear Mary</div><div>thank you very much for yoru response. i run the revised script from you but it is again giving output as a single ascii ouput as 18T1.... how could i get 19 individual stations files like 1<span style="font-family:monospace,monospace;font-size:12pt">T2oben_1kmtemp_rainnonc_rainc_raintot_wspd_wdir_snow_snowh.txt", 2</span><span style="font-family:monospace,monospace;font-size:12pt">T2oben_1kmtemp_rainnonc_rainc_raintot_wspd_wdir_snow_snowh.txt etc.</span></div><div><span style="font-family:monospace,monospace;font-size:12pt">regards</span></div><div><span style="font-family:monospace,monospace;font-size:12pt">ram</span></div><div><div><div><br></div><div><br></div><div><br><div dir="ltr"><div style="font-size:small">Please respond back to ncl-talk if you have follow-up questions. </div><div style="font-size:small"><br></div><div style="font-size:small">You have two sets of double do loops, where the first set of loops reads in the data, and the second loop tries to write it.</div><div style="font-size:small"><br></div><div style="font-size:small">The problem is that all the data you're reading in the first set of loops gets reset every time, so by the time you get to your second set of do loops, you don't have any of the original data left to write.</div><div style="font-size:small"><br></div><div style="font-size:small">You want to use just one set of do loops, so that you read in your data, and then immediately write it to a file before you then read the next set of data.</div><div style="font-size:small"><br></div><div style="font-size:small">I moved all your 'wrf_user_getvar' calls to the outside do loop, because they only change for every value of "it" and not for every value of "ip". It's time-consuming to have code in a loop that you don't need, so it's important to keep your "do" loops as clutter free as possible.</div><div style="font-size:small"><br></div><div style="font-size:small">This is UNTESTED:</div><div style="font-size:small"><br></div><div><div><br></div><div><font face="monospace, monospace"> ; -------------- LOAD FUNCTIONS AND PROCEDURES ----------------</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</font></div><div><font face="monospace, monospace"> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</font></div><div><font face="monospace, monospace"> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</font></div><div><font face="monospace, monospace"> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> ; -------------- BEGINING OF NCL SCRIPT ----------------</font></div><div><font face="monospace, monospace">begin</font></div><div><font face="monospace, monospace">DATADir = "/mnt/gpfs1/data/private/fgvy024/Build_WRF/WRFV6/run/"</font></div><div><font face="monospace, monospace">FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d03* ")</font></div><div><font face="monospace, monospace">numFILES = dimsizes(FILES)</font></div><div><font face="monospace, monospace">a = addfiles(FILES+".nc","r")</font></div><div><font face="monospace, monospace">times = wrf_user_list_times(a) ; get times in the file</font></div><div><font face="monospace, monospace">ntimes = dimsizes(times) ; number of times in the file or 1584 for domain1 4750</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">;new parameters naming</font></div><div><font face="monospace, monospace">temp = new(ntimes,float) </font></div><div><font face="monospace, monospace">rain_expp = new(ntimes,float) </font></div><div><font face="monospace, monospace">rain_conn = new(ntimes,float) </font></div><div><font face="monospace, monospace">rain_tot = new(ntimes,float)</font></div><div><font face="monospace, monospace">wspd = new(ntimes,float)</font></div><div><font face="monospace, monospace">wdir = new(ntimes,float)</font></div><div><font face="monospace, monospace">snoww_eq = new(ntimes,float)</font></div><div><font face="monospace, monospace">snowh_h = new(ntimes,float)</font></div><div><font face="monospace, monospace">;rhh = new(ntimes,float)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">ip_lats = (/ 27.3081, 27.6331,27.86,27.959167, \</font></div><div><font face="monospace, monospace"> 27.696667, 27.8024,27.8953, 27.99,27.9818, \ </font></div><div><font face="monospace, monospace"> 27.90506667, 27.89671667, 27.901, 27.8987, \</font></div><div><font face="monospace, monospace"> 27.89261111, 27.87828333, 27.85911111, \</font></div><div><font face="monospace, monospace"> 27.60111, 27.74661, 27.85722 /)</font></div><div><font face="monospace, monospace">ip_lons = (/ 86.5042, 86.2331, 86.46, 86.81278, 86.721389, 86.7144, \</font></div><div><font face="monospace, monospace"> 86.8188, 86.83, 86.7649, 86.37536667, 86.37428333, 86.37625, 86.37911667, \</font></div><div><font face="monospace, monospace"> 86.37594444,86.43361667, 86.43388889, 86.74028, 86.713, 86.79417 /)</font></div><div><font face="monospace, monospace">res = True </font></div><div><font face="monospace, monospace">res@returnInt = True </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">data = new(ntimes, "string") </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">;******************************* time loop</font></div><div><font face="monospace, monospace">do it = 0, ntimes-1 </font></div><div><font face="monospace, monospace"> tc2 = wrf_user_getvar(a,"T2",it) ; temp extraction</font></div><div><font face="monospace, monospace"> tc2 = tc2 -273.16</font></div><div><font face="monospace, monospace"> rain_exp = wrf_user_getvar(a,"RAINNC",it) </font></div><div><font face="monospace, monospace"> rain_con = wrf_user_getvar(a,"RAINC",it) </font></div><div><font face="monospace, monospace"> u10 = wrf_user_getvar(a,"U10",it) ; u at 10 m, mass point</font></div><div><font face="monospace, monospace"> v10 = wrf_user_getvar(a,"V10",it) ; v at 10 m, mass point</font></div><div><font face="monospace, monospace"> snow_eq = wrf_user_getvar(a,"SNOW",it)</font></div><div><font face="monospace, monospace"> snow_h = wrf_user_getvar(a,"SNOWH",it)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> ;************************************************</font></div><div><font face="monospace, monospace"> do ip = 0, 18 ;loop for number of station locations</font></div><div><font face="monospace, monospace"> point = wrf_user_ll_to_ij(a, ip_lons(ip), ip_lats(ip), True)</font></div><div><font face="monospace, monospace"> x = point(0) - 1</font></div><div><font face="monospace, monospace"> y = point(1) - 1 </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> temp(it) = tc2(y,x) ; temperature extraction for station location</font></div><div><font face="monospace, monospace"> rain_expp(it) = rain_exp(y,x)</font></div><div><font face="monospace, monospace"> rain_conn(it) = rain_con(y,x)</font></div><div><font face="monospace, monospace"> rain_tot(it) = rain_exp(y,x) + rain_con(y,x)</font></div><div><font face="monospace, monospace"> wspd(it) = ndtooned( sqrt(u10(y,x)^2 + v10(y,x)^2) )</font></div><div><font face="monospace, monospace"> wdir(it) = ndtooned( atan2(u10(y,x),v10(y,x))/0.01745329 +180. ) </font></div><div><font face="monospace, monospace"> snoww_eq(it) = snow_eq(y,x)</font></div><div><font face="monospace, monospace"> snowh_h (it) = snow_h(y,x)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">;---Create filename to write to</font></div><div><font face="monospace, monospace"> fName = ip+"T2oben_1kmtemp_rainnonc_rainc_raintot_wspd_wdir_snow_snowh.txt"</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> data (it)= (sprintf("%5.0f",it) +" " \</font></div><div><font face="monospace, monospace"> +sprintf("%21.2f", temp(it)) +" " \</font></div><div><font face="monospace, monospace"> +sprintf("%22.2f", rain_expp(it)) +" " \</font></div><div><font face="monospace, monospace"> +sprintf("%23.2f", rain_conn(it)) +" " \</font></div><div><font face="monospace, monospace"> +sprintf("%24.2f", rain_tot(it)) +" " \</font></div><div><font face="monospace, monospace"> +sprintf("%17.2f", wspd(it)) +" " \ </font></div><div><font face="monospace, monospace"> +sprintf("%25.2f", wdir(it)) +" " \ </font></div><div><font face="monospace, monospace"> +sprintf("%18.2f", snoww_eq(it)) +" " \</font></div><div><font face="monospace, monospace"> +sprintf("%19.2f", snowh_h(it)) +" " )</font></div><div><font face="monospace, monospace"> end do ; end of "ip" loop</font></div><div><font face="monospace, monospace"> asciiwrite (fName , data)</font></div><div><font face="monospace, monospace">end do ; end of time loop</font></div><div><font face="monospace, monospace">en</font>d</div><div style="font-size:small"><br></div></div></div><div><br><div>On Mon, May 9, 2016 at 10:23 AM, Ramchandra Karki <span dir="ltr"><<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Dear Mary<div>thank you very much. <span style="font-size:12pt">i am new to these things. the script is not giving errors but i am not getting what i am expecting. i want to get </span></div><div>-individual ascii file outputs for each stations (19 ascii files for 19 stations containing time series for whole period). would you please kindly suggest me where i need to change to get it?<br><div><div><br><i>Regards<br></i><div><i>ram</i></div><br><div><br></div><div><div><hr>Date: Mon, 9 May 2016 10:13:48 -0600<br>Subject: Re: [ncl-talk] multiple ascii file outputs<br>From: <a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a><br>To: <a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a><br>CC: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a></div><div><div><br><br><div dir="ltr"><div>It helps if you provide more information about what the problem is. Are you getting an error of any kind? If so, please indicate which line the error occurs on.</div><div><br></div><div>I think the problem is here:</div><div><br></div><div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> do ip = 0, 18</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> do it = 0,ntimes-1 ;ntimes-1</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> data (it)= (sprintf("%5.0f",it) +" " \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%21.2f", temp(it)) +" " \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%22.2f", rain_expp(it)) +" " \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%23.2f", rain_conn(it)) +" " \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%24.2f", rain_tot(it)) +" " \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%17.2f", wspd(it)) +" " \ </font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%25.2f", wdir(it)) +" " \ </font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%18.2f", snoww_eq(it)) +" " \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> +sprintf("%19.2f", snowh_h(it)) +" " )</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">end do</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> end do ; end of time loop</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"><br></font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace"> asciiwrite (fName , data)</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><br></div><div style="line-height:21.3px;color:rgb(68,68,68)">You have a double "do" loop, where "data" is getting created inside the inner do loop. For each iteration of "ip", then, the previous strings assigned to "data" are getting clobbered. In fact, I'm not even sure why you are looping across "ip=0,18", because the inside loop is doing the exact same thing every time.</div><div style="line-height:21.3px;color:rgb(68,68,68)"><br></div><div style="line-height:21.3px;color:rgb(68,68,68)">Finally, you call "asciiwrite", but this is only going to contain "data" from the last iteration of "ip" (ip=18).</div><div style="line-height:21.3px;color:rgb(68,68,68)">--Mary</div><div style="line-height:21.3px;color:rgb(68,68,68)"><br></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px"><br></div></div></div><div><br><div>On Sat, May 7, 2016 at 8:52 AM, Ramchandra Karki <span dir="ltr"><<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> Dear NCL help,</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">I am trying to extract multiple stations time series (ascci output for each stations) from wrfoutput file but i could not succeed in doing so. Would you please kindly guide me to get the solution?</div></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> ; -------------- LOAD FUNCTIONS AND PROCEDURES ----------------</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> ; -------------- BEGINING OF NCL SCRIPT ----------------</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">begin</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">DATADir = "/mnt/gpfs1/data/private/fgvy024/Build_WRF/WRFV6/run/"</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d03* ")</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">numFILES = dimsizes(FILES)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">a = addfiles(FILES+".nc","r")</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">times = wrf_user_list_times(a) ; get times in the file</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">ntimes = dimsizes(times) ; number of times in the file or 1584 for domain1 4750</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">;new parameters naming</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">temp = new(ntimes,float) </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_expp = new(ntimes,float) </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_conn = new(ntimes,float) </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_tot = new(ntimes,float)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">wspd = new(ntimes,float)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">wdir = new(ntimes,float)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">snoww_eq = new(ntimes,float)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">snowh_h = new(ntimes,float)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">;rhh = new(ntimes,float)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">;******************************* time loop</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">do it = 0, ntimes-1 </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">time = it</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> ;************************************************</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><span style="line-height:22.72px;font-size:12pt">do ip = 0, 18 ;loop for number of station locations</span></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">ip_lats = (/ 27.3081, 27.6331,<span style="line-height:21.3px;white-space:pre-wrap">        </span>27.86,<span style="line-height:21.3px;white-space:pre-wrap">        </span>27.959167, \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> 27.696667, 27.8024,<span style="line-height:21.3px;white-space:pre-wrap">        </span>27.8953, 27.99,<span style="line-height:21.3px;white-space:pre-wrap">        </span>27.9818, \ </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> 27.90506667, 27.89671667, 27.901, 27.8987, \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> 27.89261111, 27.87828333, 27.85911111, \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> 27.60111, 27.74661, 27.85722 /)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">ip_lons = (/ 86.5042, 86.2331, 86.46, 86.81278, 86.721389, 86.7144, \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> 86.8188, 86.83, 86.7649, 86.37536667, 86.37428333, 86.37625, 86.37911667, \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><span style="line-height:21.3px;white-space:pre-wrap">        </span> 86.37594444,<span style="line-height:21.3px;white-space:pre-wrap">        </span>86.43361667, 86.43388889, 86.74028, 86.713, 86.79417 /)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">res = True </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">res@returnInt = True </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">point = wrf_user_ll_to_ij(a, ip_lons(ip), ip_lats(ip), True)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">x = point(0) - 1</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">y = point(1) - 1 </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><span style="line-height:22.72px;font-size:12pt">tc2 = wrf_user_getvar(a,"T2",it) ; temp extraction</span></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">tc2 = tc2 -273.16</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">temp(it) = tc2(y,x) ; temperature extraction for station location</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_exp = wrf_user_getvar(a,"RAINNC",it) </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_con = wrf_user_getvar(a,"RAINC",it) </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_expp(it) = rain_exp(y,x)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_conn(it) = rain_con(y,x)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">rain_tot(it) = rain_exp(y,x) + rain_con(y,x)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">u10 = wrf_user_getvar(a,"U10",it) ; u at 10 m, mass point</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">v10 = wrf_user_getvar(a,"V10",it) ; v at 10 m, mass point</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">wspd(it) = ndtooned( sqrt(u10(y,x)^2 + v10(y,x)^2) )</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">wdir(it) = ndtooned( atan2(u10(y,x),v10(y,x))/0.01745329 +180. ) </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><span style="line-height:22.72px;font-size:12pt">snow_eq = wrf_user_getvar(a,"SNOW",it)</span></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">snow_h = wrf_user_getvar(a,"SNOWH",it)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">snoww_eq(it) = snow_eq(y,x)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">snowh_h (it) = snow_h(y,x)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">end do ; end of station loop</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">end do ; end of time loop</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> npts=ntimes</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> fName = ip+"T2oben_1kmtemp_rainnonc_rainc_raintot_wspd_wdir_snow_snowh.txt"</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> data = new( npts, "string") </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> ;print(" Time temp ")</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> do ip = 0, 18</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> do it = 0,ntimes-1 ;ntimes-1</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> data (it)= (sprintf("%5.0f",it) +" " \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%21.2f", temp(it)) +" " \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%22.2f", rain_expp(it)) +" " \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%23.2f", rain_conn(it)) +" " \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%24.2f", rain_tot(it)) +" " \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%17.2f", wspd(it)) +" " \ </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%25.2f", wdir(it)) +" " \ </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%18.2f", snoww_eq(it)) +" " \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> +sprintf("%19.2f", snowh_h(it)) +" " )</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">end do</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> end do ; end of time loop</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> asciiwrite (fName , data)</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">end</div><div><br></div><div><i><br></i></div>                                            </div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div></div></div></div></div></div>                                            </div></div>
</blockquote></div><br></div></div>                                            </div></div></div></div>
</blockquote></div><br></div></div></div></div></div>                                            </div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>