20 use fckit_configuration_module,
only: fckit_configuration
21 use fckit_log_module,
only: fckit_log
24 type(c_ptr),
value,
intent(in) :: c_locs
25 type(c_ptr),
value,
intent(in) :: c_conf
29 type(fckit_configuration) :: f_conf
30 integer ::
nlocs, iloc
31 real :: tolerance = 1.e-8
32 real(c_double),
dimension(:),
allocatable :: lons_ref, lats_ref, lons, lats
33 character(len=200) :: logmessage
39 f_conf = fckit_configuration(c_conf)
40 nlocs = f_conf%get_size(
"reference lons")
41 call f_conf%get_or_die(
"reference lons", lons_ref)
42 call f_conf%get_or_die(
"reference lats", lats_ref)
47 call locs%get_lons(lons)
48 call locs%get_lats(lats)
51 write(logmessage, *)
"lons: loc and ref: ", lons(iloc),
", ", lons_ref(iloc)
52 call fckit_log%debug(logmessage)
53 write(logmessage, *)
"lats: loc and ref: ", lats(iloc),
", ", lats_ref(iloc)
54 call fckit_log%debug(logmessage)
61 deallocate(lons, lats)
71 use fckit_configuration_module,
only: fckit_configuration
72 use fckit_log_module,
only: fckit_log
76 type(c_ptr),
value,
intent(in) :: c_locs
77 type(c_ptr),
value,
intent(in) :: c_conf
81 type(fckit_configuration) :: f_conf
82 type(fckit_configuration),
allocatable :: testconfigs(:)
83 character(kind=c_char,len=:),
allocatable :: t1str, t2str
84 logical(kind=c_bool),
allocatable :: mask(:)
85 logical,
allocatable :: mask_ref(:)
86 type(datetime) :: t1, t2
87 integer ::
nlocs, iloc, itest
88 character(len=200) :: logmessage
94 f_conf = fckit_configuration(c_conf)
95 call f_conf%get_or_die(
"time mask tests", testconfigs)
97 do itest = 1,
size(testconfigs)
98 call testconfigs(itest)%get_or_die(
"t1", t1str)
99 call testconfigs(itest)%get_or_die(
"t2", t2str)
100 call datetime_create(t1str, t1)
101 call datetime_create(t2str, t2)
102 call testconfigs(itest)%get_or_die(
"reference mask", mask_ref)
106 allocate(mask(
nlocs))
107 call locs%get_timemask(t1, t2, mask)
109 write(logmessage, *)
"Test ", itest
110 call fckit_log%debug(logmessage)
112 write(logmessage, *)
"mask: loc and ref: ", mask(iloc),
", ", mask_ref(iloc)
113 call fckit_log%debug(logmessage)
integer function test_locations_timemask_c(c_locs, c_conf)
Tests whether ufo::Locations time mask method results are matching references in yaml file.
integer function test_locations_lonslats_c(c_locs, c_conf)
Tests whether latitudes and longitudes from ufo::Locations object are matching references in yaml fil...
Fortran interface to ufo::Locations.
integer function nlocs(this)
Return the number of observational locations in this Locations object.