1 subroutine da_transform_xtotb_adj (grid)
3 !----------------------------------------------------------------------
5 !----------------------------------------------------------------------
9 type (domain), intent(inout) :: grid
12 integer :: is, js, ie, je
14 real :: dx, dy, dxm, dym, zhmkz
15 real :: dum1, dum2, zrhom, ADJ_zrhom
17 real :: psfc,ta,gamma,sst,htpw,speed,alw,zcld,tpw
18 real :: ADJ_psfc,ADJ_ta,ADJ_gamma,ADJ_sst,ADJ_tpw
19 real :: ADJ_htpw,ADJ_speed,ADJ_alw,ADJ_zcld
21 if (trace_use) call da_trace_entry("da_transform_xtotb_adj")
48 if (test_transforms) then
55 if (is < ids) is = ids
56 if (js < jds) js = jds
58 if (ie > ide) ie = ide
59 if (je > jde) je = jde
66 psfc = 0.01*grid%xb%psfc(i,j)
67 ! sst = grid%xb%tgrn(i,j)
68 ta = grid%xb%tgrn(i,j) + &
69 (grid%xb%t(i,j,kts)-grid%xb%tgrn(i,j))*log(2.0/0.0001)/ &
70 log((grid%xb%h(i,j,kts)- grid%xb%terr(i,j))/0.0001)
72 gamma = (ta-270.0)*0.023 + 5.03 ! effective lapse rate (km) (4.0-6.5)
73 zcld = 1 ! effective cloud height (km)
75 tpw = grid%xb%tpw(i,j)*10.0
76 ! speed = grid%xb%speed(i,j)
82 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)* &
86 ! call da_transform_xtozrhoq(grid%xb, i, j, zh, zf, zrhom)
88 htpw = zrhom/tpw/1000.0
104 call da_tb_adj(1,53.0,psfc,ta,gamma,grid%xb%tgrn(i,j),tpw, &
105 htpw,grid%xb%speed(i,j),alw,zcld, &
106 ! grid%xb%tb19v(i,j),grid%xb%tb19h(i,j), &
107 ADJ_psfc,ADJ_ta,ADJ_gamma,ADJ_sst, &
108 ADJ_tpw,ADJ_htpw,ADJ_speed,ADJ_alw, &
109 ADJ_zcld,grid%xa%tb19v(i,j),grid%xa%tb19h(i,j) )
111 call da_tb_adj(2,53.0,psfc,ta,gamma,grid%xb%tgrn(i,j),tpw, &
112 htpw,grid%xb%speed(i,j),alw,zcld, &
113 ! grid%xb%tb22v(i,j),dum1, &
114 ADJ_psfc,ADJ_ta,ADJ_gamma,ADJ_sst, &
115 ADJ_tpw,ADJ_htpw,ADJ_speed,ADJ_alw, &
116 ADJ_zcld,grid%xa%tb22v(i,j),dum2 )
118 call da_tb_adj(3,53.0,psfc,ta,gamma,grid%xb%tgrn(i,j),tpw, &
119 htpw,grid%xb%speed(i,j),alw,zcld, &
120 ! grid%xb%tb37v(i,j),grid%xb%tb37h(i,j), &
121 ADJ_psfc,ADJ_ta,ADJ_gamma,ADJ_sst, &
122 ADJ_tpw,ADJ_htpw,ADJ_speed,ADJ_alw, &
123 ADJ_zcld,grid%xa%tb37v(i,j),grid%xa%tb37h(i,j) )
125 call da_tb_adj(4,53.0,psfc,ta,gamma,grid%xb%tgrn(i,j),tpw, &
126 htpw,grid%xb%speed(i,j),alw,zcld, &
127 ! grid%xb%tb85v(i,j),grid%xb%tb85h(i,j), &
128 ADJ_psfc,ADJ_ta,ADJ_gamma,ADJ_sst, &
129 ADJ_tpw,ADJ_htpw,ADJ_speed,ADJ_alw, &
130 ADJ_zcld,grid%xa%tb85v(i,j),grid%xa%tb85h(i,j) )
132 ADJ_zrhom = ADJ_htpw/tpw/1000.0
133 ADJ_tpw = ADJ_tpw - ADJ_htpw/tpw*htpw
136 grid%xa%rho(i,j,k) = (grid%xb%hf(i,j,k+1)-grid%xb%hf(i,j,k))*grid%xb%h(i,j,k)* &
137 grid%xb%q(i,j,k)*ADJ_zrhom + grid%xa%rho(i,j,k)
138 grid%xa%q(i,j,k) = (grid%xb%hf(i,j,k+1)-grid%xb%hf(i,j,k))*grid%xb%h(i,j,k)* &
139 ADJ_zrhom*grid%xb%rho(i,j,k) + grid%xa%q(i,j,k)
142 ! call da_transform_xtozrhoq_adj(grid%xb,grid%xa,i,j,zh,zf,ADJ_zrhom)
146 grid%xa%speed(i,j)=grid%xa%speed(i,j) + ADJ_speed
148 grid%xa%tpw(i,j) = grid%xa%tpw(i,j) + ADJ_tpw*10.0
151 ADJ_ta = ADJ_ta + ADJ_gamma*0.023
153 grid%xa%t(i,j,kts) = grid%xa%t(i,j,kts) + ADJ_ta* &
154 log(2.0/0.0001)/log((grid%xb%h(i,j,kts)-grid%xb%terr(i,j))/0.0001)
157 grid%xa%psfc(i,j) = grid%xa%psfc(i,j) + ADJ_psfc*0.01
161 if (trace_use) call da_trace_exit("da_transform_xtotb_adj")
163 end subroutine da_transform_xtotb_adj