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
19 do i = 1, obs % info % levels
20 !-----------------------------------------------------------------------
21 ! Gross check for t, p & q
22 !-----------------------------------------------------------------------
23
24 if (obs%each(i)%t %inv < 75.0 .or. obs%each(i)%t %inv > 350.0 ) then
25 obs%each(i)%t %inv = missing_r
26 obs%each(i)%t %qc = missing
27 end if
28 if (obs%each(i)%p %inv <= 0.0 .or. obs%each(i)%p %inv > 110000.0) then
29 obs%each(i)%p %inv = missing_r
30 obs%each(i)%p %qc = missing
31 end if
32 if (obs%each(i)%rh%inv < 0.0) then
33 obs%each(i)%rh%inv = missing_r
34 obs%each(i)%rh%qc = missing
35 end if
36
37 po = obs % each(i) % p % inv
38 to = obs % each(i) % t % inv
39 rho = obs % each(i) % rh % inv
40
41 if (ob_format == ob_format_ascii) then ! Calculate q if possible:
42 if (abs(po - missing_r) > 1. .and. abs(to - missing_r) > 1. .and. &
43 abs(rho- missing_r) > 1.) then
44
45 call da_tp_to_qs(to, po, es, qs)
46
47 if (rho > 100.) then
48 qvo = qs
49 else
50 qvo = rho * qs / 100.
51 end if
52 else
53 qvo = missing_r
54 end if
55
56 obs % each(i) % q % inv = qvo
57 obs % each(i) % q % qc = obs % each(i) % rh % qc
58 obs % each(i) % q % error = obs % each(i) % rh % error
59 end if
60 end do
61
62 end subroutine da_obs_proc_station
63
64