Lambert Conformal Wind Direction

Walsh, Brian J brian.walsh at AMEC.COM
Wed Jun 6 11:39:22 EDT 2007


Hi,
 
I was looking for some help in calculating wind directions from a model
on the Lambert Conformal grid.  The formula I use with other models (on
polar stereographic grids) doesn't work properly.
 
function uv2dir(u,v)
if (u = 0 & v > 0)
phi = 360
endif
if (u = 0 & v < 0)
phi = 180
endif
if (v = 0 & u > 0)
phi = 90
endif
if (v = 0 & u < 0)
phi = 270
endif
if (v = 0 & u = 0)
phi = 180
endif

theta=0
if (u > 0. & v > 0.)
theta = 180/3.1415*math_atan(v/u)
phi = 90. - theta
endif
if (u < 0. & v > 0.)
theta = 180/3.1415*math_atan(v/(-u))
phi = 270. + theta
endif
if (u < 0. & v < 0.0001)
theta = 180/3.1415*math_atan((-v)/(-u))
phi = 270. - theta
endif
if (u > 0. & v < 0.0001)
theta = 180/3.1415*math_atan((-v)/u)
phi = 90. + theta
endif
phi = phi - 180
if (phi <= 0.)
phi=phi+360.
endif
return (phi)
 
Any help would be appreciated.
 
Brian Walsh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20070606/7042779e/attachment.html 


More information about the gradsusr mailing list