da_tprh_to_q_lin.inc
References to this file elsewhere.
1 subroutine da_tprh_to_q_lin( xb, xp, xa )
2
3 !---------------------------------------------------------------------------
4 ! Purpose: Convert T/pressure/rh to specific humidity increments.
5 !
6 ! Method: q~ = q (rh~/rh + qs~/qs)
7 !---------------------------------------------------------------------------
8
9 implicit none
10
11 type (xb_type), intent(in) :: xb ! First guess structure.
12 type (xpose_type), intent(in) :: xp ! Dimensions and xpose buffers.
13 type (x_type), intent(inout) :: xa ! increment structure.
14
15 integer :: is, ie ! 1st dim. end points.
16 integer :: js, je ! 2nd dim. end points.
17 integer :: ks, ke ! 3rd dim. end points.
18 real :: qs_prime_over_qs(xp%its:xp%ite,xp%jts:xp%jte,xp%kts:xp%kte) ! qs~/qs.
19
20 !---------------------------------------------------------------------------
21 ! [1.0] initialise:
22 !---------------------------------------------------------------------------
23
24 is = xp%its; ie = xp%ite
25 js = xp%jts; je = xp%jte
26 ks = xp%kts; ke = xp%kte
27
28 !---------------------------------------------------------------------------
29 ! [1.0] Calculate saturation specific humidity ratio qs~/qs:
30 !---------------------------------------------------------------------------
31
32 call da_tp_to_qs_lin( xb, xp, xa, qs_prime_over_qs )
33
34 !---------------------------------------------------------------------------
35 ! [2.0] Calculate specific humidity increment:
36 !---------------------------------------------------------------------------
37
38 xa % q(is:ie,js:je,ks:ke) = xb % q(is:ie,js:je,ks:ke) * &
39 ( xa % rh(is:ie,js:je,ks:ke) / &
40 xb % rh(is:ie,js:je,ks:ke) + &
41 qs_prime_over_qs(is:ie,js:je,ks:ke) )
42
43 end subroutine da_tprh_to_q_lin
44
45