<div dir="ltr"><div>Unfortunately, that 'custom script' has disappeared.</div><div><br></div><div>[1] If the variable is on the file, then you can read it directly. If there are (say) 25 time steps but you only want 5 specified times,then:<br></div><div><br></div><div> it = ispan(7,11,1)</div><div> u = f->U(it,:,:,:)</div><div><br></div><div> even</div><div><br></div><div> it = (/3,7,8,9,21/)</div><div> u = f->U(it,:,:,:)</div><div><br></div><div>[2] I **speculate** that what was done was something like the following</div><div><br></div><div>undef("wrf_user_getvar_time_subset")<br>function wrf_user_getvar_time_subset(f, varName[1]:string, it[*]:integer)<br>local nit, dims, rank, n, x<br>begin<br> nit = dimsizes(it)<br> dims = getfilevardimsizes(f,varName)<br> rank = dimsizes(dims)<br> if (rank.eq.3) then<br> x = new((/nit,dims(1),dims(2)/),"float")<br> do n=0,nit-1<br> x(n,:,:) = wrf_user_getvar(f,varName,it(n))<br> end do<br> elseif (rank.eq.4) then<br> x = new((/nit,dims(1),dims(2),dims(3)/),"float")<br> do n=0,nit-1<br> x(n,:,:,:) = wrf_user_getvar(f, varName, it(n))<br> end do<br> end if<br><br> x!0 = "Time"<br> return(x)<br>end<br><br>;------------------<br> dirwrf = "./"<br> filwrf = "<a href="http://wrfout_d01_000000.nc">wrfout_d01_000000.nc</a>"<br> pthwrf = dirwrf+filwrf<br> fwrf = addfile(pthwrf,"r")<br><br> it = (/3,7,8,9,21/)<br> varName= "U"<br><br> u = wrf_user_getvar_time_subset(fwrf, varName, it)<br> printVarSummary(u)</div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 16, 2020 at 9:47 PM Dong via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi,</div><div>I'm using NCL 6.5 in Ununtu and have a question.</div><div><br></div><div>I found tha<font style="background-color:rgba(0,0,0,0);display:inline">t "wrf_user_getvar" only can get a specific time or all times but I want </font><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">to retrieve a subset of times.</font></div><font style="display:inline;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"> </div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">Fortunately ,I find a solution in your website </font></div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><a href="http://www.ncl.u" target="_blank">http://www.ncl.u</a></font><span style="font-family:Verdana;font-size:14px"><a href="http://car.edu/Support/talk_archives/2009/2720.html" target="_blank">car.edu/Support/talk_archives/2009/2720.html</a></span></div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><br></div><div style="display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">The website said there are two ways I can do this. My data is so big that I can't retrieve all times (the .ncl script will be killed without any <span style="font-family:"lucida Grande",Verdana,"Microsoft YaHei";background-color:rgba(0,0,0,0)">error message</span><span style="font-family:"lucida Grande",Verdana,"Microsoft YaHei";background-color:rgba(0,0,0,0)"> </span><span style="background-color:rgba(0,0,0,0)">)and I want to use the second way :</span></div><div style="display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><p style="font-family:"Microsoft YaHei";font-size:medium">load "./wrfslp.ncl" <br></p><p style="font-family:"Microsoft YaHei";font-size:medium">and then call with: <br></p><p style="font-family:"Microsoft YaHei";font-size:medium">times = ispan(0,10,1) <br></p><p style="font-family:"Microsoft YaHei";font-size:medium"></p><p style="font-family:"Microsoft YaHei";font-size:medium">slp = wrf_user_get_slp(z,times) </p></div><div style="display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">However, <span style="background-color:rgba(0,0,0,0)">I can't load </span><font style="background-color:rgba(0,0,0,0);display:inline">"./wrfslp.ncl" or download you attachment from your talk_archives: </font><font style="background-color:rgba(0,0,0,0);display:inline"><a href="http://www.ncl.u" target="_blank">http://www.ncl.u</a></font><span style="background-color:rgba(0,0,0,0)"><a href="http://car.edu/Support/talk_archives/2009/2720.html" target="_blank">car.edu/Support/talk_archives/2009/2720.html</a></span></div><div style="display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><span style="background-color:rgba(0,0,0,0)"> </span></div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">Any help greatly appreciated.</font></div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"> </font></div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">Thanks,</font></div><div style="font-family:"Microsoft YaHei";font-size:12px;display:block;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal"><font style="display:inline;font-size:14px;font-family:Verdana;color:rgb(0,0,0);background-color:rgba(0,0,0,0);font-weight:400;font-style:normal">Dong</font></div></font>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>