UFO
locations_interface.f
Go to the documentation of this file.
1 !
2 ! (C) Copyright 2020 UCAR
3 !
4 ! This software is licensed under the terms of the Apache Licence Version 2.0
5 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 
7 !> Define interface for C++ ufo::Locations code called from Fortran
8 
9 !-------------------------------------------------------------------------------
10 interface
11 !-------------------------------------------------------------------------------
12 integer(kind=c_size_t) function c_locations_get_nlocs(locs) bind(C,name='locations_get_nlocs_f')
13  use, intrinsic :: iso_c_binding
14  implicit none
15 
16  type(c_ptr), value :: locs
17 end function c_locations_get_nlocs
18 
19 subroutine c_locations_get_lons(locs, nlocs, lons) &
20  & bind(c,name='locations_get_lons_f')
21  use, intrinsic :: iso_c_binding, only : c_ptr,c_char,c_size_t,c_double
22  implicit none
23  type(c_ptr), value :: locs
24  integer(c_size_t), intent(in) :: nlocs
25  real(c_double), intent(inout) :: lons(nlocs)
26 end subroutine c_locations_get_lons
27 
28 subroutine c_locations_get_lats(locs, nlocs, lats) &
29  & bind(c,name='locations_get_lats_f')
30  use, intrinsic :: iso_c_binding, only : c_ptr,c_char,c_size_t,c_double
31  implicit none
32  type(c_ptr), value :: locs
33  integer(c_size_t), intent(in) :: nlocs
34  real(c_double), intent(inout) :: lats(nlocs)
35 end subroutine c_locations_get_lats
36 
37 subroutine c_locations_get_timemask(locs, t1, t2, nlocs, mask) &
38  & bind(c,name='locations_get_timemask_f')
39  use, intrinsic :: iso_c_binding, only : c_ptr,c_char,c_size_t,c_bool
40  implicit none
41  type(c_ptr), value :: locs, t1, t2
42  integer(c_size_t), intent(in) :: nlocs
43  logical(c_bool), intent(inout) :: mask(nlocs)
44 end subroutine c_locations_get_timemask
45 
46 !-------------------------------------------------------------------------------
47 end interface
48 !-------------------------------------------------------------------------------
Define interface for C++ ufo::Locations code called from Fortran.