FV3 Bundle
ufo_radiance_interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017-2018 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 !> Fortran module to handle radiance observations
7 
9 
10  use iso_c_binding
11  use config_mod
13  implicit none
14  private
15 
16  ! ------------------------------------------------------------------------------
17 #define LISTED_TYPE ufo_radiance
18 
19  !> Linked list interface - defines registry_t type
20 #include "../../linkedList_i.f"
21 
22  !> Global registry
23  type(registry_t) :: ufo_radiance_registry
24 
25  ! ------------------------------------------------------------------------------
26 
27 contains
28 
29  ! ------------------------------------------------------------------------------
30  !> Linked list implementation
31 #include "../../linkedList_c.f"
32 
33 ! ------------------------------------------------------------------------------
34 
35 subroutine ufo_radiance_setup_c(c_key_self, c_conf) bind(c,name='ufo_radiance_setup_f90')
36 implicit none
37 integer(c_int), intent(inout) :: c_key_self
38 type(c_ptr), intent(in) :: c_conf
39 
40 type(ufo_radiance), pointer :: self
41 
42 call ufo_radiance_registry%setup(c_key_self, self)
43 
44 call self%setup(c_conf)
45 
46 end subroutine ufo_radiance_setup_c
47 
48 ! ------------------------------------------------------------------------------
49 
50 subroutine ufo_radiance_delete_c(c_key_self) bind(c,name='ufo_radiance_delete_f90')
51 implicit none
52 integer(c_int), intent(inout) :: c_key_self
53 
54 type(ufo_radiance), pointer :: self
55 
56 call ufo_radiance_registry%get(c_key_self, self)
57 
58 call self%delete()
59 
60 call ufo_radiance_registry%remove(c_key_self)
61 
62 end subroutine ufo_radiance_delete_c
63 
64 ! ------------------------------------------------------------------------------
65 
66 subroutine ufo_radiance_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx, c_bias) bind(c,name='ufo_radiance_simobs_f90')
67 
68 implicit none
69 integer(c_int), intent(in) :: c_key_self
70 integer(c_int), intent(in) :: c_key_geovals
71 type(c_ptr), value, intent(in) :: c_obsspace
72 integer(c_int), intent(in) :: c_nobs
73 real(c_double), intent(inout) :: c_hofx(c_nobs)
74 integer(c_int), intent(in) :: c_bias
75 
76 type(ufo_radiance), pointer :: self
77 
78 character(len=*), parameter :: myname_="ufo_radiance_simobs_c"
79 
80 call ufo_radiance_registry%get(c_key_self, self)
81 call self%opr_simobs(c_key_geovals, c_obsspace, c_hofx)
82 
83 end subroutine ufo_radiance_simobs_c
84 
85 ! ------------------------------------------------------------------------------
86 
87 end module ufo_radiance_mod_c
Fortran module to handle radiance observations.
Fortran module to handle radiance observations.
subroutine ufo_radiance_setup_c(c_key_self, c_conf)
Linked list implementation.
subroutine ufo_radiance_delete_c(c_key_self)
type(registry_t) ufo_radiance_registry
Linked list interface - defines registry_t type.
subroutine ufo_radiance_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx, c_bias)