da_tp_to_qs.inc

References to this file elsewhere.
1 subroutine da_tp_to_qs( t, p, es, qs)
2 
3    !---------------------------------------------------------------------------
4    ! Purpose: Convert T/p to saturation specific humidity.
5    !
6    !  Method: qs = es_alpha * es / ( p - ( 1 - rd_over_rv ) * es ).
7    !          use Rogers & Yau (1989) formula: es = a exp( bTc / (T_c + c) )
8    !--------------------------------------------------------------------------
9 
10    implicit none
11 
12    real, intent(in)  :: t, p
13    real, intent(out) :: es, qs
14    
15    real              :: t_c              ! T in degreesC.
16 
17    if (trace_use_dull) call da_trace_entry("da_tp_to_qs")
18 
19    !---------------------------------------------------------------------------
20    ! [1.0] initialise:
21    !---------------------------------------------------------------------------
22    
23    t_c = t - t_kelvin
24    
25    !---------------------------------------------------------------------------
26    ! [2.0] Calculate saturation vapour pressure:
27    !---------------------------------------------------------------------------
28 
29    es = es_alpha * exp( es_beta * t_c / ( t_c + es_gamma ) )
30     
31    !---------------------------------------------------------------------------
32    ! [3.0] Calculate saturation specific humidity:
33    !---------------------------------------------------------------------------
34 
35    qs = rd_over_rv * es / ( p - rd_over_rv1 * es )
36 
37    if (trace_use_dull) call da_trace_exit("da_tp_to_qs")
38 
39 end subroutine da_tp_to_qs
40 
41