da_transform_xtotb.inc

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