11 use mphys_switches,
only: l_warm
13 use generic_diagnostic_variables,
ONLY: casdiags
91 type(model_state_type),
target,
intent(inout) :: current_state
95 if (.not. is_component_enabled(current_state%options_database,
"casim"))
then
96 call log_master_log(log_error,
"Casim profile diags requested but casim not enabled - check config, STOP")
100 allocate(
psedl_tot(current_state%local_grid%size(z_index)), &
101 pcond_tot(current_state%local_grid%size(z_index)), &
102 praut_tot(current_state%local_grid%size(z_index)), &
103 pracw_tot(current_state%local_grid%size(z_index)), &
104 prevp_tot(current_state%local_grid%size(z_index)), &
105 psedr_tot(current_state%local_grid%size(z_index)), &
112 if (.not. l_warm)
then
113 allocate(
phomc_tot(current_state%local_grid%size(z_index)), &
114 pinuc_tot(current_state%local_grid%size(z_index)), &
115 pidep_tot(current_state%local_grid%size(z_index)), &
116 piacw_tot(current_state%local_grid%size(z_index)), &
117 pisub_tot(current_state%local_grid%size(z_index)), &
118 pimlt_tot(current_state%local_grid%size(z_index)), &
119 psedi_tot(current_state%local_grid%size(z_index)), &
120 psacw_tot(current_state%local_grid%size(z_index)), &
121 psacr_tot(current_state%local_grid%size(z_index)), &
122 pssub_tot(current_state%local_grid%size(z_index)), &
123 psmlt_tot(current_state%local_grid%size(z_index)), &
124 psaut_tot(current_state%local_grid%size(z_index)), &
125 psaci_tot(current_state%local_grid%size(z_index)), &
126 psdep_tot(current_state%local_grid%size(z_index)), &
127 pseds_tot(current_state%local_grid%size(z_index)), &
128 pgacw_tot(current_state%local_grid%size(z_index)), &
129 pgacs_tot(current_state%local_grid%size(z_index)), &
130 pgmlt_tot(current_state%local_grid%size(z_index)), &
131 pgsub_tot(current_state%local_grid%size(z_index)), &
132 psedg_tot(current_state%local_grid%size(z_index)), &
141 type(model_state_type),
target,
intent(inout) :: current_state
144 integer :: icol, jcol, target_x_index, target_y_index
146 icol=current_state%column_local_x
147 jcol=current_state%column_local_y
148 target_y_index=jcol-current_state%local_grid%halo_size(y_index)
149 target_x_index=icol-current_state%local_grid%halo_size(x_index)
151 if (current_state%first_timestep_column)
then
164 if (.not. l_warm)
then
191 if (.not. current_state%halo_column)
then
192 if ( casdiags % l_psedl ) &
194 if ( casdiags % l_pcond ) &
196 if ( casdiags % l_praut ) &
198 if ( casdiags % l_pracw ) &
200 if ( casdiags % l_prevp ) &
202 if ( casdiags % l_psedr ) &
204 if ( casdiags % l_dth )
then
206 casim_monc_dgs % dth_total(:,target_y_index,target_x_index)
209 casim_monc_dgs % dth_cond_evap(:,target_y_index,target_x_index)
212 if ( casdiags % l_dqv )
then
214 casim_monc_dgs % dqv_total(:,target_y_index,target_x_index)
216 casim_monc_dgs % dqv_cond_evap(:,target_y_index,target_x_index)
219 if ( casdiags % l_dqc ) &
221 casim_monc_dgs % dqc(:,target_y_index,target_x_index)
222 if ( casdiags % l_dqr ) &
224 casim_monc_dgs % dqr(:,target_y_index,target_x_index)
226 if (.not. l_warm)
then
227 if ( casdiags % l_phomc ) &
229 casim_monc_dgs % phomc(:,target_y_index,target_x_index)
230 if ( casdiags % l_pinuc ) &
232 casim_monc_dgs % pinuc(:,target_y_index,target_x_index)
233 if ( casdiags % l_pidep ) &
235 casim_monc_dgs % pidep(:,target_y_index,target_x_index)
236 if ( casdiags % l_piacw ) &
238 casim_monc_dgs % piacw(:,target_y_index,target_x_index)
239 if ( casdiags % l_pisub ) &
241 casim_monc_dgs % pisub(:,target_y_index,target_x_index)
242 if ( casdiags % l_pimlt ) &
244 casim_monc_dgs % pimlt(:,target_y_index,target_x_index)
245 if ( casdiags % l_psedi ) &
247 casim_monc_dgs % psedi(:,target_y_index,target_x_index)
248 if ( casdiags % l_psacw ) &
250 casim_monc_dgs % psacw(:,target_y_index,target_x_index)
251 if ( casdiags % l_psacr ) &
253 casim_monc_dgs % psacr(:,target_y_index,target_x_index)
254 if ( casdiags % l_pssub ) &
256 casim_monc_dgs % pssub(:,target_y_index,target_x_index)
257 if ( casdiags % l_psmlt ) &
259 casim_monc_dgs % psmlt(:,target_y_index,target_x_index)
260 if ( casdiags % l_psaut ) &
262 casim_monc_dgs % psaut(:,target_y_index,target_x_index)
263 if ( casdiags % l_psaci ) &
265 casim_monc_dgs % psaci(:,target_y_index,target_x_index)
266 if ( casdiags % l_psdep ) &
268 casim_monc_dgs % psdep(:,target_y_index,target_x_index)
269 if ( casdiags % l_pseds ) &
271 casim_monc_dgs % pseds(:,target_y_index,target_x_index)
272 if ( casdiags % l_pgacw ) &
274 casim_monc_dgs % pgacw(:,target_y_index,target_x_index)
275 if ( casdiags % l_pgacs ) &
277 casim_monc_dgs % pgacs(:,target_y_index,target_x_index)
278 if ( casdiags % l_pgmlt ) &
280 casim_monc_dgs % pgmlt(:,target_y_index,target_x_index)
281 if ( casdiags % l_pgsub ) &
283 casim_monc_dgs % pgsub(:,target_y_index,target_x_index)
284 if ( casdiags % l_psedg ) &
286 casim_monc_dgs % psedg(:,target_y_index,target_x_index)
287 if ( casdiags % l_dqi ) &
289 casim_monc_dgs % dqi(:,target_y_index,target_x_index)
290 if ( casdiags % l_dqs ) &
292 casim_monc_dgs % dqs(:,target_y_index,target_x_index)
293 if ( casdiags % l_dqg ) &
295 casim_monc_dgs % dqg(:,target_y_index,target_x_index)
306 type(model_state_type),
target,
intent(inout) :: current_state
307 character(len=*),
intent(in) :: name
308 type(component_field_information_type),
intent(out) :: field_information
310 field_information%field_type=component_array_field_type
311 field_information%number_dimensions=1
312 field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
313 field_information%data_type=component_double_data_type
315 if (name .eq.
"pcond_total" .or. name .eq.
"praut_total" &
316 .or. name .eq.
"pracw_total" .or. name .eq.
"prevp_total" &
317 .or. name .eq.
"psedl_total" .or. name .eq.
"psedr_total" &
318 .or. name .eq.
"dth_mphys_total" .or. name .eq.
"dth_cond_evap_total" &
319 .or. name .eq.
"dqv_mphys_total" .or. name .eq.
"dqv_cond_evap_total" &
320 .or. name .eq.
"dqc_mphys_total" .or. name .eq.
"dqr_mphys_total")
then
321 field_information%enabled=.true.
324 field_information%enabled=.true.
334 type(model_state_type),
target,
intent(inout) :: current_state
335 character(len=*),
intent(in) :: name
336 type(component_field_value_type),
intent(out) :: field_value
340 if (name .eq.
"phomc_total")
then
341 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
342 field_value%real_1d_array(:)=
phomc_tot(:)
343 else if (name .eq.
"pinuc_total")
then
344 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
345 field_value%real_1d_array(:)=
pinuc_tot(:)
346 else if (name .eq.
"pidep_total")
then
347 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
348 field_value%real_1d_array(:)=
pidep_tot(:)
349 else if (name .eq.
"psdep_total")
then
350 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
351 field_value%real_1d_array(:)=
psdep_tot(:)
352 else if (name .eq.
"piacw_total")
then
353 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
354 field_value%real_1d_array(:)=
piacw_tot(:)
355 else if (name .eq.
"psacw_total")
then
356 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
357 field_value%real_1d_array(:)=
psacw_tot(:)
358 else if (name .eq.
"psacr_total")
then
359 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
360 field_value%real_1d_array(:)=
psacr_tot(:)
361 else if (name .eq.
"pisub_total")
then
362 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
363 field_value%real_1d_array(:)=
pisub_tot(:)
364 else if (name .eq.
"pssub_total")
then
365 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
366 field_value%real_1d_array(:)=
pssub_tot(:)
367 else if (name .eq.
"pimlt_total")
then
368 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
369 field_value%real_1d_array(:)=
pimlt_tot(:)
370 else if (name .eq.
"psmlt_total")
then
371 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
372 field_value%real_1d_array(:)=
psmlt_tot(:)
373 else if (name .eq.
"psaut_total")
then
374 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
375 field_value%real_1d_array(:)=
psaut_tot(:)
376 else if (name .eq.
"psaci_total")
then
377 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
378 field_value%real_1d_array(:)=
psaci_tot(:)
379 else if (name .eq.
"praut_total")
then
380 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
381 field_value%real_1d_array(:)=
praut_tot(:)
382 else if (name .eq.
"pracw_total")
then
383 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
384 field_value%real_1d_array(:)=
pracw_tot(:)
385 else if (name .eq.
"prevp_total")
then
386 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
387 field_value%real_1d_array(:)=
prevp_tot(:)
388 else if (name .eq.
"pgacw_total")
then
389 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
390 field_value%real_1d_array(:)=
pgacw_tot(:)
391 else if (name .eq.
"pgacs_total")
then
392 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
393 field_value%real_1d_array(:)=
pgacs_tot(:)
394 else if (name .eq.
"pgmlt_total")
then
395 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
396 field_value%real_1d_array(:)=
pgmlt_tot(:)
397 else if (name .eq.
"pgsub_total")
then
398 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
399 field_value%real_1d_array(:)=
pgsub_tot(:)
400 else if (name .eq.
"psedi_total")
then
401 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
402 field_value%real_1d_array(:)=
psedi_tot(:)
403 else if (name .eq.
"pseds_total")
then
404 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
405 field_value%real_1d_array(:)=
pseds_tot(:)
406 else if (name .eq.
"psedr_total")
then
407 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
408 field_value%real_1d_array(:)=
psedr_tot(:)
409 else if (name .eq.
"psedg_total")
then
410 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
411 field_value%real_1d_array(:)=
psedg_tot(:)
412 else if (name .eq.
"psedl_total")
then
413 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
414 field_value%real_1d_array(:)=
psedl_tot(:)
415 else if (name .eq.
"pcond_total")
then
416 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
417 field_value%real_1d_array(:)=
pcond_tot(:)
418 else if (name .eq.
"dth_mphys_total")
then
419 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
421 else if (name .eq.
"dth_cond_evap_total")
then
422 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
424 else if (name .eq.
"dqv_mphys_total")
then
425 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
427 else if (name .eq.
"dqv_cond_evap_total")
then
428 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
430 else if (name .eq.
"dqc_mphys_total")
then
431 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
433 else if (name .eq.
"dqr_mphys_total")
then
434 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
436 else if (name .eq.
"dqi_mphys_total")
then
437 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
439 else if (name .eq.
"dqs_mphys_total")
then
440 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
442 else if (name .eq.
"dqg_mphys_total")
then
443 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))