da_obs_proc_station.inc

References to this file elsewhere.
1 subroutine da_obs_proc_station(obs)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: Processing obs data read in at a station: 
5    !
6    ! (1) Surface correction
7    ! (2) Vertical checks
8    ! (3) Missing data check
9    !-----------------------------------------------------------------------
10 
11    implicit none
12                              
13    type (multi_level_type), intent(inout) :: obs
14 
15    real    :: po, to, rho, es, qs, qvo
16    integer :: i
17 
18    if (trace_use_dull) call da_trace_entry("da_obs_proc_station")
19 
20    do i = 1, obs % info % levels
21       !-----------------------------------------------------------------------
22       ! Gross check for t, p & q
23       !-----------------------------------------------------------------------
24 
25       if (obs%each(i)%t %inv <  75.0 .or. obs%each(i)%t %inv > 350.0  ) then
26          obs%each(i)%t %inv = missing_r
27          obs%each(i)%t %qc  = missing
28       end if
29       if (obs%each(i)%p %inv <=  0.0 .or. obs%each(i)%p %inv > 110000.0) then
30          obs%each(i)%p %inv = missing_r
31          obs%each(i)%p %qc  = missing
32       end if
33       if (obs%each(i)%rh%inv < 0.0)  then
34          obs%each(i)%rh%inv = missing_r
35          obs%each(i)%rh%qc  = missing
36       end if
37 
38       po   = obs % each(i) % p  % inv
39       to   = obs % each(i) % t  % inv
40       rho  = obs % each(i) % rh  % inv
41 
42       if (ob_format == ob_format_ascii) then ! Calculate q if possible:
43          if (abs(po -  missing_r) > 1.0 .and. abs(to -  missing_r) > 1.0 .and. &
44              abs(rho-  missing_r) > 1.0) then
45 
46             call da_tp_to_qs(to, po, es, qs)
47 
48             if (rho > 100.0) then
49                qvo = qs
50             else
51                qvo  = rho * qs / 100.0
52             end if
53          else
54             qvo       = missing_r
55          end if
56 
57          obs % each(i) % q  % inv = qvo
58          obs % each(i) % q  % qc = obs % each(i) % rh % qc
59          obs % each(i) % q  % error = obs % each(i) % rh % error
60       end if
61    end do
62 
63    if (trace_use_dull) call da_trace_exit("da_obs_proc_station")
64 
65 end subroutine da_obs_proc_station
66 
67