da_tpq_to_rh_lin1.inc
References to this file elsewhere.
1 subroutine da_tpq_to_rh_lin1( t, p, es, rh, &
2 t_prime, p_prime, q_prime, rh_prime )
3
4 !---------------------------------------------------------------------------
5 ! Purpose: Convert T/pressure/q to relative humidity increments.
6 !
7 ! Method: r~ = r (q~/q - qs~/qs).
8 !
9 ! When q approaching to zero, the above formula is undefined. The
10 ! general formula below must be used:
11 !
12 ! Method: r~ = 100 * (q~/qs) - rh*(qs~/qs)
13 !---------------------------------------------------------------------------
14
15 implicit none
16
17 real, intent(in) :: t ! Temperature.
18 real, intent(in) :: p ! Pressure.
19 real, intent(in) :: es ! Saturation vapour pressure.
20 real, intent(in) :: rh ! Relative Humidity.
21 real, intent(in) :: t_prime ! Temperature increment.
22 real, intent(in) :: p_prime ! Pressure increment.
23 real, intent(in) :: q_prime ! Pressure increment.
24 real, intent(out) :: rh_prime ! Pressure increment.
25
26 real :: es1, qs ! Saturation specific humidity.
27 real :: qs_prime_over_qs ! qs~/qs.
28
29 !---------------------------------------------------------------------------
30 ! [1.0] Calculate saturation specific humidity ratio qs~/qs:
31 !---------------------------------------------------------------------------
32
33 call da_tp_to_qs_lin1( t, p, es, t_prime, p_prime, qs_prime_over_qs )
34
35 !--------------------------------------------------------------------------
36 ! [2.0] Culcalete background saturation specific humidity qs:
37 !--------------------------------------------------------------------------
38
39 call da_tp_to_qs( t, p, es1, qs)
40
41 !---------------------------------------------------------------------------
42 ! [3.0] Calculate relative humidity increment:
43 !---------------------------------------------------------------------------
44
45 rh_prime = 100. * (q_prime / qs) - rh * qs_prime_over_qs
46
47 end subroutine da_tpq_to_rh_lin1
48
49