da_balance_geoterm_adj.inc

References to this file elsewhere.
1 subroutine da_balance_geoterm_adj( cori, rho, term_x, term_y, u, v)
2  
3    !---------------------------------------------------------------------------
4    ! Purpose: Adjoint of da_balance_geoterm.
5    !---------------------------------------------------------------------------
6 
7    implicit none
8    
9    real, intent(in)    :: cori(ims:ime,jms:jme)   ! Coriolis factor.
10    real, intent(in)    :: rho(ims:ime,jms:jme)    ! Density
11    real, intent(in)    :: term_x(ims:ime,jms:jme) ! x component of term.
12    real, intent(in)    :: term_y(ims:ime,jms:jme) ! y component of term.
13    real, intent(inout) :: u(ims:ime,jms:jme)      ! u wind increment
14    real, intent(inout) :: v(ims:ime,jms:jme)      ! v wind increment
15 
16    if (trace_use) call da_trace_entry("da_balance_geoterm_adj")
17 
18    !---------------------------------------------------------------------------
19    ! [2.0] Calculate term_y = f rho u~:
20    !---------------------------------------------------------------------------
21 
22    u(its:ite,jts:jte) = u(its:ite,jts:jte) + rho(its:ite,jts:jte) * cori(its:ite,jts:jte) &
23       * term_y(its:ite,jts:jte)
24 
25    !---------------------------------------------------------------------------
26    ! [1.0] Calculate term_x = -f rho v~:
27    !---------------------------------------------------------------------------
28 
29    v(its:ite,jts:jte) = v(its:ite,jts:jte) - rho(its:ite,jts:jte) * cori(its:ite,jts:jte) &
30       * term_x(its:ite,jts:jte)
31 
32    if (trace_use) call da_trace_exit("da_balance_geoterm_adj")
33 
34 end subroutine da_balance_geoterm_adj
35 
36