Hi!

I still use version 2.2, and don't know if anything has changed in the new version.

In mod_grid.F there are some variables defined, three of them are:

Hz: Thickness of vertical rho-Points

Huon: Total u-Momentum Flux term: interpolated(Hz)*u*dy (dy is the same as 1/pn, at least for a rectilinear grid, I don't know anything about curvilinear setups)

Hvom: interpolated(Hz)*v*dx

The 'allocate' functions in that file allocate N vertical levels for each i,j for each one of those variables.

Roms uses a staggered grid (see

http://marine.rutgers.edu/po/documentat ... =technique ).

Hz is, as documented in mod_grid, the thickness at rho points (thickness means cell hight). But due to the staggered grid, there is a different thickness at the neighbouring u and v points.

For example, take the Finite-Volume formulation for a tracer. Tracers are defined on rho-points, so the cell must be constructed in a way that it's center is a rho-point. Now the in- and outflow of the cell has to be calculated, to update the tracer. The in- and outflow has to be calculated on the cell boundaries, and in the case of a staggered grid, that's where the u- and v- points are located. To calculate the inflow per second, one has to multiply area*velocitynormal*tracer. Area is dx*Height or dy*Height, but one needs the hight at VELOCITY-points, not at rho points, so one has to linearly interpolate Hz between neighbouring rho-point-Heights (e.g, in set_massflux).

One problem in the above explanation is that cell heights are changing during a 3d-timestep, and if I understood correctly, the massflux for calculating tracer-flux is averaged in fast barotropic time to the middle of the flux-period. That means, in the equation for tracer-update you will find the following cell-heights:

one in the middle of the cell at time n to calculate the old volume of the grid cell.

one in the middle of the cell at time n+1, to calculate new volume.

one at each boundary at time n+1/2, for the inflow-area.

The second of the above is also calculated with the barotropic time steps, but with different weights as the third.

See the Shchepetkin-McWilliams 2005 paper for more info.

For the momentum equations, things are similar, I think, exept that now the cell boundaries coincide with rho points, so no need to interpolate the cellheights.

The above is all simplified, but what I want to say is that one has to take care at what time and at what location to define the height.

I hope I could help you, I spent some weeks to find out what I just wrote (and even now i don't know if it's right or not...

)

--Stefan