## Coupling of m3-m2 initial conditions

### Coupling of m3-m2 initial conditions

My configuration is a flow-channel with open boundaries in north/south and closed walles in the east and west. I want to have velocity boundary conditions identical to velocity initial conditions. All of these conditions are analytically defined.

If I want inflow from the north with u=w=0 and a vertical profile for v that has only negative values in the entire watercolumn, then I have to integrate that profile vertically and devide by depth to get the corresponding m2 condition on that boundary, right?

If I want this boundary condition to be initial condition in the entire domain, I have to do the same thing in the entire domain?

How do you integrate the velocity? Do you have to do a discrete integration (e.g. trapezoidal rule) in analytical.f90 or is there some subroutine I can call?

If I want inflow from the north with u=w=0 and a vertical profile for v that has only negative values in the entire watercolumn, then I have to integrate that profile vertically and devide by depth to get the corresponding m2 condition on that boundary, right?

If I want this boundary condition to be initial condition in the entire domain, I have to do the same thing in the entire domain?

How do you integrate the velocity? Do you have to do a discrete integration (e.g. trapezoidal rule) in analytical.f90 or is there some subroutine I can call?

In my version (2.2) there is only one possibility to define 3d velocity initial conditions analytically: ANA_INITIAL. If I define it, I have to insert analytical initial fields for BOTH m2 and m3 velocities (and tracers). That's why I don't think that there is a call to any routine that calculates m2 solely with the m3 profile, because it would then "overrule" my analytically defined m2.

I'm looking forward to get the new version!

--stefan

- m.hadfield
**Posts:**518**Joined:**Tue Jul 01, 2003 4:12 am**Location:**NIWA

Hmm, that's interesting. When I define m2 to be zero and define a m3 profile, e.g. u=w=0 and v=v(z), with all values negative from zeta down to the bottom (so vbar should be negative), the entry in the history files for the first calculated baroclinic timestep (NHIS=2) containes a vertical v profile similar to the one I defined, exept that it is translated along the y-axis in a way that its vertical integral yields (almost) exactly zero. Vbar is also almost exactly zero at this time. Then I thought about the mode-splitting and came to the conclusion that the model starts to evolve zeta, ubar and vbar with the defined fs and m2 initial conditions. After the barotropic timesteps, it adjusts the defined m3 profile accoding to the ubar and vbar result from the barotropic timesteps. Kate indicated the corresponding part of the code in her previous post.

However, I don't know how this plays together with the boundary conditions. At the moment I have a channel with inflow in north, outflow in south and closed walls in east and west. Every variable at the inflow is clamped, and everything in the south is gradient, but I have noticed the same m2-m3 initial behaviour with many other choices for boundary conditions.

--stefan