DESCRIPTION OF CHANGES:
Possible fix of the wind field issue. Comparing the previous algorithm with the one from Wikipedia's rotation matrix page shows that an addition was happening when there should have been a subtraction.
Old Rotational Algorithm:
u = u cos(theta) + v sin(theta)
v = u sin(theta) + v cos(theta)
New Rotational Algorithm
u = u cos(theta) - v sin(theta)
v = u sin(theta) + v cos(theta)
TESTS CONDUCTED:
Comparing the results of zoomed in wind fields of the two methods show a small difference:
It is difficult to tell simply by looking if the wind field is corrected. To understand more, here is a unit circle, created by an initial vector of length one (x=1,y=0) and then rotating it at 5 degree increments. This uses the rotation matrix algorithm based on the Wikipedia page.
Here is the same plot but estimating the error from the other algorithm. At each point of the previous unit circle, the old algorithm is used to rotate the vector a further 360 degrees, at 5 degree increments. The output is graphed using the starting vector's color to demonstrate the error from the old rotational algorithm can lead to widely differing results based on the starting vectors position.
NOTES:
This still hasn't "proven" that the winds are being shifted correctly though. It might be worth it to create a forcing wind field with all the same values and then graph the forcing wind field and ICAR's rotated wind field to see if the input and outputs match what is expected.
TYPE: Bug Fix
SOURCE: Soren Rasmussen, NCAR
DESCRIPTION OF CHANGES: Possible fix of the wind field issue. Comparing the previous algorithm with the one from Wikipedia's rotation matrix page shows that an addition was happening when there should have been a subtraction.
Old Rotational Algorithm:
New Rotational Algorithm
TESTS CONDUCTED: Comparing the results of zoomed in wind fields of the two methods show a small difference:
It is difficult to tell simply by looking if the wind field is corrected. To understand more, here is a unit circle, created by an initial vector of length one (x=1,y=0) and then rotating it at 5 degree increments. This uses the rotation matrix algorithm based on the Wikipedia page.
Here is the same plot but estimating the error from the other algorithm. At each point of the previous unit circle, the old algorithm is used to rotate the vector a further 360 degrees, at 5 degree increments. The output is graphed using the starting vector's color to demonstrate the error from the old rotational algorithm can lead to widely differing results based on the starting vectors position.
NOTES: This still hasn't "proven" that the winds are being shifted correctly though. It might be worth it to create a forcing wind field with all the same values and then graph the forcing wind field and ICAR's rotated wind field to see if the input and outputs match what is expected.