FV3 Bundle
ufo_stericheight_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 steric height observations
7 
9 
10  use iso_c_binding
11  use config_mod
15  use ufo_vars_mod
16  implicit none
17  private
18 
19 #define LISTED_TYPE ufo_stericheight
20 
21  !> Linked list interface - defines registry_t type
22 #include "../../linkedList_i.f"
23 
24  !> Global registry
25  type(registry_t) :: ufo_stericheight_registry
26 
27  ! ------------------------------------------------------------------------------
28 contains
29  ! ------------------------------------------------------------------------------
30  !> Linked list implementation
31 #include "../../linkedList_c.f"
32 
33 ! ------------------------------------------------------------------------------
34 
35 subroutine ufo_stericheight_setup_c(c_key_self, c_conf) bind(c,name='ufo_stericheight_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_stericheight), pointer :: self
41 
42 call ufo_stericheight_registry%init()
43 call ufo_stericheight_registry%add(c_key_self)
44 call ufo_stericheight_registry%get(c_key_self, self)
45 
46 end subroutine ufo_stericheight_setup_c
47 
48 ! ------------------------------------------------------------------------------
49 
50 subroutine ufo_stericheight_delete_c(c_key_self) bind(c,name='ufo_stericheight_delete_f90')
51 implicit none
52 integer(c_int), intent(inout) :: c_key_self
53 
54 type(ufo_stericheight), pointer :: self
55 
56 call ufo_stericheight_registry%get(c_key_self, self)
57 call ufo_stericheight_registry%remove(c_key_self)
58 
59 end subroutine ufo_stericheight_delete_c
60 
61 ! ------------------------------------------------------------------------------
62 
63 subroutine ufo_stericheight_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx, c_bias) bind(c,name='ufo_stericheight_simobs_f90')
64 
65 implicit none
66 integer(c_int), intent(in) :: c_key_self
67 integer(c_int), intent(in) :: c_key_geovals
68 type(c_ptr), value, intent(in) :: c_obsspace
69 integer(c_int), intent(in) :: c_nobs
70 real(c_double), intent(inout) :: c_hofx(:)
71 integer(c_int), intent(in) :: c_bias
72 
73 type(ufo_stericheight), pointer :: self
74 type(ufo_geovals), pointer :: geovals
75 
76 character(len=*), parameter :: myname_="ufo_stericheight_simobs_c"
77 
78 print *,myname_
79 
80 call ufo_stericheight_registry%get(c_key_self, self)
81 call ufo_geovals_registry%get(c_key_geovals,geovals)
82 
83 call ufo_stericheight_simobs(self, geovals, c_hofx)
84 
85 end subroutine ufo_stericheight_simobs_c
86 
87 end module ufo_stericheight_mod_c
Fortran module to handle steric height observations.
subroutine ufo_stericheight_delete_c(c_key_self)
subroutine, public ufo_stericheight_simobs(self, geovals, hofx)
type(registry_t) ufo_stericheight_registry
Linked list interface - defines registry_t type.
subroutine ufo_stericheight_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.
subroutine ufo_stericheight_simobs_c(c_key_self, c_key_geovals, c_obsspace, c_nobs, c_hofx, c_bias)
subroutine, public ufo_geovals_setup(self, vars, nobs)
Fortran module to handle steric height operator.