3 use generic_diagnostic_variables,
only: diaglist
7 use mphys_switches,
only: l_warm
24 REAL,
ALLOCATABLE :: precip(:,:)
25 REAL,
ALLOCATABLE :: surfacerainr(:,:)
26 REAL,
ALLOCATABLE :: surfacesnowr(:,:)
27 REAL,
ALLOCATABLE :: surfacegraupr(:,:)
30 REAL,
ALLOCATABLE :: phomc(:,:,:)
31 REAL,
ALLOCATABLE :: pinuc(:,:,:)
32 REAL,
ALLOCATABLE :: pidep(:,:,:)
33 REAL,
ALLOCATABLE :: psdep(:,:,:)
34 REAL,
ALLOCATABLE :: piacw(:,:,:)
35 REAL,
ALLOCATABLE :: psacw(:,:,:)
36 REAL,
ALLOCATABLE :: psacr(:,:,:)
37 REAL,
ALLOCATABLE :: pisub(:,:,:)
38 REAL,
ALLOCATABLE :: pssub(:,:,:)
39 REAL,
ALLOCATABLE :: pimlt(:,:,:)
40 REAL,
ALLOCATABLE :: psmlt(:,:,:)
41 REAL,
ALLOCATABLE :: psaut(:,:,:)
42 REAL,
ALLOCATABLE :: psaci(:,:,:)
43 REAL,
ALLOCATABLE :: praut(:,:,:)
44 REAL,
ALLOCATABLE :: pracw(:,:,:)
45 REAL,
ALLOCATABLE :: prevp(:,:,:)
46 REAL,
ALLOCATABLE :: pgacw(:,:,:)
47 REAL,
ALLOCATABLE :: pgacs(:,:,:)
48 REAL,
ALLOCATABLE :: pgmlt(:,:,:)
49 REAL,
ALLOCATABLE :: pgsub(:,:,:)
50 REAL,
ALLOCATABLE :: psedi(:,:,:)
51 REAL,
ALLOCATABLE :: pseds(:,:,:)
52 REAL,
ALLOCATABLE :: psedr(:,:,:)
53 REAL,
ALLOCATABLE :: psedg(:,:,:)
54 REAL,
ALLOCATABLE :: psedl(:,:,:)
55 REAL,
ALLOCATABLE :: pcond(:,:,:)
62 REAL,
ALLOCATABLE :: dth_total(:,:,:)
63 REAL,
ALLOCATABLE :: dth_cond_evap(:,:,:)
70 REAL,
ALLOCATABLE :: dqv_total(:,:,:)
71 REAL,
ALLOCATABLE :: dqv_cond_evap(:,:,:)
72 REAL,
ALLOCATABLE :: dqc(:,:,:)
73 REAL,
ALLOCATABLE :: dqr(:,:,:)
74 REAL,
ALLOCATABLE :: dqi(:,:,:)
75 REAL,
ALLOCATABLE :: dqs(:,:,:)
76 REAL,
ALLOCATABLE :: dqg(:,:,:)
87 type(diaglist),
target,
intent(in) :: casdiags
89 integer :: z_size, y_size_local, x_size_local
91 z_size = current_state%local_grid%size(
z_index)
92 y_size_local = current_state%local_grid%size(
y_index)
93 x_size_local = current_state%local_grid%size(
x_index)
96 if ( casdiags % l_precip )
then
101 if ( casdiags % l_surface_rain )
then
102 allocate (
casim_monc_dgs % SurfaceRainR(y_size_local, x_size_local) )
107 if ( casdiags % l_psedl )
then
108 allocate (
casim_monc_dgs % psedl(z_size, y_size_local, x_size_local) )
112 if ( casdiags % l_pcond )
then
113 allocate (
casim_monc_dgs % pcond(z_size, y_size_local, x_size_local) )
117 if ( casdiags % l_praut )
then
118 allocate (
casim_monc_dgs % praut(z_size, y_size_local, x_size_local) )
122 if ( casdiags % l_pracw )
then
123 allocate (
casim_monc_dgs % pracw(z_size, y_size_local, x_size_local) )
127 if ( casdiags % l_prevp )
then
128 allocate (
casim_monc_dgs % prevp(z_size, y_size_local, x_size_local) )
132 if ( casdiags % l_psedr )
then
133 allocate (
casim_monc_dgs % psedr(z_size, y_size_local, x_size_local) )
137 if ( casdiags % l_dth )
then
139 allocate (
casim_monc_dgs % dth_total(z_size, y_size_local, x_size_local) )
142 allocate (
casim_monc_dgs % dth_cond_evap(z_size, y_size_local, x_size_local) )
146 if ( casdiags % l_dqv )
then
147 allocate (
casim_monc_dgs % dqv_total(z_size, y_size_local, x_size_local) )
150 allocate (
casim_monc_dgs % dqv_cond_evap(z_size, y_size_local, x_size_local) )
154 if ( casdiags % l_dqc )
then
155 allocate (
casim_monc_dgs % dqc(z_size, y_size_local, x_size_local) )
159 if ( casdiags % l_dqr )
then
160 allocate (
casim_monc_dgs % dqr(z_size, y_size_local, x_size_local) )
164 if (.not. l_warm)
then
167 if ( casdiags % l_surface_snow )
then
168 allocate (
casim_monc_dgs % SurfaceSnowR(y_size_local, x_size_local) )
172 if ( casdiags % l_surface_graup )
then
173 allocate (
casim_monc_dgs % SurfaceGraupR(y_size_local, x_size_local) )
177 if ( casdiags % l_phomc )
then
178 allocate (
casim_monc_dgs % phomc(z_size, y_size_local, x_size_local) )
182 if ( casdiags % l_pinuc )
then
183 allocate (
casim_monc_dgs % pinuc(z_size, y_size_local, x_size_local) )
187 if ( casdiags % l_pidep )
then
188 allocate (
casim_monc_dgs % pidep(z_size, y_size_local, x_size_local) )
192 if ( casdiags % l_piacw )
then
193 allocate (
casim_monc_dgs % piacw(z_size, y_size_local, x_size_local) )
197 if ( casdiags % l_pisub )
then
198 allocate (
casim_monc_dgs % pisub(z_size, y_size_local, x_size_local) )
202 if ( casdiags % l_pimlt )
then
203 allocate (
casim_monc_dgs % pimlt(z_size, y_size_local, x_size_local) )
207 if ( casdiags % l_psedi )
then
208 allocate (
casim_monc_dgs % psedi(z_size, y_size_local, x_size_local) )
212 if ( casdiags % l_psdep )
then
213 allocate (
casim_monc_dgs % psdep(z_size, y_size_local, x_size_local) )
217 if ( casdiags % l_psacw )
then
218 allocate (
casim_monc_dgs % psacw(z_size, y_size_local, x_size_local) )
222 if ( casdiags % l_psacr )
then
223 allocate (
casim_monc_dgs % psacr(z_size, y_size_local, x_size_local) )
227 if ( casdiags % l_pssub )
then
228 allocate (
casim_monc_dgs % pssub(z_size, y_size_local, x_size_local) )
232 if ( casdiags % l_psmlt )
then
233 allocate (
casim_monc_dgs % psmlt(z_size, y_size_local, x_size_local) )
237 if ( casdiags % l_psaut )
then
238 allocate (
casim_monc_dgs % psaut(z_size, y_size_local, x_size_local) )
242 if ( casdiags % l_psaci )
then
243 allocate (
casim_monc_dgs % psaci(z_size, y_size_local, x_size_local) )
247 if ( casdiags % l_pgacw )
then
248 allocate (
casim_monc_dgs % pgacw(z_size, y_size_local, x_size_local) )
252 if ( casdiags % l_pgacs )
then
253 allocate (
casim_monc_dgs % pgacs(z_size, y_size_local, x_size_local) )
257 if ( casdiags % l_pgmlt )
then
258 allocate (
casim_monc_dgs % pgmlt(z_size, y_size_local, x_size_local) )
262 if ( casdiags % l_pgsub )
then
263 allocate (
casim_monc_dgs % pgsub(z_size, y_size_local, x_size_local) )
267 if ( casdiags % l_pseds )
then
268 allocate (
casim_monc_dgs % pseds(z_size, y_size_local, x_size_local) )
272 if ( casdiags % l_psedg )
then
273 allocate (
casim_monc_dgs % psedg(z_size, y_size_local, x_size_local) )
278 if ( casdiags % l_dqi )
then
279 allocate (
casim_monc_dgs % dqi(z_size, y_size_local, x_size_local) )
283 if ( casdiags % l_dqs )
then
284 allocate (
casim_monc_dgs % dqs(z_size, y_size_local, x_size_local) )
288 if ( casdiags % l_dqg )
then
289 allocate (
casim_monc_dgs % dqg(z_size, y_size_local, x_size_local) )
300 type(diaglist),
target,
intent(in) :: casdiags
302 INTEGER :: icol, jcol, target_x_index, target_y_index, k
304 icol=current_state%column_local_x
305 jcol=current_state%column_local_y
306 target_y_index=jcol-current_state%local_grid%halo_size(
y_index)
307 target_x_index=icol-current_state%local_grid%halo_size(
x_index)
309 if ( casdiags % l_surface_rain .and. casdiags % l_precip) &
311 casdiags % SurfaceRainR(1,1)
313 if ( casdiags % l_surface_rain ) &
315 casdiags % SurfaceRainR(1,1)
317 if ( casdiags % l_pcond ) &
319 casdiags % pcond(1,1,:)
320 if ( casdiags % l_psedl ) &
322 casdiags % psedl(1,1,:)
323 if ( casdiags % l_praut ) &
325 casdiags % praut(1,1,:)
326 if ( casdiags % l_pracw ) &
328 casdiags % pracw(1,1,:)
329 if ( casdiags % l_prevp ) &
331 casdiags % prevp(1,1,:)
332 if ( casdiags % l_psedr ) &
334 casdiags % psedr(1,1,:)
337 if ( casdiags % l_dth )
then
339 casdiags % dth_total(1,1,:)
340 casim_monc_dgs % dth_cond_evap(:,target_y_index,target_x_index) = &
341 casdiags % dth_cond_evap(1,1,:)
343 if ( casdiags % l_dqv )
then
345 casdiags % dqv_total(1,1,:)
346 casim_monc_dgs % dqv_cond_evap(:,target_y_index,target_x_index) = &
347 casdiags % dqv_cond_evap(1,1,:)
349 if ( casdiags % l_dqc ) &
351 casdiags % dqc(1,1,:)
352 if ( casdiags % l_dqr ) &
354 casdiags % dqr(1,1,:)
356 if (.not. l_warm)
then
357 if ( casdiags % l_precip ) &
359 casdiags % SurfaceRainR(1,1) + casdiags % SurfaceSnowR(1,1)
360 if ( casdiags % l_surface_snow ) &
362 casdiags % SurfaceSnowR(1,1)
363 if ( casdiags % l_surface_graup ) &
365 casdiags % SurfaceGraupR(1,1)
366 if ( casdiags % l_phomc ) &
368 casdiags % psedr(1,1,:)
369 if ( casdiags % l_pinuc ) &
371 casdiags % pinuc(1,1,:)
372 if ( casdiags % l_pidep ) &
374 casdiags % pidep(1,1,:)
375 if ( casdiags % l_piacw ) &
377 casdiags % piacw(1,1,:)
378 if ( casdiags % l_pisub ) &
380 casdiags % pisub(1,1,:)
381 if ( casdiags % l_pimlt ) &
383 casdiags % pimlt(1,1,:)
384 if ( casdiags % l_psedi ) &
386 casdiags % psedi(1,1,:)
387 if ( casdiags % l_psmlt ) &
389 casdiags % psmlt(1,1,:)
390 if ( casdiags % l_psaut ) &
392 casdiags % psaut(1,1,:)
393 if ( casdiags % l_psaci ) &
395 casdiags % psaci(1,1,:)
396 if ( casdiags % l_psacw ) &
398 casdiags % psacw(1,1,:)
399 if ( casdiags % l_psacr ) &
401 casdiags % psacr(1,1,:)
402 if ( casdiags % l_pssub ) &
404 casdiags % pssub(1,1,:)
405 if ( casdiags % l_psdep ) &
407 casdiags % psdep(1,1,:)
408 if ( casdiags % l_pseds ) &
410 casdiags % pseds(1,1,:)
411 if ( casdiags % l_pgacw ) &
413 casdiags % pgacw(1,1,:)
414 if ( casdiags % l_pgacs ) &
416 casdiags % pgacs(1,1,:)
417 if ( casdiags % l_pgmlt ) &
419 casdiags % pgmlt(1,1,:)
420 if ( casdiags % l_pgsub ) &
422 casdiags % pgsub(1,1,:)
423 if ( casdiags % l_psedg ) &
425 casdiags % psedg(1,1,:)
426 if ( casdiags % l_dqi ) &
428 casdiags % dqi(1,1,:)
429 if ( casdiags % l_dqs ) &
431 casdiags % dqs(1,1,:)
432 if ( casdiags % l_dqg ) &
434 casdiags % dqg(1,1,:)