Debian Codegraph @

src/atlas_f/interpolation/atlas_Interpolation_module.F90

raw
1 ! (C) Copyright 2013 ECMWF.
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 ! In applying this licence, ECMWF does not waive the privileges and immunities
6 ! granted to it by virtue of its status as an intergovernmental organisation nor
7 ! does it submit to any jurisdiction.
8
9 #include "atlas/atlas_f.h"
10
11 module atlas_Interpolation_module
12
13 use fckit_owned_object_module, only : fckit_owned_object
14
15 implicit none
16
17 private :: fckit_owned_object
18
19 public :: atlas_Interpolation
20
21 private
22
23 !------------------------------------------------------------------------------
24 TYPE, extends(fckit_owned_object) :: atlas_Interpolation
25
26 ! Purpose :
27 ! -------
28 ! *Interpolation* :
29
30 ! Methods :
31 ! -------
32
33 ! Author :
34 ! ------
35 ! October-2015 Willem Deconinck *ECMWF*
36
37 !------------------------------------------------------------------------------
38 contains
39 procedure, private :: execute_field
40 procedure, private :: execute_fieldset
41 procedure, private :: execute_adjoint_field
42 procedure, private :: execute_adjoint_fieldset
43 generic, public :: execute => execute_field, execute_fieldset
44 generic, public :: execute_adjoint => execute_adjoint_field, execute_adjoint_fieldset
45
46 #if FCKIT_FINAL_NOT_INHERITING
47 final :: atlas_Interpolation__final_auto
48 #endif
49
50 END TYPE atlas_Interpolation
51
52 interface atlas_Interpolation
53 module procedure atlas_Interpolation__cptr
54 module procedure atlas_Interpolation__config_funcspace
55 module procedure atlas_Interpolation__config_funcspace_field
56 module procedure atlas_Interpolation__config_funcspace_fieldset
57 end interface
58
59 !========================================================
60 contains
61 !========================================================
62
63 function atlas_Interpolation__cptr(cptr) result(this)
64 use, intrinsic :: iso_c_binding, only: c_ptr
65 type(atlas_Interpolation) :: this
66 type(c_ptr), intent(in) :: cptr
67 call this%reset_c_ptr( cptr )
68 call this%return()
69 end function
70
71 function atlas_Interpolation__config_funcspace(config,source,target) result(this)
72 use atlas_Interpolation_c_binding
73 use atlas_Config_module, only : atlas_Config
74 use atlas_FunctionSpace_module, only : atlas_FunctionSpace
75 type(atlas_Interpolation) :: this
76 type(atlas_Config), intent(in) :: config
77 class(atlas_FunctionSpace), intent(in) :: source
78 class(atlas_FunctionSpace), intent(in) :: target
79 this = atlas_Interpolation__cptr(atlas__interpolation__new(config%CPTR_PGIBUG_B, &
80 source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A))
81 call this%return()
82 end function
83
84 function atlas_Interpolation__config_funcspace_field(config,source,target) result(this)
85 use atlas_Interpolation_c_binding
86 use atlas_Config_module, only : atlas_Config
87 use atlas_FunctionSpace_module, only : atlas_FunctionSpace
88 use atlas_Field_module, only : atlas_Field
89 type(atlas_Interpolation) :: this
90 type(atlas_Config), intent(in) :: config
91 class(atlas_FunctionSpace), intent(in) :: source
92 class(atlas_Field), intent(in) :: target
93 this = atlas_Interpolation__cptr(atlas__interpolation__new_tgt_field(config%CPTR_PGIBUG_B, &
94 source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A))
95 call this%return()
96 end function
97
98 function atlas_Interpolation__config_funcspace_fieldset(config,source,target) result(this)
99 use atlas_Interpolation_c_binding
100 use atlas_Config_module, only : atlas_Config
101 use atlas_FunctionSpace_module, only : atlas_FunctionSpace
102 use atlas_FieldSet_module, only : atlas_FieldSet
103 type(atlas_Interpolation) :: this
104 type(atlas_Config), intent(in) :: config
105 class(atlas_FunctionSpace), intent(in) :: source
106 class(atlas_FieldSet), intent(in) :: target
107 this = atlas_Interpolation__cptr(atlas__interpolation__new_tgt_fieldset(config%CPTR_PGIBUG_B, &
108 source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A))
109 call this%return()
110 end function
111
112 subroutine execute_field(this,source,target)
113 use atlas_Interpolation_c_binding
114 use atlas_Field_module, only : atlas_Field
115 class(atlas_Interpolation), intent(in) :: this
116 class(atlas_Field), intent(in) :: source
117 class(atlas_Field), intent(inout) :: target
118 call atlas__Interpolation__execute_field(this%CPTR_PGIBUG_A,source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A)
119 end subroutine
120
121 subroutine execute_fieldset(this,source,target)
122 use atlas_Interpolation_c_binding
123 use atlas_FieldSet_module, only : atlas_FieldSet
124 class(atlas_Interpolation), intent(in) :: this
125 class(atlas_FieldSet), intent(in) :: source
126 class(atlas_FieldSet), intent(inout) :: target
127 call atlas__Interpolation__execute_fieldset(this%CPTR_PGIBUG_A,source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A)
128 end subroutine
129
130 subroutine execute_adjoint_field(this,source,target)
131 use atlas_Interpolation_c_binding
132 use atlas_Field_module, only : atlas_Field
133 class(atlas_Interpolation), intent(in) :: this
134 class(atlas_Field), intent(inout) :: source
135 class(atlas_Field), intent(in) :: target
136 call atlas__Interpolation__execute_adjoint_field(this%CPTR_PGIBUG_A,source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A)
137 end subroutine
138
139 subroutine execute_adjoint_fieldset(this,source,target)
140 use atlas_Interpolation_c_binding
141 use atlas_FieldSet_module, only : atlas_FieldSet
142 class(atlas_Interpolation), intent(in) :: this
143 class(atlas_FieldSet), intent(inout) :: source
144 class(atlas_FieldSet), intent(in) :: target
145 call atlas__Interpolation__execute_adjoint_fieldset(this%CPTR_PGIBUG_A,source%CPTR_PGIBUG_A,target%CPTR_PGIBUG_A)
146 end subroutine
147
148
149 !-------------------------------------------------------------------------------
150
151 #if FCKIT_FINAL_NOT_INHERITING
152 ATLAS_FINAL subroutine atlas_Interpolation__final_auto(this)
153 type(atlas_Interpolation), intent(inout) :: this
154 #if FCKIT_FINAL_DEBUGGING
155 write(0,*) "atlas_Interpolation__final_auto"
156 #endif
157 #if FCKIT_FINAL_NOT_PROPAGATING
158 call this%final()
159 #endif
160 FCKIT_SUPPRESS_UNUSED( this )
161 end subroutine
162 #endif
163
164 ! -----------------------------------------------------------------------------
165
166 end module atlas_Interpolation_module
167