da_balance_geoterm.inc

References to this file elsewhere.
1 subroutine da_balance_geoterm_nl( xb, 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 (xb_type), intent(in) :: xb           ! First guess structure.
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    !---------------------------------------------------------------------------
19    !  [1.0] Initialise:
20    !---------------------------------------------------------------------------
21 
22    term_x(:,:) = 0.0
23    term_y(:,:) = 0.0
24 
25    !---------------------------------------------------------------------------
26    !  [2.0] Calculate term_x = -f rho v~:
27    !---------------------------------------------------------------------------
28 
29    term_x(xb%its:xb%ite, xb%jts:xb%jte) = -xb%rho(xb%its:xb%ite, xb%jts:xb%jte, k) &
30                                           *xb%  v(xb%its:xb%ite, xb%jts:xb%jte, k) &
31                                           *xb%cori(xb%its:xb%ite, xb%jts:xb%jte)
32 
33    !---------------------------------------------------------------------------
34    !  [3.0] Calculate term_y = f rho u~:
35    !---------------------------------------------------------------------------
36 
37    term_y(xb%its:xb%ite, xb%jts:xb%jte) =  xb%rho(xb%its:xb%ite, xb%jts:xb%jte, k) &
38                                           *xb%  u(xb%its:xb%ite, xb%jts:xb%jte, k) &
39                                           *xb%cori(xb%its:xb%ite, xb%jts:xb%jte)
40 
41 end subroutine da_balance_geoterm_nl
42 
43