FV3 Bundle
ufo_basis_tlad_mod.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 
7 
8  use iso_c_binding
11 
12  type, abstract :: ufo_basis_tlad
13  private
14  logical, public :: ltraj = .false. !< trajectory set?
15  contains
16  procedure, non_overridable :: opr_delete => opr_delete_
17  procedure, non_overridable :: opr_settraj => opr_settraj_
18  procedure, non_overridable :: opr_simobs_tl => opr_simobs_tl_
19  procedure, non_overridable :: opr_simobs_ad => opr_simobs_ad_
20  procedure(delete_), deferred :: delete
21  procedure(settraj_), deferred :: settraj
22  procedure(simobs_tl_), deferred :: simobs_tl
23  procedure(simobs_ad_), deferred :: simobs_ad
24  end type ufo_basis_tlad
25 
26  abstract interface
27 
28  ! ------------------------------------------------------------------------------
29 
30  subroutine delete_(self)
32  implicit none
33  class(ufo_basis_tlad), intent(inout) :: self
34  end subroutine
35 
36 ! ------------------------------------------------------------------------------
37 
38  subroutine settraj_(self, geovals, obss)
39  import ufo_basis_tlad, ufo_geovals, c_ptr
40  implicit none
41  class(ufo_basis_tlad), intent(inout) :: self
42  type(ufo_geovals), intent(in) :: geovals
43  type(c_ptr), value, intent(in) :: obss
44  end subroutine
45 
46 ! ------------------------------------------------------------------------------
47 
48  subroutine simobs_tl_(self, geovals, hofx, obss)
49  use iso_c_binding
51  implicit none
52  class(ufo_basis_tlad), intent(in) :: self
53  type(ufo_geovals), intent(in) :: geovals
54  real(c_double), intent(inout) :: hofx(:)
55  type(c_ptr), value, intent(in) :: obss
56  end subroutine
57 
58 ! ------------------------------------------------------------------------------
59 
60  subroutine simobs_ad_(self, geovals, hofx, obss)
61  use iso_c_binding
63  implicit none
64  class(ufo_basis_tlad), intent(in) :: self
65  type(ufo_geovals), intent(inout) :: geovals
66  real(c_double), intent(in) :: hofx(:)
67  type(c_ptr), value, intent(in) :: obss
68  end subroutine
69 
70  ! ------------------------------------------------------------------------------
71 
72  end interface
73 
74 contains
75 ! ------------------------------------------------------------------------------
76 
77  subroutine opr_delete_(self)
78  implicit none
79  class(ufo_basis_tlad), intent(inout) :: self
80 
81  call self%delete()
82 
83  end subroutine opr_delete_
84 
85 ! ------------------------------------------------------------------------------
86 
87  subroutine opr_settraj_(self, c_key_geovals, c_obsspace)
88  implicit none
89 
90  class(ufo_basis_tlad), intent(inout) :: self
91  integer(c_int), intent(in) :: c_key_geovals
92  type(c_ptr), value, intent(in) :: c_obsspace
93 
94  type(ufo_geovals), pointer :: geovals
95 
96  call ufo_geovals_registry%get(c_key_geovals,geovals)
97 
98  call self%settraj(geovals, c_obsspace)
99  end subroutine opr_settraj_
100 
101 ! ------------------------------------------------------------------------------
102 
103  subroutine opr_simobs_tl_(self, c_key_geovals, c_obsspace, c_hofx)
104  implicit none
105 
106  class(ufo_basis_tlad), intent(in) :: self
107  integer(c_int), intent(in) :: c_key_geovals
108  real(c_double), intent(inout) :: c_hofx(:)
109  type(c_ptr), value, intent(in) :: c_obsspace
110 
111  type(ufo_geovals), pointer :: geovals
112 
113  call ufo_geovals_registry%get(c_key_geovals,geovals)
114 
115  call self%simobs_tl(geovals, c_hofx, c_obsspace)
116  end subroutine opr_simobs_tl_
117 
118 ! ------------------------------------------------------------------------------
119 
120  subroutine opr_simobs_ad_(self, c_key_geovals, c_obsspace, c_hofx)
121  implicit none
122 
123  class(ufo_basis_tlad), intent(in) :: self
124  integer(c_int), intent(in) :: c_key_geovals
125  real(c_double), intent(in) :: c_hofx(:)
126  type(c_ptr), value, intent(in) :: c_obsspace
127 
128  type(ufo_geovals), pointer :: geovals
129 
130  call ufo_geovals_registry%get(c_key_geovals,geovals)
131 
132  call self%simobs_ad(geovals, c_hofx, c_obsspace)
133  end subroutine opr_simobs_ad_
134 
135 ! ------------------------------------------------------------------------------
136 
137 end module ufo_basis_tlad_mod
subroutine opr_simobs_ad_(self, c_key_geovals, c_obsspace, c_hofx)
subroutine opr_simobs_tl_(self, c_key_geovals, c_obsspace, c_hofx)
subroutine opr_delete_(self)
type to hold interpolated fields required by the obs operators
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
subroutine opr_settraj_(self, c_key_geovals, c_obsspace)
subroutine, public delete(self)
Definition: qg_fields.F90:136