5 prsi_obs, prsi_model, &
6 prsl_obs, prsl_model, temp_model, zi_model, &
8 troplev_obs, airmass_tot, airmass_trop)
13 integer,
intent(in ) :: nlayers_obs, nlayers_model
14 real(kind_real),
intent(in ),
dimension(nlayers_obs) :: avgkernel_obs
15 real(kind_real),
intent(in ),
dimension(nlayers_obs+1) :: prsi_obs
16 real(kind_real),
intent(in ),
dimension(nlayers_model+1) :: prsi_model
17 real(kind_real),
intent(in ),
dimension(nlayers_obs) :: prsl_obs
18 real(kind_real),
intent(in ),
dimension(nlayers_model) :: prsl_model
19 real(kind_real),
intent(in ),
dimension(nlayers_model) :: profile_model
20 real(kind_real),
intent(in ),
dimension(nlayers_model) :: temp_model
21 real(kind_real),
intent(in ),
dimension(nlayers_model+1) :: zi_model
22 real(kind_real),
intent( out) :: hofx
23 real(kind_real),
intent(in ),
optional :: airmass_tot, airmass_trop
24 integer,
intent(in ),
optional :: troplev_obs
25 real(kind_real) :: airmass_ratio, lnp_ob, lnpi_ob, wf, dz, ptmp
26 real(kind_real),
dimension(nlayers_obs) :: avgkernel_use
27 real(kind_real),
dimension(nlayers_model) :: lnp_model, profile_model_use
28 real(kind_real),
dimension(nlayers_model+1) :: lnpi_model
29 real(kind_real),
dimension(nlayers_obs) :: profile_obslayers
30 real(kind_real),
dimension(nlayers_obs+1) :: zi_obs
32 logical :: troposphere
36 if (
present(airmass_tot) .and.
present(airmass_trop) .and.
present(troplev_obs))
then
42 airmass_ratio = airmass_tot / airmass_trop
43 avgkernel_use = avgkernel_obs * airmass_ratio
46 avgkernel_use(troplev_obs+1:nlayers_obs) =
zero
48 avgkernel_use = avgkernel_obs
55 lnp_model = log(prsl_model)
57 ptmp = max(prsl_obs(k), 1.0_kind_real)
61 profile_obslayers(k), wi, wf)
65 lnpi_model = log(prsi_model)
67 ptmp = max(prsi_obs(k), 1.0_kind_real)
76 dz = (zi_obs(k+1) - zi_obs(k))
77 profile_obslayers(k) = profile_obslayers(k) * dz
78 profile_obslayers(k) = profile_obslayers(k) / 1.0e4_kind_real
84 hofx = hofx + (avgkernel_use(k) * profile_obslayers(k))
90 prsi_obs, prsi_model, &
91 prsl_obs, prsl_model, temp_model, zi_model, &
92 profile_model, hofx, &
93 troplev_obs, airmass_tot, airmass_trop)
98 integer,
intent(in ) :: nlayers_obs, nlayers_model
99 real(kind_real),
intent(in ),
dimension(nlayers_obs) :: avgkernel_obs
100 real(kind_real),
intent(in ),
dimension(nlayers_obs+1) :: prsi_obs
101 real(kind_real),
intent(in ),
dimension(nlayers_model+1) :: prsi_model
102 real(kind_real),
intent(in ),
dimension(nlayers_obs) :: prsl_obs
103 real(kind_real),
intent(in ),
dimension(nlayers_model) :: prsl_model
104 real(kind_real),
intent(in ),
dimension(nlayers_model) :: profile_model
105 real(kind_real),
intent(in ),
dimension(nlayers_model) :: temp_model
106 real(kind_real),
intent(in ),
dimension(nlayers_model+1) :: zi_model
107 real(kind_real),
intent( out) :: hofx
108 real(kind_real),
intent(in ),
optional :: airmass_tot, airmass_trop
109 integer,
intent(in ),
optional :: troplev_obs
110 real(kind_real) :: airmass_ratio, lnp_ob, lnpi_ob, wf, dz, ptmp
111 real(kind_real),
dimension(nlayers_obs) :: avgkernel_use
112 real(kind_real),
dimension(nlayers_model) :: lnp_model, profile_model_use
113 real(kind_real),
dimension(nlayers_model+1) :: lnpi_model
114 real(kind_real),
dimension(nlayers_obs) :: profile_obslayers
115 real(kind_real),
dimension(nlayers_obs+1) :: zi_obs
117 logical :: troposphere
119 troposphere = .false.
121 if (
present(airmass_tot) .and.
present(airmass_trop) .and.
present(troplev_obs))
then
125 if (troposphere)
then
127 airmass_ratio = airmass_tot / airmass_trop
128 avgkernel_use = avgkernel_obs * airmass_ratio
131 avgkernel_use(troplev_obs+1:nlayers_obs) =
zero
133 avgkernel_use = avgkernel_obs
140 lnp_model = log(prsl_model)
142 ptmp = max(prsl_obs(k), 1.0_kind_real)
146 profile_obslayers(k), wi, wf)
150 lnpi_model = log(prsi_model)
152 ptmp = max(prsi_obs(k), 1.0_kind_real)
161 dz = (zi_obs(k+1) - zi_obs(k))
162 profile_obslayers(k) = profile_obslayers(k) * dz
163 profile_obslayers(k) = profile_obslayers(k) / 1.0e4_kind_real
169 hofx = hofx + (avgkernel_use(k) * profile_obslayers(k))
175 prsi_obs, prsi_model, &
176 prsl_obs, prsl_model, temp_model, zi_model, &
177 profile_model_ad, hofx_ad, &
178 troplev_obs, airmass_tot, airmass_trop)
183 integer,
intent(in ) :: nlayers_obs, nlayers_model
184 real(kind_real),
intent(in ),
dimension(nlayers_obs) :: avgkernel_obs
185 real(kind_real),
intent(in ),
dimension(nlayers_obs+1) :: prsi_obs
186 real(kind_real),
intent(in ),
dimension(nlayers_model+1) :: prsi_model
187 real(kind_real),
intent(in ),
dimension(nlayers_obs) :: prsl_obs
188 real(kind_real),
intent(in ),
dimension(nlayers_model) :: prsl_model
189 real(kind_real),
intent(inout),
dimension(nlayers_model) :: profile_model_ad
190 real(kind_real),
intent(in ),
dimension(nlayers_model) :: temp_model
191 real(kind_real),
intent(in ),
dimension(nlayers_model+1) :: zi_model
192 real(kind_real),
intent(in ) :: hofx_ad
193 real(kind_real),
intent(in ),
optional :: airmass_tot, airmass_trop
194 integer,
intent(in ),
optional :: troplev_obs
195 real(kind_real) :: airmass_ratio, lnp_ob, lnpi_ob, wf, dz, ptmp
196 real(kind_real),
dimension(nlayers_obs) :: avgkernel_use
197 real(kind_real),
dimension(nlayers_model) :: lnp_model, profile_model_use_ad
198 real(kind_real),
dimension(nlayers_model+1) :: lnpi_model
199 real(kind_real),
dimension(nlayers_obs) :: profile_obslayers_ad
200 real(kind_real),
dimension(nlayers_obs+1) :: zi_obs
202 logical :: troposphere
205 troposphere = .false.
207 if (
present(airmass_tot) .and.
present(airmass_trop) .and.
present(troplev_obs))
then
211 if (troposphere)
then
213 airmass_ratio = airmass_tot / airmass_trop
214 avgkernel_use = avgkernel_obs * airmass_ratio
217 avgkernel_use(troplev_obs+1:nlayers_obs) =
zero
219 avgkernel_use = avgkernel_obs
222 profile_obslayers_ad =
zero
223 do k=nlayers_obs,1,-1
224 profile_obslayers_ad(k) = profile_obslayers_ad(k) + avgkernel_use(k) * hofx_ad
228 lnpi_model = log(prsi_model)
229 do k=nlayers_obs+1,1,-1
230 ptmp = max(prsi_obs(k), 1.0_kind_real)
238 do k=nlayers_obs,1,-1
239 dz = (zi_obs(k+1) - zi_obs(k))
240 profile_obslayers_ad(k) = profile_obslayers_ad(k) * dz
241 profile_obslayers_ad(k) = profile_obslayers_ad(k) / 1.0e4_kind_real
244 profile_model_use_ad =
zero
246 lnp_model = log(prsl_model)
247 do k=nlayers_obs,1,-1
248 lnp_ob = log(prsl_obs(k))
251 profile_obslayers_ad(k), wi, wf)
subroutine simulate_column_ob_ad(nlayers_obs, nlayers_model, avgkernel_obs, prsi_obs, prsi_model, prsl_obs, prsl_model, temp_model, zi_model, profile_model_ad, hofx_ad, troplev_obs, airmass_tot, airmass_trop)
subroutine simulate_column_ob(nlayers_obs, nlayers_model, avgkernel_obs, prsi_obs, prsi_model, prsl_obs, prsl_model, temp_model, zi_model, profile_model, hofx, troplev_obs, airmass_tot, airmass_trop)
subroutine simulate_column_ob_tl(nlayers_obs, nlayers_model, avgkernel_obs, prsi_obs, prsi_model, prsl_obs, prsl_model, temp_model, zi_model, profile_model, hofx, troplev_obs, airmass_tot, airmass_trop)
real(kind_real), parameter, public avogadro
real(kind_real), parameter, public zero
real(kind_real), parameter, public gas_constant
Fortran module to perform linear interpolation.
subroutine vert_interp_apply_ad(nlev, fvec_ad, f_ad, wi, wf)
subroutine vert_interp_weights(nlev, obl, vec, wi, wf)
subroutine vert_interp_apply(nlev, fvec, f, wi, wf)
subroutine vert_interp_apply_tl(nlev, fvec_tl, f_tl, wi, wf)