da_transform_xtotb.inc

References to this file elsewhere.
1 subroutine da_transform_xtotb(grid)
2 
3    !----------------------------------------------------------------------
4    ! Purpose: TBD
5    !----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (domain), intent(inout)   :: grid
10 
11    integer            :: i,j,k
12 
13    real               :: psfc,ta,gamma,sst,htpw,speed,alw,zcld,tpw,dum1,zrhom
14 
15    if (trace_use) call da_trace_entry("da_transform_xtotb")
16 
17    do j=jts,jte
18       do i=its,ite
19          ! surface pressure (mb) (940 -1030)
20 
21          psfc          = 0.01*grid%xb%psfc(i,j)
22 
23          ! sea surface temperature (k) (273 - 303) (doesnot change) 
24 
25          sst           = grid%xb%tgrn(i,j)
26 
27          ! effective surface air temperature (263 - 303)
28 
29          ta          = grid%xb%tgrn(i,j) + &
30                        (grid%xb%t(i,j,kts)-grid%xb%tgrn(i,j))*log(2.0/0.0001)/ &
31                        log((grid%xb%h(i,j,kts) - grid%xb%terr(i,j))/0.0001)
32 
33          ! gamma is an emperical formula and zcld is given for now
34 
35          gamma   = (ta-270)*0.023 + 5.03  ! effective lapse rate(km) (4.0-6.5)
36 
37          zcld    = 1                           ! effective cloud height (km)
38                                                ! = 1 if no cloud infomation
39          ! total precipitable water in cm
40          ! total precipitable water in (kg/m**2) (0 - 70)
41 
42          tpw          = grid%xb%tpw(i,j)*10.0
43          speed        = grid%xb%speed(i,j)
44 
45          ! Column liquid water (kg/m**2)  (0-0.5) (no data now. So do it later)
46 
47          alw          = 0.0
48 
49          ! Column height weighted moisture density on the grid locally 
50 
51          zrhom = 0.0
52          do k=kts,kte
53             zrhom=zrhom+(grid%xb%hf(i,j,k+1)-grid%xb%hf(i,j,k))*grid%xb%h(i,j,k)*grid%xb%q(i,j,k)* &
54                grid%xb%rho(i,j,k)
55          end do
56 
57          ! Column moisture density on the grid locally
58 
59          htpw          = zrhom/tpw/1000.0
60 
61          call tb(1,53.0,psfc,ta,gamma,sst,tpw,htpw, &
62             speed,alw,zcld,grid%xb%tb19v(i,j),grid%xb%tb19h(i,j))
63          call tb(2,53.0,psfc,ta,gamma,sst,tpw,htpw, &
64             speed,alw,zcld,grid%xb%tb22v(i,j),dum1)
65          call tb(3,53.0,psfc,ta,gamma,sst,tpw,htpw, &
66             speed,alw,zcld,grid%xb%tb37v(i,j),grid%xb%tb37h(i,j))
67          call tb(4,53.0,psfc,ta,gamma,sst,tpw,htpw, &
68             speed,alw,zcld,grid%xb%tb85v(i,j),grid%xb%tb85h(i,j))
69       end do
70    end do
71 
72    if (trace_use) call da_trace_exit("da_transform_xtotb")
73 
74 end subroutine da_transform_xtotb
75 
76