Go to the documentation of this file.
21 use missing_values_mod
23 use fckit_log_module,
only : fckit_log
31 logical :: vert_interp_ops
46 use fckit_configuration_module,
only: fckit_configuration
49 type(fckit_configuration),
intent(in) :: f_conf
51 call f_conf%get_or_die(
"vert_interp_ops", self % vert_interp_ops)
52 call f_conf%get_or_die(
"pseudo_ops", self % pseudo_ops)
66 real(kind_real),
intent(inout) :: hofx(:)
67 type(c_ptr),
value,
intent(in) :: obss
69 character(len=*),
parameter :: myname_ =
"ufo_gnssro_bendmetoffice_simobs"
70 integer,
parameter :: max_string = 800
72 character(max_string) :: err_msg
73 character(max_string) :: message
81 real(kind_real),
allocatable :: obsLat(:)
82 real(kind_real),
allocatable :: obsLon(:)
83 real(kind_real),
allocatable :: impact_param(:)
84 real(kind_real),
allocatable :: radius_curv(:)
85 real(kind_real),
allocatable :: undulation(:)
89 write(err_msg,*)
"TRACE: ufo_gnssro_bendmetoffice_simobs: begin"
90 call fckit_log%info(err_msg)
93 if (geovals%nlocs /=
size(hofx))
then
94 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
95 call abor1_ftn(err_msg)
98 write(message, *) myname_,
' Running Met Office GNSS-RO forward operator with'
99 call fckit_log%info(message)
100 write(message, *)
'vert_interp_ops =', self % vert_interp_ops, &
101 'pseudo_ops =', self % pseudo_ops
102 call fckit_log%info(message)
110 write(message,
'(A,10I6)')
'Q: ', q%nval, q%nlocs, shape(q%vals)
111 call fckit_log%info(message)
112 write(message,
'(A,10I6)')
'Pressure: ', prs%nval, prs%nlocs, shape(prs%vals)
113 call fckit_log%info(message)
115 nobs = obsspace_get_nlocs(obss)
118 if (prs%vals(1,1) .lt. prs%vals(prs%nval,1) )
then
119 write(err_msg,
'(a)')
' ufo_gnssro_bendmetoffice_simobs:'//new_line(
'a')// &
120 ' Model vertical height profile is in descending order,'//new_line(
'a')// &
121 ' The data will be flipped for processing'
122 call fckit_log%info(err_msg)
127 allocate(obslon(nobs))
128 allocate(obslat(nobs))
129 allocate(impact_param(nobs))
130 allocate(radius_curv(nobs))
131 allocate(undulation(nobs))
133 call obsspace_get_db(obss,
"MetaData",
"longitude", obslon)
134 call obsspace_get_db(obss,
"MetaData",
"latitude", obslat)
135 call obsspace_get_db(obss,
"MetaData",
"impact_parameter", impact_param)
136 call obsspace_get_db(obss,
"MetaData",
"earth_radius_of_curvature", radius_curv)
137 call obsspace_get_db(obss,
"MetaData",
"geoid_height_above_reference_ellipsoid", undulation)
139 call fckit_log%info(err_msg)
141 obs_loop:
do iobs = 1, nobs
143 call fckit_log%info(err_msg)
148 rho_heights % vals(rho_heights%nval:1:-1, iobs), &
149 theta_heights % vals(theta_heights%nval:1:-1, iobs), &
150 prs % vals(prs%nval:1:-1, iobs), &
151 q % vals(q%nval:1:-1, iobs), &
153 self % vert_interp_ops, &
155 impact_param(iobs:iobs), &
164 rho_heights % vals(:,iobs), &
165 theta_heights % vals(:,iobs), &
166 prs % vals(:,iobs), &
169 self % vert_interp_ops, &
171 impact_param(iobs:iobs), &
180 write(err_msg,*)
"Error with observation processing ", iobs
181 call fckit_log % info(err_msg)
188 deallocate(impact_param)
189 deallocate(radius_curv)
190 deallocate(undulation)
192 write(err_msg,*)
"TRACE: ufo_gnssro_bendmetoffice_simobs: completed"
193 call fckit_log%info(err_msg)
206 GPSRO_vert_interp_ops, &
215 INTEGER,
INTENT(IN) :: nlevP
216 INTEGER,
INTENT(IN) :: nlevq
217 REAL(kind_real),
INTENT(IN) :: za(1:nlevP)
218 REAL(kind_real),
INTENT(IN) :: zb(1:nlevQ)
219 REAL(kind_real),
INTENT(IN) :: pressure(1:nlevP)
220 REAL(kind_real),
INTENT(IN) :: humidity(1:nlevQ)
221 LOGICAL,
INTENT(IN) :: GPSRO_pseudo_ops
222 LOGICAL,
INTENT(IN) :: GPSRO_vert_interp_ops
223 INTEGER,
INTENT(IN) :: nobs
224 REAL(kind_real),
INTENT(IN) :: zobs(1:nobs)
225 REAL(kind_real),
INTENT(IN) :: RO_Rad_Curv
226 REAL(kind_real),
INTENT(IN) :: Latitude
227 REAL(kind_real),
INTENT(IN) :: RO_geoid_und
228 REAL(kind_real),
INTENT(INOUT) :: ycalc(1:nobs)
229 LOGICAL,
INTENT(OUT) :: BAErr
233 REAL(kind_real),
ALLOCATABLE :: z_pseudo(:)
234 REAL(kind_real),
ALLOCATABLE :: N_pseudo(:)
236 REAL(kind_real) :: T(1:nlevq)
237 REAL(kind_real),
ALLOCATABLE :: nr(:)
238 REAL(kind_real) :: Refmodel(1:nlevq)
242 integer,
parameter :: max_string = 800
243 character(len=*),
parameter :: myname_ =
"Ops_GPSRO_ForwardModel"
248 INTEGER :: num_pseudo
250 REAL(kind_real) :: x(1:nlevP+nlevQ)
251 character(max_string) :: err_msg
254 IF (nlevp /= nlevq + 1)
THEN
255 write(err_msg,*) myname_ //
':' //
' Data must be on a staggered grid nlevp, nlevq = ', nlevp, nlevq
256 call fckit_log % warning(err_msg)
257 write(err_msg,*) myname_ //
':' //
' error: number of levels inconsistent!'
258 call abor1_ftn(err_msg)
261 nstate = nlevp + nlevq
263 x(1:nlevp) = pressure
264 x(nlevp+1:nstate) = humidity
266 IF (gpsro_pseudo_ops)
THEN
267 num_pseudo = 2 * nlevq - 1
271 ALLOCATE(nr(1:num_pseudo))
283 gpsro_vert_interp_ops, &
292 IF (.NOT. baerr)
THEN
294 IF (gpsro_pseudo_ops)
THEN
Fortran module for gnssro bending angle Met Office forward operator.
subroutine ops_gpsro_forwardmodel(nlevP, nlevq, za, zb, pressure, humidity, GPSRO_pseudo_ops, GPSRO_vert_interp_ops, nobs, zobs, RO_Rad_Curv, Latitude, RO_geoid_und, ycalc, BAErr)
Fortran module to prepare for Lagrange polynomial interpolation. based on GSI: lagmod....
character(len=maxvarlen), parameter, public var_zi
subroutine, public ops_gpsro_refrac(nstate, nlevP, nb, nlevq, za, zb, x, GPSRO_pseudo_ops, GPSRO_vert_interp_ops, refracerr, refrac, T, z_pseudo, N_pseudo, nb_pseudo)
subroutine, public lag_interp_smthweights(x, xt, aq, bq, w, dw, n)
subroutine ufo_gnssro_bendmetoffice_setup(self, f_conf)
Fortran module to perform linear interpolation.
character(len=maxvarlen), parameter, public var_prsi
subroutine, public lag_interp_const(q, x, n)
subroutine, public ops_gpsrocalc_alpha(nobs, nlev, a, refrac, nr, alpha)
subroutine ufo_gnssro_bendmetoffice_simobs(self, geovals, hofx, obss)
character(len=maxvarlen), parameter, public var_z
subroutine, public ufo_geovals_get_var(self, varname, geoval)
character(len=maxvarlen), parameter, public var_q
type to hold interpolated fields required by the obs operators
type to hold interpolated field for one variable, one observation
Fortran derived type for gnssro trajectory.
subroutine, public ops_gpsrocalc_nr(zb, nb, Rad, lat, und, refrac, nr)
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.