<HTML> <BODY BGCOLOR=#ccccdd LINK=#0000aa VLINK=#0000ff ALINK=#ff0000 ><BASE TARGET="bottom_target"><PRE>
<A NAME='DA_TPQ_TO_RH'><A href='../../html_code/physics/da_tpq_to_rh.inc.html#DA_TPQ_TO_RH' TARGET='top_target'><IMG SRC="../../gif/bar_red.gif" border=0></A>

subroutine da_tpq_to_rh( t, p, q, es, qs, rh ) 4,3

   !---------------------------------------------------------------------------
   ! Purpose: Convert T/p/q to relative humidity rh.
   !---------------------------------------------------------------------------

   implicit none

   real, intent(in)  :: t, p, q
   real, intent(out) :: es, qs, rh

   if (trace_use_dull) call da_trace_entry("da_tpq_to_rh")

   !---------------------------------------------------------------------------
   ! [1.0] Calculate saturation specific humidity:
   !---------------------------------------------------------------------------

   call da_tp_to_qs( t, p, es, qs )
   
   !---------------------------------------------------------------------------
   ! [2.0] Calculate relative humidity:
   !---------------------------------------------------------------------------

   rh = 100.0 * q / qs

   if (trace_use_dull) call da_trace_exit("da_tpq_to_rh")

end subroutine da_tpq_to_rh