13 use mpi,
only : mpi_sum, mpi_in_place, mpi_int, mpi_real, mpi_double, mpi_comm
45 type(model_state_type),
target,
intent(inout) :: current_state
56 type(model_state_type),
target,
intent(inout) :: current_state
57 integer :: k,cnc,dnc,ierr
58 real(kind=default_precision) :: temp
65 if (current_state%parallel%my_rank == 0)
then
66 call mpi_reduce(mpi_in_place , conddiags_tot, ncond*2*ndiag*current_state%local_grid%size(z_index), &
67 precision_type, mpi_sum, 0, current_state%parallel%monc_communicator, ierr)
69 call mpi_reduce(conddiags_tot, conddiags_tot, ncond*2*ndiag*current_state%local_grid%size(z_index), &
70 precision_type, mpi_sum, 0, current_state%parallel%monc_communicator, ierr)
78 if (dnc /= requested_area)
then
80 do k = 2, current_state%local_grid%size(z_index) - 1
81 temp = conddiags_tot(k,cnc,requested_area)
83 conddiags_tot(k,cnc,dnc) = conddiags_tot(k,cnc,dnc) / temp
85 conddiags_tot(k,cnc,dnc) = rmdi
93 conddiags_tot(:,:,requested_area) = conddiags_tot(:,:,requested_area) / gpts_total
96 conddiags_tot(1,:,:) = rmdi
97 conddiags_tot(current_state%local_grid%size(z_index),:,:) = rmdi
101 conddiags_tot = conddiags_tot / current_state%parallel%processes
104 call mpi_bcast(conddiags_tot, ncond*2*ndiag*current_state%local_grid%size(z_index), &
105 precision_type, 0, current_state%parallel%monc_communicator, ierr)
113 type(model_state_type),
target,
intent(inout) :: current_state