8 use fckit_log_module,
only: fckit_log
13 integer,
intent(in) :: nobs
14 real(kind_real),
dimension(nobs),
intent(in) :: obsImpH, obsValue
15 integer(c_int),
dimension(nobs),
intent(in) :: QCflags(:)
16 real(kind_real),
dimension(nobs),
intent(out) :: obsErr
17 real(kind_real) :: H_km, missing
24 if (qcflags(i) .eq. 0)
then
26 h_km = obsimph(i)/1000.0_kind_real
28 if ( h_km <= 10.0 )
then
29 obserr(i) = (h_km*1.25 + (10-h_km)*20)/10.0
30 obserr(i) = obserr(i)/100.0*obsvalue(i)
31 else if ( h_km > 10.0 .and. h_km <= 32.0 )
then
32 obserr(i) = 1.25/100.0*obsvalue(i)
45 integer,
intent(in) :: nobs
46 real(kind_real),
dimension(nobs),
intent(in) :: obsImpH, obsValue, obsLat
47 integer(c_int),
dimension(nobs),
intent(in) :: QCflags(:)
48 real(kind_real),
dimension(nobs),
intent(out) :: obsErr
49 real(kind_real):: H_m, missing
50 real(kind_real):: lat_in_rad,trop_proxy,damping_factor,errfac
51 real(kind_real):: max_sfc_error, min_ba_error
61 if (qcflags(i) .eq. 0)
then
64 lat_in_rad = deg2rad * obslat(i)
65 trop_proxy = 8666.66 + 3333.33*cos(2.0*lat_in_rad)
66 damping_factor = 0.66 + cos(lat_in_rad)/3.0
67 errfac = max_sfc_error*damping_factor*(trop_proxy - h_m)/trop_proxy
68 errfac = max(min_ba_error, errfac)
69 obserr(i) = max(obsvalue(i)*errfac/100.0, 3.0*1e-6)
80 integer,
intent(in) :: nobs
81 real(kind_real),
dimension(nobs),
intent(in) :: obsImpH, obsLat
82 integer(c_int),
dimension(nobs),
intent(in) :: obsSaid, QCflags(:)
83 real(kind_real),
dimension(nobs),
intent(out) :: obsErr
84 real(kind_real) :: H_km, missing
92 if (qcflags(i) .eq. 0)
then
94 h_km = obsimph(i)/1000.0_kind_real
95 if( (obssaid(i)==41).or.(obssaid(i)==722).or.(obssaid(i)==723).or. &
96 (obssaid(i)==4).or.(obssaid(i)==42).or.(obssaid(i)==3).or. &
97 (obssaid(i)==5).or.(obssaid(i)==821.or.(obssaid(i)==421)).or. &
98 (obssaid(i)==440).or.(obssaid(i)==43))
then
99 if( abs(obslat(i))>= 40.00 )
then
101 obserr(i)=0.19032 +0.287535 *h_km-0.00260813*h_km**2
103 obserr(i)=-3.20978 +1.26964 *h_km-0.0622538 *h_km**2
107 obserr(i)=-1.87788 +0.354718 *h_km-0.00313189 *h_km**2
109 obserr(i)=-2.41024 +0.806594 *h_km-0.027257 *h_km**2
114 if( abs(obslat(i))>= 40.00 )
then
115 if ( h_km>12.00 )
then
116 obserr(i)=-0.685627 +0.377174 *h_km-0.00421934 *h_km**2
118 obserr(i)=-3.27737 +1.20003 *h_km-0.0558024 *h_km**2
121 if( h_km>18.00 )
then
122 obserr(i)=-2.73867 +0.447663 *h_km-0.00475603 *h_km**2
124 obserr(i)=-3.45303 +0.908216 *h_km-0.0293331 *h_km**2
127 obserr(i) = 0.001 /abs(exp(obserr(i)))
140 integer,
intent(in) :: nobs
141 real(kind_real),
dimension(nobs),
intent(in) :: obsLat, obsZ
142 real(kind_real),
dimension(nobs),
intent(out) :: obsErr
143 integer(c_int),
dimension(nobs),
intent(in) :: QCflags(:)
144 real(kind_real) :: H_km, missing
152 if (qcflags(i) .eq. 0)
then
153 h_km = obsz(i)/1000.0_kind_real
154 if( abs(obslat(i))>= 20.0 )
then
155 obserr(i)=-1.321+0.341*h_km-0.005*h_km**2
158 obserr(i)=2.013-0.060*h_km+0.0045*h_km**2
160 obserr(i)=-1.18+0.058*h_km+0.025*h_km**2
163 obserr(i) = 1.0_kind_real/abs(exp(obserr(i)))
171 air_temperature, geopotential_height, obsZ, obsValue, obsErr, &
177 integer,
intent(in) :: nobs
178 integer,
intent(in) :: n_horiz
179 character(len=*),
intent(in) :: rmatrix_filename
180 integer,
intent(in) :: obsSatid(:)
181 integer,
intent(in) :: obsOrigC(:)
182 integer,
intent(in) :: nlevs
183 real,
intent(in) :: air_temperature(:,:)
184 real,
intent(in) :: geopotential_height(:,:)
185 real(kind_real),
intent(in) :: obsZ(:)
186 real(kind_real),
intent(in) :: obsValue(:)
187 real(kind_real),
intent(out) :: obsErr(:)
188 integer(c_int),
intent(in) :: QCflags(:)
189 real(kind_real),
intent(in) :: missing
192 integer,
parameter :: Rmax_num = 1000
197 real(kind_real) :: frac_err
201 integer :: R_num_sats
202 character(len=200) :: Message
218 if (qcflags(iob) .eq. 0)
then
220 IF (rmatrix_list(1) % av_temp > 0)
THEN
230 igeoval = (iob-1) * n_horiz + (n_horiz + 1) / 2
232 IF (geopotential_height(igeoval, ilev) < rmatrix_list(1) % max_height)
THEN
233 av_temp = av_temp + air_temperature(igeoval, ilev)
234 npoints = npoints + 1
238 IF (npoints > 0)
THEN
239 av_temp = av_temp / npoints
255 WRITE (message,
'(2A)')
"RMatrices must have positive average ", &
257 CALL abor1_ftn(message)
260 do iheight = 1, rmatrix % num_heights - 1
261 if (obsz(iob) < rmatrix % height(iheight + 1))
then
267 frac_err = rmatrix % frac_err(iheight) + &
268 (rmatrix % frac_err(iheight + 1) - rmatrix % frac_err(iheight)) * &
269 (obsz(iob) - rmatrix % height(iheight)) / &
270 (rmatrix % height(iheight + 1) - rmatrix % height(iheight))
272 WRITE(message,
'(A,I8,2F16.4,2E26.8)')
'Result', iob, obsz(iob), frac_err, &
273 obserr(iob), max(frac_err * obsvalue(iob), rmatrix % min_error)
274 CALL fckit_log % debug(message)
277 obserr(iob) = max(frac_err * obsvalue(iob), rmatrix % min_error)
280 obserr(iob) = missing
287 subroutine gnssro_obserr_latitude(nobs, rmatrix_filename, obsSatid, obsOrigC, obsLat, obsZ, obsValue, obsErr, QCflags, missing)
292 integer,
intent(in) :: nobs
293 character(len=*),
intent(in) :: rmatrix_filename
294 integer,
intent(in) :: obsSatid(:)
295 integer,
intent(in) :: obsOrigC(:)
296 real(kind_real),
intent(in) :: obsLat(:)
297 real(kind_real),
intent(in) :: obsZ(:)
298 real(kind_real),
intent(in) :: obsValue(:)
299 real(kind_real),
intent(out) :: obsErr(:)
300 integer(c_int),
intent(in) :: QCflags(:)
301 real(kind_real),
intent(in) :: missing
304 integer,
parameter :: Rmax_num = 1000
309 real(kind_real) :: frac_err
310 integer :: R_num_sats
311 character(len=200) :: Message
327 if (qcflags(iob) .eq. 0)
then
328 IF (rmatrix_list(1) % latitude > 0)
THEN
336 WRITE (message,
'(2A)')
"RMatrices must have positive average ", &
337 "temperature or latitude"
338 CALL abor1_ftn(message)
341 do iheight = 1, rmatrix % num_heights
342 if (obsz(iob) < rmatrix % height(iheight))
then
348 if (iheight == 1)
then
349 frac_err = rmatrix % frac_err(iheight)
350 else if (iheight > rmatrix % num_heights)
then
351 frac_err = rmatrix % frac_err(rmatrix % num_heights)
353 frac_err = rmatrix % frac_err(iheight - 1) + &
354 (rmatrix % frac_err(iheight) - rmatrix % frac_err(iheight - 1)) * &
355 (obsz(iob) - rmatrix % height(iheight - 1)) / &
356 (rmatrix % height(iheight) - rmatrix % height(iheight - 1))
359 WRITE(message,
'(A,I8,2F16.4,2E21.8,F12.4)')
'Result', iob, obsz(iob), &
360 frac_err, obserr(iob), max(frac_err * obsvalue(iob), rmatrix % min_error), &
362 CALL fckit_log % debug(message)
365 obserr(iob) = max(frac_err * obsvalue(iob), rmatrix % min_error)
368 WRITE(message,
'(A,I8,2F16.4)')
'Missing', iob, obsz(iob), obslat(iob)
369 CALL fckit_log % debug(message)
370 obserr(iob) = missing
subroutine bending_angle_obserr_nbam(obsLat, obsImpH, obsSaid, nobs, obsErr, QCflags, missing)
subroutine bending_angle_obserr_ecmwf(obsImpH, obsValue, nobs, obsErr, QCflags, missing)
subroutine gnssro_obserr_latitude(nobs, rmatrix_filename, obsSatid, obsOrigC, obsLat, obsZ, obsValue, obsErr, QCflags, missing)
subroutine refractivity_obserr_nbam(obsLat, obsZ, nobs, obsErr, QCflags, missing)
subroutine gnssro_obserr_avtemp(nobs, n_horiz, rmatrix_filename, obsSatid, obsOrigC, nlevs, air_temperature, geopotential_height, obsZ, obsValue, obsErr, QCflags, missing)
subroutine bending_angle_obserr_nrl(obsLat, obsImpH, obsValue, nobs, obsErr, QCflags, missing)
Fortran module for utility routines used in calculating the observation uncertainties,...
subroutine, public ufo_roobserror_getrmatrix(max_mats, filename, Rmatrix, R_num_mats)
subroutine ufo_roobserror_findnearest_rmatrix(satid, origc, latitude, R_num_sats, Rmatrix_list, out_matrix)
subroutine ufo_roobserror_interpolate_rmatrix(satid, origc, av_temp, R_num_sats, Rmatrix_list, out_matrix)