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

```
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))
```

Code: Select all

```
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))
```

**ROMS**uses a staggered

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

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) )
```

**2)**Draw vectors at interior

**RHO**-points (cell's center):

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) )
```

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