86 type(model_state_type),
target,
intent(inout) :: current_state
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
97 allocate ( casim_monc_dgs % precip(y_size_local, x_size_local) )
98 casim_monc_dgs % precip(:,:) = 0.0_default_precision
101 if ( casdiags % l_surface_rain )
then
102 allocate ( casim_monc_dgs % SurfaceRainR(y_size_local, x_size_local) )
103 casim_monc_dgs % SurfaceRainR(:, :) = 0.0_default_precision
107 if ( casdiags % l_psedl )
then
108 allocate ( casim_monc_dgs % psedl(z_size, y_size_local, x_size_local) )
109 casim_monc_dgs % psedl(:, :, :) = 0.0_default_precision
112 if ( casdiags % l_pcond )
then
113 allocate ( casim_monc_dgs % pcond(z_size, y_size_local, x_size_local) )
114 casim_monc_dgs % pcond(:, :, :) = 0.0_default_precision
117 if ( casdiags % l_praut )
then
118 allocate ( casim_monc_dgs % praut(z_size, y_size_local, x_size_local) )
119 casim_monc_dgs % praut(:, :, :) = 0.0_default_precision
122 if ( casdiags % l_pracw )
then
123 allocate ( casim_monc_dgs % pracw(z_size, y_size_local, x_size_local) )
124 casim_monc_dgs % pracw(:, :, :) = 0.0_default_precision
127 if ( casdiags % l_prevp )
then
128 allocate ( casim_monc_dgs % prevp(z_size, y_size_local, x_size_local) )
129 casim_monc_dgs % prevp(:, :, :) = 0.0_default_precision
132 if ( casdiags % l_psedr )
then
133 allocate ( casim_monc_dgs % psedr(z_size, y_size_local, x_size_local) )
134 casim_monc_dgs % psedr(:, :, :) = 0.0_default_precision
137 if ( casdiags % l_dth )
then
139 allocate ( casim_monc_dgs % dth_total(z_size, y_size_local, x_size_local) )
140 casim_monc_dgs % dth_total(:, :, :) = 0.0_default_precision
142 allocate ( casim_monc_dgs % dth_cond_evap(z_size, y_size_local, x_size_local) )
143 casim_monc_dgs % dth_cond_evap(:, :, :) = 0.0_default_precision
146 if ( casdiags % l_dqv )
then
147 allocate ( casim_monc_dgs % dqv_total(z_size, y_size_local, x_size_local) )
148 casim_monc_dgs % dqv_total(:, :, :) = 0.0_default_precision
150 allocate ( casim_monc_dgs % dqv_cond_evap(z_size, y_size_local, x_size_local) )
151 casim_monc_dgs % dqv_cond_evap(:, :, :) = 0.0_default_precision
154 if ( casdiags % l_dqc )
then
155 allocate ( casim_monc_dgs % dqc(z_size, y_size_local, x_size_local) )
156 casim_monc_dgs % dqc(:, :, :) = 0.0_default_precision
159 if ( casdiags % l_dqr )
then
160 allocate ( casim_monc_dgs % dqr(z_size, y_size_local, x_size_local) )
161 casim_monc_dgs % dqr(:, :, :) = 0.0_default_precision
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) )
169 casim_monc_dgs % SurfaceSnowR(:,:) = 0.0_default_precision
172 if ( casdiags % l_surface_graup )
then
173 allocate ( casim_monc_dgs % SurfaceGraupR(y_size_local, x_size_local) )
174 casim_monc_dgs % SurfaceGraupR(:,:) = 0.0_default_precision
177 if ( casdiags % l_phomc )
then
178 allocate ( casim_monc_dgs % phomc(z_size, y_size_local, x_size_local) )
179 casim_monc_dgs % phomc(:, :, :) = 0.0_default_precision
182 if ( casdiags % l_pinuc )
then
183 allocate ( casim_monc_dgs % pinuc(z_size, y_size_local, x_size_local) )
184 casim_monc_dgs % pinuc(:, :, :) = 0.0_default_precision
187 if ( casdiags % l_pidep )
then
188 allocate ( casim_monc_dgs % pidep(z_size, y_size_local, x_size_local) )
189 casim_monc_dgs % pidep(:, :, :) = 0.0_default_precision
192 if ( casdiags % l_piacw )
then
193 allocate ( casim_monc_dgs % piacw(z_size, y_size_local, x_size_local) )
194 casim_monc_dgs % piacw(:, :, :) = 0.0_default_precision
197 if ( casdiags % l_pisub )
then
198 allocate ( casim_monc_dgs % pisub(z_size, y_size_local, x_size_local) )
199 casim_monc_dgs % pisub(:, :, :) = 0.0_default_precision
202 if ( casdiags % l_pimlt )
then
203 allocate ( casim_monc_dgs % pimlt(z_size, y_size_local, x_size_local) )
204 casim_monc_dgs % pimlt(:, :, :) = 0.0_default_precision
207 if ( casdiags % l_psedi )
then
208 allocate ( casim_monc_dgs % psedi(z_size, y_size_local, x_size_local) )
209 casim_monc_dgs % psedi(:, :, :) = 0.0_default_precision
212 if ( casdiags % l_psdep )
then
213 allocate ( casim_monc_dgs % psdep(z_size, y_size_local, x_size_local) )
214 casim_monc_dgs % psdep(:, :, :) = 0.0_default_precision
217 if ( casdiags % l_psacw )
then
218 allocate ( casim_monc_dgs % psacw(z_size, y_size_local, x_size_local) )
219 casim_monc_dgs % psacw(:, :, :) = 0.0_default_precision
222 if ( casdiags % l_psacr )
then
223 allocate ( casim_monc_dgs % psacr(z_size, y_size_local, x_size_local) )
224 casim_monc_dgs % psacr(:, :, :) = 0.0_default_precision
227 if ( casdiags % l_pssub )
then
228 allocate ( casim_monc_dgs % pssub(z_size, y_size_local, x_size_local) )
229 casim_monc_dgs % pssub(:, :, :) = 0.0_default_precision
232 if ( casdiags % l_psmlt )
then
233 allocate ( casim_monc_dgs % psmlt(z_size, y_size_local, x_size_local) )
234 casim_monc_dgs % psmlt(:, :, :) = 0.0_default_precision
237 if ( casdiags % l_psaut )
then
238 allocate ( casim_monc_dgs % psaut(z_size, y_size_local, x_size_local) )
239 casim_monc_dgs % psaut(:, :, :) = 0.0_default_precision
242 if ( casdiags % l_psaci )
then
243 allocate ( casim_monc_dgs % psaci(z_size, y_size_local, x_size_local) )
244 casim_monc_dgs % psaci(:, :, :) = 0.0_default_precision
247 if ( casdiags % l_pgacw )
then
248 allocate ( casim_monc_dgs % pgacw(z_size, y_size_local, x_size_local) )
249 casim_monc_dgs % pgacw(:, :, :) = 0.0_default_precision
252 if ( casdiags % l_pgacs )
then
253 allocate ( casim_monc_dgs % pgacs(z_size, y_size_local, x_size_local) )
254 casim_monc_dgs % pgacs(:, :, :) = 0.0_default_precision
257 if ( casdiags % l_pgmlt )
then
258 allocate ( casim_monc_dgs % pgmlt(z_size, y_size_local, x_size_local) )
259 casim_monc_dgs % pgmlt(:, :, :) = 0.0_default_precision
262 if ( casdiags % l_pgsub )
then
263 allocate ( casim_monc_dgs % pgsub(z_size, y_size_local, x_size_local) )
264 casim_monc_dgs % pgsub(:, :, :) = 0.0_default_precision
267 if ( casdiags % l_pseds )
then
268 allocate ( casim_monc_dgs % pseds(z_size, y_size_local, x_size_local) )
269 casim_monc_dgs % pseds(:, :, :) = 0.0_default_precision
272 if ( casdiags % l_psedg )
then
273 allocate ( casim_monc_dgs % psedg(z_size, y_size_local, x_size_local) )
274 casim_monc_dgs % psedg(:, :, :) = 0.0_default_precision
278 if ( casdiags % l_dqi )
then
279 allocate ( casim_monc_dgs % dqi(z_size, y_size_local, x_size_local) )
280 casim_monc_dgs % dqi(:, :, :) = 0.0_default_precision
283 if ( casdiags % l_dqs )
then
284 allocate ( casim_monc_dgs % dqs(z_size, y_size_local, x_size_local) )
285 casim_monc_dgs % dqs(:, :, :) = 0.0_default_precision
288 if ( casdiags % l_dqg )
then
289 allocate ( casim_monc_dgs % dqg(z_size, y_size_local, x_size_local) )
290 casim_monc_dgs % dqg(:, :, :) = 0.0_default_precision