In curvilinear applications, the coordinate rotation angle is found in the ROMS grid and history NetCDF files. See NetCDF variable angle. It is defined as the counterclockwise angle (radians) between the XI-axis and true EAST at RHO-points.
Therefore, to transform between (XI,ETA) coordinates to (LON,LAT) coordinates, vectors and tensors need to be rotated according to
Code: Select all
u(LON,LAT)=u(XI,ETA)*cos(angle(i,j))-v(XI,ETA)*sin(angle(i,j))
v(LON,LAT)=v(XI,ETA)*cos(angle(i,j))+u(XI,ETA)*sin(angle(i,j))
Code: Select all
u(XI,ETA)=u(LON,LAT)*cos(angle(i,j))+v(LON,LAT)*sin(angle(i,j))
v(XI,ETA)=v(LON,LAT)*cos(angle(i,j))-u(LON,LAT)*sin(angle(i,j))
Code: Select all
------- V(i,j+1)-------
| |
U(i,j) RHO(i,j) U(i+1,j)
| |
-------- V(i,j)--------
1) Draw vectors at PSI-points (cell's corners):
Code: Select all
Upsi(i,j) = 0.5 * ( U(i,j-1) + U(i,j) )
Vpsi(i,j) = 0.5 * ( V(i-1,j) + V(i,j) )
Code: Select all
Urho(i,j) = 0.5 * ( U(i,j) + U(i+1,j) )
Vrho(i,j) = 0.5 * ( V(i,j) + V(i,j+1) )
Now, the actual world is assumed to be at RHO-points. This will allow a well posed interpolation of vectors/tensors to C-grid locations. For instance, if you are providing wind components (Uwind,Vwind) to ROMS, they must be at RHO-points. So we can use the rotation angle to convert from (LON,LAT) to (XI,ETA) or viceversa.
ROMS assumes that all the input vectors are already in (XI,ETA)coordinates. At output ROMS, writes vectors in (XI,ETA) coordinates at the appropriate C-grid location. To visualize vectors the User needs to interpolate to either PSI- or RHO-locations and rotate back to (LON,LAT) coordinates, using above formulas.