UFO
ObsInsituTemperature.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 insitutemperature 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
14  implicit none
15  private
16 
17  ! ------------------------------------------------------------------------------
18 #define LISTED_TYPE ufo_insitutemperature
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_insitutemperature_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_insitutemperature_setup_c(c_key_self, c_conf) bind(c,name='ufo_insitutemperature_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_insitutemperature), pointer :: self
42 type(fckit_configuration) :: f_conf
43 
44 call ufo_insitutemperature_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_insitutemperature_setup_c
50 
51 ! ------------------------------------------------------------------------------
52 
53 subroutine ufo_insitutemperature_delete_c(c_key_self) bind(c,name='ufo_insitutemperature_delete_f90')
54 implicit none
55 integer(c_int), intent(inout) :: c_key_self
56 
57 type(ufo_insitutemperature), pointer :: self
58 
59 call ufo_insitutemperature_registry%get(c_key_self, self)
60 
61 call self%delete()
62 
63 call ufo_insitutemperature_registry%remove(c_key_self)
64 
65 end subroutine ufo_insitutemperature_delete_c
66 
67 ! ------------------------------------------------------------------------------
68 
69 subroutine ufo_insitutemperature_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx) &
70  bind(c,name='ufo_insitutemperature_simobs_f90')
71 
72 implicit none
73 integer(c_int), intent(in) :: c_key_self
74 integer(c_int), intent(in) :: c_key_geovals
75 type(c_ptr), value, intent(in) :: c_obsspace
76 integer(c_int), intent(in) :: c_nobs
77 real(c_double), intent(inout) :: c_hofx(c_nobs)
78 
79 type(ufo_insitutemperature), pointer :: self
80 
81 call ufo_insitutemperature_registry%get(c_key_self, self)
82 call self%opr_simobs(c_key_geovals, c_obsspace, c_hofx)
83 
84 end subroutine ufo_insitutemperature_simobs_c
85 
86 ! ------------------------------------------------------------------------------
87 
Fortran insitutemperature module for functions on the interface between C++ and Fortran.
subroutine ufo_insitutemperature_setup_c(c_key_self, c_conf)
Linked list implementation.
subroutine ufo_insitutemperature_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx)
subroutine ufo_insitutemperature_delete_c(c_key_self)
type(registry_t) ufo_insitutemperature_registry
Linked list interface - defines registry_t type.
Fortran insitutemperature module for observation operator.
Fortran derived type for the observation type.