10 use oops_variables_mod
18 type(oops_variables),
public :: obsvars
19 type(oops_variables),
public :: geovars
20 integer,
public,
allocatable :: nlevels(:)
21 real,
public,
allocatable :: coefficients(:)
32 use fckit_configuration_module,
only: fckit_configuration
35 type(fckit_configuration),
intent(in) :: conf
37 character(kind=c_char,len=:),
allocatable :: coord_name
38 character(kind=c_char,len=:),
allocatable :: gvars(:)
39 real(kind=c_double),
allocatable :: coefficients(:)
40 integer(kind=c_int),
allocatable :: nlevels(:)
42 integer :: ivar, nlevs=0, nvars=0, ngvars=0, ncoefs=0
45 if (conf%has(
"geovals"))
then
46 ngvars = conf%get_size(
"geovals")
47 call conf%get_or_die(
"geovals", gvars)
50 call self%geovars%push_back(gvars(ivar))
54 nvars = self%obsvars%nvars()
55 if (ngvars == 0 .and. nvars > 0)
then
56 allocate(self%coefficients(nvars))
58 call self%geovars%push_back(self%obsvars%variable(ivar))
59 self%coefficients(ivar) = 1.0
63 if (conf%has(
"coefficients"))
then
64 ncoefs = conf%get_size(
"coefficients")
65 call conf%get_or_die(
"coefficients", coefficients)
66 allocate(self%coefficients(ncoefs))
67 self%coefficients(1:ncoefs) = coefficients(1:ncoefs)
70 if (conf%has(
"nlevels"))
then
71 nlevs = conf%get_size(
"nlevels")
72 call conf%get_or_die(
"nlevels", nlevels)
73 allocate(self%nlevels(nlevs))
74 self%nlevels(1:nlevs) = nlevels(1:nlevs)
78 call self%geovars%push_back(
var_prsi)
91 integer,
intent(in) :: nvars, nlocs
93 real(c_double),
intent(inout) :: hofx(nvars, nlocs)
94 type(c_ptr),
value,
intent(in) :: obss
98 integer :: nsig, nlevs
99 real(kind_real),
dimension(:),
allocatable :: toppressure,botpressure,airpressure
101 type(
ufo_geoval),
pointer :: modelpressures, modelozone
102 character(len=MAXVARLEN) :: geovar
103 character(len=MAXVARLEN) :: var_zdir
104 real :: pob,delp4,delz,dz1
105 real(kind_real) :: layer_oz
120 call ufo_geovals_get_var(geovals,
var_prsi, modelpressures)
121 nsig = modelpressures%nval - 1
123 allocate(toppressure(nlocs))
124 allocate(botpressure(nlocs))
125 allocate(airpressure(nlocs))
126 call obsspace_get_db(obss,
"MetaData",
"air_pressure", airpressure)
129 write(6,*)
'ufo_atmvertinterplay_simobs: self%nlevels = ', self%nlevels
130 nlevs = self%nlevels(ivar)
131 call get_integral_limits(airpressure, botpressure, toppressure, modelpressures%vals(:,:), nlevs, nlocs, nsig)
134 geovar = self%geovars%variable(ivar)
137 call ufo_geovals_get_var(geovals, geovar, modelozone)
140 call apply_layer_integral(self%coefficients(ivar), modelozone%vals(:,iobs), modelpressures%vals(:,iobs), botpressure(iobs), toppressure(iobs), nsig, layer_oz )
141 hofx(ivar,iobs) = layer_oz
144 deallocate(toppressure)
145 deallocate(botpressure)
Fortran module for atmvertinterplay observation operator.
subroutine ufo_atmvertinterplay_setup(self, conf)
subroutine ufo_atmvertinterplay_simobs(self, geovals_in, obss, nvars, nlocs, hofx)
subroutine, public ufo_geovals_reorderzdir(self, varname, zdir)
subroutine, public ufo_geovals_copy(self, other)
Copy one GeoVaLs object into another.
subroutine, public ufo_geovals_delete(self)
subroutine, public ufo_geovals_get_var(self, varname, geoval)
character(len=maxvarlen), parameter, public var_prsi
Fortran module to perform linear interpolation.
subroutine apply_layer_integral(coefficient, modelozone, modelpressure, botpressure, toppressure, nsig, layer_oz)
subroutine get_integral_limits(airpressure, botpressure, toppressure, modelpressure, nlevs, nlocs, nsig)
Fortran derived type for the observation type.
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators