1 subroutine da_tp_to_qs_adj1( t, p, es, t_prime, p_prime, qs_prime_over_qs )
3 !---------------------------------------------------------------------------
4 ! Purpose: Adjoint of da_tp_to_qs_lin.
5 !---------------------------------------------------------------------------
9 real, intent(in) :: t ! Temperature.
10 real, intent(in) :: p ! Pressure.
11 real, intent(in) :: es ! Sat. vapour pressure.
12 real, intent(inout) :: t_prime ! Temperature increment.
13 real, intent(inout) :: p_prime ! Pressure increment.
14 real, intent(in) :: qs_prime_over_qs ! qs~/qs.
16 real :: temp ! Temporary storage.
17 real :: es_prime_over_es ! es~/es
19 if (trace_use) call da_trace_entry("da_tp_to_qs_adj1")
21 !---------------------------------------------------------------------------
22 ! [3.0] Calculate saturation specific humidity increment:
23 !---------------------------------------------------------------------------
25 temp = qs_prime_over_qs / ( p - rd_over_rv1 * es )
27 es_prime_over_es = temp * p
29 p_prime = p_prime - temp
31 !---------------------------------------------------------------------------
32 ! [2.0] Calculate saturation vapour pressure increment:
33 !---------------------------------------------------------------------------
35 temp = t + es_gammakelvin
37 t_prime = t_prime + es_gammabeta * es_prime_over_es / ( temp * temp )
39 if (trace_use) call da_trace_exit("da_tp_to_qs_adj1")
41 end subroutine da_tp_to_qs_adj1