The Weather Forecasting Forum

Discussions about the latest in meteorology, programs, tools, and techniques
It is currently Fri Oct 20, 2017 5:19 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Wind Direction U and V
PostPosted: Thu Apr 12, 2007 8:18 pm 
Offline
Member

Joined: Mon Sep 25, 2006 5:35 pm
Posts: 29
Hi Jeff,

I am using DEGRIB to convert grib2 files into a XML format, but i need to calulate wind direction and wind speed.

I believe this is stored in a grib message as

UGRD
VGRD
both in M/S

I used the formla atan2(y,x)

Where y is the V and x is U

is this correct? and is the output in DEG.

I am getting a little lost here, and wondered if you could help me out.

Ian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 2:16 am 
Offline
Senior Member

Joined: Fri Jun 25, 2004 11:42 pm
Posts: 298
Ian,

Well, you are half right...but not quite. Yes, UGRD & VGRD are the way wind is 'packed' into GRIB messages. However, the numbers are not straight forward. Here are the formulas to get wind speed (M/S) & direction (grid relative) from the U & V

DIRECTION=57.29578*(arctangent(UGRD,VGRD))+180.
SPEED=SQRT(UGRD*UGRD+VGRD*VGRD)

Clear as mud...right? In essence, the UGRD is the North/South wind component (North is + & South is -) and VGRD is the East/West wind component (East is + West is - [I think...]).

Remember...you asked for it ;-)

Thanks,
Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 7:23 am 
Offline
Member

Joined: Mon Sep 25, 2006 5:35 pm
Posts: 29
Hi Jeff,

Thanks for that. However (DIRECTION=57.29578*(arctangent(UGRD,VGRD))+180)

Does this formula work in what ever quadrant?

Or does the +180 change to suit V and U values?

i.e

180 if V>=0
0 if U<0 and V<0>0 and V<0

Ian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 8:13 am 
Offline
Member

Joined: Mon Sep 25, 2006 5:35 pm
Posts: 29
Hi again,

Tried the DIRECTION=57.29578*(arctangent(UGRD,VGRD))+180 Could not get it to work.

Entered DIRECTION=57.29578*(ATAN2(UGRD,VGRD))+180

Works OK - where U = 6 and V = 5, result dir= 220 deg

Speed = 8 m/s

Could you check it please.

Thanks
Ian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 7:01 pm 
Offline
Senior Member

Joined: Fri Jun 25, 2004 11:42 pm
Posts: 298
Ian,

Yes, those numbers look good. Sorry for the confusion; arctangent & ATAN2 were the same thing. I did not know if you knew Fortran functions so I wrote the formula out longhand.

Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 9:09 pm 
Offline
Member

Joined: Mon Sep 25, 2006 5:35 pm
Posts: 29
Jeff,

No probs mate for the confusion, just glad you could help me out.

While Iam picking your brain for the maths, perhaps you would be able to help me out again.

I have two more calcs to do

1. PRATE, [kg/(m^2 s) to mm/h
2. Weather strings.

Now i was going to use the DAVIS weather software which came with my weather station to give a description of the weather based on the output of the GRIB model, but this is only based on pressure trends.
Is there a WMO standard for simple weather strings. I have looked on google, but have not found anything as of yet which made much sence to me.

Ian.

P.S
Wingridds is getting better with every relaese - keep up the good work.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 2:15 am 
Offline
Senior Member

Joined: Fri Jun 25, 2004 11:42 pm
Posts: 298
Ian,

Sorry...I don't really follow what it is you are trying to accomplish. Can you be more 'verbose' in your explaination? ;-)

Thanks,
Jeff


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group