Debian Codegraph @

src/atlas_f/numerics/atlas_fvm_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_fvm_module
12
13 use fckit_owned_object_module, only : fckit_owned_object
14 use atlas_Method_module, only : atlas_Method
15 implicit none
16
17 private :: fckit_owned_object
18 private :: atlas_Method
19
20 public :: atlas_fvm_Method
21
22 private
23
24 !------------------------------------------------------------------------------
25 TYPE, extends(atlas_Method) :: atlas_fvm_Method
26
27 ! Purpose :
28 ! -------
29 ! *Method* :
30 ! Describes how nodes are ordered
31 ! Describes how parallelisation for fields is done
32
33 ! Methods :
34 ! -------
35 ! name : The name or tag this function space was created with
36
37 ! Author :
38 ! ------
39 ! 20-Nov-2013 Willem Deconinck *ECMWF*
40
41 !------------------------------------------------------------------------------
42 contains
43
44 procedure, public :: node_columns
45 procedure, public :: edge_columns
46
47 #if FCKIT_FINAL_NOT_INHERITING
48 final :: atlas_fvm_Method__final_auto
49 #endif
50
51 END TYPE atlas_fvm_Method
52
53 interface atlas_fvm_Method
54 module procedure atlas_fvm_Method__cptr
55 module procedure atlas_fvm_Method__mesh_config
56 end interface
57
58 !========================================================
59 contains
60 !========================================================
61
62 function atlas_fvm_Method__cptr(cptr) result(this)
63 use, intrinsic :: iso_c_binding, only : c_ptr
64 type(atlas_fvm_Method) :: this
65 type(c_ptr), intent(in) :: cptr
66 call this%reset_c_ptr( cptr )
67 end function
68
69 function atlas_fvm_Method__mesh_config(mesh,config) result(this)
70 use atlas_fvm_method_c_binding
71 use atlas_Config_module, only : atlas_Config
72 use atlas_Mesh_module, only : atlas_Mesh
73 type(atlas_fvm_Method) :: this
74 type(atlas_Mesh), intent(inout) :: mesh
75 type(atlas_Config), intent(in), optional :: config
76 type(atlas_Config) :: opt_config
77 if( present(config) ) then
78 call this%reset_c_ptr( atlas__numerics__fvm__Method__new(mesh%CPTR_PGIBUG_A, &
79 config%CPTR_PGIBUG_B) )
80 else
81 opt_config = atlas_Config()
82 call this%reset_c_ptr( atlas__numerics__fvm__Method__new(mesh%CPTR_PGIBUG_A, &
83 opt_config%CPTR_PGIBUG_B) )
84 call opt_config%final()
85 endif
86 call this%return()
87 end function
88
89 function node_columns(this)
90 use atlas_fvm_method_c_binding
91 use atlas_functionspace_NodeColumns_module, only : atlas_functionspace_NodeColumns
92 type(atlas_functionspace_NodeColumns) :: node_columns
93 class(atlas_fvm_Method) :: this
94 node_columns = atlas_functionspace_NodeColumns( &
95 & atlas__numerics__fvm__Method__functionspace_nodes(this%CPTR_PGIBUG_A) )
96 call node_columns%return()
97 end function
98
99 function edge_columns(this)
100 use atlas_fvm_method_c_binding
101 use atlas_functionspace_EdgeColumns_module, only : atlas_functionspace_EdgeColumns
102 type(atlas_functionspace_EdgeColumns) :: edge_columns
103 class(atlas_fvm_Method) :: this
104 edge_columns = atlas_functionspace_EdgeColumns( &
105 & atlas__numerics__fvm__Method__functionspace_edges(this%CPTR_PGIBUG_A) )
106 call edge_columns%return()
107 end function
108
109 !-------------------------------------------------------------------------------
110
111 #if FCKIT_FINAL_NOT_INHERITING
112 ATLAS_FINAL subroutine atlas_fvm_Method__final_auto(this)
113 type(atlas_fvm_Method), intent(inout) :: this
114 #if FCKIT_FINAL_DEBUGGING
115 write(0,*) "atlas_fvm_Method__final_auto"
116 #endif
117 #if FCKIT_FINAL_NOT_PROPAGATING
118 call this%final()
119 #endif
120 FCKIT_SUPPRESS_UNUSED( this )
121 end subroutine
122 #endif
123
124 end module atlas_fvm_module
125