da_check_rh_simple.inc

References to this file elsewhere.
1 subroutine da_check_rh_simple(xb, xa, xp)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (x_type),  intent(inout)  :: xa      ! Analysis increment
10    type (xb_type), intent(inout)  :: xb      ! First guess state
11    type (xpose_type), intent(in)  :: xp      ! domain decomposition vars.
12 
13    integer                        :: i, j, k ! Loop counters.
14    real                           :: q_new   ! Modified rh.
15    real                           :: es      ! Dummy output.
16    real                           :: t_new, p_new
17    real                           :: ramax,ramin,dqmax,dqmin            
18 
19    ramax=maximum_rh/100.0
20    ramin=minimum_rh/100.0
21 
22    do k = xp%kts, xp%kte
23       do j = xp%jts, xp%jte
24          do i = xp%its, xp%ite
25             p_new  = xb % p(i,j,k) + xa %  p(i,j,k)
26             t_new  = xb % t(i,j,k) + xa %  t(i,j,k)
27 
28             call da_tp_to_qs(t_new, p_new, es, q_new)
29             dqmax=q_new*ramax - xb % q(i,j,k)        
30             dqmin=q_new*ramin - xb % q(i,j,k)        
31             xa % q(i,j,k)=min(max(xa % q(i,j,k),dqmin),dqmax)
32          end do
33       end do
34    end do
35 
36 end subroutine da_check_rh_simple
37 
38