31 type(model_state_type),
target,
intent(in) :: current_state
32 type(str_tvd_diagnostic_terms),
intent(inout) :: tvd_dgs_terms
34 integer :: k_top, x_local, y_local
36 k_top = current_state%local_grid%size(z_index) + current_state%local_grid%halo_size(z_index) * 2
37 x_local = current_state%local_grid%size(x_index) + current_state%local_grid%halo_size(x_index) * 2
38 y_local = current_state%local_grid%size(y_index) + current_state%local_grid%halo_size(x_index) * 2
40 allocate(tvd_dgs_terms%adv_u_dgs(k_top, y_local, x_local), &
41 tvd_dgs_terms%adv_v_dgs(k_top, y_local, x_local), &
42 tvd_dgs_terms%adv_w_dgs(k_top, y_local, x_local), &
43 tvd_dgs_terms%adv_th_dgs(k_top, y_local, x_local))
45 tvd_dgs_terms%adv_u_dgs(:,:,:) = 0.0
46 tvd_dgs_terms%adv_v_dgs(:,:,:) = 0.0
47 tvd_dgs_terms%adv_w_dgs(:,:,:) = 0.0
48 tvd_dgs_terms%adv_th_dgs(:,:,:) = 0.0
50 if (current_state%number_q_fields > 0)
then
51 allocate(tvd_dgs_terms%adv_q_dgs(k_top, y_local, x_local, current_state%number_q_fields))
52 tvd_dgs_terms%adv_q_dgs(:,:,:,:)= 0.0