UFO
ObsSeaIceThickness.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 seaicethickness 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_seaicethickness
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_seaicethickness_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_seaicethickness_setup_c(c_key_self, c_conf, c_obsvars) bind(c,name='ufo_seaicethickness_setup_f90')
37 use oops_variables_mod
38 implicit none
39 integer(c_int), intent(inout) :: c_key_self
40 type(c_ptr), value, intent(in) :: c_conf
41 type(c_ptr), value, intent(in) :: c_obsvars ! variables to be simulated
42 
43 type(ufo_seaicethickness), pointer :: self
44 type(fckit_configuration) :: f_conf
45 
46 call ufo_seaicethickness_registry%setup(c_key_self, self)
47 f_conf = fckit_configuration(c_conf)
48 
49 self%obsvars = oops_variables(c_obsvars)
50 
51 call self%setup(f_conf)
52 
53 end subroutine ufo_seaicethickness_setup_c
54 
55 ! ------------------------------------------------------------------------------
56 
57 subroutine ufo_seaicethickness_delete_c(c_key_self) bind(c,name='ufo_seaicethickness_delete_f90')
58 implicit none
59 integer(c_int), intent(inout) :: c_key_self
60 
61 type(ufo_seaicethickness), pointer :: self
62 
63 call ufo_seaicethickness_registry%get(c_key_self, self)
64 
65 call self%delete()
66 
67 call ufo_seaicethickness_registry%remove(c_key_self)
68 
69 end subroutine ufo_seaicethickness_delete_c
70 
71 ! ------------------------------------------------------------------------------
72 
73 subroutine ufo_seaicethickness_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx) &
74  bind(c,name='ufo_seaicethickness_simobs_f90')
75 
76 implicit none
77 integer(c_int), intent(in) :: c_key_self
78 integer(c_int), intent(in) :: c_key_geovals
79 type(c_ptr), value, intent(in) :: c_obsspace
80 integer(c_int), intent(in) :: c_nobs
81 real(c_double), intent(inout) :: c_hofx(c_nobs)
82 
83 type(ufo_seaicethickness), pointer :: self
84 
85 call ufo_seaicethickness_registry%get(c_key_self, self)
86 call self%opr_simobs(c_key_geovals, c_obsspace, c_hofx)
87 
88 end subroutine ufo_seaicethickness_simobs_c
89 
90 ! ------------------------------------------------------------------------------
91 
Fortran seaicethickness module for functions on the interface between C++ and Fortran.
subroutine ufo_seaicethickness_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx)
subroutine ufo_seaicethickness_setup_c(c_key_self, c_conf, c_obsvars)
Linked list implementation.
type(registry_t) ufo_seaicethickness_registry
Linked list interface - defines registry_t type.
subroutine ufo_seaicethickness_delete_c(c_key_self)
Fortran module for seaicethickness observation operator.
Fortran derived type for the observation type.