UFO
ObsRadarRadialVelocity.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 radarradialvelocity module for functions on the interface between C++ and Fortran
7 ! to handle observation operators
8 
10 
11  use iso_c_binding
13  use ufo_geovals_mod, only: ufo_geovals
15  implicit none
16  private
17 
18  ! ------------------------------------------------------------------------------
19 #define LISTED_TYPE ufo_radarradialvelocity
20 
21  !> Linked list interface - defines registry_t type
22 #include "oops/util/linkedList_i.f"
23 
24  !> Global registry
26 
27  ! ------------------------------------------------------------------------------
28 
29 contains
30 
31  ! ------------------------------------------------------------------------------
32  !> Linked list implementation
33 #include "oops/util/linkedList_c.f"
34 
35 ! ------------------------------------------------------------------------------
36 
37 subroutine ufo_radarradialvelocity_setup_c(c_key_self, c_conf, c_obsvars, c_geovars) &
38  bind(c,name='ufo_radarradialvelocity_setup_f90')
39 use fckit_configuration_module, only: fckit_configuration
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 reuested from the model
46 
47 type(ufo_radarradialvelocity), pointer :: self
48 type(fckit_configuration) :: f_conf
49 
50 call ufo_radarradialvelocity_registry%setup(c_key_self, self)
51 f_conf = fckit_configuration(c_conf)
52 
53 self%obsvars = oops_variables(c_obsvars)
54 self%geovars = oops_variables(c_geovars)
55 
56 call self%setup(f_conf)
57 
59 
60 ! ------------------------------------------------------------------------------
61 
62 subroutine ufo_radarradialvelocity_delete_c(c_key_self) bind(c,name='ufo_radarradialvelocity_delete_f90')
63 implicit none
64 integer(c_int), intent(inout) :: c_key_self
65 
66 type(ufo_radarradialvelocity), pointer :: self
67 
68 call ufo_radarradialvelocity_registry%delete(c_key_self, self)
69 
71 
72 ! ------------------------------------------------------------------------------
73 
74 subroutine ufo_radarradialvelocity_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, &
75  c_hofx) bind(c,name='ufo_radarradialvelocity_simobs_f90')
76 
77 implicit none
78 integer(c_int), intent(in) :: c_key_self
79 integer(c_int), intent(in) :: c_key_geovals
80 type(c_ptr), value, intent(in) :: c_obsspace
81 integer(c_int), intent(in) :: c_nvars, c_nlocs
82 real(c_double), intent(inout) :: c_hofx(c_nvars, c_nlocs)
83 
84 type(ufo_radarradialvelocity), pointer :: self
85 type(ufo_geovals), pointer :: geovals
86 
87 call ufo_radarradialvelocity_registry%get(c_key_self, self)
88 call ufo_geovals_registry%get(c_key_geovals, geovals)
89 call self%simobs(geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
90 
92 
93 ! ------------------------------------------------------------------------------
94 
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
Fortran radarradialvelocity module for functions on the interface between C++ and Fortran.
subroutine ufo_radarradialvelocity_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
subroutine ufo_radarradialvelocity_setup_c(c_key_self, c_conf, c_obsvars, c_geovars)
Linked list implementation.
type(registry_t) ufo_radarradialvelocity_registry
Linked list interface - defines registry_t type.
Fortran module for radarradialvelocity observation operator.
type to hold interpolated fields required by the obs operators
Fortran derived type for the observation type.