38 prof_x, hofxdiags, rttov_simobs, &
47 integer,
intent(in) :: channels(:)
49 real(kind_real),
intent(in) :: prof_x(:)
52 real(kind_real),
intent(out) :: hofx(:)
53 real(kind_real),
intent(out) :: h_matrix(:,:)
55 select case (trim(ob % forward_mod_name))
58 rttov_simobs, channels, &
59 profindex, hofxdiags, &
60 self % UseQtsplitRain, self % FullDiagnostics, &
64 call abor1_ftn(
"rttovonedvarcheck get jacobian: no suitable forward model => exiting")
82 rttov_data, channels, profindex, &
83 hofxdiags, UseQtsplitRain, FullDiagnostics, &
91 type(c_ptr),
value,
intent(in) :: obsdb
93 integer,
intent(in) :: channels(:)
96 logical,
intent(in) :: UseQtsplitRain
97 logical,
intent(in) :: FullDiagnostics
98 real(kind_real),
intent(out) :: hofx(:)
99 real(kind_real),
intent(out) :: H_matrix(:,:)
102 integer :: nchans, nlevels, nq_levels
105 logical :: RTTOV_GasunitConv = .false.
106 real(kind_real),
allocatable :: q_kgkg(:)
107 real(kind_real) :: s2m_kgkg
109 real(kind_real),
allocatable :: pressure(:)
110 real(kind_real),
allocatable :: dq_dqt(:)
111 real(kind_real),
allocatable :: dql_dqt(:)
112 real(kind_real),
allocatable :: dqi_dqt(:)
113 real(kind_real),
allocatable :: dBT_dq(:)
114 real(kind_real),
allocatable :: dBT_dql(:)
115 character(len=max_string) :: varname
116 real(c_double) :: BT(size(ob % channels_all))
117 real(kind_real) :: u, v, dBT_du, dBT_dv, windsp
119 nchans =
size(channels)
121 call rttov_data % simobs(geovals, obsdb,
size(ob % channels_all), 1, bt, hofxdiags, ob_info=ob)
126 all_chan_loop:
do i = 1,
size(ob % channels_all)
128 if(channels(j) == ob % channels_all(i))
then
141 if (profindex % t(1) > 0)
then
142 nlevels = profindex % t(2) - profindex % t(1) + 1
144 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_ts),
"_",channels(i)
146 h_matrix(i,profindex % t(1):profindex % t(2)) = geoval % vals(:,1)
159 if (profindex % q(1) > 0)
then
161 nq_levels = profindex % q(2)-profindex % q(1)+1
162 allocate(q_kgkg(nq_levels))
167 q_kgkg(:) = geoval%vals(nlevels:1:-1, 1)
170 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_q),
"_",channels(i)
172 h_matrix(i,profindex % q(1):profindex % q(2)) = geoval % vals(:,1) * q_kgkg(:)
190 if (profindex % qt(1) > 0)
then
192 allocate(q_kgkg(nlevels))
193 allocate(pressure(nlevels))
194 allocate(dq_dqt(nlevels))
195 allocate(dql_dqt(nlevels))
196 allocate(dqi_dqt(nlevels))
197 allocate(dbt_dq(nlevels))
198 allocate(dbt_dql(nlevels))
203 q_kgkg(:) = q_kgkg(:) + geoval%vals(nlevels:1:-1, 1)
205 q_kgkg(:) = q_kgkg(:) + geoval%vals(nlevels:1:-1, 1)
207 q_kgkg(:) = q_kgkg(:) + geoval%vals(nlevels:1:-1, 1)
211 pressure(:) = geoval%vals(nlevels:1:-1, 1)
216 ob % background_T(nlevels:1:-1), &
226 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_", trim(
var_q),
"_", channels(i)
229 dbt_dq(:) = geoval % vals(:,1)
231 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_", trim(
var_clw),
"_", channels(i)
234 dbt_dql(:) = geoval % vals(:,1)
236 h_matrix(i,profindex % qt(1):profindex % qt(2)) = &
237 (dbt_dq(:) * dq_dqt(:) + &
238 dbt_dql(:) * dql_dqt(:) ) * q_kgkg(:)
259 if (profindex % t2 > 0)
then
261 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_sfc_t2m),
"_",channels(i)
263 h_matrix(i,profindex % t2) = geoval % vals(1,1)
269 if (profindex % q2 > 0)
then
272 s2m_kgkg = geoval%vals(1, 1)
274 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_sfc_q2m),
"_",channels(i)
276 h_matrix(i,profindex % q2) = geoval % vals(1,1) * s2m_kgkg
282 if (profindex % pstar > 0)
then
284 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_sfc_p2m),
"_",channels(i)
286 h_matrix(i,profindex % pstar) = geoval % vals(1,1)
294 if (profindex % windspeed > 0)
then
296 u = geoval % vals(1, 1)
298 v = geoval % vals(1, 1)
299 windsp = sqrt(u ** 2 + v ** 2)
302 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_sfc_u10),
"_",channels(i)
304 dbt_du = geoval % vals(1,1)
305 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_sfc_v10),
"_",channels(i)
307 dbt_dv = geoval % vals(1,1)
308 if (windsp >
zero)
then
310 h_matrix(i,profindex % windspeed) = (dbt_du * u + dbt_dv * v) / windsp
312 h_matrix(i,profindex % windspeed) =
zero
319 if (profindex % tstar > 0)
then
321 write(varname,
"(3a,i0)")
"brightness_temperature_jacobian_",trim(
var_sfc_tskin),
"_",channels(i)
323 h_matrix(i,profindex % tstar) = geoval % vals(1,1)
395 if (fulldiagnostics)
then
398 profindex % nprofelements, &
399 ob % channels_used, &
417 nprofelements, & ! in
425 integer,
intent(in) :: nchans
426 integer,
intent(in) :: nprofelements
427 integer,
intent(in) :: channels(nchans)
428 real(kind_real),
intent(in) :: H_matrix(nchans,nprofelements)
433 character(len=10) :: int_fmt
434 character(len=12) :: real_fmt
435 character(len=3) :: txt_nchans
436 character(len=*),
parameter :: RoutineName =
"ufo_rttovonedvarcheck_PrintHmatrix"
439 write( unit=txt_nchans,fmt=
'(i3)' ) nchans
440 write( unit=int_fmt,fmt=
'(a)' )
'(' // trim(txt_nchans) //
'I30)'
441 write( unit=real_fmt,fmt=
'(a)' )
'(' // trim(txt_nchans) //
'E30.15)'
445 write(*, int_fmt) channels(:)
447 if ( profindex % t(1) > 0 )
THEN
448 write(*,
'(a)')
'Temperature Profile'
449 do i = profindex%t(1),profindex%t(2)
450 write(*, real_fmt) h_matrix(:,i)
454 if ( profindex % q(1) > 0 )
THEN
455 write(*,
'(a)')
'q Profile'
456 do i = profindex%q(1),profindex%q(2)
457 write(*, real_fmt) h_matrix(:,i)
461 if ( profindex % qt(1) > 0 )
THEN
462 write(*,
'(a)')
'qt Profile /1000'
463 do i = profindex%qt(1),profindex%qt(2)
464 write(*, real_fmt) h_matrix(:,i)/1000
468 if ( profindex % o3profile(1) > 0 )
THEN
469 write(*,
'(a)')
'Ozone Profile'
470 do i = profindex%o3profile(1),profindex%o3profile(2)
471 write(*, real_fmt) h_matrix(:,i)
475 if ( profindex % o3total > 0 )
THEN
476 write(*,
'(a)')
'Total Column Ozone'
477 write(*, real_fmt) h_matrix(:,profindex%o3total)
481 if ( profindex % lwp > 0 )
THEN
482 write(*,
'(a)')
'LWP'
483 write(*, real_fmt) h_matrix(i,profindex % lwp)
486 if ( profindex % t2 > 0 )
THEN
487 write(*,
'(a)')
'2m T'
488 write(*, real_fmt) h_matrix(:,profindex % t2)
491 if ( profindex % q2 > 0 )
THEN
492 write(*,
'(a)')
'2m q'
493 write(*, real_fmt) h_matrix(:,profindex % q2)
496 if ( profindex % pstar > 0 )
THEN
497 write(*,
'(a)')
'P Star'
498 write(*, real_fmt) h_matrix(:,profindex % pstar)
501 if ( profindex % windspeed > 0 )
THEN
502 write(*,
'(a)')
'Windspeed'
503 write(*, real_fmt) h_matrix(:,profindex % windspeed)
506 if ( profindex % tstar > 0 )
THEN
507 write(*,
'(a)')
'Skin Temperature'
508 write(*, real_fmt) h_matrix(:,profindex % tstar)
511 if ( profindex % mwemiss(1) > 0)
THEN
512 write(*,
'(a)')
'Microwave emissivity retrieval'
513 do i = profindex%mwemiss(1),profindex%mwemiss(2)
514 write(*, real_fmt) h_matrix(:,i)
518 if ( profindex % cloudtopp > 0 )
THEN
519 write(*,
'(a)')
'Cloud top pressure'
520 write(*, real_fmt) h_matrix(:,profindex % cloudtopp)
523 if ( profindex % cloudfrac > 0 )
THEN
524 write(*,
'(a)')
'Effective cloud fraction'
525 write(*, real_fmt) h_matrix(:,profindex % cloudfrac)
529 write(*,
'(a)')
'End H-Matrix'
530 write(*,
'(a)')
'------------------------'
real(kind_real), parameter, public zero
subroutine, public ufo_geovals_get_var(self, varname, geoval)
Fortran module for radiancerttov observation operator.
Fortran module constants used throughout the rttovonedvarcheck filter.
Fortran module to get the jacobian for the 1D-Var.
subroutine ufo_rttovonedvarcheck_printhmatrix(nchans, nprofelements, channels, H_matrix, profindex)
Routine to print the contents of the jacobian for testing.
subroutine, public ufo_rttovonedvarcheck_get_jacobian(self, geovals, ob, channels, profindex, prof_x, hofxdiags, rttov_simobs, hofx, H_matrix)
Get the jacobian used in the 1D-Var.
subroutine ufo_rttovonedvarcheck_gethmatrixrttovsimobs(geovals, ob, obsdb, rttov_data, channels, profindex, hofxdiags, UseQtsplitRain, FullDiagnostics, hofx, H_matrix)
Get the jacobian from rttov and if neccessary convert to variables used in the 1D-Var.
Fortran module which contains the observation metadata for a single observation.
Fortran module containing profile index.
Fortran module containing main type, setup and utilities for the main rttovonedvarcheck object.
Fortran module with various useful routines.
subroutine, public ops_satrad_qsplit(output_type, p, t, qtotal, q, ql, qi, UseQtSplitRain)
Split the humidity into water vapour, liquid water and ice.
character(len=maxvarlen), parameter, public var_clw
character(len=maxvarlen), parameter, public var_sfc_v10
character(len=maxvarlen), parameter, public var_prs
character(len=maxvarlen), parameter, public var_q
character(len=maxvarlen), parameter, public var_sfc_u10
character(len=maxvarlen), parameter, public var_sfc_q2m
character(len=maxvarlen), parameter, public var_sfc_tskin
character(len=maxvarlen), parameter, public var_sfc_p2m
character(len=maxvarlen), parameter, public var_ts
character(len=maxvarlen), parameter, public var_cli
character(len=maxvarlen), parameter, public var_sfc_t2m
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators
Fortran derived type for the observation type.