12 use fckit_log_module,
only: fckit_log
13 use kinds,
only: kind_real
16 use typesizes,
only: wp => eightbytereal
17 use datetimetypes,
only: dp
18 use ropp_fm_types,
only: state2dfm, obs1dbangle
19 use geodesy,
only: gravity, r_eff, geometric2geopotential
20 use arrays,
only: callocate
35 subroutine init_ropp_2d_statevec(rlon,rlat,temp,shum,pres,phi,lm, x, n_horiz, dtheta, iflip)
57 type(state2dfm),
intent(out) :: x
58 integer,
intent(in) :: lm, n_horiz
59 real(kind=kind_real),
intent(in) :: dtheta
60 real(kind=kind_real),
dimension(n_horiz),
intent(in) :: rlon, rlat
61 real(kind=kind_real),
dimension(lm,n_horiz),
intent(in) :: temp,shum,pres,phi
64 integer,
optional,
intent(in) :: iflip
77 allocate(x%temp(x%n_lev,x%n_horiz))
78 allocate(x%shum(x%n_lev,x%n_horiz))
79 allocate(x%pres(x%n_lev,x%n_horiz))
80 allocate(x%geop(x%n_lev,x%n_horiz))
83 allocate(x%refrac(x%n_lev,x%n_horiz))
84 allocate(x%nr(x%n_lev,x%n_horiz))
85 allocate(x%lat(x%n_horiz))
86 allocate(x%lon(x%n_horiz))
88 x%lat(:) = real(rlat(:),kind=wp)
89 x%lon(:) = real(rlon(:),kind=wp)
90 where (x%lon .gt. 180.0) x%lon = x%lon -360.0
100 if (
present(iflip) .and. iflip .eq. 1)
then
103 x%temp(n,:) = real(temp(k,:),kind=wp)
104 x%shum(n,:) = real(shum(k,:),kind=wp)
105 x%pres(n,:) = real(pres(k,:),kind=wp)
106 x%geop(n,:) = real(phi(k,:),kind=wp)
112 x%temp(k,:) = real(temp(k,:),kind=wp)
113 x%shum(k,:) = real(shum(k,:),kind=wp)
114 x%pres(k,:) = real(pres(k,:),kind=wp)
115 x%geop(k,:) = real(phi(k,:),kind=wp)
150 type(state2dfm),
intent(inout) :: x_ad
151 integer,
intent(in) :: lm, n_horiz
152 real(kind=kind_real), &
153 dimension(lm,n_horiz),
intent(inout) :: temp_d,shum_d,pres_d,phi_d
157 integer,
optional,
intent(in) :: iflip
160 x_ad%n_horiz = n_horiz
162 if (
present(iflip) .and. iflip .eq. 1)
then
165 do j = 1, x_ad%n_horiz
167 temp_d(k,j) = temp_d(k,j) + real(x_ad%temp(n,j),kind=kind_real)
168 x_ad%temp(n,j) = 0.0_wp
171 shum_d(k,j) = shum_d(k,j) + real(x_ad%shum(n,j),kind=kind_real)
172 x_ad%shum(n,j) = 0.0_wp
175 pres_d(k,j) = pres_d(k,j) + real(x_ad%pres(n,j),kind=kind_real)
176 x_ad%pres(n,j) = 0.0_wp
179 phi_d(k,j) = phi_d(k,j) + real(x_ad%geop(n,j),kind=kind_real)
180 x_ad%geop(n,j) = 0.0_wp
187 do j = 1, x_ad%n_horiz
188 temp_d(k,j) = temp_d(k,j) + real(x_ad%temp(k,j),kind=kind_real)
189 x_ad%temp(k,j) = 0.0_wp
190 shum_d(k,j) = shum_d(k,j) + real(x_ad%shum(k,j),kind=kind_real)
191 x_ad%shum(k,j) = 0.0_wp
192 pres_d(k,j) = pres_d(k,j) + real(x_ad%pres(k,j),kind=kind_real)
193 x_ad%pres(k,j) = 0.0_wp
194 phi_d(k,j) = phi_d(k,j) + real(x_ad%geop(k,j),kind=kind_real)
195 x_ad%geop(k,j) = 0.0_wp
225 type(obs1dbangle),
intent(out) :: y
227 integer,
intent(in) :: nvprof
228 real(kind=kind_real),
dimension(nvprof),
intent(in) :: obs_impact
229 real(kind=kind_real),
intent(in) :: rlat,rlon
230 real(kind=kind_real),
intent(in) :: roc, undulat
232 real(kind=wp) :: r8lat
234 real(kind=kind_real) :: rlon_local
237 r8lat = real(rlat,kind=wp)
240 if (rlon_local .gt. 180.) rlon_local = rlon_local - 360.0
241 y%lon = real(rlon_local,kind=wp)
242 y%g_sfc = gravity(r8lat, 0.0_wp)
243 y%r_curve = real(roc,kind=wp)
244 y%undulation = real(undulat,kind=wp)
245 y%r_earth = r_eff(r8lat)
250 allocate(y%bangle(1:nvprof))
251 allocate(y%impact(1:nvprof))
253 allocate(y%a_path(1:nvprof,2))
254 allocate(y%rtan(1:nvprof))
260 y%impact(i) = real(obs_impact(i),kind=wp)
270 rlat,rlon,roc,undulat,y,y_p)
291 type(obs1dbangle),
intent(out) :: y,y_p
293 integer,
intent(in) :: iloop
294 integer,
intent(in) :: nvprof
295 real(kind=kind_real),
dimension(nvprof),
intent(in) :: obs_impact
296 real(kind=kind_real),
intent(in) :: rlat,rlon
297 real(kind=kind_real),
intent(in) :: roc, undulat
299 real(kind=wp) :: r8lat
301 real(kind=kind_real) :: rlon_local
304 r8lat = real(rlat,kind=wp)
307 if (rlon_local .gt. 180.) rlon_local = rlon_local - 360.0
308 y%lon = real(rlon_local,kind=wp)
309 y%g_sfc = gravity(r8lat, 0.0_wp)
310 y%r_curve = real(roc,kind=wp)
311 y%undulation = real(undulat,kind=wp)
312 y%r_earth = r_eff(r8lat)
319 allocate(y%bangle(1:nvprof))
320 allocate(y%impact(1:nvprof))
322 allocate(y%a_path(1:nvprof,2))
323 allocate(y%rtan(1:nvprof))
325 allocate(y_p%bangle(1:nvprof))
326 allocate(y_p%impact(1:nvprof))
328 allocate(y_p%a_path(1:nvprof,2))
329 allocate(y_p%rtan(1:nvprof))
339 y%impact(i) = real(obs_impact(i),kind=wp)
340 y_p%impact(i) = real(obs_impact(i),kind=wp)
352 type(state2dfm),
intent(inout) :: x
353 type(obs1dbangle),
intent(inout) :: y
355 if (
associated(x%temp))
deallocate(x%temp)
356 if (
associated(x%shum))
deallocate(x%shum)
357 if (
associated(x%pres))
deallocate(x%pres)
358 if (
associated(x%geop))
deallocate(x%geop)
359 if (
associated(x%nr))
deallocate(x%nr)
360 if (
associated(x%refrac))
deallocate(x%refrac)
361 if (
associated(x%lat))
deallocate(x%lat)
362 if (
associated(x%lon))
deallocate(x%lon)
364 if (
associated(y%impact))
deallocate(y%impact)
365 if (
associated(y%bangle))
deallocate(y%bangle)
366 if (
associated(y%a_path))
deallocate(y%a_path)
367 if (
associated(y%rtan))
deallocate(y%rtan)
375 type(state2dfm),
intent(inout) :: x,x_p
376 type(obs1dbangle),
intent(inout) :: y,y_p
391 deallocate(x_p%refrac)
399 deallocate(y_p%impact)
400 deallocate(y_p%bangle)
401 deallocate(y_p%a_path)
Fortran module to handle gnssro bending angle observations following the ROPP (2018 Aug) implementati...
subroutine, public ropp_tidy_up_2d(x, y)
subroutine, public init_ropp_2d_statevec(rlon, rlat, temp, shum, pres, phi, lm, x, n_horiz, dtheta, iflip)
subroutine, public ropp_tidy_up_tlad_2d(x, x_p, y, y_p)
subroutine, public init_ropp_2d_obvec(nvprof, obs_impact, rlat, rlon, roc, undulat, y)
subroutine, public init_ropp_2d_obvec_tlad(iloop, nvprof, obs_impact, rlat, rlon, roc, undulat, y, y_p)
subroutine, public init_ropp_2d_statevec_ad(temp_d, shum_d, pres_d, phi_d, lm, x_ad, n_horiz, iflip)