UFO
SatTCWV.interface.F90
Go to the documentation of this file.
1 !
2 ! (C) Copyright 2021 Met Office
3 !
4 ! This software is licensed under the terms of the Apache Licence Version 2.0
5 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 
7 !> Fortran module to handle SatTCWV operator
8 
10 
11  use fckit_configuration_module, only: fckit_configuration
12  use iso_c_binding
13 
14  use ufo_sattcwv_mod
15  implicit none
16  private
17 
18 #define LISTED_TYPE ufo_sattcwv
19 
20  !> Linked list interface - defines registry_t type
21 #include "oops/util/linkedList_i.f"
22 
23  !> Global registry
24  type(registry_t) :: ufo_sattcwv_registry
25 
26  ! ------------------------------------------------------------------------------
27 contains
28  ! ------------------------------------------------------------------------------
29  !> Linked list implementation
30 #include "oops/util/linkedList_c.f"
31 
32 ! ------------------------------------------------------------------------------
33 
34 subroutine ufo_sattcwv_setup_c(c_key_self, c_conf) bind(c,name='ufo_sattcwv_setup_f90')
35 use, intrinsic :: iso_c_binding, only: c_ptr
36 implicit none
37 integer(c_int), intent(inout) :: c_key_self
38 type(c_ptr), intent(in) :: c_conf
39 
40 type(ufo_sattcwv), pointer :: self
41 type(fckit_configuration) :: f_conf
42 
43 call ufo_sattcwv_registry%setup(c_key_self, self)
44 f_conf = fckit_configuration(c_conf)
45 
46 call self%setup(f_conf)
47 
48 end subroutine ufo_sattcwv_setup_c
49 
50 ! ------------------------------------------------------------------------------
51 
52 subroutine ufo_sattcwv_delete_c(c_key_self) bind(c,name='ufo_sattcwv_delete_f90')
53 implicit none
54 integer(c_int), intent(inout) :: c_key_self
55 
56 type(ufo_sattcwv), pointer :: self
57 
58 call ufo_sattcwv_registry%delete(c_key_self,self)
59 
60 end subroutine ufo_sattcwv_delete_c
61 
62 ! ------------------------------------------------------------------------------
63 
64 subroutine ufo_sattcwv_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx) &
65  bind(c,name='ufo_sattcwv_simobs_f90')
66 use, intrinsic :: iso_c_binding, only: c_ptr
67 implicit none
68 integer(c_int), intent(in) :: c_key_self
69 integer(c_int), intent(in) :: c_key_geovals
70 type(c_ptr), value, intent(in) :: c_obsspace
71 integer(c_int), intent(in) :: c_nobs
72 real(c_double), intent(inout) :: c_hofx(c_nobs)
73 
74 type(ufo_sattcwv), pointer :: self
75 
76 character(len=*), parameter :: myname_="ufo_sattcwv_simobs_c"
77 call ufo_sattcwv_registry%get(c_key_self, self)
78 call self%opr_simobs(c_key_geovals, c_obsspace, c_hofx)
79 
80 end subroutine ufo_sattcwv_simobs_c
81 
82 ! ------------------------------------------------------------------------------
83 
84 end module ufo_sattcwv_mod_c
Fortran module to handle SatTCWV operator.
subroutine ufo_sattcwv_delete_c(c_key_self)
subroutine ufo_sattcwv_setup_c(c_key_self, c_conf)
Linked list implementation.
type(registry_t) ufo_sattcwv_registry
Linked list interface - defines registry_t type.
subroutine ufo_sattcwv_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx)
Fortran module for satellite precipitable water observation operator.
Fortran derived type for sattcwv trajectory.