33 use ropp_fm_types,
only: state1dfm
34 use ropp_fm_types,
only: obs1dbangle
35 use datetimetypes,
only: dp
37 class(ufo_gnssro_BndROPP1D),
intent(in):: self
38 type(ufo_geovals),
intent(in) :: geovals
39 real(kind_real),
intent(inout) :: hofx(:)
40 type(c_ptr),
value,
intent(in) :: obss
43 type(Obs1dBangle) :: y
45 character(len=*),
parameter :: myname_=
"ufo_gnssro_bndropp1d_simobs" 46 real(kind=dp) :: ob_time
47 integer,
parameter :: max_string = 800
49 character(max_string) :: err_msg
50 character(len=250) :: record
55 integer,
allocatable,
dimension(:) :: ichk
56 type(ufo_geoval),
pointer :: t, q, prs, z, z_sfc
57 real(kind_real),
allocatable :: obsLat(:), obsLon(:), obsImpP(:), obsLocR(:), obsGeoid(:)
58 real(kind_real),
allocatable :: obsYYYY(:), obsMM(:), obsDD(:), obsHH(:), obsMN(:), obsSS(:)
61 write(*,*)
"TRACE: ufo_gnssro_bndropp1d_simobs: begin" 63 if (geovals%nobs /=
size(hofx))
then 64 write(err_msg,*) myname_,
' error: nobs inconsistent!' 65 call abor1_ftn(err_msg)
70 write(err_msg,*) myname_, trim(
var_prs),
' doesnt exist' 71 call abor1_ftn(err_msg)
76 write(err_msg,*) myname_, trim(
var_q),
' doesnt exist' 77 call abor1_ftn(err_msg)
82 write(err_msg,*) myname_, trim(
var_z),
' doesnt exist' 83 call abor1_ftn(err_msg)
88 write(err_msg,*) myname_, trim(
var_sfc_z),
' doesnt exist' 89 call abor1_ftn(err_msg)
94 write(err_msg,*) myname_, trim(
var_t),
' doesnt exist' 95 call abor1_ftn(err_msg)
109 allocate(obslon(obss_nobs))
110 allocate(obslat(obss_nobs))
111 allocate(obsimpp(obss_nobs))
112 allocate(obslocr(obss_nobs))
113 allocate(obsgeoid(obss_nobs))
128 allocate(ichk(nvprof))
131 write(record,*)
"DEBUG: ufo_gnssro_bndropp1d_simobs: begin observation loop ", nobs
132 obs_loop:
do iobs = 1, nobs
151 z_sfc%vals(1,iobs), &
162 call ropp_fm_bangle_1d(x,y)
164 hofx(iobs) = y%bangle(nvprof)
179 write(*,*)
"TRACE: ufo_gnssro_bndropp1d_simobs: completed" 185 temp,shum,pres,phi,lm,phi_sfc,x)
208 use typesizes,
only: wp => eightbytereal
209 use datetimetypes,
only: dp
211 use ropp_fm_types,
only: state1dfm
212 use geodesy,
only: gravity, r_eff, geometric2geopotential
213 use arrays,
only: callocate
220 type(State1dFM),
intent(out) :: x
221 real(kind=dp),
intent(in) :: step_time
222 real(kind=kind_real),
intent(in) :: rlat, rlon
223 real(kind=kind_real),
intent(in) :: phi_sfc
224 integer,
intent(in) :: lm
225 real(kind=kind_real),
dimension(lm),
intent(in) :: temp,shum,pres,phi
228 character(len=250) :: record
229 real(kind=kind_real) :: rlon_local
234 x%new_bangle_op = .true.
238 x%lat =
real(rlat,kind=wp)
240 if (rlon_local .gt. 180) rlon_local = rlon_local - 360.
241 x%lon =
real(rlon_local,kind=wp)
242 x%time =
real(step_time,kind=wp)
253 allocate(x%temp(x%n_lev))
254 allocate(x%shum(x%n_lev))
255 allocate(x%pres(x%n_lev))
256 allocate(x%geop(x%n_lev))
262 write(record,
'(4a9,a11)')
'lvl',
'temp',
'shum',
'pres',
'geop' 264 x%temp(n) =
real(temp(k),kind=wp)
265 x%shum(n) =
real(shum(k),kind=wp)
266 x%pres(n) =
real(pres(k)*100.,kind=wp)
267 x%geop(n) =
real(phi(k),kind=wp)
268 write(record,
'(5x,i4,f9.2,f9.4,f9.1,f15.1)') &
269 n, x%temp(n), x%shum(n), x%pres(n), x%geop(n)
275 x%geop_sfc =
real(phi_sfc,kind=wp)
276 write(record,
'("geop_sfc",f15.2)') x%geop_sfc
290 if (
associated(x%cov%d))
deallocate(x%cov%d)
291 call callocate(x%cov%d, n*(n+1)/2)
295 x%cov%d(i + i*(i-1)/2) = 1.0_wp
300 x%cov%d(j + j*(j-1)/2) = 1.0_wp
303 x%cov%d(n + n*(n-1)/2) = 1.0_wp
309 if (
associated(x%cov%e))
deallocate(x%cov%e)
310 if (
associated(x%cov%f))
deallocate(x%cov%f)
311 if (
associated(x%cov%s))
deallocate(x%cov%s)
313 x%cov%fact_chol = .false.
314 x%cov%equi_chol =
'N' 320 ichk,ob_time,rlat,rlon,roc,undulat,y)
344 use typesizes,
only: wp => eightbytereal
346 use datetimetypes,
only: dp
347 use ropp_fm_types,
only: obs1dbangle
348 use geodesy,
only: gravity, r_eff, geopotential2geometric
354 type(Obs1dBangle),
intent(out) :: y
356 integer,
intent(in) :: nvprof
357 integer,
dimension(nvprof),
intent(in) :: ichk
358 real(kind=kind_real),
dimension(nvprof),
intent(in) :: obs_impact
359 real(kind=kind_real),
intent(in) :: rlat, rlon
360 real(kind=kind_real),
intent(in) :: roc, undulat
361 real(kind=dp),
intent(in) :: ob_time
363 real(kind=wp) :: r8lat
364 real(kind=kind_real) :: rlon_local
365 character(len=250) :: record
371 y%time =
real(ob_time,kind=wp)
372 r8lat =
real(rlat,kind=wp)
375 if (rlon_local .gt. 180) rlon_local = rlon_local - 360.
376 y%lon =
real(rlon_local,kind=wp)
378 y%g_sfc = gravity(r8lat, 0.0_wp)
379 y%r_curve =
real(roc,kind=wp) 380 y%undulation =
real(undulat,kind=wp) 381 y%r_earth = r_eff(r8lat)
386 if (
associated(y%bangle))
then 389 deallocate(y%weights)
395 allocate(y%bangle(1:nvprof))
396 allocate(y%impact(1:nvprof))
397 allocate(y%weights(1:nvprof))
400 y%impact(i) =
real(obs_impact(i),kind=wp) 401 if (ichk(i) .le. 0)
then 402 y%weights(i) = 1.0_wp
404 y%weights(i) = 0.0_wp
409 write(record,
'(a9,2a11,3a15)')
'ROPPyvec:',
'lat',
'lon', &
410 'g_sfc',
'roc',
'r_earth_eff' 411 write(record,
'(9x,2f11.2,f15.6,2f15.2)') y%lat, y%lon, &
412 y%g_sfc, y%r_curve, y%r_earth
422 subroutine init_ob_time(yyyy, mm, dd, hh, mn, ss, ob_time)
424 use datetimetypes,
only: dp
426 integer,
intent(in) :: yyyy, mm, dd, hh, mn, ss
427 real(dp),
intent(out) :: ob_time
429 integer,
dimension(8) :: dt8
subroutine, public ufo_geovals_get_var(self, varname, geoval, status)
Fortran module to handle gnssro bending angle observations following the ROPP (2018 Aug) implementati...
subroutine, public lag_interp_smthweights(x, xt, aq, bq, w, dw, n)
integer function, public obsspace_get_nobs(c_dom)
Return the number of observations.
subroutine ufo_gnssro_bndropp1d_simobs(self, geovals, hofx, obss)
Fortran module to prepare for Lagrange polynomial interpolation. based on GSI: lagmod.f90.
Fortran derived type for gnssro trajectory.
subroutine init_ropp_1d_statevec(step_time, rlon, rlat, temp, shum, pres, phi, lm, phi_sfc, x)
character(len=maxvarlen), public var_z
Fortran module to perform linear interpolation.
character(len=maxvarlen), public var_q
character(len=maxvarlen), public var_prs
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
subroutine, public lag_interp_const(q, x, n)
integer, parameter, public kind_real
character(len=maxvarlen), public var_t
Fortran interface to ObsSpace.
subroutine init_ropp_1d_obvec(nvprof, obs_impact, ichk, ob_time, rlat, rlon, roc, undulat, y)
character(len=maxvarlen), public var_sfc_z
subroutine init_ob_time(yyyy, mm, dd, hh, mn, ss, ob_time)