1 subroutine da_tprh_to_q_lin(grid)
3 !---------------------------------------------------------------------------
4 ! Purpose: Convert T/pressure/rh to specific humidity increments.
6 ! Method: q~ = q (rh~/rh + qs~/qs)
7 !---------------------------------------------------------------------------
11 type (domain), intent(inout) :: grid
13 real :: qs_prime_over_qs(its:ite,jts:jte,kts:kte) ! qs~/qs.
15 if (trace_use) call da_trace_entry("da_tprh_to_q_lin")
17 !---------------------------------------------------------------------------
18 ! [1.0] Calculate saturation specific humidity ratio qs~/qs:
19 !---------------------------------------------------------------------------
21 call da_tp_to_qs_lin( grid, qs_prime_over_qs )
23 !---------------------------------------------------------------------------
24 ! [2.0] Calculate specific humidity increment:
25 !---------------------------------------------------------------------------
27 grid%xa % q(its:ite,jts:jte,kts:kte) = grid%xb % q(its:ite,jts:jte,kts:kte) * &
28 ( grid%xa % rh(its:ite,jts:jte,kts:kte) / &
29 grid%xb % rh(its:ite,jts:jte,kts:kte) + &
30 qs_prime_over_qs(its:ite,jts:jte,kts:kte) )
32 if (trace_use) call da_trace_exit("da_tprh_to_q_lin")
34 end subroutine da_tprh_to_q_lin