Curvilinear Coordinates
The requirement for a boundary-following coordinate system and for a laterally variable grid resolution can both be met (for suitably
smooth domains) by introducing an appropriate orthogonal coordinate transformation in the horizontal. Let the new coordinates be
and
where the relationship of horizontal arc length to the differential distance is given by:


Here,
and
are the scale factors which relate the differential distances
to the actual (physical) arc lengths.
It is helpful to write the equations in vector notation and to use the formulas for div, grad, and curl in curvilinear coordinates (see
Batchelor, Appendix 2):

![{\displaystyle \nabla \cdot {\vec {a}}=mn\left[{\partial \over \partial \xi }\!\!\left({a \over n}\right)+{\partial \over \partial \eta }\!\!\left({b \over m}\right)\right]}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/defdc5f841067731331e3afff5e6157c36bc6760)

![{\displaystyle \nabla ^{2}\phi =\nabla \cdot \nabla \phi =mn\left[{\partial \over \partial \xi }\!\!\left({m \over n}{\partial \phi \over \partial \xi }\right)+{\partial \over \partial \eta }\!\!\left({n \over m}{\partial \phi \over \partial \eta }\right)\right]}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/552f23044e680f1d3a58fc0001c9f49fea269882)
where
is a scalar and
is a vector with components
,
, and
.