On Tue, Nov 3, 2009 at 11:15 AM, Nathan Cool <span dir="ltr"><<a href="mailto:nathan@nathancool.com">nathan@nathancool.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 0 107,1,1 ** surface Primary wave direction [deg]<br>
DIRSWsfc 0 109,1,1 ** surface Secondary wave direction [deg]<br>
HTSGWsfc 0 100,1,1 ** surface Sig height of wind waves and swell [m]<br>
PERPWsfc 0 108,1,1 ** surface Primary wave mean period [s]<br>
PERSWsfc 0 110,1,1 ** surface Secondary wave mean period [s]<br>
UGRDsfc 0 33,1,1 ** surface u wind [m/s]<br>
VGRDsfc 0 34,1,1 ** surface v wind [m/s]<br>
WDIRsfc 0 31,1,1 ** surface Wind direction [deg]<br>
WINDsfc 0 32,1,1 ** surface Wind speed [m/s]<br>
WVDIRsfc 0 101,1,1 ** surface Direction of wind waves [deg]<br>
WVPERsfc 0 103,1,1 ** 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></font></blockquote><div><br></div><div>Given the direction you should be able to construct a vector of magnitude 1 pointing the direction of the wave, say</div>
<div><br></div><div>ga-> display cos(0.01745*WVDIRsfc);sin(0.01745*WVDIRsfc)</div><div><br></div><div>The factor 0.01745 is the conversion of deg to radians. (This assumes that when the wave direction is 90 deg, the wave is going north).</div>
<div><br></div><div> Arlindo</div></div><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>