<div dir="ltr">Hi Joe,<div><br></div><div>I think we're going to need to look at your script, because this works for me (NCL 6.4.0):</div><div><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"><span class="gmail-s1">ncl 1> uv = wind_component(17., 180., 0)<br></span><span class="gmail-s1">ncl 2> print (uv)</span><br><br><span class="gmail-s1">Variable: uv<br></span><span class="gmail-s1">Type: float<br></span><span class="gmail-s1">Total Size: 8 bytes<br></span><span class="gmail-s1"> 2 values<br></span><span class="gmail-s1">Number of Dimensions: 2<br></span><span class="gmail-s1">Dimensions and sizes: [uv | 2] x [1]<br></span><span class="gmail-s1">Coordinates: <br></span><span class="gmail-s1">Number Of Attributes: 1<br></span><span class="gmail-s1"> long_name : zonal [0] and meridional [1] wind components<br></span><span class="gmail-s1">(0,0) 0<br></span><span class="gmail-s1">(1,0) 17</span></blockquote><div><br></div><div>If you're able to run the code above via the NCL interpreter, then you should do a printVarSummary on the variables that you are passing to 'wind_component' to make sure it is what you think it is. If the code snippet above fails for you, what version of NCL are you using?</div><div><br></div><div>Regards,</div><div><br></div><div>Bill</div>
<p class="gmail-p2"><span class="gmail-s1"></span></p>
<p class="gmail-p2"><span class="gmail-s1"></span></p>
</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 13, 2017 at 8:47 AM, Joe Grim <span dir="ltr"><<a href="mailto:grim@ucar.edu" target="_blank">grim@ucar.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"><div><div><div><div>Hi,<br><br></div>When I try to use the valuable function "wind_component" with single values (e.g., uv = wind_component(17.0,180.,0)), I get the following error message:<br>fatal:Number of subscripts (1) and number of dimensions (2) do not match for variable (uv)<br>fatal:["Execute.c":8575]:<wbr>Execute: Error occurred at or near line 1279 in file /usr/local/ncl/lib/ncarg/<wbr>nclscripts/csm/contributed.ncl<br><br>fatal:["Execute.c":8575]:<wbr>Execute: Error occurred at or near line 4 in file temp.ncl<br><br></div>It looks like it expects "wspd" and "wdir" to have at least two elements in both arrays. I know how to program around this, but was wondering if the intention for this function was to also deal with single values for wspd and wdir?<br><br></div>Thanks!<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Joe<br></font></span></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>