This is to remind you that

ROMS/TOMS is formulated in general horizontal curvilinear coordinates. It is possible to formulate any application in

Cartesian,

spherical, or

polar coordinates. You can activate a curvilnear application by turning on CPP option

CURVILINEAR. Curvilinear applications include extra terms in the advection and any vector or tensor needs to be rotated to model generic coordinates (

XI,

ETA).

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:**

u(LON,LAT)=u(XI,ETA)*cos(angle(i,j))-v(XI,ETA)*sin(angle(i,j))

v(LON,LAT)=u(XI,ETA)*sin(angle(i,j))+v(XI,ETA)*cos(angle(i,j))

conversely,

**Code:**

u(XI,ETA)=u(LON,LAT)*cos(angle(i,j))+v(LON,LAT)*sin(angle(i,j))

v(XI,ETA)=u(LON,LAT)*sin(angle(i,j))-v(LON,LAT)*cos(angle(i,j))

Then, you need to consider that

ROMS uses a staggered

C-grid. That is, the vector components are not located in the same place:

**Code:**

------- V(i,j+1)-------

| |

U(i,j) RHO(i,j) U(i+1,j)

| |

-------- V(i,j)--------

If plotting, you have two choices:

1) Draw vectors at

PSI-points (cell's corners):

**Code:**

Upsi(i,j) = 0.5 * ( U(i,j-1) + U(i,j) )

Vpsi(i,j) = 0.5 * ( V(i-1,j) + V(i,j) )

2) Draw vectors at interior

RHO-points (cell's center):

**Code:**

Urho(i,j) = 0.5 * ( U(i,j) + U(i+1,j) )

Vrho(i,j) = 0.5 * ( V(i,j) + V(i,j+1) )

It is more physical to draw vectors at

PSI-points. It will be consistent with the physical boundaries of the domain. It will also show the behavior around Land/Sea masking, if any.

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.