<div dir="ltr">NCL support,<div><br></div><div>Is there any progress on this request? This issue keeps coming up in my work group. We perform a lot of generalized file handling. Thank you.</div><div><br></div><div>--Dave<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 12:30 PM, David Brown <span dir="ltr"><<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dave,<br>
This is a very good suggestion. We will create a ticket for it.<br>
-dave<br>
<br>
On Aug 22, 2013, at 12:06 PM, Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov">dave.allured@noaa.gov</a>> wrote:<br>
<br>
> NCL support,<br>
><br>
> This is a request for improved support for mixed types in coordinate<br>
> subscripting. For example, it is legal to subscript a double<br>
> coordinate with floats, but going the other way is an error. This<br>
> shows that type handling in simple NCL relational operators is more<br>
> liberal than in coordinate subscripting:<br>
><br>
> lats = (/ 0., 10., 20., 30., 40., 50., 60. /)<br>
> x = (/ 0, 111, 222, 333, 444, 555, 666 /)<br>
> x!0 = "lat"<br>
> y = x<br>
><br>
> x&lat = tofloat (lats)<br>
> y&lat = todouble (lats)<br>
><br>
> f1 = 20. ; floats<br>
> f2 = 40.<br>
> d1 = 20d ; doubles<br>
> d2 = 40d<br>
><br>
> ind1 = ind (y&lat .ge. f1 .and. y&lat .le. f2)<br>
> print (ind1+"")<br>
> print ("")<br>
><br>
> ind2 = ind (x&lat .ge. d1 .and. x&lat .le. d2)<br>
> print (ind2+"")<br>
> print ("")<br>
><br>
> sub1 = y({f1:f2}) ; float subscripts double<br>
> print (sub1&lat+" "+typeof(sub1&lat))<br>
> print ("")<br>
><br>
> sub2 = x({d1:d2}) ; double subscripts float<br>
> print (sub2&lat+" "+typeof(sub2&lat))<br>
><br>
> Result:<br>
><br>
> NCAR Command Language Version 6.1.2<br>
> (0) 2<br>
> (1) 3<br>
> (2) 4<br>
> (0)<br>
> (0) 2<br>
> (1) 3<br>
> (2) 4<br>
> (0)<br>
> (0) 20 double<br>
> (1) 30 double<br>
> (2) 40 double<br>
> (0)<br>
> fatal:Coordinate subscript type mismatch. Subscript (0) can not be<br>
> coerced to type of coordinate variable<br>
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 26 in<br>
> file mixed-mode-coord-subscripts.ncl<br>
><br>
> I think it would be generally helpful if coordinate subscripting could<br>
> be broadened to support all reasonable cases of mixed types. At a<br>
> minimum, please support the same combinations as for the relational<br>
> operators. I know that there are simple workarounds, but this<br>
> improvement would benefit simpler user code and generalized file<br>
> support. Thanks for your consideration.<br>
><br>
> --Dave A.<br>
> NOAA/PSD/CIRES Climate Analysis Branch<br></blockquote></div></div></div></div>