19 use oops_variables_mod
28 integer :: nlocs, nlayers, ntracers, nvars
29 type(oops_variables),
public :: obsvars
30 type(oops_variables),
public :: geovars
31 real(kind=kind_real),
allocatable :: bext(:,:,:,:)
32 real(kind=kind_real),
public,
allocatable :: wavelength(:)
33 character(len=maxvarlen),
public:: rcfile
34 real(kind=kind_real),
dimension(:,:),
allocatable :: delp(:,:)
48 use fckit_configuration_module,
only: fckit_configuration
51 type(fckit_configuration),
intent(in) :: f_conf
55 character(len=:),
allocatable :: tracer_variables(:)
56 character(len=:),
allocatable :: str
59 call f_conf%get_or_die(
"tracer_geovals",tracer_variables)
60 self%ntracers = f_conf%get_size(
"tracer_geovals")
61 do iq = 1, self%ntracers
62 call self%geovars%push_back(tracer_variables(iq))
64 deallocate(tracer_variables)
67 self%nvars = self%obsvars%nvars()
69 allocate(self%wavelength(self%nvars))
70 call f_conf%get_or_die(
"wavelengths", self%wavelength)
73 call f_conf%get_or_die(
"RCFile",str)
85 if (
allocated(self%bext))
deallocate(self%bext)
86 if (
allocated(self%delp))
deallocate(self%delp)
87 if (
allocated(self%wavelength))
deallocate(self%wavelength)
98 type(c_ptr),
value,
intent(in) :: obss
105 character(len=MAXVARLEN) :: geovar
106 character(len=MAXVARLEN),
dimension(:),
allocatable:: tracer_name
108 real(kind=kind_real),
dimension(:,:),
allocatable :: rh
109 real(kind=kind_real),
dimension(:,:,:),
allocatable :: qm
112 self%nlocs = obsspace_get_nlocs(obss)
116 self%nlayers = delp_profile%nval
117 allocate(self%delp(self%nlayers,self%nlocs))
118 self%delp = delp_profile%vals
121 allocate(rh(self%nlayers,self%nlocs))
126 allocate(qm(self%ntracers, self%nlayers, self%nlocs))
127 allocate(tracer_name(self%ntracers))
128 do iq = 1, self%ntracers
129 geovar = self%geovars%variable(iq)
130 tracer_name(iq) = geovar
132 qm(iq,:,:) = aer_profile%vals
133 qm(iq,:,:) = qm(iq,:,:) * self%delp /
grav
136 allocate(self%bext(self%nlayers, self%nvars, self%ntracers, self%nlocs))
137 call get_geos_aod(self%nlayers, self%nlocs, self%nvars, self%ntracers, self%rcfile, &
138 self%wavelength, tracer_name, qm, rh, ext=self%bext, rc = rc)
142 deallocate(self%wavelength)
143 deallocate(tracer_name)
154 type(c_ptr),
value,
intent(in) :: obss
155 integer,
intent(in) :: nvars, nlocs
156 real(c_double),
intent(inout) :: hofx(nvars, nlocs)
159 real(kind_real),
dimension(:,:,:),
allocatable :: qm_tl
162 character(len=MAXVARLEN) :: geovar
165 allocate(qm_tl(self%ntracers, self%nlayers, nlocs))
167 do iq = 1, self%ntracers
168 geovar = self%geovars%variable(iq)
170 qm_tl(iq,:,:) = aer_profile%vals
171 qm_tl(iq,:,:) = qm_tl(iq,:,:) * self%delp /
grav
174 call get_geos_aod_tl(self%nlayers,self%nlocs, nvars, self%ntracers, self%bext, qm_tl, aod_tot_tl=hofx)
187 type(c_ptr),
value,
intent(in) :: obss
188 integer,
intent(in) :: nvars, nlocs
189 real(c_double),
intent(in) :: hofx(nvars, nlocs)
192 real(kind_real),
dimension(:,:,:),
allocatable :: qm_ad
194 character(len=MAXVARLEN) :: geovar
196 allocate(qm_ad(self%ntracers, self%nlayers, nlocs))
198 call get_geos_aod_ad(self%nlayers, nlocs, nvars, self%ntracers, self%bext, hofx, qm_ad)
200 do iq = self%ntracers,1,-1
202 geovar = self%geovars%variable(iq)
204 qm_ad(iq,:,:) = qm_ad(iq,:,:) * self%delp /
grav
205 aer_profile%vals = qm_ad(iq,:,:)
Fortran module for aodgeos tl/ad observation operator.
subroutine ufo_aodgeos_tlad_setup(self, f_conf)
subroutine ufo_aodgeos_simobs_tl(self, geovals, obss, nvars, nlocs, hofx)
subroutine ufo_aodgeos_simobs_ad(self, geovals, obss, nvars, nlocs, hofx)
integer, parameter max_string
subroutine ufo_aodgeos_tlad_settraj(self, geovals, obss)
subroutine ufo_aodgeos_tlad_delete(self)
real(kind_real), parameter, public grav
subroutine, public ufo_geovals_get_var(self, varname, geoval)
character(len=maxvarlen), parameter, public var_rh
character(len=maxvarlen), parameter, public var_delp
Fortran derived type for the tl/ad observation operator.
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators