18 use missing_values_mod
20 use fckit_log_module,
only : fckit_log
56 use ropp_fm_types,
only: state1dfm
57 use ropp_fm_types,
only: obs1drefrac
58 use typesizes,
only: wp => eightbytereal
59 use datetimetypes,
only: dp
64 real(kind_real),
intent(inout) :: hofx(:)
65 type(c_ptr),
value,
intent(in) :: obss
66 real(c_double) :: missingDouble
69 type(obs1drefrac) :: y
71 character(len=*),
parameter :: myname_=
"ufo_groundgnss_ropp_simobs"
72 real(kind=dp) :: ob_time
73 integer,
parameter :: max_string = 800
75 character(max_string) :: err_msg
76 integer :: nlev, nobs, iobs
77 integer,
allocatable,
dimension(:) :: ichk
78 type(
ufo_geoval),
pointer :: t, q, prs, gph, z_sfc
79 real(kind_real),
allocatable :: obsLat(:), obsLon(:)
80 real(kind_real),
allocatable :: obsHeight(:), obsValue(:)
81 real(kind_real),
allocatable :: model_z(:)
82 real(kind_real) :: station_phi
83 real(kind_real) :: model_ztd
86 write(err_msg,*)
"TRACE: ufo_groundgnss_ropp_simobs: begin"
87 call fckit_log%info(err_msg)
90 if (geovals%nlocs /=
size(hofx))
then
91 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
92 call abor1_ftn(err_msg)
102 missingdouble = missing_value(missingdouble)
105 nobs = obsspace_get_nlocs(obss)
109 if (prs%vals(1,1) .lt. prs%vals(prs%nval,1) )
then
111 write(err_msg,
'(a)')
' ufo_groundgnss_ropp_simobs:'//new_line(
'a')// &
112 ' Model vertical height profile is in descending order,'//new_line(
'a')// &
113 ' but ROPP requires it to be ascending order, need flip'
114 call fckit_log%info(err_msg)
118 allocate(obslon(nobs))
119 allocate(obslat(nobs))
120 allocate(obsheight(nobs))
121 allocate(obsvalue(nobs))
124 allocate(model_z(nlev))
127 call obsspace_get_db(obss,
"MetaData",
"longitude", obslon)
128 call obsspace_get_db(obss,
"MetaData",
"latitude", obslat)
129 call obsspace_get_db(obss,
"MetaData",
"station_height", obsheight)
130 call obsspace_get_db(obss,
"ObsValue",
"ZTD", obsvalue)
136 write(err_msg,*)
"TRACE: ufo_groundgnss_ropp_simobs: begin observation loop, nobs = ", nobs
137 call fckit_log%info(err_msg)
139 obs_loop:
do iobs = 1, nobs
151 z_sfc%vals(1,iobs), &
162 call ropp_fm_refrac_1d(x,y)
166 call gnss_ztd_integral(nlev, y%refrac, model_z, obsheight(iobs), model_ztd, l_linear)
168 if ( model_ztd == 0.0 )
then
169 model_ztd = missingdouble
173 if ( iobs == 1 )
then
174 write(err_msg,
'(a9,2a11,2a16,2a15)')
'ROPPsim: ',
'lat',
'lon', &
175 'ob',
'bk',
'station_hgt',
'model_terr'
176 call fckit_log%debug(err_msg)
178 write(err_msg,
'(9x,2f11.3,2f16.6,2f15.3)') &
185 call fckit_log%debug(err_msg)
187 hofx(iobs) = model_ztd
197 deallocate(obsheight)
201 write(err_msg,*)
"TRACE: ufo_groundgnss_ropp_simobs: completed"
202 call fckit_log%info(err_msg)
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 ground-based gnss refractivity ropp forward operator following the ROPP (2018 Aug)...
subroutine ufo_groundgnss_ropp_simobs(self, geovals, hofx, obss)
Fortran module to handle ground-based gnss observations following the ROPP (2018 Aug) implementation.
subroutine, public ropp_tidy_up_1d(x, y)
subroutine, public calc_model_z(nlev, rlat, model_phi, model_z)
subroutine, public init_ropp_1d_obvec(nlev, ichk, ob_time, rlat, rlon, station_phi, x, y)
subroutine, public gnss_ztd_integral(lm, model_refrac, model_z, ob_terr, model_ztd, l_linear)
subroutine, public calc_station_phi(rlat, station_height, station_phi)
subroutine, public init_ropp_1d_statevec(step_time, rlon, rlat, temp, shum, pres, phi, lm, z_sfc, x, iflip)
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
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators
Fortran derived type for ground based gnss trajectory.