[ncl-talk] wind_component not working for single values?

Bill Ladwig ladwig at ucar.edu
Thu Jul 13 09:48:16 MDT 2017


Hi Joe,

I think we're going to need to look at your script, because this works for
me (NCL 6.4.0):

ncl 1> uv = wind_component(17., 180., 0)
> ncl 2> print (uv)
>
> Variable: uv
> Type: float
> Total Size: 8 bytes
>             2 values
> Number of Dimensions: 2
> Dimensions and sizes:   [uv | 2] x [1]
> Coordinates:
> Number Of Attributes: 1
>   long_name :   zonal [0] and meridional [1] wind components
> (0,0)    0
> (1,0)   17


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?

Regards,

Bill


On Thu, Jul 13, 2017 at 8:47 AM, Joe Grim <grim at ucar.edu> wrote:

> Hi,
>
> 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:
> fatal:Number of subscripts (1) and number of dimensions (2) do not match
> for variable (uv)
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1279 in
> file /usr/local/ncl/lib/ncarg/nclscripts/csm/contributed.ncl
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 4 in
> file temp.ncl
>
> 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?
>
> Thanks!
>
> Joe
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170713/e7bf15cd/attachment.html 


More information about the ncl-talk mailing list