<div dir="ltr"><div class="gmail_default" style="font-size:small">There's an undocumented build-in function called "testspan" that may also do what you want. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It's never been made public and it is *not* guaranteed to live forever, so use at your own risk.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">These three statements should give you the same set of values:</div><div class="gmail_default" style="">
<p class="" style=""><font face="monospace, monospace"> ilat = ispan(-360, 360, 5) * 0.25</font></p><p class="" style=""><font face="monospace, monospace"> flat = fspan( -90, 90, 145)</font></p><p class="" style=""><font face="monospace, monospace"> lat = testspan( -90, 90, 1.25)</font></p><p class="" style="font-size:small">The next question is probably going to be: "why isn't this public"?</p><p class="" style="font-size:small">The answer is, "I don't remember". I think it has something to do with precision accuracy that can potentially cause a problem. Here's an example of where you would get different values, with a slight change in precision:</p><p class=""><font face="monospace, monospace"><span class="">f1 = testspan(1,9.999999,3) </span>; 1,4,7 </font><span style="font-family:monospace,monospace">f2 = testspan(1,9.9999999,3) </span><span class="" style="font-family:monospace,monospace">; 1,4,7,10 </span></p><p class=""><span class="">If you add a "d" to make the second argument a double, then you get better results:</span></p><p class=""><font face="monospace, monospace"><span class="">d1 = testspan(1,9.999999d,3) ; 1,4,7 <br></span>d2 = testspan(1,9.9999999d,3) ; 1,4,7</font></p><p class=""><span class="">--Mary</span></p><p class=""><span class=""><br></span></p><p class="" style="font-size:small"><br></p><p class="" style="font-size:small">--Mary</p><p class="" style="font-size:small"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 6:54 AM, Carl Schreck <span dir="ltr"><<a href="mailto:cjschrec@ncsu.edu" target="_blank">cjschrec@ncsu.edu</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">This is a feature I'd wanted too, so I wrote a simple little function to do it (attached). cspan (for Carl's span, because I couldn't think of anything more descriptive).<div><br></div><div> Carl</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 9:58 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please see 'fspan'<br>
<br>
xlow = 1e-7<br>
xhi = 4e-05<br>
xinc = 1e-7<br>
nn = toint((xhi-xlow)/xinc)+1<br>
<br>
x = fspan(xlow, xhi, nn)<br>
<br>
====<br>
*you* can create your own function<br>
<br>
function myspan(xlow, xhi, xinc)<br>
<br>
that will return the values<br>
<span><br>
On Fri, Oct 9, 2015 at 6:55 AM, Ahmad Farsyud <<a href="mailto:a.farsyud@gmail.com" target="_blank">a.farsyud@gmail.com</a>> wrote:<br>
</span><div><div>> Hallo,<br>
><br>
> Is there any solution to execute the following command:<br>
><br>
> ncl 0> x= ispan (1e-7,4e-5,1e-7)<br>
> fatal:ispan: arguments must be of an integral type, can't continue<br>
> fatal:["Execute.c":8573]:Execute: Error occurred at or near line 0<br>
><br>
> Thanks<br>
> Ahmad<br>
><br>
</div></div><div><div>> _______________________________________________<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><br>
><br>
_______________________________________________<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><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><table border="0" cellpadding="2" cellspacing="2" style="max-width:100%;border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-size:14px;border:3px solid rgb(170,170,170);font-family:Times;line-height:12px;background-color:transparent"><tbody><tr><td align="center" height="71" width="71"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><a href="http://www.cicsnc.org/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank"><img src="http://www.cicsnc.org/assets/images/cicsnc-logo.png" width="96" height="93"></a> <a href="http://www.researcherid.com/rid/B-8711-2011" target="_blank"><br></a></span></span><br><font size="4"><b style="text-align:start;color:rgb(38,58,143);font-family:arial,helvetica,sans-serif"> <a href="http://www.cyclonecenter.org/" style="color:rgb(38,58,143);text-decoration:none" target="_blank">Cyclone</a></b><a href="http://www.cyclonecenter.org/" style="text-align:start;color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;text-decoration:none" target="_blank">Center.org</a> </font></td><td valign="top"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><b>Carl J. Schreck III, PhD</b><br><b>Research Associate</b><br></span></span><a href="http://www.cicsnc.org/" style="font-family:arial,helvetica,sans-serif;font-size:11px;color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">Cooperative Institute for Climate and Satellites NC (CICS-NC)</a> /<br><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><a href="http://www.cicsnc.org/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">North Carolina Institute for Climate Studies (NCICS)</a> <br><a href="http://ncsu.edu/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">North Carolina State University</a><br><a href="http://ncei.noaa.gov/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">NOAA National Centers for Environmental Information (NCEI)</a><br>151 Patton Ave, Asheville, NC 28801<br>e: </span></span><a href="mailto:cjschrec@ncsu.edu" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">cjschrec@ncsu.edu</a><br style="font-family:arial,helvetica,sans-serif;font-size:11px"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif">o: <a href="tel:%2B1%20828%20257%203140" value="+18282573140" target="_blank">+1 828 257 3140</a><br></span></span><a href="http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">Publications</a><br><a href="http://monitor.cicsnc.org/mjo/" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">monitor.cicsnc.org/mjo</a><br style="font-family:arial,helvetica,sans-serif;font-size:11px"></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div>
</div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>