Changeset 4444 for palm/trunk/SOURCE/multi_agent_system_mod.f90
- Timestamp:
- Mar 5, 2020 3:59:50 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/multi_agent_system_mod.f90
r4346 r4444 25 25 ! ----------------- 26 26 ! $Id$ 27 ! bugfix: cpp-directives for serial mode added 28 ! 29 ! 4346 2019-12-18 11:55:56Z motisi 27 30 ! Removed wall_flags_static_0 from USE statements as it's not used within 28 31 ! the module … … 115 118 INTEGER(iwp) :: iran_agent = -1234567 !< number for random generator 116 119 INTEGER(iwp) :: min_nr_agent = 2 !< namelist parameter (see documentation) 120 #if defined( __parallel ) 117 121 INTEGER(iwp) :: ghla_count_recv !< number of agents in left ghost layer 118 122 INTEGER(iwp) :: ghna_count_recv !< number of agents in north ghost layer 119 123 INTEGER(iwp) :: ghra_count_recv !< number of agents in right ghost layer 120 124 INTEGER(iwp) :: ghsa_count_recv !< number of agents in south ghost layer 121 INTEGER(iwp) :: maximum_number_of_agents = 0 !< maximum number of agents during run122 125 INTEGER(iwp) :: nr_move_north !< number of agts to move north during exchange_horiz 123 126 INTEGER(iwp) :: nr_move_south !< number of agts to move south during exchange_horiz 127 #endif 128 INTEGER(iwp) :: maximum_number_of_agents = 0 !< maximum number of agents during run 124 129 INTEGER(iwp) :: number_of_agents = 0 !< number of agents for each grid box (3d array is saved on agt_count) 125 130 INTEGER(iwp) :: number_of_agent_groups = 1 !< namelist parameter (see documentation) … … 239 244 TYPE(agent_type), DIMENSION(:), POINTER :: agents !< Agent array for this grid cell 240 245 TYPE(agent_type) :: zero_agent !< zero agent to avoid weird thing 246 #if defined( __parallel ) 241 247 TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: move_also_north !< for agent exchange between PEs 242 248 TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: move_also_south !< for agent exchange between PEs … … 245 251 TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: agt_gh_r !< ghost layer right of pe domain 246 252 TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: agt_gh_s !< ghost layer south of pe domain 253 #endif 247 254 ! 248 255 !-- Type for 2D grid on which agents are stored … … 1216 1223 IMPLICIT NONE 1217 1224 1225 #if defined( __parallel ) 1218 1226 INTEGER(iwp) :: agt_size !< Agent size in bytes 1227 INTEGER(iwp) :: n !< counter (number of PEs) 1228 INTEGER(iwp) :: noa_rcv !< received number of agents 1229 #endif 1219 1230 INTEGER(iwp) :: dummy !< dummy 1220 1231 INTEGER(iwp) :: ii !< counter (x) 1221 1232 INTEGER(iwp) :: ip !< counter (x) 1222 1233 INTEGER(iwp) :: jp !< counter (y) 1223 INTEGER(iwp) :: n !< counter (number of PEs)1224 1234 INTEGER(iwp) :: noa !< number of agents 1225 INTEGER(iwp) :: noa_rcv !< received number of agents1226 1235 INTEGER(iwp) :: out_noa !< number of agents for output 1227 1236 1237 #if defined( __parallel ) 1228 1238 INTEGER(iwp), DIMENSION(0:numprocs-1) :: noa_arr !< number of agents on each PE 1239 #endif 1229 1240 ! 1230 1241 !-- SAVE attribute required to avoid compiler warning about pointer outlive the pointer target 1231 1242 TYPE(agent_type), DIMENSION(:), ALLOCATABLE, TARGET, SAVE :: trf_agents !< all agents on current PE 1243 #if defined( __parallel ) 1232 1244 TYPE(agent_type), DIMENSION(:), ALLOCATABLE, TARGET, SAVE :: out_agents !< all agents in entire domain 1245 #endif 1233 1246 1234 1247 LOGICAL, INTENT (INOUT) :: ftest … … 1454 1467 END SUBROUTINE mas_data_output_agents 1455 1468 1469 #if defined( __parallel ) 1456 1470 !------------------------------------------------------------------------------! 1457 1471 ! Description: … … 1596 1610 1597 1611 END SUBROUTINE mas_eh_add_agents_to_gridcell 1598 1612 #endif 1613 1614 1615 #if defined( __parallel ) 1599 1616 !------------------------------------------------------------------------------! 1600 1617 ! Description: … … 1648 1665 ENDDO 1649 1666 END SUBROUTINE mas_eh_add_ghost_agents_to_gridcell 1667 #endif 1650 1668 1651 1669 !------------------------------------------------------------------------------! … … 1742 1760 IMPLICIT NONE 1743 1761 1762 INTEGER(iwp) :: ip !< index variable along x 1763 INTEGER(iwp) :: jp !< index variable along y 1764 INTEGER(iwp) :: n !< agent index variable 1765 1766 #if defined( __parallel ) 1767 1744 1768 INTEGER(iwp) :: i !< grid index (x) of agent positition 1745 INTEGER(iwp) :: ip !< index variable along x1746 1769 INTEGER(iwp) :: j !< grid index (y) of agent positition 1747 INTEGER(iwp) :: jp !< index variable along y1748 INTEGER(iwp) :: n !< agent index variable1749 1770 INTEGER(iwp) :: par_size !< Agent size in bytes 1771 1750 1772 INTEGER(iwp) :: trla_count !< number of agents send to left PE 1751 1773 INTEGER(iwp) :: trla_count_recv !< number of agents receive from right PE … … 1765 1787 TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: trra !< agents send to right PE 1766 1788 TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: trsa !< agents send to south PE 1767 1768 #if defined( __parallel )1769 1789 1770 1790 ! … … 2228 2248 DEALLOCATE( move_also_south ) 2229 2249 2250 ! 2251 !-- Accumulate the number of agents transferred between the subdomains) 2252 CALL mas_eh_ghost_exchange 2253 2230 2254 #else 2231 2255 … … 2316 2340 #endif 2317 2341 2318 !2319 !-- Accumulate the number of agents transferred between the subdomains)2320 CALL mas_eh_ghost_exchange2321 2322 2342 END SUBROUTINE mas_eh_exchange_horiz 2323 2343 2344 2345 #if defined( __parallel ) 2324 2346 !------------------------------------------------------------------------------! 2325 2347 ! Description: … … 2332 2354 2333 2355 IMPLICIT NONE 2334 2335 #if defined( __parallel )2336 2356 2337 2357 INTEGER(iwp) :: ip !< index variable along x … … 2617 2637 ENDIF 2618 2638 2639 END SUBROUTINE mas_eh_ghost_exchange 2619 2640 #endif 2620 2621 END SUBROUTINE mas_eh_ghost_exchange2622 2641 2623 2642 !------------------------------------------------------------------------------! … … 3922 3941 END SUBROUTINE mas_ps_sort_in_subboxes 3923 3942 3943 #if defined( __parallel ) 3924 3944 !------------------------------------------------------------------------------! 3925 3945 ! Description: … … 3962 3982 number_of_agents = nn 3963 3983 3964 END SUBROUTINE mas_ps_pack 3984 END SUBROUTINE mas_ps_pack 3985 #endif 3965 3986 3966 3987 !------------------------------------------------------------------------------!
Note: See TracChangeset
for help on using the changeset viewer.