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