Ignore:
Timestamp:
Sep 12, 2018 3:02:00 PM (6 years ago)
Author:
raasch
Message:

various changes to avoid compiler warnings (mainly removal of unused variables)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/multi_agent_system_mod.f90

    r3235 r3241  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3235 2018-09-07 14:06:15Z sward
    2730! Bugfix in output, added agent-number dimension and related messages and
    2831! input parameters, updated cpu logging, added mas_last_actions
     
    9699    INTEGER(iwp) ::  ibc_mas_lr                        !< agent left/right boundary condition dummy
    97100    INTEGER(iwp) ::  ibc_mas_ns                        !< agent north/south boundary condition dummy
    98     INTEGER(iwp) ::  ind_pm10 = -9                     !< chemical species index of PM10
    99     INTEGER(iwp) ::  ind_pm25 = -9                     !< chemical species index of PM2.5
     101!    INTEGER(iwp) ::  ind_pm10 = -9                     !< chemical species index of PM10
     102!    INTEGER(iwp) ::  ind_pm25 = -9                     !< chemical species index of PM2.5
    100103    INTEGER(iwp) ::  iran_agent = -1234567             !< number for random generator
    101104    INTEGER(iwp) ::  min_nr_agent = 2                  !< namelist parameter (see documentation)
     
    536539       INTEGER(iwp) ::  n  !< loop variable over all agents in a grid box
    537540       INTEGER(iwp) ::  pc !< agent path counter
    538        INTEGER(iwp) ::  nobo !< agent path counter
    539541
    540542       REAL(wp) ::  abs_dir         !< length of direction vector (for normalization)
    541        REAL(wp) ::  d_curr_target   !< rounding influence expressed as x speed component
    542        REAL(wp) ::  d_prev_target   !< rounding influence expressed as x speed component
     543!       REAL(wp) ::  d_curr_target   !< rounding influence expressed as x speed component
     544!       REAL(wp) ::  d_prev_target   !< rounding influence expressed as x speed component
    543545       REAL(wp) ::  dir_x           !< direction of agent (x)
    544546       REAL(wp) ::  dir_y           !< direction of agent (y)
    545        REAL(wp) ::  dist_round = 3. !< distance at which agents start rounding a corner
     547!       REAL(wp) ::  dist_round = 3. !< distance at which agents start rounding a corner
    546548       REAL(wp) ::  dtit            !< distance to intermittent target
    547        REAL(wp) ::  round_fac  = .2 !< factor for rounding influence
    548        REAL(wp) ::  speed_round_x   !< rounding influence expressed as x speed component
    549        REAL(wp) ::  speed_round_y   !< rounding influence expressed as x speed component
     549!       REAL(wp) ::  round_fac  = 0.2 !< factor for rounding influence
     550!       REAL(wp) ::  speed_round_x   !< rounding influence expressed as x speed component
     551!       REAL(wp) ::  speed_round_y   !< rounding influence expressed as x speed component
    550552
    551553!
     
    728730       INTEGER(iwp) ::  i           !< loop variable ( agent groups )
    729731       INTEGER(iwp) ::  ip          !< index variable along x
    730        INTEGER(iwp) ::  j           !< loop variable ( agents per point )
    731732       INTEGER(iwp) ::  jp          !< index variable along y
    732733       INTEGER(iwp) ::  loop_stride !< loop variable for initialization
     
    10101011       IMPLICIT NONE
    10111012
    1012        INTEGER(iwp) ::  agt_size !< Agent size in bytes
    1013        INTEGER(iwp) ::  dummy    !< dummy
    10141013       INTEGER(iwp) ::  il
    10151014       INTEGER(iwp) ::  jl
     
    11301129
    11311130       USE netcdf_interface,                                                   &
    1132            ONLY:  nc_stat, id_set_agt, id_var_time_agt, id_var_rnoa_agt,       &
     1131           ONLY:  nc_stat, id_set_agt, id_var_time_agt,        &
    11331132                  id_var_agt, netcdf_handle_error
    11341133
     
    12351234       IF ( myid == 0 ) THEN
    12361235#if defined( __parallel )
    1237           agents=>out_agents
     1236          agents => out_agents
    12381237#else
    1239           agents=>trf_agents
     1238          agents => trf_agents
    12401239#endif
    12411240
     
    15301529
    15311530       TYPE(agent_type), DIMENSION(:), INTENT(IN)  ::  agent_array !< new agents in a grid box
    1532        TYPE(agent_type), DIMENSION(:), ALLOCATABLE ::  temp_ns     !< temporary agent array for reallocation
    15331531
    15341532       pack_done     = .FALSE.
     
    16621660       INTEGER(iwp) ::  j                !< grid index (y) of agent positition
    16631661       INTEGER(iwp) ::  jp               !< index variable along y
    1664        INTEGER(iwp) ::  kp               !< index variable along z
    16651662       INTEGER(iwp) ::  n                !< agent index variable
    16661663       INTEGER(iwp) ::  par_size         !< Agent size in bytes
     
    22522249#if defined( __parallel )
    22532250
    2254        INTEGER(iwp) ::  i           !< grid index (x) of agent positition
    22552251       INTEGER(iwp) ::  ip          !< index variable along x
    2256        INTEGER(iwp) ::  j           !< grid index (y) of agent positition
    22572252       INTEGER(iwp) ::  jp          !< index variable along y
    22582253       INTEGER(iwp) ::  agt_size    !< Bit size of agent datatype
     
    26842679           ONLY:  u, v, pt, hyp
    26852680
    2686        USE chem_gasphase_mod,                                                  &
    2687            ONLY:  nvar
    2688 
    2689        USE chemistry_model_mod,                                                &
    2690            ONLY:  chem_species
    2691 
    2692        USE control_parameters,                                                 &
    2693               ONLY:  air_chemistry
     2681!       USE chemistry_model_mod,                                                &
     2682!           ONLY:  chem_species
     2683
     2684!       USE control_parameters,                                                 &
     2685!              ONLY:  air_chemistry
    26942686
    26952687       IMPLICIT NONE
     
    27072699       REAL(wp) ::  u_a  !< windspeed at agent position (x)
    27082700       REAL(wp) ::  v_a  !< windspeed at agent position (y)
    2709        REAL(wp) ::  x_a  !< agent position (x)
    2710        REAL(wp) ::  y_a  !< agent position (y)
    27112701
    27122702       DO  il = nxl, nxr
     
    29322922    SUBROUTINE mas_init
    29332923
    2934        USE chem_gasphase_mod,                                                  &
    2935            ONLY:  nspec
    2936 
    2937        USE chemistry_model_mod,                                                &
    2938            ONLY:  chem_species
     2924!       USE chem_gasphase_mod,                                                  &
     2925!           ONLY:  nspec
     2926
     2927!       USE chemistry_model_mod,                                                &
     2928!           ONLY:  chem_species
    29392929
    29402930       USE control_parameters,                                                 &
    2941            ONLY:  air_chemistry, coupling_char, initializing_actions,          &
    2942                   io_blocks, io_group
     2931           ONLY:  coupling_char, initializing_actions, io_blocks, io_group
    29432932
    29442933       USE surface_mod,                                                        &
     
    29682957       REAL(wp) ::  avg_agt_height = 1.8_wp
    29692958
    2970        INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  noc !< temp: number of connections in nav_mesh
    29712959
    29722960!
     
    32443232
    32453233       INTEGER(iwp) ::  cur_node     !< current node of binary heap
    3246        INTEGER(iwp) ::  i_ag         !< agent index
    32473234       INTEGER(iwp) ::  il           !< counter (x)
    3248        INTEGER(iwp) ::  jl           !< counter (y)
    32493235       INTEGER(iwp) ::  neigh_node   !< neighbor node
    32503236       INTEGER(iwp) ::  node_counter !< binary heap node counter
    32513237       INTEGER(iwp) ::  path_ag      !< index of agent path
    32523238       INTEGER(iwp) ::  som          !< size of mesh
    3253        INTEGER(iwp) ::  rn_side      !< index of agent path
    32543239       INTEGER(iwp) ::  steps        !< steps along the path
    32553240       INTEGER(iwp) ::  nsteps        !< number of steps
     
    32593244       REAL(wp) ::  new_cost     !< updated cost to reach node
    32603245       REAL(wp) ::  new_priority !< priority of node to be added to queue
    3261        REAL(wp) ::  rand_nr      !< x-coordinate target
    32623246       REAL(wp) ::  rn_gate      !< random number for corner gate
    32633247       REAL(wp) ::  target_x     !< x-coordinate target
     
    39273911!> complete the LES timestep.
    39283912!------------------------------------------------------------------------------!
    3929     SUBROUTINE mas_ps_sort_timeloop_done
    3930 
    3931        IMPLICIT NONE
    3932 
    3933        INTEGER(iwp) :: end_index     !< agent end index for each sub-box
    3934        INTEGER(iwp) :: i             !< index of agent grid box in x-direction
    3935        INTEGER(iwp) :: j             !< index of agent grid box in y-direction
    3936        INTEGER(iwp) :: n             !< running index for number of agents
    3937        INTEGER(iwp) :: nb            !< index of subgrid boux
    3938        INTEGER(iwp) :: nf            !< indices for agents in each sub-box that already finalized their substeps
    3939        INTEGER(iwp) :: nnf           !< indices for agents in each sub-box that need further treatment
    3940        INTEGER(iwp) :: num_finalized !< number of agents in each sub-box that already finalized their substeps
    3941        INTEGER(iwp) :: start_index   !< agent start index for each sub-box
    3942 
    3943        TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: sort_agents  !< temporary agent array
    3944 
    3945        DO  i = nxl, nxr
    3946           DO  j = nys, nyn
    3947 
    3948              number_of_agents = agt_count(j,i)
    3949              IF ( number_of_agents <= 0 )  CYCLE
    3950 
    3951              agents => grid_agents(j,i)%agents(1:number_of_agents)
    3952 
    3953              DO  nb = 0, 3
     3913!    SUBROUTINE mas_ps_sort_timeloop_done
     3914!
     3915!       IMPLICIT NONE
     3916!
     3917!       INTEGER(iwp) :: end_index     !< agent end index for each sub-box
     3918!       INTEGER(iwp) :: i             !< index of agent grid box in x-direction
     3919!       INTEGER(iwp) :: j             !< index of agent grid box in y-direction
     3920!       INTEGER(iwp) :: n             !< running index for number of agents
     3921!       INTEGER(iwp) :: nb            !< index of subgrid boux
     3922!       INTEGER(iwp) :: nf            !< indices for agents in each sub-box that already finalized their substeps
     3923!       INTEGER(iwp) :: nnf           !< indices for agents in each sub-box that need further treatment
     3924!       INTEGER(iwp) :: num_finalized !< number of agents in each sub-box that already finalized their substeps
     3925!       INTEGER(iwp) :: start_index   !< agent start index for each sub-box
     3926!
     3927!       TYPE(agent_type), DIMENSION(:), ALLOCATABLE :: sort_agents  !< temporary agent array
     3928!
     3929!       DO  i = nxl, nxr
     3930!          DO  j = nys, nyn
     3931!
     3932!             number_of_agents = agt_count(j,i)
     3933!             IF ( number_of_agents <= 0 )  CYCLE
     3934!
     3935!             agents => grid_agents(j,i)%agents(1:number_of_agents)
     3936!
     3937!             DO  nb = 0, 3
    39543938!
    39553939!--             Obtain start and end index for each subgrid box
    3956                 start_index = grid_agents(j,i)%start_index(nb)
    3957                 end_index   = grid_agents(j,i)%end_index(nb)
     3940!                start_index = grid_agents(j,i)%start_index(nb)
     3941!                end_index   = grid_agents(j,i)%end_index(nb)
    39583942!
    39593943!--             Allocate temporary array used for sorting
    3960                 ALLOCATE( sort_agents(start_index:end_index) )
     3944!                ALLOCATE( sort_agents(start_index:end_index) )
    39613945!
    39623946!--             Determine number of agents already completed the LES
    39633947!--             timestep, and write them into a temporary array
    3964                 nf = start_index
    3965                 num_finalized = 0
    3966                 DO  n = start_index, end_index
    3967                    IF ( dt_3d - agents(n)%dt_sum < 1E-8_wp )  THEN
    3968                       sort_agents(nf) = agents(n)
    3969                       nf              = nf + 1
    3970                       num_finalized   = num_finalized + 1
    3971                    ENDIF
    3972                 ENDDO
     3948!                nf = start_index
     3949!                num_finalized = 0
     3950!                DO  n = start_index, end_index
     3951!                   IF ( dt_3d - agents(n)%dt_sum < 1E-8_wp )  THEN
     3952!                      sort_agents(nf) = agents(n)
     3953!                      nf              = nf + 1
     3954!                      num_finalized   = num_finalized + 1
     3955!                   ENDIF
     3956!                ENDDO
    39733957!
    39743958!--             Determine number of agents that not completed the LES
    39753959!--             timestep, and write them into a temporary array
    3976                 nnf = nf
    3977                 DO  n = start_index, end_index
    3978                    IF ( dt_3d - agents(n)%dt_sum > 1E-8_wp )  THEN
    3979                       sort_agents(nnf) = agents(n)
    3980                       nnf              = nnf + 1
    3981                    ENDIF
    3982                 ENDDO
     3960!                nnf = nf
     3961!                DO  n = start_index, end_index
     3962!                   IF ( dt_3d - agents(n)%dt_sum > 1E-8_wp )  THEN
     3963!                      sort_agents(nnf) = agents(n)
     3964!                      nnf              = nnf + 1
     3965!                   ENDIF
     3966!                ENDDO
    39833967!
    39843968!--             Write back sorted agents
    3985                 agents(start_index:end_index) =                          &
    3986                                         sort_agents(start_index:end_index)
     3969!                agents(start_index:end_index) =                          &
     3970!                                        sort_agents(start_index:end_index)
    39873971!
    39883972!--             Determine updated start_index, used to masked already
    39893973!--             completed agents.
    3990                 grid_agents(j,i)%start_index(nb) =                     &
    3991                                    grid_agents(j,i)%start_index(nb)    &
    3992                                  + num_finalized
     3974!                grid_agents(j,i)%start_index(nb) =                     &
     3975!                                   grid_agents(j,i)%start_index(nb)    &
     3976!                                 + num_finalized
    39933977!
    39943978!--             Deallocate dummy array
    3995                 DEALLOCATE ( sort_agents )
     3979!                DEALLOCATE ( sort_agents )
    39963980!
    39973981!--             Finally, if number of non-completed agents is non zero
    39983982!--             in any of the sub-boxes, set control flag appropriately.
    3999                 IF ( nnf > nf )                                             &
    4000                    grid_agents(j,i)%time_loop_done = .FALSE.
    4001 
    4002              ENDDO
    4003           ENDDO
    4004        ENDDO
    4005 
    4006     END SUBROUTINE mas_ps_sort_timeloop_done
     3983!                IF ( nnf > nf )                                             &
     3984!                   grid_agents(j,i)%time_loop_done = .FALSE.
     3985!
     3986!             ENDDO
     3987!          ENDDO
     3988!       ENDDO
     3989!
     3990!    END SUBROUTINE mas_ps_sort_timeloop_done
    40073991
    40083992!------------------------------------------------------------------------------!
     
    41064090    SUBROUTINE mas_timestep_social_forces ( mode, nl, ip, jp )
    41074091
    4108        USE constants,                                                          &
    4109            ONLY:  pi
     4092!       USE constants,                                                          &
     4093!           ONLY:  pi
    41104094
    41114095       IMPLICIT NONE
     
    41384122       REAL(wp) ::  dist             !< distance to obstacle
    41394123       REAL(wp) ::  dist_sq          !< distance to obstacle squared
    4140        REAL(wp) ::  dummy_coll_time  !< dummy for collision time
    41414124       REAL(wp) ::  pos_rel_x        !< relative position of two agents (x)
    41424125       REAL(wp) ::  pos_rel_y        !< relative position of two agents (y)
     
    43114294!
    43124295!--                   Calculate force of found wall on agent
    4313                       CALL mas_timestep_wall_corner_force ( nl, x_a, x_wall,   &
    4314                                                             y_a, y_a )
     4296                      CALL mas_timestep_wall_corner_force( x_a, x_wall, y_a,   &
     4297                                                           y_a )
    43154298!
    43164299!--                   calculate new x starting index for later scan for corners
     
    43354318!
    43364319!--                   Calculate force of found wall on agent
    4337                       CALL mas_timestep_wall_corner_force ( nl, x_a, x_wall,   &
    4338                                                             y_a, y_a )
     4320                      CALL mas_timestep_wall_corner_force( x_a, x_wall, y_a,   &
     4321                                                           y_a )
    43394322!
    43404323!--                   calculate new x end index for later scan for corners
     
    43584341                      y_wall = (jl+1)*dy
    43594342
    4360                       CALL mas_timestep_wall_corner_force ( nl, x_a, x_a, y_a, &
    4361                                                             y_wall )
     4343                      CALL mas_timestep_wall_corner_force( x_a, x_a, y_a,      &
     4344                                                           y_wall )
    43624345!
    43634346!--                   calculate new y starting index for later scan for corners
     
    43814364                      y_wall = jl*dy
    43824365
    4383                       CALL mas_timestep_wall_corner_force ( nl, x_a, x_a, y_a, &
    4384                                                             y_wall )
     4366                      CALL mas_timestep_wall_corner_force( x_a, x_a, y_a,      &
     4367                                                           y_wall )
    43854368!
    43864369!--                   calculate new y end index for later scan for corners
     
    44124395                            y_wall = (jl+1)*dy
    44134396
    4414                             CALL mas_timestep_wall_corner_force ( nl, x_a,     &
    4415                                                            x_wall, y_a, y_wall )
     4397                            CALL mas_timestep_wall_corner_force( x_a, x_wall,  &
     4398                                                                 y_a, y_wall )
    44164399
    44174400                         ENDIF
     
    44264409                            y_wall = jl*dy
    44274410
    4428                             CALL mas_timestep_wall_corner_force ( nl, x_a,     &
    4429                                                          x_wall, y_a, y_wall )
     4411                            CALL mas_timestep_wall_corner_force( x_a, x_wall,  &
     4412                                                                 y_a, y_wall )
    44304413
    44314414                         ENDIF
     
    44424425                            y_wall = (jl+1)*dy
    44434426
    4444                             CALL mas_timestep_wall_corner_force ( nl, x_a,     &
    4445                                                            x_wall, y_a, y_wall )
     4427                            CALL mas_timestep_wall_corner_force( x_a, x_wall,  &
     4428                                                                 y_a, y_wall )
    44464429
    44474430                         ENDIF
     
    44564439                            y_wall = jl*dy
    44574440
    4458                             CALL mas_timestep_wall_corner_force ( nl, x_a,     &
    4459                                                            x_wall, y_a, y_wall )
     4441                            CALL mas_timestep_wall_corner_force( x_a, x_wall,  &
     4442                                                                 y_a, y_wall )
    44604443
    44614444                         ENDIF
     
    44774460!> or wall exerts on that agent
    44784461!------------------------------------------------------------------------------!
    4479     SUBROUTINE mas_timestep_wall_corner_force ( nl, xa, xw, ya, yw )
     4462    SUBROUTINE mas_timestep_wall_corner_force( xa, xw, ya, yw )
    44804463
    44814464       IMPLICIT NONE
    4482 
    4483        INTEGER(iwp) ::  nl !< loop variable over all agents in a grid box
    44844465
    44854466       REAL(wp) ::  dist_l     !< distance to obstacle
Note: See TracChangeset for help on using the changeset viewer.