da_balance_geoterm_lin.inc
References to this file elsewhere.
1 subroutine da_balance_geoterm_lin( cori, rho, u, v, term_x, term_y)
2
3 !---------------------------------------------------------------------------
4 ! Purpose: calculates linearised geostrophic term in balance equation.
5 !
6 ! method: term is k x rho f u on a single level.
7 !
8 ! assumptions: Various (see documentation).
9 !---------------------------------------------------------------------------
10
11 implicit none
12
13 real, intent(in) :: cori(ims:ime,jms:jme) ! Coriolis factor.
14 real, intent(in) :: rho(ims:ime,jms:jme) ! Density
15 real, intent(in) :: u(ims:ime,jms:jme) ! u wind increment
16 real, intent(in) :: v(ims:ime,jms:jme) ! v wind increment
17 real, intent(inout) :: term_x(ims:ime,jms:jme) ! x component of term.
18 real, intent(inout) :: term_y(ims:ime,jms:jme) ! y component of term.
19
20 integer :: is, js ! i,j lower loop limits
21 integer :: ie, je ! i,j upper loop limits
22
23 if (trace_use) call da_trace_entry("da_balance_geoterm_lin")
24
25 ! Set loop limits
26
27 is = its-1
28 ie = ite+1
29 js = jts-1
30 je = jte+1
31 if (its == ids ) is = ids
32 if (ite == ide ) ie = ide
33 if (jts == jds ) js = jds
34 if (jte == jde ) je = jde
35
36 !---------------------------------------------------------------------------
37 ! [1.0] Calculate term_x = -f rho v~:
38 !---------------------------------------------------------------------------
39
40 term_x(is:ie,js:je) = term_x(is:ie,js:je) - rho(is:ie,js:je) * cori(is:ie,js:je) * v(is:ie,js:je)
41
42 !---------------------------------------------------------------------------
43 ! [2.0] Calculate term_y = f rho u~:
44 !---------------------------------------------------------------------------
45
46 term_y(is:ie,js:je) = term_y(is:ie,js:je) + rho(is:ie,js:je) * cori(is:ie,js:je) * u(is:ie,js:je)
47
48 if (trace_use) call da_trace_exit("da_balance_geoterm_lin")
49
50 end subroutine da_balance_geoterm_lin
51
52