FV3 Bundle
fv3jedi_getvalues_traj_mod.F90
Go to the documentation of this file.
1 
2 !> Fortran module handling interpolation trajectory for the FV3 model
3 
5 
6 !General JEDI uses
8 use iso_c_binding
9 use type_bump, only: bump_type
10 
11 implicit none
12 private
13 
17 
19  integer :: bumpid, ngrid
20  logical :: noobs
21  real(kind=kind_real), allocatable :: t(:,:,:)
22  real(kind=kind_real), allocatable :: q(:,:,:)
23  type(bump_type) :: bump
24  logical :: lalloc = .false.
25  contains
26  final :: dummy_final !Work around for gcc compiler bug
28 
29 #define LISTED_TYPE fv3jedi_getvalues_traj
30 
31 !> Linked list interface - defines registry_t type
32 #include "linkedList_i.f"
33 
34 !> Global registry
36 
37 ! ------------------------------------------------------------------------------
38 contains
39 ! ------------------------------------------------------------------------------
40 !> Linked list implementation
41 #include "linkedList_c.f"
42 
43 ! ------------------------------------------------------------------------------
44 
45 subroutine c_fv3jedi_getvalues_traj_setup(c_key_self) bind(c,name='fv3jedi_getvalues_traj_setup_f90')
46 
47 implicit none
48 integer(c_int), intent(inout) :: c_key_self
49 type(fv3jedi_getvalues_traj), pointer :: self
50 
51 ! Init, add and get key
52 ! ---------------------
54 call fv3jedi_getvalues_traj_registry%add(c_key_self)
55 call fv3jedi_getvalues_traj_registry%get(c_key_self,self)
56 
57 self%lalloc = .false.
58 self%bumpid = c_key_self !Just use key for the BUMP identifier
59 self%ngrid = 0
60 self%noobs = .false.
61 
62 end subroutine c_fv3jedi_getvalues_traj_setup
63 
64 ! ------------------------------------------------------------------------------
65 
66 subroutine c_fv3jedi_getvalues_traj_delete(c_key_self) bind(c,name='fv3jedi_getvalues_traj_delete_f90')
67 
68 implicit none
69 integer(c_int), intent(inout) :: c_key_self
70 type(fv3jedi_getvalues_traj), pointer :: self
71 
72 ! Get key
73 call fv3jedi_getvalues_traj_registry%get(c_key_self, self)
74 
75 if (self%lalloc) then
76  if (allocated(self%t)) deallocate(self%t)
77  if (allocated(self%q)) deallocate(self%q)
78  call self%bump%dealloc
79 endif
80 
81 ! Remove key
82 call fv3jedi_getvalues_traj_registry%remove(c_key_self)
83 
85 
86 ! ------------------------------------------------------------------------------
87 
88 subroutine dummy_final(self)
89 type(fv3jedi_getvalues_traj), intent(inout) :: self
90 end subroutine dummy_final
91 
92 ! ------------------------------------------------------------------------------
93 
Fortran module handling interpolation trajectory for the FV3 model.
type(registry_t), public fv3jedi_getvalues_traj_registry
Linked list interface - defines registry_t type.
subroutine, public c_fv3jedi_getvalues_traj_setup(c_key_self)
Linked list implementation.
subroutine, public c_fv3jedi_getvalues_traj_delete(c_key_self)
integer, parameter, public kind_real