1 subroutine da_scan_obs_ssmi (iv, filename)
3 !---------------------------------------------------------------------------
4 ! Purpose: Read the header of a SSMI 2.0 GTS observation file
5 !---------------------------------------------------------------------------
9 type(iv_type), intent(inout) :: iv
10 character(len=*), intent(in) :: filename
12 character (len = 10) :: fmt_name
13 character (len = 160) :: fmt_info, fmt_loc
14 character (len = 120) :: char_ned
16 integer :: iost, fm,iunit
18 type (model_loc_type) :: loc
19 type (info_type) :: info
20 type (field_type) :: speed, tpw
22 type (field_type) :: tb19v, tb19h, tb22v
23 type (field_type) :: tb37v, tb37h, tb85v, tb85h
25 logical :: isfilter,ipass
27 integer :: irain, iprecip
29 if (trace_use) call da_trace_entry("da_scan_obs_ssmi")
31 isfilter = .true. ! filter out rain points
35 call da_get_unit(iunit)
37 FILE = trim(filename), &
39 ACCESS = 'SEQUENTIAL', &
44 call da_warning(__FILE__,__LINE__, (/"Cannot open SSMI file "//filename/))
45 call da_free_unit(iunit)
57 read (unit = iunit, fmt = '(A)', iostat = iost) char_ned
59 call da_error(__FILE__,__LINE__, (/"Cannot read SSMI file "//filename/))
62 ! 2.3 read number of reports
64 read (unit = iunit, fmt = '(A)', iostat = iost) char_ned
66 call da_error(__FILE__,__LINE__, (/"Cannot read SSMI file "//filename/))
68 if (char_ned(1:6) == 'NESTIX') exit
72 read (unit = iunit, fmt = '(A)', iostat = iost) char_ned
73 if (char_ned(1:6) == 'INFO ') exit
76 read (unit = iunit, fmt = '(A)', iostat = iost) char_ned
79 read (unit=iunit, fmt = '(A,1X,A)') &
84 read (unit=iunit, fmt = '(A)') fmt_name
88 ! read station general info
89 read (unit=iunit, fmt = fmt_info, iostat = iost) &
99 read(unit=info % platform (4:6),fmt='(I3)') fm
100 if (iost /= 0) exit reports
104 ! read surface wind speed and precipitable water
105 read (unit=iunit, fmt = fmt_loc) &
106 speed%inv, speed%qc, speed%error, &
107 tpw%inv, tpw%qc, tpw%error
109 read (unit=iunit, fmt = fmt_loc) &
110 tb19v%inv, tb19v%qc, tb19v%error, &
111 tb19h%inv, tb19h%qc, tb19h%error, &
112 tb22v%inv, tb22v%qc, tb22v%error, &
113 tb37v%inv, tb37v%qc, tb37v%error, &
114 tb37h%inv, tb37h%qc, tb37h%error, &
115 tb85v%inv, tb85v%qc, tb85v%error, &
116 tb85h%inv, tb85h%qc, tb85h%error
118 write(unit=message(1), fmt='(a, i6)') 'unsaved ssmi obs found, fm=', fm
119 write(unit=message(2), fmt='(a, 2f12.6)') 'info%(lon,lat)=', info%lon, info%lat
120 call da_warning(__FILE__,__LINE__,message(1:2))
123 ! check if obs is in horizontal domain
125 ! Compute the model horizontal coordinate x, y
126 ! Check if obs is wihin horizontal domain
128 call da_llxy (info, loc, outside)
132 if (.not. use_ssmiretrievalobs .or. iv%info(ssmi_rv)%ntotal == max_ssmi_rv_input) cycle reports
134 ! Check if at least one field is present
135 if ((tpw % qc == missing) .AND. (speed % qc == missing)) then
138 iv%info(ssmi_rv)%ntotal = iv%info(ssmi_rv)%ntotal + 1
139 if (outside) cycle reports
141 iv%info(ssmi_rv)%nlocal = iv%info(ssmi_rv)%nlocal + 1
144 if (.not. use_ssmitbobs .or. iv%info(ssmi_tb)%ntotal == max_ssmi_tb_input) cycle reports
146 ! Check if at least one field is present
148 if ((tb19v % qc == missing) .AND. (tb19h % qc == missing) .AND. &
149 (tb22v % qc == missing) .AND. &
150 (tb37v % qc == missing) .AND. (tb37h % qc == missing) .AND. &
151 (tb85v % qc == missing) .AND. (tb85h % qc == missing)) then
156 ! ====================================
161 call filter(tb19v%inv, tb19h%inv, tb22v%inv, tb37v%inv, &
162 tb37h%inv, tb85v%inv, tb85h%inv, ipass, iprecip, &
164 if (iprecip == 1) then
170 iv%info(ssmi_tb)%ntotal = iv%info(ssmi_tb)%ntotal + 1
171 if (outside) cycle reports
172 iv%info(ssmi_tb)%nlocal = iv%info(ssmi_tb)%nlocal + 1
180 iv%info(ssmt1)%max_lev = 1
181 iv%info(ssmt2)%max_lev = 1
182 iv%info(ssmi_tb)%max_lev = 1
183 iv%info(ssmi_rv)%max_lev = 1
186 call da_free_unit(iunit)
189 write(unit=stdout, fmt='(/,5x,a,i6/)') 'Rejected rain contaminated ssmi_tb =', irain
190 write(unit=stdout, fmt='(A)') ' '
193 if (trace_use) call da_trace_exit("da_scan_obs_ssmi")
195 end subroutine da_scan_obs_ssmi