FV3-JEDI
Traj.interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017-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 
7 
8 ! iso
9 use iso_c_binding
10 
11 ! fv3-jedi
12 use fv3jedi_traj_mod, only: fv3jedi_traj, wipe, set
15 
16 implicit none
17 private
18 
19 public :: fv3jedi_traj_registry
20 
21 !> Linked list interface - defines registry_t type
22 #define LISTED_TYPE fv3jedi_traj
23 #include "oops/util/linkedList_i.f"
24 type(registry_t) :: fv3jedi_traj_registry
25 
26 ! --------------------------------------------------------------------------------------------------
27 
28 contains
29 
30 ! --------------------------------------------------------------------------------------------------
31 
32 !> Linked list implementation
33 #include "oops/util/linkedList_c.f"
34 
35 ! --------------------------------------------------------------------------------------------------
36 
37 subroutine c_fv3jedi_traj_set(c_key_self, c_key_state) bind(c,name='fv3jedi_traj_set_f90')
38 
39 implicit none
40 integer(c_int), intent(inout) :: c_key_self !< traj
41 integer(c_int), intent(in) :: c_key_state !< State
42 
43 type(fv3jedi_state), pointer :: state
44 type(fv3jedi_traj), pointer :: self
45 
46 ! LinkedList
47 call fv3jedi_state_registry%get(c_key_state, state)
48 call fv3jedi_traj_registry%init()
49 call fv3jedi_traj_registry%add(c_key_self)
50 call fv3jedi_traj_registry%get(c_key_self, self)
51 
52 ! Implementation
53 call set(self, state)
54 
55 end subroutine c_fv3jedi_traj_set
56 
57 ! --------------------------------------------------------------------------------------------------
58 
59 subroutine c_fv3jedi_traj_wipe(c_key_self) bind(c,name='fv3jedi_traj_wipe_f90')
60 
61 implicit none
62 integer(c_int), intent(inout) :: c_key_self
63 
64 type(fv3jedi_traj), pointer :: self
65 
66 ! LinkedList
67 call fv3jedi_traj_registry%get(c_key_self,self)
68 
69 ! Implementation
70 call wipe(self)
71 
72 ! LinkedList
73 call fv3jedi_traj_registry%remove(c_key_self)
74 
75 end subroutine c_fv3jedi_traj_wipe
76 
77 ! --------------------------------------------------------------------------------------------------
78 
fv3jedi_state_mod::fv3jedi_state
Fortran derived type to hold FV3JEDI state.
Definition: fv3jedi_state_mod.F90:30
fv3jedi_traj_interface_mod::c_fv3jedi_traj_set
subroutine c_fv3jedi_traj_set(c_key_self, c_key_state)
Linked list implementation.
Definition: Traj.interface.F90:38
fv3jedi_state_interface_mod
Definition: fv3jedi_state_interface_mod.F90:8
fv3jedi_state_mod
Definition: fv3jedi_state_mod.F90:6
fv3jedi_traj_mod
Definition: fv3jedi_traj_mod.f90:6
fv3jedi_state_interface_mod::fv3jedi_state_registry
type(registry_t), public fv3jedi_state_registry
Linked list interface - defines registry_t type.
Definition: fv3jedi_state_interface_mod.F90:40
fv3jedi_traj_mod::wipe
subroutine, public wipe(self)
Definition: fv3jedi_traj_mod.f90:214
fv3jedi_traj_mod::set
subroutine, public set(self, state)
Definition: fv3jedi_traj_mod.f90:30
fv3jedi_traj_interface_mod::fv3jedi_traj_registry
type(registry_t), public fv3jedi_traj_registry
Linked list interface - defines registry_t type.
Definition: Traj.interface.F90:24
fv3jedi_traj_interface_mod
Definition: Traj.interface.F90:6
fv3jedi_traj_interface_mod::c_fv3jedi_traj_wipe
subroutine c_fv3jedi_traj_wipe(c_key_self)
Definition: Traj.interface.F90:60