|
| 1 | +!>@file const_surface_comm_table.f90 |
| 2 | +!!@brief module const_surface_comm_table |
| 3 | +!! |
| 4 | +!!@author H. Matsui |
| 5 | +!!@date Programmed in June, 2015 |
| 6 | +! |
| 7 | +!> @brief Belonged element list for each node |
| 8 | +!! |
| 9 | +!!@verbatim |
| 10 | +!! subroutine const_surf_comm_table & |
| 11 | +!! & (node, nod_comm, surf_comm, surf, m_SR) |
| 12 | +!! subroutine dealloc_surf_comm_table(surf_comm, surf) |
| 13 | +!! type(node_data), intent(in) :: node |
| 14 | +!! type(communication_table), intent(in) :: nod_comm |
| 15 | +!! type(communication_table), intent(inout) :: surf_comm |
| 16 | +!! type(surface_data), intent(inout) :: surf |
| 17 | +!! type(mesh_SR), intent(inout) :: m_SR |
| 18 | +!! |
| 19 | +!! subroutine surf_send_recv_test & |
| 20 | +!! & (surf, surf_comm, surf_check, SR_sig, SR_r) |
| 21 | +!! type(node_data), intent(in) :: node |
| 22 | +!! type(surface_data), intent(in) :: surf |
| 23 | +!! type(communication_table), intent(in) :: surf_comm |
| 24 | +!! type(work_for_comm_check), intent(inout) :: surf_check |
| 25 | +!! type(send_recv_status), intent(inout) :: SR_sig |
| 26 | +!! type(send_recv_real_buffer), intent(inout) :: SR_r |
| 27 | +!!@endverbatim |
| 28 | +! |
| 29 | + module const_surface_comm_table |
| 30 | +! |
| 31 | + use m_precision |
| 32 | + use calypso_mpi |
| 33 | + use t_next_node_ele_4_node |
| 34 | + use t_mesh_data |
| 35 | + use t_geometry_data |
| 36 | + use t_surface_data |
| 37 | + use t_comm_table |
| 38 | + use t_failed_export_list |
| 39 | + use t_mesh_SR |
| 40 | +! |
| 41 | + use m_machine_parameter |
| 42 | + use m_geometry_constants |
| 43 | +! |
| 44 | + implicit none |
| 45 | +! |
| 46 | + character(len=kchara), parameter :: txt_surf = 'surface' |
| 47 | +! |
| 48 | + private :: txt_surf |
| 49 | +! |
| 50 | +!----------------------------------------------------------------------- |
| 51 | +! |
| 52 | + contains |
| 53 | +! |
| 54 | +!----------------------------------------------------------------------- |
| 55 | +! |
| 56 | + subroutine const_surf_comm_table & |
| 57 | + & (node, nod_comm, surf_comm, surf, m_SR) |
| 58 | +! |
| 59 | + use t_para_double_numbering |
| 60 | + use t_element_double_number |
| 61 | + use t_const_comm_table |
| 62 | + use t_sum_local_node_id_list |
| 63 | + use const_global_element_ids |
| 64 | +! |
| 65 | + type(node_data), intent(in) :: node |
| 66 | + type(communication_table), intent(in) :: nod_comm |
| 67 | +! |
| 68 | + type(surface_data), intent(inout) :: surf |
| 69 | + type(communication_table), intent(inout) :: surf_comm |
| 70 | + type(mesh_SR), intent(inout) :: m_SR |
| 71 | +! |
| 72 | + type(node_ele_double_number) :: inod_dbl |
| 73 | + type(element_double_number) :: isurf_dbl |
| 74 | + type(element_around_node) :: neib_surf |
| 75 | + type(failed_table) :: fail_tbl_s |
| 76 | + type(sum_of_local_id_list) :: sum_list_s |
| 77 | +! |
| 78 | + integer(kind = kint) :: internal_num = 0 |
| 79 | + integer(kind = kint_gl), allocatable :: istack_inersurf(:) |
| 80 | +! |
| 81 | +! |
| 82 | + call dealloc_interior_surf(surf) |
| 83 | + call alloc_global_surf_id(surf) |
| 84 | + call alloc_interior_surf(surf) |
| 85 | +! |
| 86 | + call alloc_double_numbering(node%numnod, inod_dbl) |
| 87 | + call set_node_double_numbering(node, nod_comm, inod_dbl, & |
| 88 | + & m_SR%SR_sig, m_SR%SR_i) |
| 89 | +! |
| 90 | + call alloc_ele_double_number(surf%numsurf, isurf_dbl) |
| 91 | + call find_belonged_pe_4_surf(my_rank, inod_dbl, & |
| 92 | + & surf%numsurf, surf%nnod_4_surf, surf%ie_surf, & |
| 93 | + & internal_num, surf%interior_surf, isurf_dbl) |
| 94 | +! |
| 95 | + call set_surf_id_4_node_sum_order(node, surf, inod_dbl, & |
| 96 | + & neib_surf, sum_list_s) |
| 97 | +! |
| 98 | + call alloc_failed_export(0, fail_tbl_s) |
| 99 | + call const_comm_table_by_connenct & |
| 100 | + & (txt_surf, surf%numsurf, surf%nnod_4_surf, surf%ie_surf, & |
| 101 | + & surf%x_surf, node, nod_comm, inod_dbl, isurf_dbl, neib_surf, & |
| 102 | + & sum_list_s, surf_comm, fail_tbl_s, m_SR%SR_sig) |
| 103 | + call dealloc_iele_belonged(neib_surf) |
| 104 | + call dealloc_failed_export(fail_tbl_s) |
| 105 | +! |
| 106 | + allocate(istack_inersurf(0:nprocs)) |
| 107 | + istack_inersurf(0:nprocs) = 0 |
| 108 | +! |
| 109 | + call count_number_of_node_stack(internal_num, istack_inersurf) |
| 110 | + call set_global_ele_id(txt_surf, surf%numsurf, istack_inersurf, & |
| 111 | + & surf%interior_surf, surf_comm, surf%isurf_global, & |
| 112 | + & m_SR%SR_sig, m_SR%SR_il) |
| 113 | + deallocate(istack_inersurf) |
| 114 | +! |
| 115 | + call calypso_mpi_barrier |
| 116 | + call check_element_position & |
| 117 | + & (txt_surf, node%inod_global, surf%numsurf, & |
| 118 | + & surf%nnod_4_surf, surf%ie_surf, surf%isurf_global, & |
| 119 | + & surf%x_surf, inod_dbl, surf_comm, m_SR%SR_sig, m_SR%SR_r) |
| 120 | + call dealloc_sum_of_local_id_list(sum_list_s) |
| 121 | + call dealloc_ele_double_number(isurf_dbl) |
| 122 | + call dealloc_double_numbering(inod_dbl) |
| 123 | +! |
| 124 | + end subroutine const_surf_comm_table |
| 125 | +! |
| 126 | +!----------------------------------------------------------------------- |
| 127 | +! |
| 128 | + subroutine dealloc_surf_comm_table(surf_comm, surf) |
| 129 | +! |
| 130 | + type(communication_table), intent(inout) :: surf_comm |
| 131 | + type(surface_data), intent(inout) :: surf |
| 132 | +! |
| 133 | + call dealloc_comm_table(surf_comm) |
| 134 | + call dealloc_interior_surf(surf) |
| 135 | + call dealloc_global_surf_id(surf) |
| 136 | +! |
| 137 | + end subroutine dealloc_surf_comm_table |
| 138 | +! |
| 139 | +!----------------------------------------------------------------------- |
| 140 | +!----------------------------------------------------------------------- |
| 141 | +! |
| 142 | + subroutine surf_send_recv_test & |
| 143 | + & (surf, surf_comm, surf_check, SR_sig, SR_r) |
| 144 | +! |
| 145 | + use t_work_for_comm_check |
| 146 | + use diff_geometory_comm_test |
| 147 | + use nod_phys_send_recv |
| 148 | + use solver_SR_type |
| 149 | + use mesh_send_recv_check |
| 150 | +! |
| 151 | + type(surface_data), intent(in) :: surf |
| 152 | + type(communication_table), intent(in) :: surf_comm |
| 153 | +! |
| 154 | + type(work_for_comm_check), intent(inout) :: surf_check |
| 155 | + type(send_recv_status), intent(inout) :: SR_sig |
| 156 | + type(send_recv_real_buffer), intent(inout) :: SR_r |
| 157 | +! |
| 158 | +! |
| 159 | + call alloc_geom_4_comm_test(surf%numsurf, surf_check) |
| 160 | + call set_element_4_comm_test(surf%numsurf, surf%interior_surf, & |
| 161 | + & surf%x_surf, surf_check%xx_test) |
| 162 | + call SOLVER_SEND_RECV_3_type(surf%numsurf, surf_comm, & |
| 163 | + & SR_sig, SR_r, surf_check%xx_test) |
| 164 | +! |
| 165 | + call ele_send_recv_check & |
| 166 | + & (surf%numsurf, surf%isurf_global, surf%x_surf, surf_check) |
| 167 | +! |
| 168 | + if(i_debug .gt. 0) write(*,*) my_rank, & |
| 169 | + & 'Failed communication for surface', surf_check%num_diff |
| 170 | + call collect_failed_comm(surf_check) |
| 171 | + if(my_rank .eq. 0) write(*,*) my_rank, & |
| 172 | + & 'Total Failed communication for surface', & |
| 173 | + & surf_check%istack_diff_pe(nprocs) |
| 174 | +! |
| 175 | + end subroutine surf_send_recv_test |
| 176 | +! |
| 177 | +! ---------------------------------------------------------------------- |
| 178 | +! |
| 179 | + end module const_surface_comm_table |
0 commit comments