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