<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey Lin,<div class="">when dealing with non-monotonic arrays I usually employ the <font face="Menlo" class="">ind</font> function, so I don’t understand why is not working for you…</div><div class=""><br class=""></div><div class="">If you have, say, <font face="Menlo" class="">lon</font> and <font face="Menlo" class="">lat</font> arrays (<b class="">this assume to have them 1-Dimensio</b>nal, otherwise it gets fishy…).</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">min_lon= -50.</font></div><div class=""><font face="Menlo" class="">max_lon= -70.</font></div><div class=""><font face="Menlo" class="">min_lat= -180.</font></div><div class=""><font face="Menlo" class="">max_lat= -180.</font></div><div class=""><font face="Menlo" class="">box_lon= ind(lon.ge.min_lon .AND. lon.le.max_lon)</font></div><div class=""><div class=""><font face="Menlo" class="">box_lat= ind(lat.ge.min_lat .AND. lat.le.max_lat)</font></div></div><div class=""><br class=""></div><div class="">should give you exactly all the indices inside the user-prescribed area. Then you can subset using</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">var_box=var(:,box_lat,box_lon)</font></div><div class=""><br class=""></div><div class="">Please be reminded that box_values will have different dimensions, since it is a subset of the original variable.</div><div class="">Cheers,<br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Guido Cioni</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista.org" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 22 Aug 2016, at 01:13, 林祥 &lt;<a href="mailto:xianglin72@icloud.com" class="">xianglin72@icloud.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span id="cid:E18B13C8-D8C7-4DA5-B89B-AE8032041F39@mpi.zmaw.de">&lt;latitude.csv&gt;</span></div></blockquote></div><br class=""></div></body></html>