1 subroutine da_print_stats_chem_sfc(stats_unit, nchem, stats, ichem)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
8 use module_state_description, only : num_chem, PARAM_FIRST_SCALAR &
9 ,p_chemsi_pm25, p_chemsi_pm10
14 integer, intent(in) :: stats_unit
15 integer, intent(inout) :: nchem
16 type (stats_chem_sfc_type), intent(in) :: stats
17 integer, intent(in), optional :: ichem
19 ! local variables (Ha)
21 character*64 :: str_pm2,str_pm1,str_so2,str_no2,str_o3,str_co
22 str_pm2 = 'pm25 (ug/m3) n k '
23 str_pm1 = 'pm10 (ug/m3) n k '
24 str_so2 = 'so2 (ug/m3) n k '
25 str_no2 = 'no2 (ug/m3) n k '
26 str_o3 = 'o3 (ug/m3) n k '
27 str_co = 'co (ug/m3) n k '
29 if (chem_cv_options >= 108) then
30 str_so2 = 'so2 (ppmv) n k '
31 str_no2 = 'no2 (ppmv) n k '
32 str_o3 = 'o3 (ppmv) n k '
33 str_co = 'co (ppmv) n k '
36 if (trace_use_dull) call da_trace_entry("da_print_stats_chem_sfc")
38 if (chemicda_opt == 1 ) then
39 write(unit=stats_unit, fmt='(2a/)') &
41 write(unit=stats_unit, fmt='(a,i16)') &
43 if (nchem < 1) nchem = 1
44 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
45 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_pm25), &
46 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_pm25)
47 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
48 ' Average : ', stats%average%chem(p_chemsi_pm25)/real(nchem), &
49 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_pm25)/real(nchem))
51 else if (chemicda_opt == 2 ) then
52 write(unit=stats_unit, fmt='(2a/)') &
54 write(unit=stats_unit, fmt='(a,i16)') &
56 if (nchem < 1) nchem = 1
57 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
58 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_pm10), &
59 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_pm10)
60 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
61 ' Average : ', stats%average%chem(p_chemsi_pm10)/real(nchem), &
62 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_pm10)/real(nchem))
64 else if (chemicda_opt == 3) then
65 if (present(ichem).and.ichem == PARAM_FIRST_SCALAR) then
66 write(unit=stats_unit, fmt='(2a/)') &
68 write(unit=stats_unit, fmt='(a,i16)') &
70 if (nchem < 1) nchem = 1
71 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
72 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_pm25), &
73 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_pm25)
74 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
75 ' Average : ', stats%average%chem(p_chemsi_pm25)/real(nchem), &
76 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_pm25)/real(nchem))
78 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+1) then
79 write(unit=stats_unit, fmt='(2a/)') &
81 write(unit=stats_unit, fmt='(a,i16)') &
83 if (nchem < 1) nchem = 1
84 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
85 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_pm10), &
86 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_pm10)
87 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
88 ' Average : ', stats%average%chem(p_chemsi_pm10)/real(nchem), &
89 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_pm10)/real(nchem))
93 else if (chemicda_opt == 4) then
94 if (present(ichem).and.ichem == PARAM_FIRST_SCALAR) then
95 write(unit=stats_unit, fmt='(2a/)') &
97 write(unit=stats_unit, fmt='(a,i16)') &
99 if (nchem < 1) nchem = 1
100 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
101 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_so2), &
102 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_so2)
103 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
104 ' Average : ', stats%average%chem(p_chemsi_so2)/real(nchem), &
105 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_so2)/real(nchem))
107 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+1) then
108 write(unit=stats_unit, fmt='(2a/)') &
110 write(unit=stats_unit, fmt='(a,i16)') &
112 if (nchem < 1) nchem = 1
113 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
114 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_no2), &
115 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_no2)
116 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
117 ' Average : ', stats%average%chem(p_chemsi_no2)/real(nchem), &
118 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_no2)/real(nchem))
120 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+2) then
121 write(unit=stats_unit, fmt='(2a/)') &
123 write(unit=stats_unit, fmt='(a,i16)') &
125 if (nchem < 1) nchem = 1
126 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
127 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_o3), &
128 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_o3)
129 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
130 ' Average : ', stats%average%chem(p_chemsi_o3)/real(nchem), &
131 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_o3)/real(nchem))
133 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+3) then
134 write(unit=stats_unit, fmt='(2a/)') &
136 write(unit=stats_unit, fmt='(a,i16)') &
138 if (nchem < 1) nchem = 1
139 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
140 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_co), &
141 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_co)
142 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
143 ' Average : ', stats%average%chem(p_chemsi_co)/real(nchem), &
144 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_co)/real(nchem))
148 else if (chemicda_opt == 5) then
149 if (present(ichem).and.ichem == PARAM_FIRST_SCALAR) then
150 write(unit=stats_unit, fmt='(2a/)') &
152 write(unit=stats_unit, fmt='(a,i16)') &
154 if (nchem < 1) nchem = 1
155 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
156 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_pm25), &
157 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_pm25)
158 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
159 ' Average : ', stats%average%chem(p_chemsi_pm25)/real(nchem), &
160 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_pm25)/real(nchem))
162 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+1) then
163 write(unit=stats_unit, fmt='(2a/)') &
165 write(unit=stats_unit, fmt='(a,i16)') &
167 if (nchem < 1) nchem = 1
168 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
169 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_pm10), &
170 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_pm10)
171 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
172 ' Average : ', stats%average%chem(p_chemsi_pm10)/real(nchem), &
173 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_pm10)/real(nchem))
175 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+2) then
176 write(unit=stats_unit, fmt='(2a/)') &
178 write(unit=stats_unit, fmt='(a,i16)') &
180 if (nchem < 1) nchem = 1
181 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
182 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_so2), &
183 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_so2)
184 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
185 ' Average : ', stats%average%chem(p_chemsi_so2)/real(nchem), &
186 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_so2)/real(nchem))
188 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+3) then
189 write(unit=stats_unit, fmt='(2a/)') &
191 write(unit=stats_unit, fmt='(a,i16)') &
193 if (nchem < 1) nchem = 1
194 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
195 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_no2), &
196 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_no2)
197 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
198 ' Average : ', stats%average%chem(p_chemsi_no2)/real(nchem), &
199 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_no2)/real(nchem))
201 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+4) then
202 write(unit=stats_unit, fmt='(2a/)') &
204 write(unit=stats_unit, fmt='(a,i16)') &
206 if (nchem < 1) nchem = 1
207 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
208 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_o3), &
209 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_o3)
210 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
211 ' Average : ', stats%average%chem(p_chemsi_o3)/real(nchem), &
212 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_o3)/real(nchem))
214 else if (present(ichem).and.ichem == PARAM_FIRST_SCALAR+5) then
215 write(unit=stats_unit, fmt='(2a/)') &
217 write(unit=stats_unit, fmt='(a,i16)') &
219 if (nchem < 1) nchem = 1
220 write(unit=stats_unit, fmt='((a,f12.4,2i10))') &
221 ' Minimum(n,k): ', stats%minimum%chem(p_chemsi_co), &
222 ' Maximum(n,k): ', stats%maximum%chem(p_chemsi_co)
223 write(unit=stats_unit, fmt='((a,(f12.4,10x)))') &
224 ' Average : ', stats%average%chem(p_chemsi_co)/real(nchem), &
225 ' RMSE : ', sqrt(stats%rms_err%chem(p_chemsi_co)/real(nchem))
230 if (trace_use_dull) call da_trace_exit("da_print_stats_chem_sfc")
232 end subroutine da_print_stats_chem_sfc