<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">You must make an effort to debug some of these problems on your own. The error is telling you that something is wrong around line 34 and it is telling you exactly what the problem is. Please try to fix this error.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you continue to have problems after fixing this error, then I need to ask you to provide the full script and data via ftp:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/ftp_files.shtml">http://www.ncl.ucar.edu/ftp_files.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">However, make sure you debug any other new problems that come up, instead of just emailing them to ncl-talk. We have a page to help you understand some of NCL's errors, and what causes them:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Language/error_messages.shtml">http://www.ncl.ucar.edu/Document/Language/error_messages.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">The particular error you're seeing can be found here:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Language/error_messages.shtml#NumSubRHS">http://www.ncl.ucar.edu/Document/Language/error_messages.shtml#NumSubRHS</a><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">As a side note, you are running a 3-year old version of NCL. I suggest that you upgrade to NCL V6.4.0.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 16, 2017 at 12:52 AM, 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>I simply include the code (which you mentioned) were I was taking the avg of the data as given below (please correct me if I did wrong)<br><br><br>;-----------------------------<wbr>------------------------------<wbr>-----------<span class=""><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_<wbr>055_grid1km)<br></span>printVarSummary (data)<br>printMinMax (data, 0)<br>print("-----")<br> nFill = num(ismissing(data))<br>print("nFill="+nFill)<br>print("-----")<span class=""><br><br> lat2d = a->GridLat_grid1km<br> lon2d = a->GridLon_grid1km<br></span>printMinMax (lat2d, 0)<br>printMinMax (lon2d, 0)<br>print("-----")<br><br>;---grid points of interest<br>;---<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/<wbr>Contributed/getind_latlon2d.<wbr>shtml</a><br> ; latv = (/22, 24.0, 24.0, 22.0, 22.0/)<span class=""><br> ; lonv = (/76, 76.0, 78.0, 78.0, 76.0/)<br><br></span> <span style="color:rgb(255,0,0)"><b>latv = (/ 22, 24/)<br> lonv = (/ 76, 78 /)<br> nm = getind_latlon2d (lat2d, lon2d, latv, lonv)<span class=""><br> ilt1 = nm(0,0) ; start lat index<br> ilt2 = nm(1,0) ; start lon index<br> iln1 = nm(0,1) ; end lat index<br> iln2 = nm(1,1) ; end lon index<br> var_subset = var(ilt1:ilt2,iln1:iln2)<br> var_subset_avg = avg(var_subset)</span></b></span><br><br> print(nm)<br> print("-----")<span class=""><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)) <br></span><span class=""> print(" "+data(:,n,m)) <wbr> ; nearest grid point at all time steps<br> print("-----")<br> end do<br><br><br><br><br><br></span></div><b>But still not getting the desired output as a single square box mean value . It is showing the errors as</b><br><br>kunal@kunal-Vostro-1015:/<wbr>media/Local Disk_/IIT_DELHI/2001/<wbr>MAIACTAOT_TIME$ ncl extract1.ncl <br> Copyright (C) 1995-2014 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.2.1<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br><br><br>Variable: fnames<br>Type: string<br>Total Size: 4 bytes<br> 1 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [1]<br>Coordinates: <br>(0) ./<a href="http://maiactaot.h00v02.20010040635-20011550640.nc" target="_blank">maiactaot.h00v02.<wbr>20010040635-20011550640.nc</a><br><br>Variable: data<br>Type: float<br>Total Size: 40320000 bytes<br> 10080000 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [time | 7] x [YDim_grid1km | 1200] x [XDim_grid1km | 1200]<br>Coordinates: <br> time: [8862.583333333314..12486.<wbr>66666666669]<br>Number Of Attributes: 8<br> coordinates : GridLat_grid1km, GridLon_grid1km<br> hdfeos_name : Optical_Depth_055<br> projection : Albers Conical Equal_Area<br> unit : None<br> long_name : AOT at 0.55 micron<br> _FillValue_original : -28672<br> _FillValue : -28672<br> valid_range : ( -0.1, 5 )<br>(0) AOT at 0.55 micron: min=0 max=3.924<br>(0) -----<br>(0) nFill=6285271<br>(0) -----<br>(0) latitude: min=21.86737357453027 max=34.99855492029426<br>(0) longitude: min=64.23634233372005 max=79.4747290253718<br>(0) -----<br><span style="color:rgb(255,0,0)">fatal:["Execute.c":7863]:<wbr>Number of subscripts on right-hand-side do not match<br> number of dimensions of variable: (2), Subscripts used: (3)<br><br>fatal:["Execute.c":8578]:<wbr>Execute: Error occurred at or near line 34 in file extract1.ncl<br><br>fatal:Variable (var_subset) is undefined<br>fatal:["Execute.c":8578]:<wbr>Execute: Error occurred at or near line 35 in file extract1.ncl</span><br><br><br><br><br>Variable: nm<br>Type: integer<br>Total Size: 16 bytes<br> 4 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [2] x [2]<br>Coordinates: <br>Number Of Attributes: 1<br> long_name : indices closest to specified LAT/LON coordinate pairs<br>(0,0) 1199<br>(0,1) 792<br>(1,0) 1199<br>(1,1) 1041<br>(0) -----<span class=""><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></span>(0) 24.26559325846936 77.93996773594735<br>(0) -28672<br>(1) 0.393<br>(2) -28672<br>(3) 0.156<br>(4) 0.313<span class=""><br>(5) -28672<br>(6) -28672<br>(0) -----<br><br></span><div><span class="HOEnZb"><font color="#888888"><br><br><br><br><br><br> <br></font></span><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_7618211217714691404gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><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></font></span><div><div class="h5">
<br><div class="gmail_quote">On Sat, Oct 14, 2017 at 12:24 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small">Kunal,</div><div style="font-size:small"><br></div><div style="font-size:small">Please include the code where you are actually taking the average of your data using the information returned from getind_latlon2d.</div><div style="font-size:small"><br></div><div style="font-size:small">It's important to note that getind_latlon2d simply returns the individual index values that are closest to each of the lat/lon pairs that you gave it. It doesn't work in such a way that you give it a lat/lon box and it returns all the values in that box. </div><div style="font-size:small"><br></div><div style="font-size:small">That's what I was trying to illustrate with the wrf_gsn_10.ncl I created. I gave the function two corners of the box, and then using the two pairs of index values I got back, I was able to get all the values inside the box area of interest:</div><div style="font-size:small"><br></div><div style="font-size:small"><div><font face="monospace, monospace"> lats = (/ min_lat, max_lat /)</font></div><div><font face="monospace, monospace"> lons = (/ min_lon, max_lon /)<br></font><div><font face="monospace, monospace"> nm = getind_latlon2d (lat2d, lon2d, lats, lons)</font></div><div><font face="monospace, monospace"> ilt1 = nm(0,0) ; start lat index</font></div><div><font face="monospace, monospace"> ilt2 = nm(1,0) ; start lon index</font></div><div><font face="monospace, monospace"> iln1 = nm(0,1) ; end lat index</font></div><div><font face="monospace, monospace"> iln2 = nm(1,1) ; end lon index<br> var_subset = var(ilt1:ilt2,iln1:iln2)</font></div><div><font face="monospace, monospace"> var_subset_avg = avg(var_subset)</font></div><span class="m_7618211217714691404gmail-HOEnZb"><font color="#888888"><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">--Mary</font></div><div><br></div></font></span></div></div></div><div class="m_7618211217714691404gmail-HOEnZb"><div class="m_7618211217714691404gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 12, 2017 at 1:19 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear Haley Ma'am,<div><br></div><div>Thanks for providing the information and <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0bbd9b95-cb2b-4f0a-b8b2-4edcfc107596" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">example. </span></div><div class="gmail_extra"><div><div class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail_signature"><div dir="ltr"><div dir="ltr"><div>But if I follow the getind_latlon2d function as I did, <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-1c477331-4a11-4c84-ad39-3a8ba33ef414" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">then</span> it seems like I followed the same procedure as given in the example <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Contributed/getin<wbr>d_latlon2d.shtml</a></div><div><br></div><div>But still I am not getting the mean of the grid box on every time step or am I reading incorrectly the result ?</div><div><br></div><div><br></div><div>regards</div><span class="m_7618211217714691404gmail-m_-7893384156443960248HOEnZb"><font color="#888888"><div>Kunal Bali<br></div><div><br></div><div><br></div><div><br></div><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></font></span></div></div></div></div><div><div class="m_7618211217714691404gmail-m_-7893384156443960248h5">
<br><div class="gmail_quote">On Fri, Oct 13, 2017 at 12:11 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small">Kunal,</div><div style="font-size:small"><br></div><div 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 style="font-size:small"><br></div><div style="font-size:small">You have to be careful with <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-1289eca5-8b9d-4751-8b41-203824a2d70e" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">subsetting</span> curvilinear data, because specifying a <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-f9850e60-a155-4ea7-8bbb-7b44d4bb976b" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">lat</span>/<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-a9f8cbe1-6e90-406d-9d33-36e9eb5603ab" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">lon</span> 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 style="font-size:small"><br></div><div style="font-size:small">See example wrf_gsn_10<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-400a1526-0159-44ad-9b85-2943a7748b6b" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">.</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-58d9264d-b4fb-44f7-a8d1-5273e9437d65" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">ncl</span> at:</div><div style="font-size:small"><br></div><div><a href="http://www.ncl.ucar.edu/Applications/wrfgsn.shtml#ex10" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/wrfgsn.shtml#ex10</a><br></div><div><br></div><div>--Mary</div><div><br></div><div style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-h5">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></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-h5"><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> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0eab2372-bf07-4566-8be4-194c036a7be5" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">dir</span> = "<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289eb66f378-df2f-4d2a-9b36-192d3bd52243" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289GINGER_SOFTWARE_mark">.</span>/"<br> fnames = systemfunc("ls " + dir + "maiactaot*.nc")<br><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-01b044f6-38bf-485e-acdf-ba1d22d492a4" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">print</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-adb5574c-48f3-4308-b709-4f2feea381d7" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0f74ff8f-0ce4-420a-81e6-bff096448b14" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">fnames</span>)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-29a33cf6-7d8b-42d2-a7a2-cc759938745b" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">a</span> = <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-41dd69d4-630b-4b7a-99f2-beefd157e052" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">addfile</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-ad398bb2-cf92-44ae-ab19-1f5afe3a7dd7" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-87206339-7931-4ae3-b2a1-079285d695c3" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">fnames</span>,"r")<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-bcae822f-609a-47c2-8824-3665cfd41e71" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">data</span> = short2flt<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-ac3b2eee-102a-4ed1-b9df-b3257ab6a9a6" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>a->Optical_Depth_055<wbr>_grid1km)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-219c3815-4e7b-4e5f-a3e6-d6a4a9b6a08f" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">nFill</span> = <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-bfaa5817-9b42-44ca-88ab-eff43b22b436" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">num</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-3659f5e6-ebcc-4fac-8c31-0bc9c70c1960" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-cf814eb0-0ab8-457e-86c8-ea3605715cb8" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">ismissing</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289efa1c965-9013-41b9-9c42-5be1289f675a" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289GINGER_SOFTWARE_mark">(</span>data))<br> lat2d = a->GridLat_grid1km<br> lon2d = a->GridLon_grid1km<br><br><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-04f30fc0-40ae-4d18-8ba4-5e77b3bf2f04" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">;</span>---grid points of interest<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-f3b93122-e518-4ae2-9fb9-0fd4b214dc3e" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">latv</span> = (/23.0/)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-115643a3-d152-4114-ba20-f1a60b04afd3" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">lonv</span> = (/77.0 /)<br> <br> nm = getind_latlon2d (lat2d,lon2d, latv, lonv)<br> <br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-099d53de-f551-4764-9543-8221a12abf0c" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">do</span> k=0<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-a69fa0cf-7759-4145-bdcf-d978798a71e9" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-3ba935a2-1b90-46bd-b638-0a071abbfc6b" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">dimsizes</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-76de012b-7e94-4223-96c8-d5547fdb1cc1" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-9a02ff64-99e8-4db4-aa9b-7a77268ca367" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">latv</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-a4c57e6b-18dc-4a07-a369-56bf54f86b40" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">)</span>-1<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0f8c0fe5-1980-431c-820a-15f372f351c0" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">n</span> = <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-7bb9a579-6d60-4292-8ff9-9f4e310f9d9c" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">nm</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-4d516442-f36a-4c47-a61c-94b85425d47e" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>k<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-1e0c19a9-d4ca-4a78-8688-9aa3a0e68224" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span>0)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-446a2187-9e79-4bde-850c-b105ae793c20" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">m</span> = <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289ea6e60ca-f646-4f45-a9b9-9f9264aa5877" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289GINGER_SOFTWARE_mark">nm</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-074d96f4-e799-43f9-b539-3c1a4fdfac89" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>k<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-8363988c-9f57-4aaa-bf35-7d0be783383e" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span>1)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-35df3b6d-3bb3-446b-a73f-f7189cccf843" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">print</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-9a0da512-5789-45e2-93b3-ed87c6139deb" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>lat2d<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-5dfb6b38-c317-46b6-a8d2-78e14ee6a2c1" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>n<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-1137e035-7e87-4678-888a-8d0a89811411" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span>m<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-5058d776-df51-4303-bfc8-b4191bad89eb" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">)</span>+" "+lon2d<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-d2d5e97e-676f-4384-abe0-898083cc7a94" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>n<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-276f3f05-2f4d-44b3-9e93-68e031c9fd57" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span>m))<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-4519e924-0bd5-4ac0-977e-76c89a450d87" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark"> ;</span> grid point location<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-f7f19858-5fb9-4ca5-8e98-4431cf8a937a" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">print</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-dfb984a4-43ea-4e52-bcaf-e1123af92a28" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>" "+data<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-61e5e32a-6ac6-482b-a3fe-3aaeb0328a9e" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>:<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-acebda5f-cde4-4701-84c7-9c54bdc02f2f" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span>n<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-332c9976-ed1b-45b3-a10c-447af1bff740" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">,</span>m))<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-7fedb156-b839-4bc1-b32e-1ca36913b12d" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark"> <wbr> ;</span> nearest grid point at all time steps<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0ceadbb8-787e-4a29-a45d-ad7c4143403f" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">print</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-88590e2e-6ab2-4f48-a268-30abf27307c0" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">(</span>"-----")<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0cca89c0-44cc-4b16-85cf-8350baa58bfe" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">end</span> 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> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-56a37e98-4e37-4030-99df-0773ca663e8d" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">latv</span> = (/22, 24.0, 24.0, 22.0, 22.0/)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-40988c35-c7dd-41f2-8a8e-342f5982734a" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">lonv</span> = (/76, 76.0, 78.0, 78.0, 76.0 /)<br><br><br><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0ff724fa-e29b-4eab-bbe1-b2de3975a31f" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">after</span> 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 <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-a1b9144a-5584-426f-b36b-f421fd1a6205" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">replacing</span> <br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-a8e90c83-2c3b-4487-9623-659592d903b2" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">latv</span> = (/23.0/)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-81e03fdc-a361-4f48-98ce-b7b19919e539" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">lonv</span> = (/77.0/)<div><div><div><div><br></div><div><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-523ff320-986b-48b4-9de2-d2b31c2fc288" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">with</span><br><br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-b72de5f5-11c2-4b2a-9b07-c6b5f0a43729" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">latv</span> = (/22, 24.0, 24.0, 22.0, 22.0/)<br> <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-23cf30b5-cd6b-4845-a2e5-656528aeaf35" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">lonv</span> = (/76, 76.0, 78.0, 78.0, 76.0 /)<br><br></div><div><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-533657e8-e50c-43eb-94bd-79f4eeacfce0" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">then</span> It's not giving <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-4560b2ea-4a62-4752-a123-7fad0b6e299f" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">mean</span> 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 <span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-caeb93ef-ff68-4e03-b87c-edd6fe4dd3d6" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">asciiwrite</span> 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><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-606478b4-8f99-4ef2-b02b-40b38fce9195" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">etc</span>.<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-4e9d351b-658a-4db2-8526-0d74705d8994" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">.</span><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-1eb96f87-eea9-4539-b3f0-b5bd67743d13" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">etc</span>..<br></div><div><br><br><br></div><div><span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-0241a938-1e80-41a1-a7fc-22ceaffd8f72" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">regards</span><span class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-m_2067925330722622683HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-m_2067925330722622683HOEnZb"><font color="#888888"><div><div><div><div class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-m_2067925330722622683m_-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></div></div>______________________________<wbr>_________________<br>
<span id="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-c5e5f52d-823e-4d15-8982-b06388b22bd1" class="m_7618211217714691404gmail-m_-7893384156443960248m_1683168822085668289gmail-GINGER_SOFTWARE_mark">ncl</span>-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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></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>