UFO
ObsAodLUTs.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 aodluts observations
7 
9 
10  use fckit_configuration_module, only: fckit_configuration
11  use iso_c_binding
12  use ufo_aodluts_mod
13  use ufo_geovals_mod
15 
16  implicit none
17  private
18 
19  ! ------------------------------------------------------------------------------
20 #define LISTED_TYPE ufo_aodluts
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_aodluts_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_aodluts_setup_c(c_key_self, c_conf, c_nchan, c_channels, c_varlist) &
39  bind(c,name='ufo_aodluts_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 integer(c_int), intent(in) :: c_nchan
45 integer(c_int), intent(in) :: c_channels(c_nchan)
46 type(c_ptr), intent(in), value :: c_varlist
47 
48 type(oops_variables) :: oops_vars
49 type(ufo_aodluts), pointer :: self
50 type(fckit_configuration) :: f_conf
51 
52 call ufo_aodluts_registry%setup(c_key_self, self)
53 f_conf = fckit_configuration(c_conf)
54 
55 call self%setup(f_conf, c_channels)
56 
57 !> Update C++ ObsOperator with input variable list
58 oops_vars = oops_variables(c_varlist)
59 call oops_vars%push_back( self%varin )
60 
61 end subroutine ufo_aodluts_setup_c
62 
63 ! ------------------------------------------------------------------------------
64 
65 subroutine ufo_aodluts_delete_c(c_key_self) bind(c,name='ufo_aodluts_delete_f90')
66 implicit none
67 integer(c_int), intent(inout) :: c_key_self
68 
69 type(ufo_aodluts), pointer :: self
70 
71 call ufo_aodluts_registry%get(c_key_self, self)
72 
73 call self%delete()
74 
75 call ufo_aodluts_registry%remove(c_key_self)
76 
77 end subroutine ufo_aodluts_delete_c
78 
79 ! ------------------------------------------------------------------------------
80 
81 subroutine ufo_aodluts_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, &
82  c_nlocs, c_hofx) bind(c,name='ufo_aodluts_simobs_f90')
83 
84 implicit none
85 integer(c_int), intent(in) :: c_key_self
86 integer(c_int), intent(in) :: c_key_geovals
87 type(c_ptr), value, intent(in) :: c_obsspace
88 integer(c_int), intent(in) :: c_nvars, c_nlocs
89 real(c_double), intent(inout) :: c_hofx(c_nvars, c_nlocs)
90 
91 
92 type(ufo_aodluts), pointer :: self
93 type(ufo_geovals), pointer :: geovals
94 
95 character(len=*), parameter :: myname_="ufo_aodluts_simobs_c"
96 
97 call ufo_aodluts_registry%get(c_key_self, self)
98 
99 call ufo_geovals_registry%get(c_key_geovals,geovals)
100 
101 call self%simobs(geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
102 
103 end subroutine ufo_aodluts_simobs_c
104 
105 ! ------------------------------------------------------------------------------
106 
107 end module ufo_aodluts_mod_c
Fortran module to handle aodluts observations.
type(registry_t) ufo_aodluts_registry
Linked list interface - defines registry_t type.
subroutine ufo_aodluts_setup_c(c_key_self, c_conf, c_nchan, c_channels, c_varlist)
Linked list implementation.
subroutine ufo_aodluts_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nvars, c_nlocs, c_hofx)
subroutine ufo_aodluts_delete_c(c_key_self)
fortran module to handle aod observations
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
fortran derived type for aod trajectory
type to hold interpolated fields required by the obs operators