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

Dennis Shea shea at ucar.edu
Thu Jul 13 12:58:12 MDT 2017


As noted: This fails under 6.3.0 and  works for 6.4.0

My bad for not noting any 'bug fix' for the 6.4.0 release notes     :-(
    http://www.ncl.ucar.edu/current_release.shtml

My memory is that a change was made to specificall handle the case where
bot input arguments were scalars.

D

On Thu, Jul 13, 2017 at 9:57 AM, Guilherme Martins <jgmsantos at gmail.com>
wrote:

> Nice! :-)
>
>
>
> Em qui, 13 de jul de 2017 às 12:56, Joe Grim <grim at ucar.edu> escreveu:
>
>> Thank you, Guilherme and Bill!  I tried using both 6.3.0 and 6.4.0, and
>> both created the error.  Then, I checked in my .cshrc file and realized I
>> hadn't updated by $NCARG_ROOT from 6.3.0 to 6.4.0 (I had updated everything
>> else.)  It works now using 6.4.0.  It looks like it was a bug in 6.3.0.
>>
>> Sorry for my mistake.
>>
>> Joe
>>
>> On Thu, Jul 13, 2017 at 9:48 AM, Bill Ladwig <ladwig at ucar.edu> wrote:
>>
>>> 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
>>>>
>>>>
>>>
>> --
> ------------------------------------------------------------
> ------------------------------------
> Instituto Nacional de Pesquisas Espaciais (INPE)
> Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)
> Divisão de Satélites e Sistemas Ambientais (DSA)
> Programa de Monitoramento de Queimadas
> Telefone (INPE/CP): +55 12 3186-9205 <+55%2012%203186-9205> || Celular
> (TIM): +55 12 98111-4292 <+55%2012%2098111-4292>
> E-mail: guilherme.martins at inpe.br || jgmsantos at gmail.com
> Skype: guilherme.martins.
> Homepage: https://sites.google.com/site/jgmsantos
> Currículo Lattes: http://lattes.cnpq.br/5997657584785803
> ------------------------------------------------------------
> ------------------------------------
>
> _______________________________________________
> 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/c59df618/attachment.html 


More information about the ncl-talk mailing list