MPAS-JEDI
mpasjedi_vc_model2geovars_interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2020 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 ! --------------------------------------------------------------------------------------------------
7 
9 
10 use iso_c_binding
11 
12 use datetime_mod
13 
14 use fckit_configuration_module, only: fckit_configuration
15 
19 
20 implicit none
21 
22 private
24 
25 ! --------------------------------------------------------------------------------------------------
26 
27 #define LISTED_TYPE mpasjedi_vc_model2geovars
28 
29 !> Linked list interface - defines registry_t type
30 #include "oops/util/linkedList_i.f"
31 
32 !> Global registry
34 
35 ! --------------------------------------------------------------------------------------------------
36 
37 contains
38 
39 ! --------------------------------------------------------------------------------------------------
40 
41 !> Linked list implementation
42 #include "oops/util/linkedList_c.f"
43 
44 ! --------------------------------------------------------------------------------------------------
45 
46 subroutine c_mpasjedi_vc_model2geovars_create(c_key_self, c_key_geom, c_conf) &
47  bind(c, name='mpasjedi_vc_model2geovars_create_f90')
48 
49 implicit none
50 integer(c_int), intent(inout) :: c_key_self
51 integer(c_int), intent(in) :: c_key_geom
52 type(c_ptr), value, intent(in) :: c_conf
53 
54 type(mpasjedi_vc_model2geovars), pointer :: self
55 type(mpas_geom), pointer :: geom
56 type(fckit_configuration) :: conf
57 
58 ! Linked list
59 ! -----------
61 call mpasjedi_vc_model2geovars_registry%add(c_key_self)
62 call mpasjedi_vc_model2geovars_registry%get(c_key_self, self)
63 call mpas_geom_registry%get(c_key_geom,geom)
64 
65 ! APIs
66 ! ----
67 conf = fckit_configuration(c_conf)
68 
69 ! Implementation
70 ! --------------
71 !call self%create(geom, conf)
72 
74 
75 ! --------------------------------------------------------------------------------------------------
76 
77 subroutine c_mpasjedi_vc_model2geovars_delete(c_key_self) &
78  bind(c, name='mpasjedi_vc_model2geovars_delete_f90')
79 
80 implicit none
81 integer(c_int), intent(inout) :: c_key_self !< Change variable structure
82 
83 type(mpasjedi_vc_model2geovars), pointer :: self
84 
85 ! Linked list
86 ! -----------
87 call mpasjedi_vc_model2geovars_registry%get(c_key_self,self)
88 
89 ! Implementation
90 ! --------------
91 !call self%delete()
92 
93 ! Linked list
94 ! -----------
95 call mpasjedi_vc_model2geovars_registry%remove(c_key_self)
96 
98 
99 ! --------------------------------------------------------------------------------------------------
100 
101 subroutine c_mpasjedi_vc_model2geovars_changevar(c_key_self, c_key_geom, c_key_xm, c_key_xg) &
102  bind(c, name='mpasjedi_vc_model2geovars_changevar_f90')
103 
104 implicit none
105 integer(c_int), intent(in) :: c_key_self
106 integer(c_int), intent(in) :: c_key_geom
107 integer(c_int), intent(in) :: c_key_xm
108 integer(c_int), intent(in) :: c_key_xg
109 
110 type(mpasjedi_vc_model2geovars), pointer :: self
111 type(mpas_geom), pointer :: geom
112 type(mpas_fields), pointer :: xm
113 type(mpas_fields), pointer :: xg
114 
115 ! Linked list
116 ! -----------
117 call mpasjedi_vc_model2geovars_registry%get(c_key_self,self)
118 call mpas_fields_registry%get(c_key_xm,xm)
119 call mpas_fields_registry%get(c_key_xg,xg)
120 call mpas_geom_registry%get(c_key_geom,geom)
121 
122 ! Implementation
123 ! --------------
124 call self%changevar(geom, xm, xg)
125 
127 
128 ! --------------------------------------------------------------------------------------------------
129 
type(registry_t), public mpas_fields_registry
Linked list interface - defines registry_t type.
type(registry_t), public mpas_geom_registry
Linked list interface - defines registry_t type.
subroutine c_mpasjedi_vc_model2geovars_create(c_key_self, c_key_geom, c_conf)
Linked list implementation.
type(registry_t), public mpasjedi_vc_model2geovars_registry
Linked list interface - defines registry_t type.
subroutine c_mpasjedi_vc_model2geovars_changevar(c_key_self, c_key_geom, c_key_xm, c_key_xg)
Fortran derived type to hold MPAS field.
Fortran derived type to hold geometry definition.