FV3 Bundle
ufo_adt_interface.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017 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 adt observations
7 
9 
10  use iso_c_binding
11  use config_mod
12  use ufo_geovals_mod, only: ufo_geovals
14  use ufo_adt_mod
15  implicit none
16  private
17 
18 #define LISTED_TYPE ufo_adt
19 
20  !> Linked list interface - defines registry_t type
21 #include "../../linkedList_i.f"
22 
23  !> Global registry
24  type(registry_t) :: ufo_adt_registry
25 
26  ! ------------------------------------------------------------------------------
27 contains
28  ! ------------------------------------------------------------------------------
29  !> Linked list implementation
30 #include "../../linkedList_c.f"
31 
32 ! ------------------------------------------------------------------------------
33 
34 subroutine ufo_adt_setup_c(c_key_self, c_conf) bind(c,name='ufo_adt_setup_f90')
35 implicit none
36 integer(c_int), intent(inout) :: c_key_self
37 type(c_ptr), intent(in) :: c_conf
38 
39 type(ufo_adt), pointer :: self
40 
41 call ufo_adt_registry%init()
42 call ufo_adt_registry%add(c_key_self)
43 call ufo_adt_registry%get(c_key_self, self)
44 
45 end subroutine ufo_adt_setup_c
46 
47 ! ------------------------------------------------------------------------------
48 
49 subroutine ufo_adt_delete_c(c_key_self) bind(c,name='ufo_adt_delete_f90')
50 implicit none
51 integer(c_int), intent(inout) :: c_key_self
52 
53 type(ufo_adt), pointer :: self
54 
55 call ufo_adt_registry%get(c_key_self, self)
56 call ufo_adt_registry%remove(c_key_self)
57 
58 end subroutine ufo_adt_delete_c
59 
60 ! ------------------------------------------------------------------------------
61 
62 subroutine ufo_adt_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx, c_bias) bind(c,name='ufo_adt_simobs_f90')
63 
64 implicit none
65 integer(c_int), intent(in) :: c_key_self
66 integer(c_int), intent(in) :: c_key_geovals
67 integer(c_int), intent(in) :: c_nobs
68 real(c_double), intent(inout) :: c_hofx(c_nobs)
69 type(c_ptr), value, intent(in) :: c_obsspace
70 integer(c_int), intent(in) :: c_bias
71 
72 type(ufo_adt), pointer :: self
73 type(ufo_geovals), pointer :: geovals
74 
75 character(len=*), parameter :: myname_="ufo_adt_simobs_c"
76 
77 call ufo_adt_registry%get(c_key_self, self)
78 call ufo_geovals_registry%get(c_key_geovals,geovals)
79 
80 call ufo_adt_simobs(self, geovals, c_hofx, c_obsspace)
81 
82 end subroutine ufo_adt_simobs_c
83 
84 end module ufo_adt_mod_c
Fortran module to handle adt observations.
subroutine ufo_adt_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx, c_bias)
subroutine ufo_adt_delete_c(c_key_self)
Fortran module to handle adt observations.
Definition: ufo_adt_mod.F90:8
subroutine, public ufo_adt_simobs(self, geovals, hofx, obss)
Definition: ufo_adt_mod.F90:35
subroutine ufo_adt_setup_c(c_key_self, c_conf)
Linked list implementation.
type to hold interpolated fields required by the obs operators
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
type(registry_t) ufo_adt_registry
Linked list interface - defines registry_t type.