UFO
ObsCoolSkin.interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017-2018 UCAR
2 !
3 ! This software is licensed under the terms of the Apache Licence Version 2.0
4 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 
6 !> Fortran coolskin module for functions on the interface between C++ and Fortran
7 ! to handle observation operators
8 
10 
11  use fckit_configuration_module, only: fckit_configuration
12  use iso_c_binding
13  use ufo_coolskin_mod
14  implicit none
15  private
16 
17  ! ------------------------------------------------------------------------------
18 #define LISTED_TYPE ufo_CoolSkin
19 
20  !> Linked list interface - defines registry_t type
21 #include "oops/util/linkedList_i.f"
22 
23  !> Global registry
24  type(registry_t) :: ufo_coolskin_registry
25 
26  ! ------------------------------------------------------------------------------
27 
28 contains
29 
30  ! ------------------------------------------------------------------------------
31  !> Linked list implementation
32 #include "oops/util/linkedList_c.f"
33 
34 ! ------------------------------------------------------------------------------
35 
36 subroutine ufo_coolskin_setup_c(c_key_self, c_conf) bind(c,name='ufo_CoolSkin_setup_f90')
37 implicit none
38 integer(c_int), intent(inout) :: c_key_self
39 type(c_ptr), value, intent(in) :: c_conf
40 
41 type(ufo_coolskin), pointer :: self
42 type(fckit_configuration) :: f_conf
43 
44 call ufo_coolskin_registry%setup(c_key_self, self)
45 f_conf = fckit_configuration(c_conf)
46 
47 call self%setup(f_conf)
48 
49 end subroutine ufo_coolskin_setup_c
50 
51 ! ------------------------------------------------------------------------------
52 
53 subroutine ufo_coolskin_delete_c(c_key_self) bind(c,name='ufo_CoolSkin_delete_f90')
54 implicit none
55 integer(c_int), intent(inout) :: c_key_self
56 
57 type(ufo_coolskin), pointer :: self
58 
59 call ufo_coolskin_registry%get(c_key_self, self)
60 
61 call self%delete()
62 
63 call ufo_coolskin_registry%remove(c_key_self)
64 
65 end subroutine ufo_coolskin_delete_c
66 
67 ! ------------------------------------------------------------------------------
68 
69 subroutine ufo_coolskin_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx) bind(c,name='ufo_CoolSkin_simobs_f90')
70 
71 implicit none
72 integer(c_int), intent(in) :: c_key_self
73 integer(c_int), intent(in) :: c_key_geovals
74 type(c_ptr), value, intent(in) :: c_obsspace
75 integer(c_int), intent(in) :: c_nobs
76 real(c_double), intent(inout) :: c_hofx(c_nobs)
77 
78 type(ufo_coolskin), pointer :: self
79 
80 call ufo_coolskin_registry%get(c_key_self, self)
81 call self%opr_simobs(c_key_geovals, c_obsspace, c_hofx)
82 
83 end subroutine ufo_coolskin_simobs_c
84 
85 ! ------------------------------------------------------------------------------
86 
87 end module ufo_coolskin_mod_c
Fortran coolskin module for functions on the interface between C++ and Fortran.
subroutine ufo_coolskin_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx)
type(registry_t) ufo_coolskin_registry
Linked list interface - defines registry_t type.
subroutine ufo_coolskin_setup_c(c_key_self, c_conf)
Linked list implementation.
subroutine ufo_coolskin_delete_c(c_key_self)
Fortran coolskin module for observation operator.
Fortran derived type for the observation type.