FV3 Bundle
ufo_obscheck_mod.F90
Go to the documentation of this file.
1 !
2 ! (C) Copyright 2017-2018 UCAR
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 !
8 
9 use iso_c_binding
10 use ufo_vars_mod
11 use ioda_locs_mod
14 use kinds
15 
16 implicit none
17 private
18 public :: ufo_obscheck_registry
19 
20 ! ------------------------------------------------------------------------------
21 
22 !> Fortran derived type to hold interpolated fields required by the obs operators
23 type :: ufo_obscheck
24  integer :: nobs
25  integer :: nvar
26 end type ufo_obscheck
27 
28 #define LISTED_TYPE ufo_obscheck
29 
30 !> Linked list interface - defines registry_t type
31 #include "linkedList_i.f"
32 
33 !> Global registry
34 type(registry_t) :: ufo_obscheck_registry
35 
36 ! ------------------------------------------------------------------------------
37 contains
38 ! ------------------------------------------------------------------------------
39 !> Linked list implementation
40 #include "linkedList_c.f"
41 
42 ! ------------------------------------------------------------------------------
43 
44 subroutine c_ufo_obscheck_setup(c_key_self, c_conf) bind(c,name='ufo_obscheck_setup_f90')
45  implicit none
46  integer(c_int), intent(in) :: c_key_self
47  type(c_ptr), intent(in) :: c_conf
48  type(ufo_obscheck), pointer :: self
49 
50  call ufo_obscheck_registry%init()
51  call ufo_obscheck_registry%add(c_key_self)
52  call ufo_obscheck_registry%get(c_key_self, self)
53 
54 end subroutine c_ufo_obscheck_setup
55 
56 ! ------------------------------------------------------------------------------
57 
58 subroutine c_ufo_obscheck_delete(c_key_self) bind(c,name='ufo_obscheck_delete_f90')
59  implicit none
60  integer(c_int), intent(inout) :: c_key_self
61 
62  type(ufo_obscheck), pointer :: self
63 
64  call ufo_obscheck_registry%get(c_key_self, self)
65  call ufo_obscheck_registry%remove(c_key_self)
66 
67 end subroutine c_ufo_obscheck_delete
68 
69 ! ------------------------------------------------------------------------------
70 
71 subroutine c_ufo_postfilter_f90(c_key_geovals, c_nobs, c_hofx, c_obsspace) bind(c,name='ufo_postFilter_f90')
72 
73  implicit none
74  integer(c_int), intent(in) :: c_key_geovals
75  integer(c_int), intent(in) :: c_nobs
76  real(c_double), intent(in) :: c_hofx(c_nobs)
77  type(c_ptr), value, intent(in) :: c_obsspace
78 
79  type(ufo_geovals), pointer :: geovals
80 
81  write(*,*) '=======Start Post Filter (observation QC)========='
82 ! Get pointers to geovals and obsdata
83  call ufo_geovals_registry%get(c_key_geovals,geovals)
84 ! call obs_data_registry%get(c_key_obsspace,obsdata)
85 !
86 ! working
87 !
88  if (geovals%lalloc .and. geovals%linit) then
89  write(*,*) 'read geovals =========================='
90  write(*,*) 'nobs=',geovals%nobs
91  write(*,*) 'nvar=',geovals%nvar
92  write(*,*) 'geovals nval=',geovals%geovals(1:geovals%nvar)%nval
93  write(*,*) 'geovals nobs=',geovals%geovals(1:geovals%nvar)%nobs
94  write(*,*) 'geovals vals=',geovals%geovals(1)%vals(1:geovals%geovals(1)%nval,1)
95  write(*,*) 'varaibles nv=',geovals%variables%nv
96  write(*,*) 'varaibles fldnames==',geovals%variables%fldnames(1:geovals%variables%nv)
97  else
98  write(*,*) 'GeoVals has not allocated or initialized'
99  write(*,*) 'lalloc=',geovals%lalloc
100  write(*,*) 'linit=',geovals%linit
101  endif
102  write(*,*) '=======End Post Filter (observation QC)========='
103 
104 end subroutine c_ufo_postfilter_f90
105 
106 ! ------------------------------------------------------------------------------
107 
108 subroutine c_ufo_priorfilter_f90(c_obsspace) bind(c,name='ufo_priorFilter_f90')
110  implicit none
111  type(c_ptr), value, intent(in) :: c_obsspace
112 
113 
114  write(*,*) '=======Start Prior Filter (observation QC)========='
115  write(*,*) '=======End Proir Filter (observation QC)========='
116 
117 end subroutine c_ufo_priorfilter_f90
118 
119 ! ------------------------------------------------------------------------------
120 
121 end module ufo_obscheck_mod
subroutine c_ufo_postfilter_f90(c_key_geovals, c_nobs, c_hofx, c_obsspace)
Fortran derived type to hold interpolated fields required by the obs operators.
subroutine c_ufo_priorfilter_f90(c_obsspace)
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
subroutine c_ufo_obscheck_setup(c_key_self, c_conf)
Linked list implementation.
Fortran module handling observation locations.
type(registry_t), public ufo_obscheck_registry
Linked list interface - defines registry_t type.
subroutine c_ufo_obscheck_delete(c_key_self)