UFO
ObsAtmVertInterpLay.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 atmvertinterplay module for functions on the interface between C++ and Fortran
7 ! to handle observation operators
8 
10 
11  use iso_c_binding
12 
13  use fckit_configuration_module, only: fckit_configuration
15  use ufo_geovals_mod, only: ufo_geovals
17  implicit none
18  private
19 
20  ! ------------------------------------------------------------------------------
21 #define LISTED_TYPE ufo_atmvertinterplay
22 
23  !> Linked list interface - defines registry_t type
24 #include "oops/util/linkedList_i.f"
25 
26  !> Global registry
27  type(registry_t) :: ufo_atmvertinterplay_registry
28 
29  ! ------------------------------------------------------------------------------
30 
31 contains
32 
33  ! ------------------------------------------------------------------------------
34  !> Linked list implementation
35 #include "oops/util/linkedList_c.f"
36 
37 ! ------------------------------------------------------------------------------
38 
39 subroutine ufo_atmvertinterplay_setup_c(c_key_self, c_conf, c_obsvars, c_geovars) bind(c,name='ufo_atmvertinterplay_setup_f90')
40 use oops_variables_mod
41 implicit none
42 integer(c_int), intent(inout) :: c_key_self
43 type(c_ptr), value, intent(in) :: c_conf
44 type(c_ptr), value, intent(in) :: c_obsvars ! variables to be simulated
45 type(c_ptr), value, intent(in) :: c_geovars ! variables requested from the model
46 
47 type(ufo_atmvertinterplay), pointer :: self
48 type(fckit_configuration) :: f_conf
49 
50 call ufo_atmvertinterplay_registry%setup(c_key_self, self)
51 
52 f_conf = fckit_configuration(c_conf)
53 
54 self%obsvars = oops_variables(c_obsvars)
55 self%geovars = oops_variables(c_geovars)
56 
57 call self%setup(f_conf)
58 
59 end subroutine ufo_atmvertinterplay_setup_c
60 
61 ! ------------------------------------------------------------------------------
62 
63 subroutine ufo_atmvertinterplay_delete_c(c_key_self) bind(c,name='ufo_atmvertinterplay_delete_f90')
64 implicit none
65 integer(c_int), intent(inout) :: c_key_self
66 
67 type(ufo_atmvertinterplay), pointer :: self
68 
69 call ufo_atmvertinterplay_registry%delete(c_key_self, self)
70 
71 end subroutine ufo_atmvertinterplay_delete_c
72 
73 ! ------------------------------------------------------------------------------
74 
75 subroutine ufo_atmvertinterplay_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, &
76  c_hofx) bind(c,name='ufo_atmvertinterplay_simobs_f90')
77 
78 implicit none
79 integer(c_int), intent(in) :: c_key_self
80 integer(c_int), intent(in) :: c_key_geovals
81 type(c_ptr), value, intent(in) :: c_obsspace
82 integer(c_int), intent(in) :: c_nvars, c_nlocs
83 real(c_double), intent(inout) :: c_hofx(c_nvars, c_nlocs)
84 
85 type(ufo_atmvertinterplay), pointer :: self
86 type(ufo_geovals), pointer :: geovals
87 character(len=*), parameter :: myname_="ufo_atmvertinterplay_simobs_c"
88 
89 call ufo_atmvertinterplay_registry%get(c_key_self, self)
90 call ufo_geovals_registry%get(c_key_geovals, geovals)
91 call self%simobs(geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
92 
93 end subroutine ufo_atmvertinterplay_simobs_c
94 
95 ! ------------------------------------------------------------------------------
96 
Fortran atmvertinterplay module for functions on the interface between C++ and Fortran.
type(registry_t) ufo_atmvertinterplay_registry
Linked list interface - defines registry_t type.
subroutine ufo_atmvertinterplay_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
subroutine ufo_atmvertinterplay_setup_c(c_key_self, c_conf, c_obsvars, c_geovars)
Linked list implementation.
subroutine ufo_atmvertinterplay_delete_c(c_key_self)
Fortran module for atmvertinterplay observation operator.
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
Fortran derived type for the observation type.
type to hold interpolated fields required by the obs operators