[ncl-talk] Wind direction variable

Alan Brammer abrammer at albany.edu
Sun Sep 20 13:04:21 MDT 2015


" the error."   What error?

  +sprintf("%dir0", dir0) +"  " \
^^ This isn't going to work.

Like all your other lines you probably want something like (assuming dir
and thus dir0 are floats).

  +sprintf("%4.1f", dir0) +"  " \




On Sat, Sep 19, 2015 at 1:31 AM, isakhar sakhar isakhar <
isakhar.inside13 at gmail.com> wrote:

> Dear Mr.Alan and all
>
> I just follow your link but I still get the error.
> I use the script below inside my ncl_script;
>
>               ; Wind direction at 10 Meters
>                r2d = 45.0/atan(1.0)
>                dir = atan2(u_plane,v_plane) * r2d + 180
>                dir0 = dir(x,y)
>
> And to print out I use the variable below but I get a strange output;
>
>              +sprintf("%dir0", dir0) +"  " \
>
>
> I will appreciate for any help or suggestion
>
> Soares
>
>
> On Sat, Sep 19, 2015 at 12:23 AM, Alan Brammer <abrammer at albany.edu>
> wrote:
>
>> This isn't really an NCL question.  The answer depends entirely on your
>> dataset.
>>
>> If you need to calc meteorological wind direction:
>>
>> https://www.ncl.ucar.edu/Document/Functions/Contributed/wind_direction.shtml
>>
>>
>> Alan.
>>
>> On Fri, Sep 18, 2015 at 4:52 AM, isakhar sakhar isakhar <
>> isakhar.inside13 at gmail.com> wrote:
>>
>>> Dear All
>>>
>>> So far I use a ncl script to print out variable for
>>> temperature,pressure, humidity and wind speed in ASCII file.
>>>
>>>   print (sprintf("%5.0f",it)    +" " \
>>>   +sprintf("%21.2f", T0(it)) +"  " \                ; for temperature
>>>   +sprintf("%19.2f", P(it)) +"  " \                  ; for pressure
>>>   +sprintf("%31.2f", rh0(it)) +"  " \               ; for humidity
>>>   +sprintf("%23.2f", windspd0(it)) +"  " )      ; for wind speed
>>>
>>>
>>> What variable should I use or add above to print out output for wind
>>> direction ?
>>>
>>> Thank you in advance,
>>>
>>> Soares
>>>
>>> _______________________________________________
>>> 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/20150920/dea458b6/attachment.html 


More information about the ncl-talk mailing list