11 use fckit_configuration_module,
only: fckit_configuration
21 use missing_values_mod
26 use fckit_log_module,
only : fckit_log
34 real(kind_real),
allocatable :: obslon2d(:), obslat2d(:)
47 type(fckit_configuration),
intent(in) :: f_conf
48 integer,
intent(in) :: c_size
52 allocate(self%obsLon2d(c_size*self%roconf%n_horiz))
53 allocate(self%obsLat2d(c_size*self%roconf%n_horiz))
62 use ropp_fm_types,
only: state2dfm, state1dfm
63 use ropp_fm_types,
only: obs1dbangle
64 use typesizes,
only: wp => eightbytereal
65 use datetimetypes,
only: dp
70 real(kind_real),
intent(inout) :: hofx(:)
71 type(c_ptr),
value,
intent(in) :: obss
72 real(c_double) :: missing
75 type(state1dfm) :: x1d
76 type(obs1dbangle) :: y
78 character(len=*),
parameter :: myname_=
"ufo_gnssro_bndropp2d_simobs"
79 integer,
parameter :: max_string = 800
80 character(max_string) :: err_msg
81 integer :: nlev, nlocs, iobs, nvprof
83 type(
ufo_geoval),
pointer :: t, q, prs, gph, gph_sfc
84 real(kind_real),
allocatable :: obsImpP(:),obsLocR(:),obsGeoid(:),obsAzim(:)
85 real(kind_real),
allocatable :: obsLat(:),obsLon(:)
86 real(kind_real),
allocatable :: obsLonnh(:),obsLatnh(:)
88 real(kind_real) :: dtheta
89 real(kind_real) :: ob_time
90 integer,
allocatable,
dimension(:) :: ichk
92 n_horiz = self%roconf%n_horiz
93 dtheta = self%roconf%dtheta
95 write(err_msg,*)
"TRACE: ufo_gnssro_bndropp2d_simobs: begin"
96 call fckit_log%info(err_msg)
98 if (geovals%nlocs /=
size(hofx)*n_horiz)
then
99 write(err_msg,*) myname_,
' error: 2d nlocs inconsistent! geovals%nlocs, size(hofx), &
100 and n_horiz are', geovals%nlocs,
size(hofx), n_horiz
101 call abor1_ftn(err_msg)
111 missing = missing_value(missing)
113 nlocs = obsspace_get_nlocs(obss)
116 if (prs%vals(1,1) .lt. prs%vals(prs%nval,1) )
then
118 write(err_msg,
'(a)')
' ufo_gnssro_bndropp2d_simobs:'//new_line(
'a')// &
119 ' Model vertical height profile is in descending order,'//new_line(
'a')// &
120 ' but ROPP requires it to be ascending order, need flip'
121 call fckit_log%info(err_msg)
125 allocate(obslon(nlocs))
126 allocate(obslat(nlocs))
127 allocate(obsimpp(nlocs))
128 allocate(obslocr(nlocs))
129 allocate(obsgeoid(nlocs))
130 allocate(obsazim(nlocs))
131 allocate(obslatnh(n_horiz))
132 allocate(obslonnh(n_horiz))
134 call obsspace_get_db(obss,
"MetaData",
"longitude", obslon)
135 call obsspace_get_db(obss,
"MetaData",
"latitude", obslat)
136 call obsspace_get_db(obss,
"MetaData",
"impact_parameter", obsimpp)
137 call obsspace_get_db(obss,
"MetaData",
"earth_radius_of_curvature", obslocr)
138 call obsspace_get_db(obss,
"MetaData",
"geoid_height_above_reference_ellipsoid", obsgeoid)
139 call obsspace_get_db(obss,
"MetaData",
"sensor_azimuth_angle", obsazim)
143 allocate(ichk(nvprof))
145 write(err_msg,*)
"TRACE: ufo_gnssro_bndropp2d_simobs: begin observation loop, nlocs = ", nlocs
146 call fckit_log%info(err_msg)
149 obs_loop:
do iobs = 1, nlocs
151 if ( ( obsimpp(iobs)-obslocr(iobs)-obsgeoid(iobs) ) <= self%roconf%top_2d .and. &
152 obsazim(iobs) /= missing )
then
154 obslatnh = self%obsLat2d( (iobs-1)*n_horiz+1:iobs*n_horiz )
155 obslonnh = self%obsLon2d( (iobs-1)*n_horiz+1:iobs*n_horiz )
157 t%vals(:,(iobs-1)*n_horiz+1:iobs*n_horiz), &
158 q%vals(:,(iobs-1)*n_horiz+1:iobs*n_horiz), &
159 prs%vals(:,(iobs-1)*n_horiz+1:iobs*n_horiz), &
160 gph%vals(:,(iobs-1)*n_horiz+1:iobs*n_horiz), &
161 nlev,x,n_horiz,dtheta,iflip)
171 call ropp_fm_bangle_2d(x,y)
178 t%vals(:,(iobs-1)*n_horiz+1+(n_horiz-1)/2), &
179 q%vals(:,(iobs-1)*n_horiz+1+(n_horiz-1)/2), &
180 prs%vals(:,(iobs-1)*n_horiz+1+(n_horiz-1)/2), &
181 gph%vals(:,(iobs-1)*n_horiz+1+(n_horiz-1)/2), &
183 gph_sfc%vals(1,(iobs-1)*n_horiz+1+(n_horiz-1)/2), &
195 call ropp_fm_bangle_1d(x1d,y)
200 if (y%bangle(nvprof) .lt. -900.0_wp )
then
202 y%bangle(nvprof) = missing
204 hofx(iobs) = y%bangle(nvprof)
209 if ( ( obsimpp(iobs)-obslocr(iobs)-obsgeoid(iobs) ) <= self%roconf%top_2d )
then
227 write(err_msg,*)
"TRACE: ufo_gnssro_bndropp2d_simobs: completed"
228 call fckit_log%info(err_msg)
subroutine, public gnssro_conf_setup(roconf, f_conf)
Fortran module to prepare for Lagrange polynomial interpolation. based on GSI: lagmod....
subroutine, public lag_interp_const(q, x, n)
subroutine, public lag_interp_smthweights(x, xt, aq, bq, w, dw, n)
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
subroutine, public ufo_geovals_get_var(self, varname, geoval)
Fortran module for gnssro bending angle ropp2d forward operator following the ROPP (2018 Aug) impleme...
subroutine ufo_gnssro_bndropp2d_setup(self, f_conf, c_size)
subroutine ufo_gnssro_bndropp2d_simobs(self, geovals, hofx, obss)
Fortran module to handle gnssro bending angle observations following the ROPP (2018 Aug) implementati...
subroutine, public init_ropp_1d_statevec(step_time, rlon, rlat, temp, shum, pres, phi, lm, phi_sfc, x, iflip)
subroutine, public ropp_tidy_up_1d(x, y)
subroutine, public init_ropp_1d_obvec(nvprof, obs_impact, ichk, ob_time, rlat, rlon, roc, undulat, y)
Fortran module to handle gnssro bending angle observations following the ROPP (2018 Aug) implementati...
subroutine, public ropp_tidy_up_2d(x, y)
subroutine, public init_ropp_2d_statevec(rlon, rlat, temp, shum, pres, phi, lm, x, n_horiz, dtheta, iflip)
subroutine, public init_ropp_2d_obvec(nvprof, obs_impact, rlat, rlon, roc, undulat, y)
character(len=maxvarlen), parameter, public var_prs
character(len=maxvarlen), parameter, public var_q
character(len=maxvarlen), parameter, public var_sfc_geomz
character(len=maxvarlen), parameter, public var_z
character(len=maxvarlen), parameter, public var_ts
Fortran module to perform linear interpolation.
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators
Fortran derived type for gnssro trajectory.