<div dir="ltr"><div class="gmail_default" style="font-size:small">Kunal,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I created an example for you, showing three ways you can subset a WRF grid (since I already had a similar example). It shows how to use the getind_latlon2d function.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You have to be careful with subsetting curvilinear data, because specifying a lat/lon box to take an average over can mean two different things. You will be able to see the difference when you look at the graphic.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See example wrf_gsn_10.ncl at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/wrfgsn.shtml#ex10">http://www.ncl.ucar.edu/Applications/wrfgsn.shtml#ex10</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 11, 2017 at 12:03 PM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Dear NCL users,<br></div><br>Single point coordinates values of 23.0 N and 77.0 E is extracted or print by using the script below<br><br>------------------------------<wbr>------------------------------<wbr>----------<br>; Main code<br>;-----------------------------<wbr>------------------------------<wbr>-----------<br> dir = "./"<br> fnames = systemfunc("ls " + dir + "maiactaot*.nc")<br>print(fnames)<br> a = addfile(fnames,"r")<br> data = short2flt(a->Optical_Depth_055<wbr>_grid1km)<br> nFill = num(ismissing(data))<br> lat2d = a->GridLat_grid1km<br> lon2d = a->GridLon_grid1km<br><br>;---grid points of interest<br> latv = (/23.0/)<br> lonv = (/77.0 /)<br> <br> nm = getind_latlon2d (lat2d,lon2d, latv, lonv)<br> <br> do k=0,dimsizes(latv)-1<br> n = nm(k,0)<br> m = nm(k,1)<br> print(lat2d(n,m)+" "+lon2d(n,m)) ; grid point location<br> print(" "+data(:,n,m)) <wbr> ; nearest grid point at all time steps<br> print("-----")<br> end do<br><br></div></div> <br>NOW, I want to extract the square grid box of 100 km around the coordinates (23N,77E) such as <br> latv = (/22, 24.0, 24.0, 22.0, 22.0/)<br> lonv = (/76, 76.0, 78.0, 78.0, 76.0 /)<br><br><br>after that I want to do the area mean of the grid box. So that I can get one single point value of that grid box.<br></div>So when I replacing <br> latv = (/23.0/)<br> lonv = (/77.0/)<div><div><div><div><br></div><div>with<br><br> latv = (/22, 24.0, 24.0, 22.0, 22.0/)<br> lonv = (/76, 76.0, 78.0, 78.0, 76.0 /)<br><br></div><div>then It's not giving mean of the square grid box. <br><br></div><div>It shows the something like that (given below), which is incorrect. So please let me know how can I get the square grid box mean and then extract as asciiwrite or print?<br><br>(0) 23.76603307545667 75.53995171540016<br>(0) 0.179<br>(1) 0.142<br>(2) -28672<br>(3) 0.169<br>(4) -28672<br>(5) -28672<br>(6) -28672<br>(0) -----<br>(0) 24.00322458681621 75.99551564353467<br>(0) 0.171<br>(1) 0.16<br>(2) -28672<br>(3) 0.17<br>(4) -28672<br>(5) -28672<br>(6) -28672<br><br></div><div>etc..etc..<br></div><div><br><br><br></div><div>regards<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><div><div><div><div class="m_-3126016792024081524gmail-m_-4699656085058546873gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
</div></div></font></span></div></div></div></div>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>