<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">How about this:<div><br></div><div>set gxout vector</div><div>display cos(DIRPWsfc * 3.14159/180);&nbsp;sin(DIRPWsfc&nbsp;* 3.14159/180)</div><div><br></div><div>This converts the wave direction from degrees to radians, and then calculates its u and v components.</div><div><br></div><div>Matthias</div><div><br><div><div>On Nov 4, 2009, at 2:38 PM, Nathan Cool wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Thanks, but I'm not trying to display "wind" vector arrows; instead, I'm trying to display the primary wave direction.<br><br>The vars in the Grib are:<br>------------------------<br><div id=":ai" class="ii gt"> DIRPWsfc &nbsp;0 107,1,1 &nbsp;** surface Primary wave direction [deg]<br> DIRSWsfc &nbsp;0 109,1,1 &nbsp;** surface Secondary wave direction [deg]<br> HTSGWsfc &nbsp;0 100,1,1 &nbsp;** surface Sig height of wind waves and swell [m]<br> PERPWsfc &nbsp;0 108,1,1 &nbsp;** surface Primary wave mean period [s]<br> PERSWsfc &nbsp;0 110,1,1 &nbsp;** surface Secondary wave mean period [s]<br> UGRDsfc &nbsp;0 33,1,1 &nbsp;** surface u wind [m/s]<br> VGRDsfc &nbsp;0 34,1,1 &nbsp;** surface v wind [m/s]<br> WDIRsfc &nbsp;0 31,1,1 &nbsp;** surface Wind direction [deg]<br> WINDsfc &nbsp;0 32,1,1 &nbsp;** surface Wind speed [m/s]<br> WVDIRsfc &nbsp;0 101,1,1 &nbsp;** surface Direction of wind waves [deg]<br> WVPERsfc &nbsp;0 103,1,1 &nbsp;** surface Mean period of wind waves [s]</div><br>...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:<br> <a href="https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif" target="_blank">https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif</a><br><br>Do you know how this can be done?<br><br> Thanks,<br><br>-Nathan<br><br><br><div class="gmail_quote">On Tue, Nov 3, 2009 at 9:58 PM, sushant puranik <span dir="ltr">&lt;<a href="mailto:sushantpuranik@gmail.com">sushantpuranik@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi<br>I am able to generate wind direction. try his <br>'set arrscl 1 30'<br>'set cthick 5'<br>'set arrowhead 0.10'<br>'set clevs 3 5 10 15 20 25'<br>'set ccols 0 4 1 2 3 5 12'<br>'set gxout vector'<br> 'd skip(UGRDsfc,2,2);skip(VGRDsfc,2,2);skip(sqrt(UGRDsfc*UGRDsfc+VGRDsfc*VGRDsfc),2,2)'<br>'run <a href="http://cbar.gs" target="_blank">cbar.gs</a>'<br>'printim wind(m/s)'<br><br>with the help of such script i am able to generate output which is attached with this mail.<br> <br>all the best.<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Nov 3, 2009 at 9:45 PM, Nathan Cool <span dir="ltr">&lt;<a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a>&gt;</span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Good morning everyone,<br><br>I'm generating wave analysis models, but I'm having a tough time showing the mean-wave (or primary) wave direction arrows. <br> <br> The vars in the Grib are:<br> -------------------------------------------------<br> DIRPWsfc &nbsp;0 107,1,1 &nbsp;** surface Primary wave direction [deg]<br> DIRSWsfc &nbsp;0 109,1,1 &nbsp;** surface Secondary wave direction [deg]<br> HTSGWsfc &nbsp;0 100,1,1 &nbsp;** surface Sig height of wind waves and swell [m]<br> PERPWsfc &nbsp;0 108,1,1 &nbsp;** surface Primary wave mean period [s]<br> PERSWsfc &nbsp;0 110,1,1 &nbsp;** surface Secondary wave mean period [s]<br> UGRDsfc &nbsp;0 33,1,1 &nbsp;** surface u wind [m/s]<br> VGRDsfc &nbsp;0 34,1,1 &nbsp;** surface v wind [m/s]<br> WDIRsfc &nbsp;0 31,1,1 &nbsp;** surface Wind direction [deg]<br> WINDsfc &nbsp;0 32,1,1 &nbsp;** surface Wind speed [m/s]<br> WVDIRsfc &nbsp;0 101,1,1 &nbsp;** surface Direction of wind waves [deg]<br> WVPERsfc &nbsp;0 103,1,1 &nbsp;** surface Mean period of wind waves [s]<br> <br>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:<br> <a href="https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif" target="_blank">https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif</a><br><br>...which was generated using GrADS by FNMOC.<br> <br> Any help you can provide would be greatly appreciated, and thank you for your time.<br><font color="#888888"><br>--<br>Nathan Cool<br><a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a><br> </font></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>Sushant Puranik<br>Junior Research Fellow<br>Dept. of Atmospheric &amp; Space Sciences,<br>University of Pune,<br>Pune-07,<br>India.<br> </font></blockquote></div><br></blockquote></div><br></div></body></html>