3 USE RAD_BIAS
, only
: bias
, print_bias
, da_read_biasprep
, &
8 ! BIASSELE - TO PERFORM BASIC DATA SELETION FOR BIAS CORRECTION PROGRAMS.
15 INTEGER :: ntotal
, ngood
,nreject(5)
17 ! definition of defaut namelist values
18 !--------------------------------------
19 INTEGER :: platform_id
, satellite_id
, sensor_id
20 INTEGER :: isurf
,nscan
,ierr
22 NAMELIST /INPUTS
/ platform_id
, satellite_id
, sensor_id
, &
23 nscan
,isurf
! ISURF=1 : sea only
24 ! ISURF=2 : land + sea
27 ! 1. read and print namelist
29 READ(5,INPUTS
,END=100)
33 OPEN(UNIT
=10,FORM
='unformatted') ! Open input file
34 OPEN(UNIT
=11,FORM
='unformatted') ! Open output file
36 READ(UNIT
=10,END=990) tovs
%nchan
, tovs
%npred
! Read in data
39 allocate(tovs
%tb(tovs
%nchan
))
40 allocate(tovs
%omb(tovs
%nchan
))
41 allocate(tovs
%bias(tovs
%nchan
))
42 allocate(tovs
%qc_flag(tovs
%nchan
))
43 allocate(tovs
%cloud_flag(tovs
%nchan
))
44 allocate(tovs
%pred(tovs
%npred
))
53 call da_read_biasprep(tovs
,10,ierr
)
54 if (ierr
== 0) then ! not end
56 elseif (ierr
== 1) then ! end
59 stop 'read error in da_bias_sele'
63 IF ( mod(ntotal
,500) == 0 ) THEN
67 ! QC for whole pixel point
68 !-----------------------------
69 ! 2.1 wrong satellite test
70 !-----------------------------
71 IF (tovs
%platform_id
/= platform_id
.or
. &
72 tovs
%satellite_id
/= satellite_id
.or
. &
73 tovs
%sensor_id
/= sensor_id
) THEN
74 nreject(1) = nreject(1) + 1
78 !--------------------------------------------------------
79 ! 2.2 wrong scan position
80 !--------------------------------------------------------
81 IF ( tovs
%scanpos
<1 .or
. tovs
%scanpos
>nscan
) THEN
82 nreject(2) = nreject(2) + 1
86 !---------------------------------
87 ! 2.3 land,sea,height test
88 !---------------------------------
89 IF ( ((tovs
%landmask
== 0) .AND
. & ! over land
90 ((isurf
== 1) .OR
. (tovs
%elevation
> 2000.0))) .OR
. & ! reject land (ISURF=1, only sea) or above 2km
91 ((tovs
%landmask
== 1) .AND
. (isurf
== 3)) ) THEN ! reject sea (ISURF=3, only land)
92 nreject(3) = nreject(3) + 1
96 !------------------------
97 ! 2.4 cloud/rain check
98 !------------------------
99 IF ( any (tovs
%cloud_flag
/= 1) ) THEN
100 nreject(4) = nreject(4) + 1
104 !-----------------------------------------------
105 ! 2.5 surf_flag check (reject mixture surface)
106 !-----------------------------------------------
107 IF ( (tovs
%surf_flag
>= 4) ) THEN
108 nreject(5) = nreject(5) + 1
112 ngood
= ngood
+ 1 !! total obs number
114 call da_write_biasprep(tovs
,11)
125 deallocate(tovs
%bias
)
126 deallocate(tovs
%qc_flag
)
127 deallocate(tovs
%cloud_flag
)
128 deallocate(tovs
%pred
)
130 write(6,'(a,i10)') ' INPUT NUMBER OF OBS :', ntotal
131 write(6,'(a,i10)') 'OUTPUT NUMBER OF OBS :', ngood
132 write(6,'(a)') 'Rejected OBS by Cheching '
133 write(6,'(a)') 'SENSOR_ID SCANPOS SURFACE/HEIGHT CLOUD/RAIN SURF_FLAG'
134 write(6,'(5i10)') nreject
136 END PROGRAM da_bias_sele