UFO
ObsMarineVertInterp.interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017-2019 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 marinevertinterp 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
15 
16  implicit none
17  private
18 
19  ! ------------------------------------------------------------------------------
20 #define LISTED_TYPE ufo_marinevertinterp
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_marinevertinterp_registry
27 
28  ! ------------------------------------------------------------------------------
29 
30 contains
31 
32  ! ------------------------------------------------------------------------------
33  !> Linked list implementation
34 #include "oops/util/linkedList_c.f"
35 
36 ! ------------------------------------------------------------------------------
37 
38 subroutine ufo_marinevertinterp_setup_c(c_key_self, c_conf, c_obsvars, c_geovars) bind(c,name='ufo_marinevertinterp_setup_f90')
39 use oops_variables_mod
40 implicit none
41 integer(c_int), intent(inout) :: c_key_self
42 type(c_ptr), value, intent(in) :: c_conf
43 type(c_ptr), value, intent(in) :: c_obsvars ! variables to be simulated
44 type(c_ptr), value, intent(in) :: c_geovars ! variables requested from the model
45 
46 type(ufo_marinevertinterp), pointer :: self
47 
48 call ufo_marinevertinterp_registry%setup(c_key_self, self)
49 
50 self%obsvars = oops_variables(c_obsvars)
51 self%geovars = oops_variables(c_geovars)
52 
53 call self%setup()
54 
55 end subroutine ufo_marinevertinterp_setup_c
56 
57 ! ------------------------------------------------------------------------------
58 
59 subroutine ufo_marinevertinterp_delete_c(c_key_self) bind(c,name='ufo_marinevertinterp_delete_f90')
60 implicit none
61 integer(c_int), intent(inout) :: c_key_self
62 
63 type(ufo_marinevertinterp), pointer :: self
64 
65 call ufo_marinevertinterp_registry%delete(c_key_self, self)
66 
67 
68 end subroutine ufo_marinevertinterp_delete_c
69 
70 ! ------------------------------------------------------------------------------
71 
72 subroutine ufo_marinevertinterp_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx) &
73  bind(c,name='ufo_marinevertinterp_simobs_f90')
74 
75 implicit none
76 integer(c_int), intent(in) :: c_key_self
77 integer(c_int), intent(in) :: c_key_geovals
78 type(c_ptr), value, intent(in) :: c_obsspace
79 integer(c_int), intent(in) :: c_nobs
80 real(c_double), intent(inout) :: c_hofx(c_nobs)
81 
82 type(ufo_marinevertinterp), pointer :: self
83 type(ufo_geovals), pointer :: geovals
84 
85 call ufo_marinevertinterp_registry%get(c_key_self, self)
86 call ufo_geovals_registry%get(c_key_geovals,geovals)
87 
88 call self%simobs(geovals, c_hofx, c_obsspace)
89 
90 end subroutine ufo_marinevertinterp_simobs_c
91 
92 ! ------------------------------------------------------------------------------
93 
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
Fortran marinevertinterp module for functions on the interface between C++ and Fortran.
type(registry_t) ufo_marinevertinterp_registry
Linked list interface - defines registry_t type.
subroutine ufo_marinevertinterp_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx)
subroutine ufo_marinevertinterp_setup_c(c_key_self, c_conf, c_obsvars, c_geovars)
Linked list implementation.
subroutine ufo_marinevertinterp_delete_c(c_key_self)
Fortran marinevertinterp module for observation operator.
type to hold interpolated fields required by the obs operators
Fortran derived type for the observation type.