UFO
ufo_gnssro_bndropp2d_mod_stub.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 !> Stubbed Fortran module for gnssro bending angle ropp2d forward operator
7 !> following the ROPP (2018 Aug) implementation
8 
10 
11 use fckit_configuration_module, only: fckit_configuration
12 use kinds
13 use ufo_vars_mod
16 use ufo_basis_mod, only: ufo_basis
19 use obsspace_mod
21 use missing_values_mod
22 use fckit_log_module, only : fckit_log
23 
24 implicit none
25 public :: ufo_gnssro_bndropp2d
26 private
27 
28  !> Fortran derived type for gnssro trajectory
29 type, extends(ufo_basis) :: ufo_gnssro_bndropp2d
30  type(gnssro_conf) :: roconf
31  real(kind_real), allocatable :: obsLon2d(:), obsLat2d(:) !2d location
32  contains
33  procedure :: setup => ufo_gnssro_bndropp2d_setup
34  procedure :: simobs => ufo_gnssro_bndropp2d_simobs
35 end type ufo_gnssro_bndropp2d
36 
37 contains
38 
39 ! ------------------------------------------------------------------------------
40 subroutine ufo_gnssro_bndropp2d_setup(self, f_conf, c_size)
41  implicit none
42  class(ufo_gnssro_bndropp2d), intent(inout) :: self
43  type(fckit_configuration), intent(in) :: f_conf
44  integer, intent(in) :: c_size ! 1d obsspace vector length
45 
46  call gnssro_conf_setup(self%roconf,f_conf)
47 
48  allocate(self%obsLon2d(c_size*self%roconf%n_horiz))
49  allocate(self%obsLat2d(c_size*self%roconf%n_horiz))
50 
51 end subroutine ufo_gnssro_bndropp2d_setup
52 
53 ! ------------------------------------------------------------------------------
54 subroutine ufo_gnssro_bndropp2d_simobs(self, geovals, hofx, obss)
55 
56  implicit none
57  class(ufo_gnssro_bndropp2d), intent(in) :: self
58  type(ufo_geovals), intent(in) :: geovals
59  real(kind_real), intent(inout) :: hofx(:)
60  type(c_ptr), value, intent(in) :: obss
61  real(c_double) :: missing
62 
63  character(len=*), parameter :: myname_="ufo_gnssro_bndropp2d_simobs"
64  integer, parameter :: max_string = 800
65  character(max_string) :: err_msg
66  integer :: nlev, nobs, iobs, nvprof, obss_nobs
67  type(ufo_geoval), pointer :: t, q, prs, gph !, gph_sfc
68  real(kind_real), allocatable :: obslat(:), obslon(:), obsimpp(:), obslocr(:), obsgeoid(:)
69  integer :: n_horiz
70 
71 
72  write(err_msg,*) "TRACE: ufo_gnssro_bndropp2d_simobs_stub: begin"
73  call fckit_log%info(err_msg)
74 
75  n_horiz = self%roconf%n_horiz
76 
77 ! check if nlocs is consistent in geovals & hofx
78  if (geovals%nlocs /= size(hofx)*n_horiz) then
79  write(err_msg,*) myname_, ' error: nlocs inconsistent!'
80  call abor1_ftn(err_msg)
81  endif
82 
83 ! get variables from geovals
84  call ufo_geovals_get_var(geovals, var_ts, t) ! temperature
85  call ufo_geovals_get_var(geovals, var_q, q) ! specific humidity
86  call ufo_geovals_get_var(geovals, var_prs, prs) ! pressure
87  call ufo_geovals_get_var(geovals, var_z, gph) ! geopotential height
88 
89  missing = missing_value(missing)
90 
91  nlev = t%nval ! number of model levels
92  nobs = obsspace_get_nlocs(obss)
93 
94 ! set obs space struture
95  allocate(obslon(nobs))
96  allocate(obslat(nobs))
97  allocate(obsimpp(nobs))
98  allocate(obslocr(nobs))
99  allocate(obsgeoid(nobs))
100 
101  call obsspace_get_db(obss, "MetaData", "longitude", obslon)
102  call obsspace_get_db(obss, "MetaData", "latitude", obslat)
103  call obsspace_get_db(obss, "MetaData", "impact_parameter", obsimpp)
104  call obsspace_get_db(obss, "MetaData", "earth_radius_of_curvature", obslocr)
105  call obsspace_get_db(obss, "MetaData", "geoid_height_above_reference_ellipsoid", obsgeoid)
106 
107 
108  write(err_msg,*) "TRACE: ufo_gnssro_bndropp2d_simobs_stub: begin observation loop, nobs = ", nobs
109  call fckit_log%info(err_msg)
110 
111  deallocate(obslat)
112  deallocate(obslon)
113  deallocate(obsimpp)
114  deallocate(obslocr)
115  deallocate(obsgeoid)
116 
117  write(err_msg,*) "TRACE: ufo_gnssro_bndropp2d_simobs_stub: completed"
118  call fckit_log%info(err_msg)
119 
120  return
121 end subroutine ufo_gnssro_bndropp2d_simobs
122 ! ------------------------------------------------------------------------------
123 
124 end module ufo_gnssro_bndropp2d_mod
subroutine, public gnssro_conf_setup(roconf, f_conf)
Fortran module to prepare for Lagrange polynomial interpolation. based on GSI: lagmod....
Definition: lag_interp.F90:4
subroutine, public lag_interp_const(q, x, n)
Definition: lag_interp.F90:24
subroutine, public lag_interp_smthweights(x, xt, aq, bq, w, dw, n)
Definition: lag_interp.F90:174
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
integer, parameter max_string
subroutine, public ufo_geovals_get_var(self, varname, geoval)
Fortran module for gnssro bending angle ropp2d forward operator following the ROPP (2018 Aug) impleme...
subroutine ufo_gnssro_bndropp2d_setup(self, f_conf, c_size)
subroutine ufo_gnssro_bndropp2d_simobs(self, geovals, hofx, obss)
character(len=maxvarlen), parameter, public var_prs
character(len=maxvarlen), parameter, public var_q
character(len=maxvarlen), parameter, public var_z
character(len=maxvarlen), parameter, public var_ts
Fortran module to perform linear interpolation.
Definition: vert_interp.F90:8
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators
Fortran derived type for gnssro trajectory.