UFO
ObsAtmSfcInterp.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 atmsfcinterp 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  use ufo_geovals_mod, only: ufo_geovals
16 
17  implicit none
18 
19  private
20 
21  ! ------------------------------------------------------------------------------
22 #define LISTED_TYPE ufo_atmsfcinterp
23 
24  !> Linked list interface - defines registry_t type
25 #include "oops/util/linkedList_i.f"
26 
27  !> Global registry
28  type(registry_t) :: ufo_atmsfcinterp_registry
29 
30  ! ------------------------------------------------------------------------------
31 
32 contains
33 
34  ! ------------------------------------------------------------------------------
35  !> Linked list implementation
36 #include "oops/util/linkedList_c.f"
37 
38 ! ------------------------------------------------------------------------------
39 
40 subroutine ufo_atmsfcinterp_setup_c(c_key_self, c_conf, c_obsvars, c_geovars) bind(c,name='ufo_atmsfcinterp_setup_f90')
41 use oops_variables_mod
42 implicit none
43 integer(c_int), intent(inout) :: c_key_self
44 type(c_ptr), value, intent(in) :: c_conf
45 type(c_ptr), value, intent(in) :: c_obsvars ! variables to be simulated
46 type(c_ptr), value, intent(in) :: c_geovars ! variables requested from the model
47 
48 type(ufo_atmsfcinterp), pointer :: self
49 type(fckit_configuration) :: f_conf
50 
51 call ufo_atmsfcinterp_registry%setup(c_key_self, self)
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_atmsfcinterp_setup_c
60 
61 ! ------------------------------------------------------------------------------
62 
63 subroutine ufo_atmsfcinterp_delete_c(c_key_self) bind(c,name='ufo_atmsfcinterp_delete_f90')
64 implicit none
65 integer(c_int), intent(inout) :: c_key_self
66 
67 type(ufo_atmsfcinterp), pointer :: self
68 
69 call ufo_atmsfcinterp_registry%delete(c_key_self, self)
70 
71 end subroutine ufo_atmsfcinterp_delete_c
72 
73 ! ------------------------------------------------------------------------------
74 
75 subroutine ufo_atmsfcinterp_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, &
76  c_hofx) bind(c,name='ufo_atmsfcinterp_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_atmsfcinterp), pointer :: self
86 type(ufo_geovals), pointer :: geovals
87 character(len=*), parameter :: myname_="ufo_atmsfcinterp_simobs_c"
88 
89 
90 call ufo_atmsfcinterp_registry%get(c_key_self, self)
91 call ufo_geovals_registry%get(c_key_geovals, geovals)
92 
93 call self%simobs(geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
94 
95 end subroutine ufo_atmsfcinterp_simobs_c
96 
97 ! ------------------------------------------------------------------------------
98 
99 end module ufo_atmsfcinterp_mod_c
ufo_atmsfcinterp_mod
Fortran module for atmsfcinterp observation operator.
Definition: ufo_atmsfcinterp_mod.F90:8
ufo_atmsfcinterp_mod_c::ufo_atmsfcinterp_delete_c
subroutine ufo_atmsfcinterp_delete_c(c_key_self)
Definition: ObsAtmSfcInterp.interface.F90:64
ufo_geovals_mod
Definition: ufo_geovals_mod.F90:7
ufo_geovals_mod_c
Definition: GeoVaLs.interface.F90:7
ufo_atmsfcinterp_mod_c::ufo_atmsfcinterp_setup_c
subroutine ufo_atmsfcinterp_setup_c(c_key_self, c_conf, c_obsvars, c_geovars)
Linked list implementation.
Definition: ObsAtmSfcInterp.interface.F90:41
ufo_atmsfcinterp_mod_c::ufo_atmsfcinterp_simobs_c
subroutine ufo_atmsfcinterp_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
Definition: ObsAtmSfcInterp.interface.F90:77
ufo_atmsfcinterp_mod_c
Fortran atmsfcinterp module for functions on the interface between C++ and Fortran.
Definition: ObsAtmSfcInterp.interface.F90:9
ufo_atmsfcinterp_mod::ufo_atmsfcinterp
Fortran derived type for the observation type.
Definition: ufo_atmsfcinterp_mod.F90:18
ufo_geovals_mod::ufo_geovals
type to hold interpolated fields required by the obs operators
Definition: ufo_geovals_mod.F90:47
ufo_atmsfcinterp_mod_c::ufo_atmsfcinterp_registry
type(registry_t) ufo_atmsfcinterp_registry
Linked list interface - defines registry_t type.
Definition: ObsAtmSfcInterp.interface.F90:28
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