[Met_help] [rt.rap.ucar.edu #80271] History for I think I found a bug
John Halley Gotway via RT
met_help at ucar.edu
Wed Jul 10 17:01:11 MDT 2019
----------------------------------------------------------------
Initial Request
----------------------------------------------------------------
Hello met help team,
I think I found a bug in data2d_utils.cc, function rotate_uv_grid_to_earth:
It's about rotating to earth relative grid.
Instead of
// Rotate U component
u_rot = cosd(alpha_deg)*u + sind(alpha_deg)*v;
// Rotate V component
v_rot = -1.0*sind(alpha_deg)*u + cosd(alpha_deg)*v;
It should be
// Rotate U component
u_rot = cosd(alpha_deg)*u - sind(alpha_deg)*v;
// Rotate V component
v_rot = sind(alpha_deg)*u + cosd(alpha_deg)*v;
Could you please confirm this?
Concerning transforming WRF winds to "earth'" winds, one has also to consider the mapscale factors, right? I could not find this in the met-code so far
Cheers, Jonas Berndt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
----------------------------------------------------------------
Complete Ticket History
----------------------------------------------------------------
Subject: I think I found a bug
From: Randy Bullock
Time: Wed Apr 26 08:39:48 2017
Hello Jonas -
Thanks for your email.
You asked two questions in your email, one having to do with the
correct
placement of minus signs in the transformation equations, and the
other
involving map scale factors. I'll address the latter one first.
The equations would indeed have to involve map scale factors if the
wind
speed were given to us in terms of "grid units" per unit time. That's
not
the case in most datasets, however ... the wind components are given
in
meters per second or kilometers per hour; in other words in terms of a
"true" distance per unit time. That means that whoever produced the
data
has already handled issues involving map scale factors, and we, as
users of
that data, can only assume (or hope) that it's been done correctly.
So:
no, the equations don't need to handle map scale factors.
As for your other question, basically the difference between our
equations
and yours is a change in the sign of alpha_deg. It's entirely
possible
that we got the sign wrong (I found a minus sign error in some code
just
yesterday), but it seems to me that if we had gotten it wrong, it
would
have shown up before now. In any case, we'll do some checking on our
end
concerning this.
As a related matter, if you go to the documentation section of the MET
Users Page (link here
<http://www.dtcenter.org/met/users/docs/overview.php>)
and scroll down, there's a writeup I did concerning how map
projections
transform velocity vectors. The writeup is basically concerned with
drawing vectors correctly on a map, which isn't quite exactly your
question, but it does deal with the relationship between vector
components
relative to map coordinates versus components relative to cardinal
directions (east, north) that I think there's enough overlap with your
questions that you may find the writeup informative.
Thanks for your interest in MET!
Randy Bullock
On Wed, Apr 26, 2017 at 4:14 AM, Jonas Berndt via RT
<met_help at ucar.edu>
wrote:
>
> Wed Apr 26 04:14:31 2017: Request 80271 was acted upon.
> Transaction: Ticket created by j.berndt at fz-juelich.de
> Queue: met_help
> Subject: I think I found a bug
> Owner: Nobody
> Requestors: j.berndt at fz-juelich.de
> Status: new
> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80271 >
>
>
> Hello met help team,
>
> I think I found a bug in data2d_utils.cc, function
rotate_uv_grid_to_earth:
> It's about rotating to earth relative grid.
>
> Instead of
>
> // Rotate U component
> u_rot = cosd(alpha_deg)*u + sind(alpha_deg)*v;
>
> // Rotate V component
> v_rot = -1.0*sind(alpha_deg)*u + cosd(alpha_deg)*v;
>
>
> It should be
>
> // Rotate U component
> u_rot = cosd(alpha_deg)*u - sind(alpha_deg)*v;
>
> // Rotate V component
> v_rot = sind(alpha_deg)*u + cosd(alpha_deg)*v;
>
> Could you please confirm this?
> Concerning transforming WRF winds to "earth'" winds, one has also to
> consider the mapscale factors, right? I could not find this in the
met-code
> so far
>
> Cheers, Jonas Berndt
>
>
>
> ------------------------------------------------------------
> ------------------------------------
> ------------------------------------------------------------
> ------------------------------------
> Forschungszentrum Juelich GmbH
> 52425 Juelich
> Sitz der Gesellschaft: Juelich
> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt
(Vorsitzender),
> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> Prof. Dr. Sebastian M. Schmidt
> ------------------------------------------------------------
> ------------------------------------
> ------------------------------------------------------------
> ------------------------------------
>
>
>
------------------------------------------------
More information about the Met_help
mailing list