[Wrf-users] Grid Magnetic Angle
Bart Brashers
bbrashers at environcorp.com
Fri Jan 27 11:43:39 MST 2012
I noticed after I sent this that I have placed a project-specific range limit on the longitude (between 90E and 90W).
Please remove that if-then statement, or turn it into something more general, like:
if (lon > -999.) then
Bart
From: wrf-users-bounces at ucar.edu [mailto:wrf-users-bounces at ucar.edu] On Behalf Of Bart Brashers
Sent: Thursday, January 26, 2012 9:44 AM
To: wrf-users (wrf-users at ucar.edu)
Subject: Re: [Wrf-users] Grid Magnetic Angle
Here's the subroutine I use to convert to TRUE North (not magnetic North, but maybe you can tweak this for your needs):
subroutine uv2sd(u,v,lon,speed,dir)
!
! Converts U and V (vector components) to speed and direction.
! If lon >= -90., rotate the winds from the local projection to E-N.
!
USE met_fields
!-----Vars needed from met_fields:
! cenlat
! conefact
implicit none
!
!-----Variable declaration
!
real :: u,v,lon ! Vector components, Longitude
real :: speed,dir ! Output speed and direction
real :: lon_diff, sign
real, parameter :: pi = 3.14159265
real, parameter :: d2r = pi/180.
!
!-----Entry point
!
speed = sqrt(u**2 + v**2)
dir = atan2(u,v) / d2r ! in degrees, not radians
if (lon >= -90. .and. lon <= 90.) then
lon_diff = lon - clon
if ( lon_diff > 180. ) lon_diff = lon_diff - 360.
if ( lon_diff < -180. ) lon_diff = lon_diff + 360.
sign = 1 ! northern hemisphere
if (cenlat < 0.) sign = -1 ! southern hemisphere
dir = dir + lon_diff * conefact * sign
end if
if (dir < 0.) dir = dir + 360.
if (dir > 360.) dir = dir - 360.
end subroutine uv2sd
Bart Brashers
From: wrf-users-bounces at ucar.edu [mailto:wrf-users-bounces at ucar.edu] On Behalf Of Jason Padovani Ginies
Sent: Wednesday, January 25, 2012 11:49 PM
To: wrf-users
Subject: [Wrf-users] Grid Magnetic Angle
Dear all,
I am to understand that u- and v- wind components in WRF are given with respect to the x and y coordinates respectively according to Grid North. How would I go about converting from Grid north to magnetic North (Grid Magnetic angle) on a Lambert Conformal map?
Kind regards,
Jason
________________________________
This message contains information that may be confidential, privileged or otherwise protected by law from disclosure. It is intended for the exclusive use of the Addressee(s). Unless you are the addressee or authorized agent of the addressee, you may not review, copy, distribute or disclose to anyone the message or any information contained within. If you have received this message in error, please contact the sender by electronic reply to email at environcorp.com<mailto:email at environcorp.com> and immediately delete all copies of the message.
________________________________
This message contains information that may be confidential, privileged or otherwise protected by law from disclosure. It is intended for the exclusive use of the Addressee(s). Unless you are the addressee or authorized agent of the addressee, you may not review, copy, distribute or disclose to anyone the message or any information contained within. If you have received this message in error, please contact the sender by electronic reply to email at environcorp.com and immediately delete all copies of the message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/wrf-users/attachments/20120127/7357395b/attachment.html
More information about the Wrf-users
mailing list