4 use fckit_log_module,
only : fckit_log
5 use kinds,
only : kind_real
16 use fckit_log_module,
only : fckit_log
22 type(ufo_locs),
intent(inout) :: locs
23 class(ufo_gnssro_BndROPP2D),
intent(inout) :: self
24 type(c_ptr),
value,
intent(in) :: obss
25 type(datetime),
intent(in) :: t1, t2
27 character(len=*),
parameter :: myname =
"ufo_gnssro_2d_locs_init"
28 integer,
parameter :: max_string = 800
29 character(max_string) :: err_msg
31 integer :: i, j, tw_nlocs,nlocs
32 integer,
dimension(:),
allocatable :: tw_indx
33 real(kind_real),
dimension(:),
allocatable :: lon, lat
34 type(datetime),
dimension(:),
allocatable :: date_time
37 real(kind_real),
dimension(:),
allocatable :: obsAzim
38 real(kind_real),
dimension(self%roconf%n_horiz) :: plat_2d, plon_2d
39 integer :: kerror, n_horiz
40 real(kind_real) :: dtheta
42 dtheta = self%roconf%dtheta
43 n_horiz = self%roconf%n_horiz
45 nlocs = obsspace_get_nlocs(obss)
47 allocate(date_time(nlocs), lon(nlocs), lat(nlocs))
49 call obsspace_get_db(obss,
"MetaData",
"datetime", date_time)
50 call obsspace_get_db(obss,
"MetaData",
"longitude", lon)
51 call obsspace_get_db(obss,
"MetaData",
"latitude", lat)
54 allocate(tw_indx(nlocs))
57 if (date_time(i) > t1 .and. date_time(i) <= t2)
then
58 tw_nlocs = tw_nlocs + 1
63 allocate(obsazim(nlocs))
64 if (obsspace_has(obss,
"ObsValue",
"bending_angle"))
then
65 if (obsspace_has(obss,
"MetaData",
"sensor_azimuth_angle"))
then
66 call obsspace_get_db(obss,
"MetaData",
"sensor_azimuth_angle", obsazim)
68 write(err_msg,*) myname,
' error: sensor_azimuth_angle not found'
69 call abor1_ftn(err_msg)
76 locs%lon( (i-1)*n_horiz+1 : i*n_horiz) = lon(tw_indx(i))
77 locs%lat( (i-1)*n_horiz+1 : i*n_horiz) = lat(tw_indx(i))
79 locs%indx((i-1)*n_horiz+j) = (tw_indx(i)-1)*n_horiz+j
80 locs%time((i-1)*n_horiz+j) = date_time(tw_indx(i))
85 self%obsLat2d = locs%lat
86 self%obsLon2d = locs%lon
89 call datetime_delete(date_time(i))
91 deallocate(date_time, lon, lat, tw_indx, obsazim)