19 use missing_values_mod
21 use fckit_log_module,
only : fckit_log
30 logical :: vert_interp_ops
32 real(kind_real) :: min_temp_grad
46 use fckit_configuration_module,
only: fckit_configuration
49 type(fckit_configuration),
intent(in) :: f_conf
50 call f_conf%get_or_die(
"min_temp_grad", self % min_temp_grad)
65 real(kind_real),
intent(inout) :: hofx(:)
66 type(c_ptr),
value,
intent(in) :: obss
68 character(len=*),
parameter :: myname_ =
"ufo_groundgnss_metoffice_simobs"
69 integer,
parameter :: max_string = 800
71 character(max_string) :: err_msg
72 character(max_string) :: message
80 real(kind_real),
allocatable :: zStation(:)
83 INTEGER :: ilev, nlevp, nlevq, iflip
84 REAL(kind_real),
allocatable :: pressure(:)
85 REAL(kind_real),
allocatable :: humidity(:)
86 REAL(kind_real),
allocatable :: za(:)
87 REAL(kind_real),
allocatable :: zb(:)
90 write(err_msg,*)
"TRACE: ufo_groundgnss_metoffice_simobs: begin"
91 call fckit_log%info(err_msg)
94 IF (geovals%nlocs /=
size(hofx))
THEN
95 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
96 call abor1_ftn(err_msg)
109 IF (prs % vals(1,1)-prs % vals(nlevp,1) < 0.0)
THEN
111 WRITE(message, *)
"Pressure is in ascending order. Reorder the variables in vertical direction"
112 CALL fckit_log % warning(message)
115 nobs = obsspace_get_nlocs(obss)
116 allocate(zstation(nobs))
118 call obsspace_get_db(obss,
"MetaData",
"station_height", zstation)
120 write(err_msg,*)
"TRACE: ufo_groundgnss_metoffice_simobs: begin observation loop, nobs = ", nobs
121 call fckit_log%info(err_msg)
125 allocate(pressure(1:nlevp))
126 allocate(humidity(1:nlevq))
127 allocate(za(1:nlevp))
128 allocate(zb(1:nlevq))
130 obs_loop:
do iobs = 1, nobs
134 pressure(ilev) = prs % vals(nlevp-ilev+1,iobs)
135 za(ilev) = rho_heights % vals(nlevp-ilev+1,iobs)
138 humidity(ilev) = q % vals(nlevq-ilev+1,iobs)
139 zb(ilev) = theta_heights % vals(nlevq-ilev+1,iobs)
142 pressure = prs % vals(:,iobs)
143 humidity = q % vals(:,iobs)
144 za = rho_heights % vals(:,iobs)
145 zb = theta_heights % vals(:,iobs)
154 self % min_temp_grad, &
159 write(message,
'(A,10I6)')
"Size of hofx = ", shape(hofx)
160 call fckit_log%debug(message)
161 write(message,
'(A,F12.4)')
"hofx(iobs) = ", hofx(iobs)
162 call fckit_log%debug(message)
166 write(err_msg,*)
"TRACE: ufo_groundgnss_metoffice_simobs: completed"
167 call fckit_log%info(err_msg)
184 gbgnss_min_temp_grad, &
189 INTEGER,
INTENT(IN) :: nlevp
190 INTEGER,
INTENT(IN) :: nlevq
191 REAL(kind_real),
INTENT(IN) :: za(1:nlevp)
192 REAL(kind_real),
INTENT(IN) :: zb(1:nlevq)
193 REAL(kind_real),
INTENT(IN) :: pressure(1:nlevp)
194 REAL(kind_real),
INTENT(IN) :: humidity(1:nlevq)
195 REAL(kind_real),
INTENT(IN) :: gbgnss_min_temp_grad
196 INTEGER,
INTENT(IN) :: nobs
198 REAL(kind_real),
INTENT(IN) :: zStation
199 REAL(kind_real),
INTENT(INOUT) :: Model_ZTD
205 REAL(kind_real) :: pN(nlevq)
206 REAL(kind_real),
ALLOCATABLE :: refrac(:)
208 INTEGER :: nRefLevels
209 REAL(kind_real) :: TopCorrection
213 integer,
parameter :: max_string = 800
214 character(len=*),
parameter :: myname_ =
"Ops_Groundgnss_ForwardModel"
219 REAL(kind_real) :: x(1:nlevp+nlevq)
220 character(max_string) :: err_msg
221 character(max_string) :: message
223 REAL(kind_real),
ALLOCATABLE :: model_heights(:)
226 IF (nlevp /= nlevq + 1)
THEN
227 write(err_msg,*) myname_ //
':' //
' Data must be on a staggered grid nlevp, nlevq = ', nlevp, nlevq
228 call fckit_log % warning(err_msg)
229 write(err_msg,*) myname_ //
':' //
' error: number of levels inconsistent!'
230 call abor1_ftn(err_msg)
241 gbgnss_min_temp_grad, &
260 model_ztd = model_ztd + topcorrection
262 write(message,
'(A,F16.14)')
"Model_ZTD = ", model_ztd
263 call fckit_log%debug(message)
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 Met Office forward operator.
subroutine ufo_groundgnss_metoffice_setup(self, f_conf)
subroutine ops_groundgnss_forwardmodel(nlevp, nlevq, za, zb, pressure, humidity, gbgnss_min_temp_grad, nobs, zStation, Model_ZTD)
subroutine ufo_groundgnss_metoffice_simobs(self, geovals, hofx, obss)
subroutine, public ops_groundgnss_topcorrection(P, nlevq, za, zb, TopCorrection)
subroutine, public ops_groundgnss_ztd(nlevq, refrac, zb, zStation, Model_ZTD)
Module for containing a general refractivity forward operator and its K-matrix.
subroutine, public ufo_calculate_refractivity(nlevP, nlevq, za, zb, P, q, vert_interp_ops, pseudo_ops, min_temp_grad, refracerr, nRefLevels, refractivity, model_heights, temperature, interp_pressure)
Calculation of the refractivity from the pressure and specific humidity.
character(len=maxvarlen), parameter, public var_prsi
character(len=maxvarlen), parameter, public var_q
character(len=maxvarlen), parameter, public var_zi
character(len=maxvarlen), parameter, public var_z
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators
Fortran derived type for groundgnss trajectory.