<div dir="ltr"><div class="gmail_default" style="font-size:small">I had an error. This line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default" style="font-size:12.8px"><div class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace">  asciiwrite (fName , data)</font></div><div><font face="monospace, monospace"><br></font></div><span class="im" style="font-size:12.8px"></span></div><div class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace">Need to be just before the first &quot;end do&quot;:</font></div><div class="gmail_default" style="font-size:12.8px"><br></div><div class="gmail_default" style="font-size:12.8px"><div class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace">    asciiwrite (fName , data)</font></div><span class="im" style="font-size:12.8px"></span></div><div class="gmail_default" style="font-size:12.8px"><div class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace">  end do                      ; end of &quot;ip&quot; loop</font></div><div class="gmail_default" 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 class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace">en</font>d</div></div><div class="gmail_default" style="font-size:12.8px"><font face="monospace, monospace"><br></font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 11:07 AM, Ramchandra Karki <span dir="ltr">&lt;<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>&gt;</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"><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&quot;, 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 class="h5"><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&#39;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&#39;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 &#39;wrf_user_getvar&#39; calls to the outside do loop, because they only change for every value of &quot;it&quot; and not for every value of &quot;ip&quot;.  It&#39;s time-consuming to have code in a loop that you don&#39;t need, so it&#39;s important to keep your &quot;do&quot; 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 &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</font></div><div><font face="monospace, monospace">    load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</font></div><div><font face="monospace, monospace">    load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</font></div><div><font face="monospace, monospace">    load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</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 = &quot;/mnt/gpfs1/data/private/fgvy024/Build_WRF/WRFV6/run/&quot;</font></div><div><font face="monospace, monospace">FILES = systemfunc (&quot; ls -1 &quot; + DATADir + &quot;wrfout_d03* &quot;)</font></div><div><font face="monospace, monospace">numFILES = dimsizes(FILES)</font></div><div><font face="monospace, monospace">a = addfiles(FILES+&quot;.nc&quot;,&quot;r&quot;)</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, &quot;string&quot;)   </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,&quot;T2&quot;,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,&quot;RAINNC&quot;,it) </font></div><div><font face="monospace, monospace">  rain_con = wrf_user_getvar(a,&quot;RAINC&quot;,it) </font></div><div><font face="monospace, monospace">  u10      = wrf_user_getvar(a,&quot;U10&quot;,it)    ; u at 10 m, mass point</font></div><div><font face="monospace, monospace">  v10      = wrf_user_getvar(a,&quot;V10&quot;,it)    ; v at 10 m, mass point</font></div><div><font face="monospace, monospace">  snow_eq  = wrf_user_getvar(a,&quot;SNOW&quot;,it)</font></div><div><font face="monospace, monospace">  snow_h   = wrf_user_getvar(a,&quot;SNOWH&quot;,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+&quot;T2oben_1kmtemp_rainnonc_rainc_raintot_wspd_wdir_snow_snowh.txt&quot;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">    data (it)= (sprintf(&quot;%5.0f&quot;,it)    +&quot; &quot; \</font></div><div><font face="monospace, monospace">          +sprintf(&quot;%21.2f&quot;, temp(it)) +&quot;  &quot; \</font></div><div><font face="monospace, monospace">          +sprintf(&quot;%22.2f&quot;, rain_expp(it)) +&quot;  &quot; \</font></div><div><font face="monospace, monospace">          +sprintf(&quot;%23.2f&quot;, rain_conn(it)) +&quot;  &quot; \</font></div><div><font face="monospace, monospace">          +sprintf(&quot;%24.2f&quot;, rain_tot(it)) +&quot;  &quot; \</font></div><div><font face="monospace, monospace">          +sprintf(&quot;%17.2f&quot;, wspd(it)) +&quot;  &quot; \ </font></div><div><font face="monospace, monospace">          +sprintf(&quot;%25.2f&quot;, wdir(it)) +&quot;  &quot; \ </font></div><div><font face="monospace, monospace">          +sprintf(&quot;%18.2f&quot;, snoww_eq(it)) +&quot;  &quot; \</font></div><div><font face="monospace, monospace">          +sprintf(&quot;%19.2f&quot;, snowh_h(it)) +&quot;  &quot; )</font></div><div><font face="monospace, monospace">  end do                      ; end of &quot;ip&quot; 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">&lt;<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>&gt;</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(&quot;%5.0f&quot;,it)    +&quot; &quot; \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%21.2f&quot;, temp(it)) +&quot;  &quot; \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%22.2f&quot;, rain_expp(it)) +&quot;  &quot; \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%23.2f&quot;, rain_conn(it)) +&quot;  &quot; \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%24.2f&quot;, rain_tot(it)) +&quot;  &quot; \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%17.2f&quot;, wspd(it)) +&quot;  &quot; \ </font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%25.2f&quot;, wdir(it)) +&quot;  &quot; \ </font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%18.2f&quot;, snoww_eq(it)) +&quot;  &quot; \</font></div><div style="line-height:21.3px;color:rgb(68,68,68)"><font face="monospace, monospace">          +sprintf(&quot;%19.2f&quot;, snowh_h(it)) +&quot;  &quot; )</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 &quot;do&quot; loop, where &quot;data&quot; is getting created inside the inner do loop.  For each iteration of &quot;ip&quot;, then, the previous strings assigned to &quot;data&quot; are getting clobbered.  In fact, I&#39;m not even sure why you are looping across &quot;ip=0,18&quot;, 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 &quot;asciiwrite&quot;, but this is only going to contain &quot;data&quot; from the last iteration of &quot;ip&quot; (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">&lt;<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>&gt;</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 &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">    load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">    load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">    load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</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 = &quot;/mnt/gpfs1/data/private/fgvy024/Build_WRF/WRFV6/run/&quot;</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">FILES = systemfunc (&quot; ls -1 &quot; + DATADir + &quot;wrfout_d03* &quot;)</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+&quot;.nc&quot;,&quot;r&quot;)</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,&quot;T2&quot;,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,&quot;RAINNC&quot;,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,&quot;RAINC&quot;,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,&quot;U10&quot;,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,&quot;V10&quot;,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,&quot;SNOW&quot;,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,&quot;SNOWH&quot;,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+&quot;T2oben_1kmtemp_rainnonc_rainc_raintot_wspd_wdir_snow_snowh.txt&quot;</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">    data  = new( npts, &quot;string&quot;)   </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">    ;print(&quot; Time temp &quot;)</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(&quot;%5.0f&quot;,it)    +&quot; &quot; \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%21.2f&quot;, temp(it)) +&quot;  &quot; \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%22.2f&quot;, rain_expp(it)) +&quot;  &quot; \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%23.2f&quot;, rain_conn(it)) +&quot;  &quot; \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%24.2f&quot;, rain_tot(it)) +&quot;  &quot; \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%17.2f&quot;, wspd(it)) +&quot;  &quot; \ </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%25.2f&quot;, wdir(it)) +&quot;  &quot; \ </div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%18.2f&quot;, snoww_eq(it)) +&quot;  &quot; \</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">          +sprintf(&quot;%19.2f&quot;, snowh_h(it)) +&quot;  &quot; )</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>