Vector arrows for primary wave direction

Matthias Fripp matthias.fripp at ECI.OX.AC.UK
Wed Nov 4 13:18:49 EST 2009


That's right -- I just checked this page ( http://polar.ncep.noaa.gov/waves/products.html
  ), which reports that the datasets use the "oceanographical
convention", and this page ( http://www.aims.gov.au/pages/facilities/oceanographic-buoys/ob-1.html
  ), which says that the oceanographic convention is to show "the
direction the current is flowing towards, measured in degrees
clockwise from North".

If you replace DIRPWsfc with (90 - DIRPWsfc), you can convert between
the two conventions. So that would give you

set gxout vector
display cos((90-DIRPWsfc) * 3.14159/180); sin((90-DIRPWsfc) *
3.14159/180)

Sorry about that -- I'm so used to the physicists' approach to angles
that I forgot about the real world!

Matthias

On Nov 4, 2009, at 6:10 PM, James T. Potemra wrote:

> Hi Nathan:
>
> Matthias suggestion is correct, but I think you need to be careful
> with
> the direction.  His calculation
> presumes that the direction is measured counterclockwise from the east
> (so a direction of zero would
> be a wave headed due east, direction 90 would be headed north, and so
> on).  The direction from the
> model is probably compass heading (0 is north).  So, you might have to
> add an extra step to convert
> the direction angle.
>
> Jim
>
> Nathan Cool wrote:
>> Thanks Matthias. I sure do appreciate the help. That produced some
>> interesting results, but it didn't seem accurate (arrows pointing in
>> some rather bizarre directions). Perhaps though this is a data
>> problem, and I need to grab different GRIB files? Currently, I'm
>> using
>> GRIBs from the NCEP server:
>> ftp://polar.ncep.noaa.gov/pub/waves/latest_run/
>>
>> -Nathan
>>
>>
>> On Wed, Nov 4, 2009 at 7:53 AM, Matthias Fripp
>> <matthias.fripp at eci.ox.ac.uk <mailto:matthias.fripp at eci.ox.ac.uk>>
>> wrote:
>>
>>    How about this:
>>
>>    set gxout vector
>>    display cos(DIRPWsfc * 3.14159/180); sin(DIRPWsfc * 3.14159/180)
>>
>>    This converts the wave direction from degrees to radians, and then
>>    calculates its u and v components.
>>
>>    Matthias
>>
>>    On Nov 4, 2009, at 2:38 PM, Nathan Cool wrote:
>>
>>>    Thanks, but I'm not trying to display "wind" vector arrows;
>>>    instead, I'm trying to display the primary wave direction.
>>>
>>>    The vars in the Grib are:
>>>    ------------------------
>>>    DIRPWsfc  0 107,1,1  ** surface Primary wave direction [deg]
>>>    DIRSWsfc  0 109,1,1  ** surface Secondary wave direction [deg]
>>>    HTSGWsfc  0 100,1,1  ** surface Sig height of wind waves and
>>>    swell [m]
>>>    PERPWsfc  0 108,1,1  ** surface Primary wave mean period [s]
>>>    PERSWsfc  0 110,1,1  ** surface Secondary wave mean period [s]
>>>    UGRDsfc  0 33,1,1  ** surface u wind [m/s]
>>>    VGRDsfc  0 34,1,1  ** surface v wind [m/s]
>>>    WDIRsfc  0 31,1,1  ** surface Wind direction [deg]
>>>    WINDsfc  0 32,1,1  ** surface Wind speed [m/s]
>>>    WVDIRsfc  0 101,1,1  ** surface Direction of wind waves [deg]
>>>    WVPERsfc  0 103,1,1  ** surface Mean period of wind waves [s]
>>>
>>>    ...and I can see that others have been able to show the primary
>>>    wave direction (DIRPWsfc) using vector arrows, as is the case on
>>>    the FNMOC models like this one:
>>>    https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif
>>>
>>>    Do you know how this can be done?
>>>
>>>    Thanks,
>>>
>>>    -Nathan
>>>
>>>
>>>    On Tue, Nov 3, 2009 at 9:58 PM, sushant puranik
>>>    <sushantpuranik at gmail.com <mailto:sushantpuranik at gmail.com>>
>>> wrote:
>>>
>>>        Hi
>>>        I am able to generate wind direction. try his
>>>        'set arrscl 1 30'
>>>        'set cthick 5'
>>>        'set arrowhead 0.10'
>>>        'set clevs 3 5 10 15 20 25'
>>>        'set ccols 0 4 1 2 3 5 12'
>>>        'set gxout vector'
>>>        'd
>>>        skip(UGRDsfc,2,2);skip(VGRDsfc,
>>> 2,2);skip(sqrt(UGRDsfc*UGRDsfc+VGRDsfc*VGRDsfc),2,2)'
>>>        'run cbar.gs <http://cbar.gs>'
>>>        'printim wind(m/s)'
>>>
>>>        with the help of such script i am able to generate output
>>>        which is attached with this mail.
>>>
>>>        all the best.
>>>
>>>
>>>        On Tue, Nov 3, 2009 at 9:45 PM, Nathan Cool
>>>        <nathan at nathancool.com <mailto:nathan at nathancool.com>> wrote:
>>>
>>>            Good morning everyone,
>>>
>>>            I'm generating wave analysis models, but I'm having a
>>>            tough time showing the mean-wave (or primary) wave
>>>            direction arrows.
>>>
>>>            The vars in the Grib are:
>>>            -------------------------------------------------
>>>            DIRPWsfc  0 107,1,1  ** surface Primary wave direction
>>> [deg]
>>>            DIRSWsfc  0 109,1,1  ** surface Secondary wave direction
>>>            [deg]
>>>            HTSGWsfc  0 100,1,1  ** surface Sig height of wind waves
>>>            and swell [m]
>>>            PERPWsfc  0 108,1,1  ** surface Primary wave mean
>>> period [s]
>>>            PERSWsfc  0 110,1,1  ** surface Secondary wave mean
>>>            period [s]
>>>            UGRDsfc  0 33,1,1  ** surface u wind [m/s]
>>>            VGRDsfc  0 34,1,1  ** surface v wind [m/s]
>>>            WDIRsfc  0 31,1,1  ** surface Wind direction [deg]
>>>            WINDsfc  0 32,1,1  ** surface Wind speed [m/s]
>>>            WVDIRsfc  0 101,1,1  ** surface Direction of wind waves
>>> [deg]
>>>            WVPERsfc  0 103,1,1  ** surface Mean period of wind
>>> waves [s]
>>>
>>>            For displaying wind vector arrows it's straightforward as
>>>            there are U and V variables (UGRDsfc and VGRDsfc) for the
>>>            zonal and meridional components. Displaying primary wave
>>>            direction though seems more elusive, yet I see it done on
>>>            many models such as the following:
>>>            https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif
>>>
>>>            ...which was generated using GrADS by FNMOC.
>>>
>>>            Any help you can provide would be greatly appreciated,
>>>            and thank you for your time.
>>>
>>>            --
>>>            Nathan Cool
>>>            nathan at nathancool.com <mailto:nathan at nathancool.com>
>>>
>>>
>>>
>>>
>>>        --
>>>        Sushant Puranik
>>>        Junior Research Fellow
>>>        Dept. of Atmospheric & Space Sciences,
>>>        University of Pune,
>>>        Pune-07,
>>>        India.
>>>
>>>
>>
>>



More information about the gradsusr mailing list