da_balance_geoterm.inc
References to this file elsewhere.
1 subroutine da_balance_geoterm_nl (domain, k, u, v, term_x, term_y)
2
3 !---------------------------------------------------------------------------
4 ! Purpose: calculates nonlinear geostrophic term in balance equation.
5 !
6 ! method: term is k x rho f u on a single level.
7 !---------------------------------------------------------------------------
8
9 implicit none
10
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.
17
18 if (trace_use) call da_trace_entry("da_balance_geoterm_nl")
19
20 !---------------------------------------------------------------------------
21 ! [1.0] Initialise:
22 !---------------------------------------------------------------------------
23
24 term_x(:,:) = 0.0
25 term_y(:,:) = 0.0
26
27 !---------------------------------------------------------------------------
28 ! [2.0] Calculate term_x = -f rho v~:
29 !---------------------------------------------------------------------------
30
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)
33
34 !---------------------------------------------------------------------------
35 ! [3.0] Calculate term_y = f rho u~:
36 !---------------------------------------------------------------------------
37
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)
40
41 if (trace_use) call da_trace_exit("da_balance_geoterm_nl")
42
43 end subroutine da_balance_geoterm_nl
44
45