1 subroutine da_biascorr ( i, ob, iv)
3 !---------------------------------------------------------------------------
4 ! Purpose: perform bias correction for radiance data.
6 ! METHOD: omb(corrected)=omb-scanbias-airbias
7 !---------------------------------------------------------------------------
11 integer, intent(in) :: i ! sensor index.
12 type (y_type), intent(in) :: ob ! Observation structure.
13 type (iv_type), intent(inout) :: iv ! O-B structure.
16 integer :: k,iband,iscan, n,j,npred,nlevels, num_rad
17 real :: pred(4),airbias
18 real,allocatable :: q(:), temp(:), hum(:), pf(:)
20 num_rad = iv%instid(i)%info%n2-iv%instid(i)%info%n1+1
21 if (num_rad < 1) return
23 if (trace_use) call da_trace_entry("da_biascorr")
26 nlevels=iv%instid(i)%nlevels-1
27 allocate(temp(nlevels))
28 allocate(hum(nlevels))
29 allocate(pf(0:nlevels))
31 do n=iv%instid(i)%info%n1,iv%instid(i)%info%n2
32 ! get airmass predictors
33 !-------------------------
34 if (rtm_option==rtm_option_rttov) then
36 q(1:nlevels) = iv%instid(i)%mr(1:nlevels,n)/q2ppmv
37 call da_predictor_rttov(i, pred(1:npred), npred, nlevels, &
38 iv%instid(i)%t(1:nlevels,n), q(1:nlevels), iv%instid(i)%ts(n))
40 else if (rtm_option==rtm_option_crtm) then
42 ! FIX? problems with IBM AIX COMPILER
43 temp(1:nlevels) = iv%instid(i)%tm(1:nlevels,n)
44 hum(1:nlevels) = iv%instid(i)%qm(1:nlevels,n)
45 pf(0:nlevels) = iv%instid(i)%pf(0:nlevels,n)
46 call da_predictor_crtm(pred(1:npred), npred, nlevels,temp, &
47 hum, iv%instid(i)%ts(n), pf)
50 iscan = iv%instid(i)%scanpos(n)
51 iband = floor(iv%instid(i)%info%lat(1,n)/10.0001) + 10
52 do k=1,iv%instid(i)%nchan
53 ! only do bias correction for used channels
54 if ( (satinfo(i)%iuse(k) == 1) .and. (iv%instid(i)%tb_inv(k,n) > missing_r) ) then
55 ! scan bias correction
56 !-----------------------
58 iv%instid(i)%tb_inv(k,n) = iv%instid(i)%tb_inv(k,n) - satinfo(i)%scanbias_b(k,iscan,iband)
60 iv%instid(i)%tb_inv(k,n) = iv%instid(i)%tb_inv(k,n) - satinfo(i)%scanbias(k,iscan)
62 ! airmass bias correction
63 !----------------------------
64 airbias = satinfo(i)%bcoef0(k)
66 airbias= airbias + satinfo(i)%bcoef(k,j)*pred(j)
68 iv%instid(i)%tb_inv(k,n) = iv%instid(i)%tb_inv(k,n)-airbias
78 if (trace_use) call da_trace_exit("da_biascorr")
80 end subroutine da_biascorr