1 subroutine da_balance_geoterm_nl (domain, k, u, v, term_x, term_y)
3 !---------------------------------------------------------------------------
4 ! Purpose: calculates nonlinear geostrophic term in balance equation.
6 ! method: term is k x rho f u on a single level.
7 !---------------------------------------------------------------------------
11 type(domain), intent(in) :: grid
12 integer, intent(in) :: k ! Model level.
13 real, intent(in) :: u(:,:) ! u wind comp. (dot pts)
14 real, intent(in) :: v(:,:) ! v wind comp. (dot pts)
15 real, intent(out) :: term_x(:,:) ! x component of term.
16 real, intent(out) :: term_y(:,:) ! y component of term.
18 if (trace_use) call da_trace_entry("da_balance_geoterm_nl")
20 !---------------------------------------------------------------------------
22 !---------------------------------------------------------------------------
27 !---------------------------------------------------------------------------
28 ! [2.0] Calculate term_x = -f rho v~:
29 !---------------------------------------------------------------------------
31 term_x(its:ite, jts:jte) = -grid%xb%rho(its:ite, jts:jte, k) &
32 * grid%xb% v(its:ite, jts:jte, k) * grid%xb%cori(its:ite, jts:jte)
34 !---------------------------------------------------------------------------
35 ! [3.0] Calculate term_y = f rho u~:
36 !---------------------------------------------------------------------------
38 term_y(its:ite, jts:jte) = grid%xb%rho(its:ite, jts:jte, k) &
39 * grid%xb% u(its:ite, jts:jte, k) * grid%xb%cori(its:ite, jts:jte)
41 if (trace_use) call da_trace_exit("da_balance_geoterm_nl")
43 end subroutine da_balance_geoterm_nl