UFO
ufo_gnssro_bndropp1d_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 ropp1d forward operator
7 !> following the ROPP (2018 Aug) implementation
8 
10 
11 use iso_c_binding
12 use kinds
13 use ufo_vars_mod
16 use ufo_basis_mod, only: ufo_basis
19 use obsspace_mod
20 use missing_values_mod
21 use fckit_log_module, only : fckit_log
22 
23 implicit none
24 public :: ufo_gnssro_bndropp1d
25 private
26 
27  !> Fortran derived type for gnssro trajectory
28 type, extends(ufo_basis) :: ufo_gnssro_bndropp1d
29  contains
30  procedure :: simobs => ufo_gnssro_bndropp1d_simobs
31 end type ufo_gnssro_bndropp1d
32 
33 contains
34 
35 ! ------------------------------------------------------------------------------
36 ! ------------------------------------------------------------------------------
37 subroutine ufo_gnssro_bndropp1d_simobs(self, geovals, hofx, obss)
38 
39  implicit none
40  class(ufo_gnssro_bndropp1d), intent(in) :: self
41  type(ufo_geovals), intent(in) :: geovals
42  real(kind_real), intent(inout) :: hofx(:)
43  type(c_ptr), value, intent(in) :: obss
44  real(c_double) :: missing
45 
46  character(len=*), parameter :: myname_="ufo_gnssro_bndropp1d_simobs"
47  integer, parameter :: max_string = 800
48 
49  character(max_string) :: err_msg
50  integer :: nlev, nobs, iobs,nvprof, obss_nobs
51  type(ufo_geoval), pointer :: t, q, prs, gph, gph_sfc
52  real(kind_real), allocatable :: obslat(:), obslon(:), obsimpp(:), obslocr(:), obsgeoid(:)
53 
54  write(err_msg,*) "TRACE: ufo_gnssro_bndropp1d_simobs_stub: begin"
55  call fckit_log%info(err_msg)
56 
57 ! check if nobs is consistent in geovals & hofx
58  if (geovals%nlocs /= size(hofx)) then
59  write(err_msg,*) myname_, ' error: nlocs inconsistent!'
60  call abor1_ftn(err_msg)
61  endif
62 
63 ! get variables from geovals
64  call ufo_geovals_get_var(geovals, var_ts, t) ! temperature
65  call ufo_geovals_get_var(geovals, var_q, q) ! specific humidity
66  call ufo_geovals_get_var(geovals, var_prs, prs) ! pressure
67  call ufo_geovals_get_var(geovals, var_z, gph) ! geopotential height
68  call ufo_geovals_get_var(geovals, var_sfc_geomz, gph_sfc) ! surface geopotential height
69 
70  missing = missing_value(missing)
71 
72  nlev = t%nval ! number of model levels
73  nobs = obsspace_get_nlocs(obss)
74 
75 ! set obs space struture
76  allocate(obslon(nobs))
77  allocate(obslat(nobs))
78  allocate(obsimpp(nobs))
79  allocate(obslocr(nobs))
80  allocate(obsgeoid(nobs))
81 
82  call obsspace_get_db(obss, "MetaData", "longitude", obslon)
83  call obsspace_get_db(obss, "MetaData", "latitude", obslat)
84  call obsspace_get_db(obss, "MetaData", "impact_parameter", obsimpp)
85  call obsspace_get_db(obss, "MetaData", "earth_radius_of_curvature", obslocr)
86  call obsspace_get_db(obss, "MetaData", "geoid_height_above_reference_ellipsoid", obsgeoid)
87 
88  deallocate(obslat)
89  deallocate(obslon)
90  deallocate(obsimpp)
91  deallocate(obslocr)
92  deallocate(obsgeoid)
93 
94  write(err_msg,*) "TRACE: ufo_gnssro_bndropp1d_simobs_stub: completed"
95  call fckit_log%info(err_msg)
96 
97 end subroutine ufo_gnssro_bndropp1d_simobs
98 ! ------------------------------------------------------------------------------
99 
100 end module ufo_gnssro_bndropp1d_mod
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 ropp1d forward operator following the ROPP (2018 Aug) impleme...
subroutine ufo_gnssro_bndropp1d_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_sfc_geomz
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.