1 subroutine da_analysis_stats (grid, stats_unit, stats_unit2)
3 !------------------------------------------------------------------------
4 ! Purpose: Calculate min, max, mean and RMS of input 1d field.
5 !------------------------------------------------------------------------
7 use module_state_description, only : num_chem, PARAM_FIRST_SCALAR &
8 ,p_chem_ic_p25, p_chem_ic_sulf &
9 ,p_chem_ic_bc1, p_chem_ic_bc2, p_chem_ic_oc1, p_chem_ic_oc2 &
10 ,p_chem_ic_dust_1, p_chem_ic_dust_2, p_chem_ic_seas_1, p_chem_ic_seas_2 &
11 ,p_chem_ic_bc_a01, p_chem_ic_bc_a02, p_chem_ic_bc_a03 &
12 ,p_chem_ic_oc_a01, p_chem_ic_oc_a02, p_chem_ic_oc_a03 &
13 ,p_chem_ic_so4_a01, p_chem_ic_so4_a02, p_chem_ic_so4_a03 &
14 ,p_chem_ic_no3_a01, p_chem_ic_no3_a02, p_chem_ic_no3_a03 &
15 ,p_chem_ic_nh4_a01, p_chem_ic_nh4_a02, p_chem_ic_nh4_a03 &
16 ,p_chem_ic_cl_a01, p_chem_ic_cl_a02, p_chem_ic_cl_a03 &
17 ,p_chem_ic_na_a01, p_chem_ic_na_a02, p_chem_ic_na_a03 &
18 ,p_chem_ic_oin_a01, p_chem_ic_oin_a02, p_chem_ic_oin_a03
23 type (domain), intent (in) :: grid
24 integer, intent (in) :: stats_unit ! Output unit for stats.
25 integer, optional, intent (in) :: stats_unit2 ! Output unit for chem stats.
28 integer :: ij_g, ijk_g ! ij, ijk for global domain.
29 integer :: kdim ! k range
31 real :: um, vm, tm, pm, qm , qcwm, qrnm ! On local domain.
32 real :: qcim, qsnm, qgrm
33 real :: rij_g, rijk_g ! On global domain.
35 type (maxmin_field_type) :: max_u(kts:kte), max_v(kts:kte), &
36 max_t(kts:kte), max_p(kts:kte), &
38 min_u(kts:kte), min_v(kts:kte), &
39 min_t(kts:kte), min_p(kts:kte), &
42 type (maxmin_field_type) :: max_qcw(kts:kte), max_qrn(kts:kte), &
43 max_qci(kts:kte), max_qsn(kts:kte), &
45 min_qcw(kts:kte), min_qrn(kts:kte), &
46 min_qci(kts:kte), min_qsn(kts:kte), &
49 type (maxmin_field_type) :: max_chem(kts:kte,num_chem), min_chem(kts:kte,num_chem)
50 real :: chemm(num_chem), chemv(kts:kte,num_chem)
54 real :: uv(kts:kte), vv(kts:kte), &
55 tv(kts:kte), pv(kts:kte), &
57 real :: qcwv(kts:kte), qrnv(kts:kte), &
58 qciv(kts:kte), qsnv(kts:kte), &
61 call da_trace_entry("da_analysis_stats")
68 rij_g = 1.0/real(ij_g)
69 rijk_g = 1.0/real(ijk_g)
72 write(unit=stats_unit, fmt='(/a/)') ' Minimum of gridded analysis increments'
73 select case ( cloud_cv_options )
75 write(unit=stats_unit, fmt='(6a/)') &
83 write(unit=stats_unit, fmt='(8a/)') &
93 write(unit=stats_unit, fmt='(11a/)') &
108 write(unit=stats_unit2, fmt='(/a/)') ' Minimum of gridded analysis increments'
109 select case ( chem_cv_options )
111 write(unit=stats_unit2, fmt='(11a/)') &
124 write(unit=stats_unit2, fmt='(9a/)') &
125 ' Lvl, so4aj i j, so4ai i j, nh4aj i j, nh4ai i j, no3aj i j,', &
126 'no3ai i j, naaj i j, naai i j, claj i j, clai i j,', &
127 'asoa1j i j, asoa1i i j, asoa2j i j, asoa2i i j, ', &
128 'asoa3j i j, asoa3i i j, asoa4j i j, asoa4i i j,', &
129 'bsoa1j i j, bsoa1i i j, bsoa2j i j, bsoa2i i j, ', &
130 'bsoa3j i j, bsoa3i i j, bsoa4j i j, bsoa4i i j,', &
131 'orgpaj i j, orgpai i j, ecj i j, eci i j,', &
132 'p25j i j, p25i i j, antha i j, seas i j, soila i j,', &
133 'so2 i j, no2 i j, o3 i j, co i j'
138 call da_maxmin_in_field(grid%xa%u(its:ite,jts:jte,kts:kte), max_u, min_u)
139 call da_proc_maxmin_combine(kdim, max_u, min_u)
140 call da_maxmin_in_field(grid%xa%v(its:ite,jts:jte,kts:kte), max_v, min_v)
141 call da_proc_maxmin_combine(kdim, max_v, min_v)
142 call da_maxmin_in_field(grid%xa%t(its:ite,jts:jte,kts:kte), max_t, min_t)
143 call da_proc_maxmin_combine(kdim, max_t, min_t)
144 call da_maxmin_in_field(grid%xa%p(its:ite,jts:jte,kts:kte), max_p, min_p)
145 call da_proc_maxmin_combine(kdim, max_p, min_p)
146 call da_maxmin_in_field(grid%xa%q(its:ite,jts:jte,kts:kte), max_q, min_q)
147 call da_proc_maxmin_combine(kdim, max_q, min_q)
149 if ( cloud_cv_options >= 1 ) then
150 call da_maxmin_in_field(grid%xa%qcw(its:ite,jts:jte,kts:kte), max_qcw, min_qcw)
151 call da_proc_maxmin_combine(kdim, max_qcw, min_qcw)
152 call da_maxmin_in_field(grid%xa%qrn(its:ite,jts:jte,kts:kte), max_qrn, min_qrn)
153 call da_proc_maxmin_combine(kdim, max_qrn, min_qrn)
156 if ( cloud_cv_options >= 2 ) then
157 call da_maxmin_in_field(grid%xa%qci(its:ite,jts:jte,kts:kte), max_qci, min_qci)
158 call da_proc_maxmin_combine(kdim, max_qci, min_qci)
159 call da_maxmin_in_field(grid%xa%qsn(its:ite,jts:jte,kts:kte), max_qsn, min_qsn)
160 call da_proc_maxmin_combine(kdim, max_qsn, min_qsn)
161 call da_maxmin_in_field(grid%xa%qgr(its:ite,jts:jte,kts:kte), max_qgr, min_qgr)
162 call da_proc_maxmin_combine(kdim, max_qgr, min_qgr)
166 if ( chem_cv_options >= 10 ) then
167 do ic=PARAM_FIRST_SCALAR, num_chem
168 call da_maxmin_in_field(grid%xachem%chem_ic(its:ite,jts:jte,kts:kte, ic), max_chem(:,ic), min_chem(:,ic))
169 call da_proc_maxmin_combine(kdim, max_chem(:,ic), min_chem(:,ic))
192 if ( abs(min_q(k)%value) < 1.e-30 ) min_q(k)%value = 0.0
193 select case ( cloud_cv_options )
195 write(unit=stats_unit, fmt='(i4,4(f12.4,2i5),e12.4,2i5)') k, &
196 min_u(k), min_v(k), min_t(k), min_p(k), min_q(k)
198 write(unit=stats_unit, fmt='(i4,4(f12.4,2i5),3(e12.4,2i5))') k, &
199 min_u(k), min_v(k), min_t(k), min_p(k), min_q(k), &
200 min_qcw(k), min_qrn(k)
202 write(unit=stats_unit, fmt='(i4,4(f12.4,2i5),6(e12.4,2i5))') k, &
203 min_u(k), min_v(k), min_t(k), min_p(k), min_q(k), &
204 min_qcw(k), min_qrn(k), min_qci(k), min_qsn(k), min_qgr(k)
208 select case ( chem_cv_options )
210 write(unit=stats_unit2, fmt='(i4,4(f12.4,2i5),6(e12.4,2i5))') k, &
211 min_chem(k, p_chem_ic_p25), min_chem(k, p_chem_ic_sulf), &
212 min_chem(k, p_chem_ic_bc1), min_chem(k, p_chem_ic_bc2), min_chem(k, p_chem_ic_oc1), min_chem(k, p_chem_ic_oc2), &
213 min_chem(k, p_chem_ic_dust_1), min_chem(k, p_chem_ic_dust_2), min_chem(k, p_chem_ic_seas_1), min_chem(k, p_chem_ic_seas_1)
215 write(unit=stats_unit2, fmt='(i4,24(f12.4,2i5))') k, &
216 min_chem(k, p_chem_ic_bc_a01), min_chem(k, p_chem_ic_bc_a02), min_chem(k, p_chem_ic_bc_a03), &
217 min_chem(k, p_chem_ic_oc_a01), min_chem(k, p_chem_ic_oc_a02), min_chem(k, p_chem_ic_oc_a03), &
218 min_chem(k, p_chem_ic_so4_a01), min_chem(k, p_chem_ic_so4_a02), min_chem(k, p_chem_ic_so4_a03), &
219 min_chem(k, p_chem_ic_no3_a01), min_chem(k, p_chem_ic_no3_a02), min_chem(k, p_chem_ic_no3_a03), &
220 min_chem(k, p_chem_ic_nh4_a01), min_chem(k, p_chem_ic_nh4_a02), min_chem(k, p_chem_ic_nh4_a03), &
221 min_chem(k, p_chem_ic_cl_a01), min_chem(k, p_chem_ic_cl_a02), min_chem(k, p_chem_ic_cl_a03), &
222 min_chem(k, p_chem_ic_na_a01), min_chem(k, p_chem_ic_na_a02), min_chem(k, p_chem_ic_na_a03), &
223 min_chem(k, p_chem_ic_oin_a01), min_chem(k, p_chem_ic_oin_a02), min_chem(k, p_chem_ic_oin_a03)
224 case ( 108 ) ! racm_soa_vbs_da
225 write(unit=stats_unit2,fmt='(A,i4,39(f8.3,2i4))') 'k=',k, (min_chem(k,ic),ic=PARAM_FIRST_SCALAR,num_chem)
230 um=minval(min_u(:)%value)
231 vm=minval(min_v(:)%value)
232 tm=minval(min_t(:)%value)
233 pm=minval(min_p(:)%value)
234 qm=minval(min_q(:)%value)
235 if ( cloud_cv_options >= 1 ) then
236 qcwm=minval(min_qcw(:)%value)
237 qrnm=minval(min_qrn(:)%value)
239 if ( cloud_cv_options >= 2 ) then
240 qcim=minval(min_qci(:)%value)
241 qsnm=minval(min_qsn(:)%value)
242 qgrm=minval(min_qgr(:)%value)
247 do ic=PARAM_FIRST_SCALAR, num_chem
248 chemm(ic)=minval(min_chem(:,ic)%value)
253 select case ( cloud_cv_options )
255 write(unit=stats_unit, fmt='(a,4(f12.4,10x),e12.4)') ' ALL', &
258 write(unit=stats_unit, fmt='(a,4(f12.4,10x),3(e12.4,10x))') ' ALL', &
259 um, vm, tm, pm, qm, qcwm, qrnm
261 write(unit=stats_unit, fmt='(a,4(f12.4,10x),6(e12.4,10x))') ' ALL', &
262 um, vm, tm, pm, qm, qcwm, qrnm, qcim, qsnm, qgrm
266 select case ( chem_cv_options )
268 write(unit=stats_unit2, fmt='(a,4(f12.4,10x),6(e12.4,10x))') ' ALL', &
269 chemm(p_chem_ic_p25), chemm(p_chem_ic_sulf), chemm(p_chem_ic_bc1), chemm(p_chem_ic_bc2), chemm(p_chem_ic_oc1), &
270 chemm(p_chem_ic_oc2), chemm(p_chem_ic_dust_1), chemm(p_chem_ic_dust_2), chemm(p_chem_ic_seas_1), chemm(p_chem_ic_seas_2)
272 write(unit=stats_unit2, fmt='(a,24(f12.4,10x))') ' ALL', &
273 chemm(p_chem_ic_bc_a01), chemm(p_chem_ic_bc_a02), chemm(p_chem_ic_bc_a03), &
274 chemm(p_chem_ic_oc_a01), chemm(p_chem_ic_oc_a02), chemm(p_chem_ic_oc_a03), &
275 chemm(p_chem_ic_so4_a01), chemm(p_chem_ic_so4_a02), chemm(p_chem_ic_so4_a03), &
276 chemm(p_chem_ic_no3_a01), chemm(p_chem_ic_no3_a02), chemm(p_chem_ic_no3_a03), &
277 chemm(p_chem_ic_nh4_a01), chemm(p_chem_ic_nh4_a02), chemm(p_chem_ic_nh4_a03), &
278 chemm(p_chem_ic_cl_a01), chemm(p_chem_ic_cl_a02), chemm(p_chem_ic_cl_a03), &
279 chemm(p_chem_ic_na_a01), chemm(p_chem_ic_na_a02), chemm(p_chem_ic_na_a03), &
280 chemm(p_chem_ic_oin_a01), chemm(p_chem_ic_oin_a02), chemm(p_chem_ic_oin_a03)
281 case ( 108 ) ! racm_soa_vbs_da
282 write(unit=stats_unit2,fmt='(A,39f8.3)') 'Column_Min', (chemm(ic),ic=PARAM_FIRST_SCALAR,num_chem)
286 write(unit=stats_unit, fmt='(/a/)') &
287 ' Maximum of gridded analysis increments'
290 write(unit=stats_unit2, fmt='(/a/)') ' Maximum of gridded analysis increments'
291 select case ( chem_cv_options )
293 write(unit=stats_unit2, fmt='(11a/)') &
308 select case ( cloud_cv_options )
310 write(unit=stats_unit, fmt='(6a/)') &
318 write(unit=stats_unit, fmt='(8a/)') &
328 write(unit=stats_unit, fmt='(11a/)') &
345 if ( abs(max_q(k)%value) < 1.e-30 ) max_q(k)%value = 0.0
346 select case ( cloud_cv_options )
348 write(unit=stats_unit, fmt='(i4,4(f12.4,2i5),e12.4,2i5)') k, &
349 max_u(k), max_v(k), max_t(k), max_p(k), max_q(k)
351 write(unit=stats_unit, fmt='(i4,4(f12.4,2i5),3(e12.4,2i5))') k, &
352 max_u(k), max_v(k), max_t(k), max_p(k), max_q(k), &
353 max_qcw(k), max_qrn(k)
355 write(unit=stats_unit, fmt='(i4,4(f12.4,2i5),6(e12.4,2i5))') k, &
356 max_u(k), max_v(k), max_t(k), max_p(k), max_q(k), &
357 max_qcw(k), max_qrn(k), max_qci(k), max_qsn(k), max_qgr(k)
361 select case ( chem_cv_options )
363 write(unit=stats_unit2, fmt='(i4,4(f12.4,2i5),6(e12.4,2i5))') k, &
364 max_chem(k, p_chem_ic_p25), max_chem(k, p_chem_ic_sulf), &
365 max_chem(k, p_chem_ic_bc1), max_chem(k, p_chem_ic_bc2), max_chem(k, p_chem_ic_oc1), max_chem(k, p_chem_ic_oc2), &
366 max_chem(k, p_chem_ic_dust_1), max_chem(k, p_chem_ic_dust_2), max_chem(k, p_chem_ic_seas_1), max_chem(k, p_chem_ic_seas_1)
368 write(unit=stats_unit2, fmt='(i4,24(f12.4,2i5))') k, &
369 max_chem(k, p_chem_ic_bc_a01), max_chem(k, p_chem_ic_bc_a02), max_chem(k, p_chem_ic_bc_a03), &
370 max_chem(k, p_chem_ic_oc_a01), max_chem(k, p_chem_ic_oc_a02), max_chem(k, p_chem_ic_oc_a03), &
371 max_chem(k, p_chem_ic_so4_a01), max_chem(k, p_chem_ic_so4_a02), max_chem(k, p_chem_ic_so4_a03), &
372 max_chem(k, p_chem_ic_no3_a01), max_chem(k, p_chem_ic_no3_a02), max_chem(k, p_chem_ic_no3_a03), &
373 max_chem(k, p_chem_ic_nh4_a01), max_chem(k, p_chem_ic_nh4_a02), max_chem(k, p_chem_ic_nh4_a03), &
374 max_chem(k, p_chem_ic_cl_a01), max_chem(k, p_chem_ic_cl_a02), max_chem(k, p_chem_ic_cl_a03), &
375 max_chem(k, p_chem_ic_na_a01), max_chem(k, p_chem_ic_na_a02), max_chem(k, p_chem_ic_na_a03), &
376 max_chem(k, p_chem_ic_oin_a01), max_chem(k, p_chem_ic_oin_a02), max_chem(k, p_chem_ic_oin_a03)
377 case ( 108 ) ! racm_soa_vbs_da
378 write(unit=stats_unit2,fmt='(A,i4,39(f8.3,2i4))') 'k=',k, (max_chem(k,ic),ic=PARAM_FIRST_SCALAR,num_chem)
383 um=maxval(max_u(:)%value)
384 vm=maxval(max_v(:)%value)
385 tm=maxval(max_t(:)%value)
386 pm=maxval(max_p(:)%value)
387 qm=maxval(max_q(:)%value)
388 if ( cloud_cv_options >= 1 ) then
389 qcwm=maxval(max_qcw(:)%value)
390 qrnm=maxval(max_qrn(:)%value)
392 if ( cloud_cv_options >= 2 ) then
393 qcim=maxval(max_qci(:)%value)
394 qsnm=maxval(max_qsn(:)%value)
395 qgrm=maxval(max_qgr(:)%value)
400 do ic=PARAM_FIRST_SCALAR, num_chem
401 chemm(ic)=maxval(max_chem(:,ic)%value)
406 select case ( cloud_cv_options )
408 write(unit=stats_unit, fmt='(a,4(f12.4,10x),e12.4)') ' ALL', &
411 write(unit=stats_unit, fmt='(a,4(f12.4,10x),3(e12.4,10x))') ' ALL', &
412 um, vm, tm, pm, qm, qcwm, qrnm
414 write(unit=stats_unit, fmt='(a,4(f12.4,10x),6(e12.4,10x))') ' ALL', &
415 um, vm, tm, pm, qm, qcwm, qrnm, qcim, qsnm, qgrm
419 select case ( chem_cv_options )
421 write(unit=stats_unit2, fmt='(a,4(f12.4,10x),6(e12.4,10x))') ' ALL', &
422 chemm(p_chem_ic_p25), chemm(p_chem_ic_sulf), chemm(p_chem_ic_bc1), chemm(p_chem_ic_bc2), chemm(p_chem_ic_oc1), &
423 chemm(p_chem_ic_oc2), chemm(p_chem_ic_dust_1), chemm(p_chem_ic_dust_2), chemm(p_chem_ic_seas_1), chemm(p_chem_ic_seas_2)
425 write(unit=stats_unit2, fmt='(a,24(f12.4,10x))') ' ALL', &
426 chemm(p_chem_ic_bc_a01), chemm(p_chem_ic_bc_a02), chemm(p_chem_ic_bc_a03), &
427 chemm(p_chem_ic_oc_a01), chemm(p_chem_ic_oc_a02), chemm(p_chem_ic_oc_a03), &
428 chemm(p_chem_ic_so4_a01), chemm(p_chem_ic_so4_a02), chemm(p_chem_ic_so4_a03), &
429 chemm(p_chem_ic_no3_a01), chemm(p_chem_ic_no3_a02), chemm(p_chem_ic_no3_a03), &
430 chemm(p_chem_ic_nh4_a01), chemm(p_chem_ic_nh4_a02), chemm(p_chem_ic_nh4_a03), &
431 chemm(p_chem_ic_cl_a01), chemm(p_chem_ic_cl_a02), chemm(p_chem_ic_cl_a03), &
432 chemm(p_chem_ic_na_a01), chemm(p_chem_ic_na_a02), chemm(p_chem_ic_na_a03), &
433 chemm(p_chem_ic_oin_a01), chemm(p_chem_ic_oin_a02), chemm(p_chem_ic_oin_a03)
434 case ( 108 ) ! racm_soa_vbs_da
435 write(unit=stats_unit2,fmt='(A,39f8.3)') 'Column_Max', (chemm(ic),ic=PARAM_FIRST_SCALAR,num_chem)
439 write(unit=stats_unit, fmt='(/a/)') ' Mean of gridded analysis increments'
442 write(unit=stats_unit2, fmt='(/a/)') ' Mean of gridded analysis increments'
443 select case ( chem_cv_options )
445 write(unit=stats_unit2, fmt='(a/)') &
446 ' Lvl p25 sulf bc1 bc2 oc1 oc2 dust_1 dust_2 seas_1 seas_2'
450 select case ( cloud_cv_options )
452 write(unit=stats_unit, fmt='(a/)') &
455 write(unit=stats_unit, fmt='(a/)') &
456 ' Lvl u v t p q qcw qrn'
458 write(unit=stats_unit, fmt='(a/)') &
459 ' Lvl u v t p q qcw qrn qci qsn qgr'
471 if ( chem_cv_options >= 10 ) then
472 do ic=PARAM_FIRST_SCALAR, num_chem
474 chemv(k,ic) = sum(grid%xachem%chem_ic(its:ite,jts:jte,k,ic))
476 call da_proc_sum_real (chemv(:,ic))
482 uv(k) = sum(grid%xa%u(its:ite,jts:jte,k))
483 vv(k) = sum(grid%xa%v(its:ite,jts:jte,k))
484 tv(k) = sum(grid%xa%t(its:ite,jts:jte,k))
485 pv(k) = sum(grid%xa%p(its:ite,jts:jte,k))
486 qv(k) = sum(grid%xa%q(its:ite,jts:jte,k))
488 call da_proc_sum_real (uv)
489 call da_proc_sum_real (vv)
490 call da_proc_sum_real (tv)
491 call da_proc_sum_real (pv)
492 call da_proc_sum_real (qv)
494 if ( cloud_cv_options >= 1 ) then
498 qcwv(k) = sum(grid%xa%qcw(its:ite,jts:jte,k))
499 qrnv(k) = sum(grid%xa%qrn(its:ite,jts:jte,k))
501 call da_proc_sum_real (qcwv)
502 call da_proc_sum_real (qrnv)
504 if ( cloud_cv_options >= 2 ) then
509 qciv(k) = sum(grid%xa%qci(its:ite,jts:jte,k))
510 qsnv(k) = sum(grid%xa%qsn(its:ite,jts:jte,k))
511 qgrv(k) = sum(grid%xa%qgr(its:ite,jts:jte,k))
513 call da_proc_sum_real (qciv)
514 call da_proc_sum_real (qsnv)
515 call da_proc_sum_real (qgrv)
520 select case ( cloud_cv_options )
522 write(unit=stats_unit, fmt='(i4,4f12.4,e12.4)') k, &
523 uv(k)*rij_g, vv(k)*rij_g, tv(k)*rij_g, &
524 pv(k)*rij_g, qv(k)*rij_g
526 write(unit=stats_unit, fmt='(i4,4f12.4,3e12.4)') k, &
527 uv(k)*rij_g, vv(k)*rij_g, tv(k)*rij_g, &
528 pv(k)*rij_g, qv(k)*rij_g, &
529 qcwv(k)*rij_g, qrnv(k)*rij_g
531 write(unit=stats_unit, fmt='(i4,4f12.4,6e12.4)') k, &
532 uv(k)*rij_g, vv(k)*rij_g, tv(k)*rij_g, &
533 pv(k)*rij_g, qv(k)*rij_g, &
534 qcwv(k)*rij_g, qrnv(k)*rij_g, qciv(k)*rij_g, &
535 qsnv(k)*rij_g, qgrv(k)*rij_g
539 select case ( chem_cv_options )
541 write(unit=stats_unit2, fmt='(i4,10e14.4)') k, &
542 chemv(k, p_chem_ic_p25)*rij_g, chemv(k, p_chem_ic_sulf)*rij_g, &
543 chemv(k, p_chem_ic_bc1)*rij_g, chemv(k, p_chem_ic_bc2)*rij_g, chemv(k, p_chem_ic_oc1)*rij_g, chemv(k, p_chem_ic_oc2)*rij_g, &
544 chemv(k, p_chem_ic_dust_1)*rij_g, chemv(k, p_chem_ic_dust_2)*rij_g, chemv(k, p_chem_ic_seas_2)*rij_g, chemv(k, p_chem_ic_seas_2)*rij_g
546 write(unit=stats_unit2, fmt='(i4,24e14.4)') k, &
547 chemv(k, p_chem_ic_bc_a01)*rij_g, chemv(k, p_chem_ic_bc_a02)*rij_g, chemv(k, p_chem_ic_bc_a03)*rij_g, &
548 chemv(k, p_chem_ic_oc_a01)*rij_g, chemv(k, p_chem_ic_oc_a02)*rij_g, chemv(k, p_chem_ic_oc_a03)*rij_g, &
549 chemv(k, p_chem_ic_so4_a01)*rij_g, chemv(k, p_chem_ic_so4_a02)*rij_g, chemv(k, p_chem_ic_so4_a03)*rij_g, &
550 chemv(k, p_chem_ic_no3_a01)*rij_g, chemv(k, p_chem_ic_no3_a02)*rij_g, chemv(k, p_chem_ic_no3_a03)*rij_g, &
551 chemv(k, p_chem_ic_nh4_a01)*rij_g, chemv(k, p_chem_ic_nh4_a02)*rij_g, chemv(k, p_chem_ic_nh4_a03)*rij_g, &
552 chemv(k, p_chem_ic_cl_a01)*rij_g, chemv(k, p_chem_ic_cl_a02)*rij_g, chemv(k, p_chem_ic_cl_a03)*rij_g, &
553 chemv(k, p_chem_ic_na_a01)*rij_g, chemv(k, p_chem_ic_na_a02)*rij_g, chemv(k, p_chem_ic_na_a03)*rij_g, &
554 chemv(k, p_chem_ic_oin_a01)*rij_g, chemv(k, p_chem_ic_oin_a02)*rij_g, chemv(k, p_chem_ic_oin_a03)*rij_g
555 case ( 108 ) ! racm_soa_vbs_da
556 write(unit=stats_unit2,fmt='(A,i4,39f8.3)') 'k=',k, &
557 (chemv(k,ic)*rij_g, ic=PARAM_FIRST_SCALAR,num_chem)
560 do ic=PARAM_FIRST_SCALAR, num_chem
561 chemm(ic)=chemm(ic)+chemv(k,ic)
570 if ( cloud_cv_options >= 1 ) then
571 qcwm = qcwm + qcwv(k)
572 qrnm = qrnm + qrnv(k)
574 if ( cloud_cv_options >= 2 ) then
575 qcim = qcim + qciv(k)
576 qsnm = qsnm + qsnv(k)
577 qgrm = qgrm + qgrv(k)
583 select case ( cloud_cv_options )
585 write(unit=stats_unit, fmt='(a,4f12.4,e12.4)') ' ALL', &
586 um*rijk_g, vm*rijk_g, tm*rijk_g, pm*rijk_g, qm*rijk_g
588 write(unit=stats_unit, fmt='(a,4f12.4,3e12.4)') ' ALL', &
589 um*rijk_g, vm*rijk_g, tm*rijk_g, pm*rijk_g, qm*rijk_g, &
590 qcwm*rijk_g, qrnm*rijk_g
592 write(unit=stats_unit, fmt='(a,4f12.4,6e12.4)') ' ALL', &
593 um*rijk_g, vm*rijk_g, tm*rijk_g, pm*rijk_g, qm*rijk_g, &
594 qcwm*rijk_g, qrnm*rijk_g, qcim*rijk_g, qsnm*rijk_g, qgrm*rijk_g
598 select case ( chem_cv_options )
600 write(unit=stats_unit2, fmt='(a,10e14.4)') ' ALL', &
601 chemm(p_chem_ic_p25)*rijk_g, chemm(p_chem_ic_sulf)*rijk_g, &
602 chemm(p_chem_ic_bc1)*rijk_g, chemm(p_chem_ic_bc2)*rijk_g, chemm(p_chem_ic_oc1)*rijk_g, chemm(p_chem_ic_oc2)*rijk_g, &
603 chemm(p_chem_ic_dust_1)*rijk_g, chemm(p_chem_ic_dust_2)*rijk_g, chemm(p_chem_ic_seas_2)*rijk_g, chemm(p_chem_ic_seas_2)*rijk_g
605 write(unit=stats_unit2, fmt='(a,24e14.4)') ' ALL', &
606 chemm(p_chem_ic_bc_a01)*rijk_g, chemm(p_chem_ic_bc_a02)*rijk_g, chemm(p_chem_ic_bc_a03)*rijk_g, &
607 chemm(p_chem_ic_oc_a01)*rijk_g, chemm(p_chem_ic_oc_a02)*rijk_g, chemm(p_chem_ic_oc_a03)*rijk_g, &
608 chemm(p_chem_ic_so4_a01)*rijk_g, chemm(p_chem_ic_so4_a02)*rijk_g, chemm(p_chem_ic_so4_a03)*rijk_g, &
609 chemm(p_chem_ic_no3_a01)*rijk_g, chemm(p_chem_ic_no3_a02)*rijk_g, chemm(p_chem_ic_no3_a03)*rijk_g, &
610 chemm(p_chem_ic_nh4_a01)*rijk_g, chemm(p_chem_ic_nh4_a02)*rijk_g, chemm(p_chem_ic_nh4_a03)*rijk_g, &
611 chemm(p_chem_ic_cl_a01)*rijk_g, chemm(p_chem_ic_cl_a02)*rijk_g, chemm(p_chem_ic_cl_a03)*rijk_g, &
612 chemm(p_chem_ic_na_a01)*rijk_g, chemm(p_chem_ic_na_a02)*rijk_g, chemm(p_chem_ic_na_a03)*rijk_g, &
613 chemm(p_chem_ic_oin_a01)*rijk_g, chemm(p_chem_ic_oin_a02)*rijk_g, chemm(p_chem_ic_oin_a03)*rijk_g
614 case ( 108 ) ! racm_soa_vbs_da
615 write(unit=stats_unit2,fmt='(A,39f8.3)') 'ALL', (chemm(ic)*rijk_g,ic=PARAM_FIRST_SCALAR,num_chem)
620 write(unit=stats_unit, fmt='(/a/)') ' RMSE of gridded analysis increments'
623 write(unit=stats_unit2, fmt='(/a/)') ' RMSE of gridded analysis increments'
624 select case ( chem_cv_options )
626 write(unit=stats_unit2, fmt='(a/)') &
627 ' Lvl p25 sulf bc1 bc2 oc1 oc2 dust_1 dust_2 seas_1 seas_2'
631 select case ( cloud_cv_options )
633 write(unit=stats_unit, fmt='(a/)') &
636 write(unit=stats_unit, fmt='(a/)') &
637 ' Lvl u v t p q qcw qrn'
639 write(unit=stats_unit, fmt='(a/)') &
640 ' Lvl u v t p q qcw qrn qci qsn qgr'
674 uv(k) = uv(k) + grid%xa%u(i,j,k) * grid%xa%u(i,j,k)
675 vv(k) = vv(k) + grid%xa%v(i,j,k) * grid%xa%v(i,j,k)
676 tv(k) = tv(k) + grid%xa%t(i,j,k) * grid%xa%t(i,j,k)
677 pv(k) = pv(k) + grid%xa%p(i,j,k) * grid%xa%p(i,j,k)
678 qv(k) = qv(k) + grid%xa%q(i,j,k) * grid%xa%q(i,j,k)
682 call da_proc_sum_real (uv)
683 call da_proc_sum_real (vv)
684 call da_proc_sum_real (tv)
685 call da_proc_sum_real (pv)
686 call da_proc_sum_real (qv)
689 do ic=PARAM_FIRST_SCALAR, num_chem
693 chemv(k,ic) = chemv(k,ic) + grid%xachem%chem_ic(i,j,k,ic) * grid%xachem%chem_ic(i,j,k,ic)
696 call da_proc_sum_real (chemv(:,ic))
701 if ( cloud_cv_options >= 1 ) then
705 qcwv(k) = qcwv(k) + grid%xa%qcw(i,j,k) * grid%xa%qcw(i,j,k)
706 qrnv(k) = qrnv(k) + grid%xa%qrn(i,j,k) * grid%xa%qrn(i,j,k)
710 call da_proc_sum_real (qcwv)
711 call da_proc_sum_real (qrnv)
714 if ( cloud_cv_options >= 2 ) then
718 qciv(k) = qciv(k) + grid%xa%qci(i,j,k) * grid%xa%qci(i,j,k)
719 qsnv(k) = qsnv(k) + grid%xa%qsn(i,j,k) * grid%xa%qsn(i,j,k)
720 qgrv(k) = qgrv(k) + grid%xa%qgr(i,j,k) * grid%xa%qgr(i,j,k)
724 call da_proc_sum_real (qciv)
725 call da_proc_sum_real (qsnv)
726 call da_proc_sum_real (qgrv)
731 select case ( cloud_cv_options )
733 write(unit=stats_unit, fmt='(i4,4f12.4,e12.4)') k, &
740 write(unit=stats_unit, fmt='(i4,4f12.4,3e12.4)') k, &
746 sqrt(qcwv(k)*rij_g), &
749 write(unit=stats_unit, fmt='(i4,4f12.4,6e12.4)') k, &
755 sqrt(qcwv(k)*rij_g), &
756 sqrt(qrnv(k)*rij_g), &
757 sqrt(qciv(k)*rij_g), &
758 sqrt(qsnv(k)*rij_g), &
763 select case ( chem_cv_options )
765 write(unit=stats_unit2, fmt='(i4,10e14.4)') k, &
766 sqrt(chemv(k, p_chem_ic_p25)*rij_g), &
767 sqrt(chemv(k, p_chem_ic_sulf)*rij_g), &
768 sqrt(chemv(k, p_chem_ic_bc1)*rij_g), &
769 sqrt(chemv(k, p_chem_ic_bc2)*rij_g), &
770 sqrt(chemv(k, p_chem_ic_oc1)*rij_g), &
771 sqrt(chemv(k, p_chem_ic_oc2)*rij_g), &
772 sqrt(chemv(k, p_chem_ic_dust_1)*rij_g), &
773 sqrt(chemv(k, p_chem_ic_dust_2)*rij_g), &
774 sqrt(chemv(k, p_chem_ic_seas_1)*rij_g), &
775 sqrt(chemv(k, p_chem_ic_seas_2)*rij_g)
777 write(unit=stats_unit2, fmt='(i4,24e14.4)') k, &
778 sqrt(chemv(k, p_chem_ic_bc_a01)*rij_g), sqrt(chemv(k, p_chem_ic_bc_a02)*rij_g), sqrt(chemv(k, p_chem_ic_bc_a03)*rij_g), &
779 sqrt(chemv(k, p_chem_ic_oc_a01)*rij_g), sqrt(chemv(k, p_chem_ic_oc_a02)*rij_g), sqrt(chemv(k, p_chem_ic_oc_a03)*rij_g), &
780 sqrt(chemv(k, p_chem_ic_so4_a01)*rij_g), sqrt(chemv(k, p_chem_ic_so4_a02)*rij_g), sqrt(chemv(k, p_chem_ic_so4_a03)*rij_g), &
781 sqrt(chemv(k, p_chem_ic_no3_a01)*rij_g), sqrt(chemv(k, p_chem_ic_no3_a02)*rij_g), sqrt(chemv(k, p_chem_ic_no3_a03)*rij_g), &
782 sqrt(chemv(k, p_chem_ic_nh4_a01)*rij_g), sqrt(chemv(k, p_chem_ic_nh4_a02)*rij_g), sqrt(chemv(k, p_chem_ic_nh4_a03)*rij_g), &
783 sqrt(chemv(k, p_chem_ic_cl_a01)*rij_g), sqrt(chemv(k, p_chem_ic_cl_a02)*rij_g), sqrt(chemv(k, p_chem_ic_cl_a03)*rij_g), &
784 sqrt(chemv(k, p_chem_ic_na_a01)*rij_g), sqrt(chemv(k, p_chem_ic_na_a02)*rij_g), sqrt(chemv(k, p_chem_ic_na_a03)*rij_g), &
785 sqrt(chemv(k, p_chem_ic_oin_a01)*rij_g), sqrt(chemv(k, p_chem_ic_oin_a02)*rij_g), sqrt(chemv(k, p_chem_ic_oin_a03)*rij_g)
786 case ( 108 ) ! racm_soa_vbs_da
787 write(unit=stats_unit2,fmt='(A,i4,39f8.3)') 'k=',k, &
788 (sqrt(chemv(k,ic)*rij_g), ic=PARAM_FIRST_SCALAR,num_chem)
790 do ic=PARAM_FIRST_SCALAR, num_chem
791 chemm(ic)=chemm(ic)+chemv(k,ic)
800 if ( cloud_cv_options >= 1 ) then
804 if ( cloud_cv_options >= 2 ) then
812 select case ( cloud_cv_options )
814 write(unit=stats_unit, fmt='(a,4f12.4,e12.4)') ' ALL', &
815 sqrt(um*rijk_g), sqrt(vm*rijk_g), sqrt(tm*rijk_g), &
816 sqrt(pm*rijk_g), sqrt(qm*rijk_g)
818 write(unit=stats_unit, fmt='(a,4f12.4,3e12.4)') ' ALL', &
819 sqrt(um*rijk_g), sqrt(vm*rijk_g), sqrt(tm*rijk_g), &
820 sqrt(pm*rijk_g), sqrt(qm*rijk_g), &
821 sqrt(qcwm*rijk_g), sqrt(qrnm*rijk_g)
823 write(unit=stats_unit, fmt='(a,4f12.4,6e12.4)') ' ALL', &
824 sqrt(um*rijk_g), sqrt(vm*rijk_g), sqrt(tm*rijk_g), &
825 sqrt(pm*rijk_g), sqrt(qm*rijk_g), &
826 sqrt(qcwm*rijk_g), sqrt(qrnm*rijk_g), sqrt(qcim*rijk_g), &
827 sqrt(qsnm*rijk_g), sqrt(qgrm*rijk_g)
831 select case ( chem_cv_options )
833 write(unit=stats_unit2, fmt='(a,10e14.4)') ' ALL', &
834 sqrt(chemm(p_chem_ic_p25)*rijk_g), sqrt(chemm(p_chem_ic_sulf)*rijk_g), &
835 sqrt(chemm(p_chem_ic_bc1)*rijk_g), sqrt(chemm(p_chem_ic_bc2)*rijk_g), sqrt(chemm(p_chem_ic_oc1)*rijk_g), sqrt(chemm(p_chem_ic_oc2)*rijk_g), &
836 sqrt(chemm(p_chem_ic_dust_1)*rijk_g), sqrt(chemm(p_chem_ic_dust_2)*rijk_g), &
837 sqrt(chemm(p_chem_ic_seas_1)*rijk_g), sqrt(chemm(p_chem_ic_seas_2)*rijk_g)
839 write(unit=stats_unit2, fmt='(a,24e14.4)') ' ALL', &
840 sqrt(chemm(p_chem_ic_bc_a01)*rijk_g), sqrt(chemm(p_chem_ic_bc_a02)*rijk_g), sqrt(chemm(p_chem_ic_bc_a03)*rijk_g), &
841 sqrt(chemm(p_chem_ic_oc_a01)*rijk_g), sqrt(chemm(p_chem_ic_oc_a02)*rijk_g), sqrt(chemm(p_chem_ic_oc_a03)*rijk_g), &
842 sqrt(chemm(p_chem_ic_so4_a01)*rijk_g), sqrt(chemm(p_chem_ic_so4_a02)*rijk_g), sqrt(chemm(p_chem_ic_so4_a03)*rijk_g), &
843 sqrt(chemm(p_chem_ic_no3_a01)*rijk_g), sqrt(chemm(p_chem_ic_no3_a02)*rijk_g), sqrt(chemm(p_chem_ic_no3_a03)*rijk_g), &
844 sqrt(chemm(p_chem_ic_nh4_a01)*rijk_g), sqrt(chemm(p_chem_ic_nh4_a02)*rijk_g), sqrt(chemm(p_chem_ic_nh4_a03)*rijk_g), &
845 sqrt(chemm(p_chem_ic_cl_a01)*rijk_g), sqrt(chemm(p_chem_ic_cl_a02)*rijk_g), sqrt(chemm(p_chem_ic_cl_a03)*rijk_g), &
846 sqrt(chemm(p_chem_ic_na_a01)*rijk_g), sqrt(chemm(p_chem_ic_na_a02)*rijk_g), sqrt(chemm(p_chem_ic_na_a03)*rijk_g), &
847 sqrt(chemm(p_chem_ic_oin_a01)*rijk_g), sqrt(chemm(p_chem_ic_oin_a02)*rijk_g), sqrt(chemm(p_chem_ic_oin_a03)*rijk_g)
848 case ( 108 ) ! racm_soa_vbs_da
849 write(unit=stats_unit2,fmt='(A,39f8.3)') 'ALL', (sqrt(chemm(ic)*rijk_g),ic=PARAM_FIRST_SCALAR,num_chem)
854 call da_trace_exit("da_analysis_stats")
858 #include "da_maxmin_in_field.inc"
860 end subroutine da_analysis_stats