UFO
new_qc/example/ufo_example_mod.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 implement example check
7 
8 module ufo_example_mod
9 
10 use fckit_configuration_module, only: fckit_configuration
11 use iso_c_binding
12 use kinds
14 use obsspace_mod
15 use ufo_vars_mod
16 
17 implicit none
19 private
20 integer, parameter :: max_string=800
21 
22 ! ------------------------------------------------------------------------------
23 !> TODO: fill in this type
24 type, public :: ufo_example
25 private
26  character(len=max_string), public, allocatable :: geovars(:)
27 end type ufo_example
28 
29 ! ------------------------------------------------------------------------------
30 contains
31 ! ------------------------------------------------------------------------------
32 
33 subroutine ufo_example_create(self, f_conf)
34 implicit none
35 type(ufo_example), intent(inout) :: self
36 type(fckit_configuration), intent(in) :: f_conf
37 
38 ! TODO: set self%geovars (list of variables to use from GeoVaLs) if needed
39 
40 end subroutine ufo_example_create
41 
42 ! ------------------------------------------------------------------------------
43 
44 subroutine ufo_example_delete(self)
45 implicit none
46 type(ufo_example), intent(inout) :: self
47 
48 if (allocated(self%geovars)) deallocate(self%geovars)
49 
50 end subroutine ufo_example_delete
51 
52 ! ------------------------------------------------------------------------------
53 
54 subroutine ufo_example_prior(self, obspace, geovals)
55 implicit none
56 type(ufo_example), intent(in) :: self
57 type(c_ptr), value, intent(in) :: obspace
58 type(ufo_geovals), intent(in) :: geovals
59 
60 end subroutine ufo_example_prior
61 
62 ! ------------------------------------------------------------------------------
63 
64 subroutine ufo_example_post(self, obspace, nvars, nlocs, hofx, hofxbias, hofxdiags)
65 implicit none
66 type(ufo_example), intent(in) :: self
67 type(c_ptr), value, intent(in) :: obspace
68 integer, intent(in) :: nvars, nlocs
69 real(c_double), intent(in) :: hofx(nvars, nlocs)
70 real(c_double), intent(in) :: hofxbias(nvars, nlocs)
71 type(ufo_geovals), intent(in) :: hofxdiags
72 
73 end subroutine ufo_example_post
74 
75 ! ------------------------------------------------------------------------------
76 
77 end module ufo_example_mod
Fortran module for example observation operator.
subroutine, public ufo_example_delete(self)
subroutine, public ufo_example_prior(self, obspace, geovals)
subroutine, public ufo_example_create(self, f_conf)
subroutine, public ufo_example_post(self, obspace, nvars, nlocs, hofx, hofxbias, hofxdiags)
integer, parameter max_string
Fortran derived type for the observation type.
type to hold interpolated fields required by the obs operators