Changeset 3198 for palm/trunk


Ignore:
Timestamp:
Aug 15, 2018 9:23:10 AM (6 years ago)
Author:
sward
Message:

Added MAS end time, used time_since_reference_point, corrected tolerance_dp in nav_mesh

Location:
palm/trunk
Files:
5 edited

Legend:

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

    r3183 r3198  
    2525! -----------------
    2626! $Id$
     27! Added multi_agent_system_end and multi_agent_system_start
     28!
     29! 3183 2018-07-27 14:25:55Z suehring
    2730! Rename offline nesting variables:
    2831! -inflow_l, inflow_n, inflow_r, inflow_s,
     
    14701473    REAL(wp) ::  maximum_cpu_time_allowed = 0.0_wp             !< given wall time for run
    14711474    REAL(wp) ::  molecular_viscosity = 1.461E-5_wp             !< molecular viscosity (used in lsm and lpm)
     1475    REAL(wp) ::  multi_agent_system_end   = 9999999.9_wp       !< namelist parameter (see documentation)
     1476    REAL(wp) ::  multi_agent_system_start = 0.0_wp             !< namelist parameter (see documentation)
    14721477    REAL(wp) ::  old_dt = 1.0E-10_wp                           !< length of previous timestep
    14731478    REAL(wp) ::  omega = 7.29212E-5_wp                         !< namelist parameter
  • palm/trunk/SOURCE/multi_agent_system_mod.f90

    r3187 r3198  
    2525! -----------------
    2626! $Id$
     27! Now using time_since_reference_point; moved multi_agent_system_start and
     28! multi_agent_system_end to control_parameters; renamed NAMELIST agents_par to
     29! agent_parameters
     30!
     31! 3187 2018-07-31 10:32:34Z sward
    2732! Reworked agent pathfinding to avoid collisions with walls
    2833!
     
    5661
    5762    USE control_parameters,                                                    &
    58         ONLY:  dt_3d, message_string, simulated_time, dt_write_agent_data
     63        ONLY:  dt_3d, message_string, time_since_reference_point, dt_write_agent_data
    5964
    6065    USE cpulog,                                                                &
     
    121126    LOGICAL, DIMENSION(max_number_of_agent_groups) ::  a_rand_target = .FALSE. !< namelist parameter (see documentation)
    122127
    123     REAL(wp) ::  agent_maximum_age = 9999999.9_wp    !< namelist parameter (see documentation)
    124     REAL(wp) ::  alloc_factor_mas = 20.0_wp          !< namelist parameter (see documentation)
    125     REAL(wp) ::  coll_t_0 = 3.                       !< namelist parameter (see documentation)
    126     REAL(wp) ::  corner_gate_start = 0.5_wp          !< namelist parameter (see documentation)
    127     REAL(wp) ::  corner_gate_width = 1.0_wp          !< namelist parameter (see documentation)   
    128     REAL(wp) ::  d_sigma_rep_agent                   !< inverse of sigma_rep_agent
    129     REAL(wp) ::  d_sigma_rep_wall                    !< inverse of sigma_rep_wall
    130     REAL(wp) ::  d_tau_accel_agent                   !< inverse of tau_accel_agent
    131     REAL(wp) ::  desired_speed = 1.2_wp              !< namelist parameter (see documentation)
    132     REAL(wp) ::  des_sp_sig = .2_wp                  !< namelist parameter (see documentation)
    133     REAL(wp) ::  dist_target_reached = 2.0_wp        !< distance at which target counts as reached
    134     REAL(wp) ::  dist_to_int_target = .25_wp         !< namelist parameter (see documentation)
    135     REAL(wp) ::  dt_agent = 0.02_wp                  !< namelist parameter (see documentation)
    136     REAL(wp) ::  dt_arel = 9999999.9_wp              !< namelist parameter (see documentation)
    137     REAL(wp) ::  end_time_arel = 9999999.9_wp        !< namelist parameter (see documentation)
    138     REAL(wp) ::  force_x                             !< dummy value for force on current agent in x-direction
    139     REAL(wp) ::  force_y                             !< dummy value for force on current agent in y-direction
    140     REAL(wp) ::  max_dist_from_path = 0.25_wp        !< distance from current path at which a new path is calculated
    141     REAL(wp) ::  multi_agent_system_start = 0.0_wp   !< namelist parameter (see documentation)
    142     REAL(wp) ::  radius_agent = .25_wp               !< namelist parameter (see documentation)
    143     REAL(wp) ::  repuls_agent = 1.5_wp               !< namelist parameter (see documentation)
    144     REAL(wp) ::  repuls_wall = 7.0_wp                !< namelist parameter (see documentation)
    145     REAL(wp) ::  scan_radius_agent = 3.0_wp          !< namelist parameter (see documentation)
    146     REAL(wp) ::  scan_radius_wall = 2.0_wp           !< namelist parameter (see documentation)
    147     REAL(wp) ::  sigma_rep_agent = 0.3_wp            !< namelist parameter (see documentation)
    148     REAL(wp) ::  sigma_rep_wall = 0.1_wp             !< namelist parameter (see documentation)
    149     REAL(wp) ::  tau_accel_agent = 0.5_wp            !< namelist parameter (see documentation)
    150     REAL(wp) ::  time_arel = 0.0_wp                  !< time for agent release
    151     REAL(wp) ::  time_write_agent_data = 0.0_wp      !< write agent data at current time on file
    152     REAL(wp) ::  v_max_agent = 1.3_wp                !< namelist parameter (see documentation)
     128    REAL(wp) ::  agent_maximum_age = 9999999.9_wp          !< namelist parameter (see documentation)
     129    REAL(wp) ::  alloc_factor_mas = 20.0_wp                !< namelist parameter (see documentation)
     130    REAL(wp) ::  coll_t_0 = 3.                             !< namelist parameter (see documentation)
     131    REAL(wp) ::  corner_gate_start = 0.5_wp                !< namelist parameter (see documentation)
     132    REAL(wp) ::  corner_gate_width = 1.0_wp                !< namelist parameter (see documentation)   
     133    REAL(wp) ::  d_sigma_rep_agent                         !< inverse of sigma_rep_agent
     134    REAL(wp) ::  d_sigma_rep_wall                          !< inverse of sigma_rep_wall
     135    REAL(wp) ::  d_tau_accel_agent                         !< inverse of tau_accel_agent
     136    REAL(wp) ::  desired_speed = 1.2_wp                    !< namelist parameter (see documentation)
     137    REAL(wp) ::  des_sp_sig = .2_wp                        !< namelist parameter (see documentation)
     138    REAL(wp) ::  dist_target_reached = 2.0_wp              !< distance at which target counts as reached
     139    REAL(wp) ::  dist_to_int_target = .25_wp               !< namelist parameter (see documentation)
     140    REAL(wp) ::  dt_agent = 0.02_wp                        !< namelist parameter (see documentation)
     141    REAL(wp) ::  dt_arel = 9999999.9_wp                    !< namelist parameter (see documentation)
     142    REAL(wp) ::  end_time_arel = 9999999.9_wp              !< namelist parameter (see documentation)
     143    REAL(wp) ::  force_x                                   !< dummy value for force on current agent in x-direction
     144    REAL(wp) ::  force_y                                   !< dummy value for force on current agent in y-direction
     145    REAL(wp) ::  max_dist_from_path = 0.25_wp              !< distance from current path at which a new path is calculated
     146    REAL(wp) ::  radius_agent = .25_wp                     !< namelist parameter (see documentation)
     147    REAL(wp) ::  repuls_agent = 1.5_wp                     !< namelist parameter (see documentation)
     148    REAL(wp) ::  repuls_wall = 7.0_wp                      !< namelist parameter (see documentation)
     149    REAL(wp) ::  scan_radius_agent = 3.0_wp                !< namelist parameter (see documentation)
     150    REAL(wp) ::  scan_radius_wall = 2.0_wp                 !< namelist parameter (see documentation)
     151    REAL(wp) ::  sigma_rep_agent = 0.3_wp                  !< namelist parameter (see documentation)
     152    REAL(wp) ::  sigma_rep_wall = 0.1_wp                   !< namelist parameter (see documentation)
     153    REAL(wp) ::  tau_accel_agent = 0.5_wp                  !< namelist parameter (see documentation)
     154    REAL(wp) ::  time_arel = 0.0_wp                        !< time for agent release
     155    REAL(wp) ::  time_write_agent_data = 0.0_wp            !< write agent data at current time on file
     156    REAL(wp) ::  v_max_agent = 1.3_wp                      !< namelist parameter (see documentation)
    153157
    154158    REAL(wp), DIMENSION(:), ALLOCATABLE ::  dummy_path_x  !<  dummy path (x-coordinate)
     
    269273!
    270274!-- Public parameters, constants and initial values
    271     PUBLIC agents_active, multi_agent_system_start
     275    PUBLIC agents_active
    272276
    273277    INTERFACE mas_parin
     
    318322!
    319323!-- If necessary, release new set of agents
    320     IF ( time_arel >= dt_arel  .AND.  end_time_arel > simulated_time )  THEN
     324    IF ( time_arel >= dt_arel  .AND.  end_time_arel > time_since_reference_point )  THEN
    321325
    322326       CALL mas_create_agent(PHASE_RELEASE)
     
    12231227
    12241228          nc_stat = NF90_PUT_VAR( id_set_agt, id_var_time_agt, &
    1225                                   (/ simulated_time /),        &
     1229                                  (/ time_since_reference_point /),        &
    12261230                                  start = (/ agt_time_count /), count = (/ 1 /) )
    12271231          CALL netcdf_handle_error( 'mas_data_output_agents', 1 )
     
    36383642
    36393643       USE control_parameters,                                                 &
    3640            ONLY: agent_time_unlimited
     3644           ONLY: agent_time_unlimited, multi_agent_system_end,                 &
     3645                 multi_agent_system_start
    36413646
    36423647       IMPLICIT NONE
     
    36443649       CHARACTER (LEN=80) ::  line  !<
    36453650
    3646        NAMELIST /agents_par/  a_rand_target, adx, ady, agent_maximum_age,      &
    3647                               agent_time_unlimited, alloc_factor_mas, asl, asn,&
    3648                               asr, ass, at_x, at_y, bc_mas_lr, bc_mas_ns,      &
    3649                               coll_t_0, corner_gate_start, corner_gate_width,  &
    3650                               deallocate_memory_mas, dist_to_int_target,       &
    3651                               dt_agent, dt_arel, dt_write_agent_data,&
    3652                               end_time_arel, max_dist_from_path, min_nr_agent, &
    3653                               multi_agent_system_start, number_of_agent_groups,&
    3654                               radius_agent, random_start_position_agents,      &
    3655                               read_agents_from_restartfile, repuls_agent,      &
    3656                               repuls_wall, scan_radius_agent, sigma_rep_agent, &
    3657                               sigma_rep_wall, step_dealloc_mas, tau_accel_agent
     3651       NAMELIST /agent_parameters/  a_rand_target,                             &
     3652                                    adx,                                       &
     3653                                    ady,                                       &
     3654                                    agent_maximum_age,                         &
     3655                                    agent_time_unlimited,                      &
     3656                                    alloc_factor_mas,                          &
     3657                                    asl,                                       &
     3658                                    asn,                                       &
     3659                                    asr,                                       &
     3660                                    ass,                                       &
     3661                                    at_x,                                      &
     3662                                    at_y,                                      &
     3663                                    bc_mas_lr,                                 &
     3664                                    bc_mas_ns,                                 &
     3665                                    coll_t_0,                                  &
     3666                                    corner_gate_start,                         &
     3667                                    corner_gate_width,                         &
     3668                                    deallocate_memory_mas,                     &
     3669                                    dist_to_int_target,                        &
     3670                                    dt_agent,                                  &
     3671                                    dt_arel,                                   &
     3672                                    dt_write_agent_data,                       &
     3673                                    end_time_arel,                             &
     3674                                    max_dist_from_path,                        &
     3675                                    min_nr_agent,                              &
     3676                                    multi_agent_system_end,                    &
     3677                                    multi_agent_system_start,                  &
     3678                                    number_of_agent_groups,                    &
     3679                                    radius_agent,                              &
     3680                                    random_start_position_agents,              &
     3681                                    read_agents_from_restartfile,              &
     3682                                    repuls_agent,                              &
     3683                                    repuls_wall,                               &
     3684                                    scan_radius_agent,                         &
     3685                                    sigma_rep_agent,                           &
     3686                                    sigma_rep_wall,                            &
     3687                                    step_dealloc_mas,                          &
     3688                                    tau_accel_agent
    36583689
    36593690!
     
    36613692       REWIND ( 11 )
    36623693       line = ' '
    3663        DO   WHILE ( INDEX( line, '&agents_par' ) == 0 )
     3694       DO   WHILE ( INDEX( line, '&agent_parameters' ) == 0 )
    36643695          READ ( 11, '(A)', END=20 )  line
    36653696       ENDDO
     
    36683699!
    36693700!--    Read user-defined namelist
    3670        READ ( 11, agents_par )
     3701       READ ( 11, agent_parameters )
    36713702
    36723703!
  • palm/trunk/SOURCE/netcdf_interface_mod.f90

    r3187 r3198  
    2525! -----------------
    2626! $Id$
     27! Redefined MAS limited time dimension to fit usage of multi_agent_system_end
     28!
     29! 3187 2018-07-31 10:32:34Z sward
    2730! Changed agent output to precision NF90_DOUBLE
    2831!
     
    283286
    284287    USE control_parameters,                                                    &
    285         ONLY:  max_masks, fl_max, var_fl_max, varnamelength
     288        ONLY:  fl_max, max_masks, multi_agent_system_end,                      &
     289               multi_agent_system_start, var_fl_max, varnamelength
    286290    USE kinds
    287291#if defined( __netcdf )
     
    19681972          ELSE
    19691973             CALL netcdf_create_dim( id_set_agt, 'time',                       &
    1970                                      INT(end_time/dt_write_agent_data*1.2),    &
     1974                                     INT( ( MIN( multi_agent_system_end,       &
     1975                                                 end_time ) -                  &
     1976                                            multi_agent_system_start ) /       &
     1977                                            dt_write_agent_data * 1.1 ),       &
    19711978                                     id_dim_time_agt, 331 )
    19721979          ENDIF
  • palm/trunk/SOURCE/time_integration.f90

    r3183 r3198  
    2525! -----------------
    2626! $Id$
     27! Added multi_agent_system_end; defined start time for MAS relative to
     28! time_since_reference_point
     29!
     30! 3183 2018-07-27 14:25:55Z suehring
    2731! Replace simulated_time by time_since_reference_point in COSMO nesting mode.
    2832! Rename subroutines and variables in COSMO nesting mode
     
    388392               loop_optimization, lsf_surf, lsf_vert, masks,                   &
    389393               microphysics_morrison, microphysics_seifert, mid,               &
     394               multi_agent_system_end, multi_agent_system_start,               &
    390395               nesting_offline, neutral, nr_timesteps_this_run, nudging,       &
    391396               ocean, passive_scalar, prho_reference, pt_reference,            &
     
    440445
    441446    USE multi_agent_system_mod,                                                &
    442         ONLY:  agents_active, multi_agent_system, multi_agent_system_start
     447        ONLY:  agents_active, multi_agent_system
    443448
    444449    USE particle_attributes,                                                   &
     
    719724!--       Movement of agents in multi agent system
    720725          IF ( agents_active  .AND.                                            &
    721                simulated_time >= multi_agent_system_start  .AND.               &
     726               time_since_reference_point >= multi_agent_system_start  .AND.   &
     727               time_since_reference_point <= multi_agent_system_end    .AND.   &
    722728               intermediate_timestep_count == 1 )  THEN
    723729             CALL multi_agent_system
  • palm/trunk/UTIL/nav_mesh/nav_mesh.f90

    r3168 r3198  
    2525! -----------------!
    2626! $Id$
     27! Reduced tolerance_dp to 3 entries, fixed its initialization
     28!
     29! 3168 2018-07-25 06:40:29Z sward
    2730! Updated NetCDF ororgraphy and building input
    2831!
     
    9598    REAL(wp)    ::  start            !< variable for CPU time measurement
    9699
    97     REAL(wp), DIMENSION(0:4) ::  tolerance_dp  !< tolerance in Douglas-Poicker algorithm
     100    REAL(wp), DIMENSION(0:2) ::  tolerance_dp = 999999.0_wp  !< tolerance in Douglas-Peucker algorithm
    98101
    99102    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  obstacle_height  !< height of obstacles
     
    13381341!
    13391342!--    If tolerance_dp was not set, put in default values
    1340        IF ( tolerance_dp(0) == 999999.0_wp ) tolerance_dp(0) = SQRT(dx*dy)*2.99
    1341        IF ( tolerance_dp(1) == 999999.0_wp ) tolerance_dp(1) = SQRT(dx*dy)*1.99
    1342        IF ( tolerance_dp(2) == 999999.0_wp ) tolerance_dp(2) = SQRT(dx*dy)*1.41
    1343        IF ( tolerance_dp(3) == 999999.0_wp ) tolerance_dp(3) = SQRT(dx*dy)*.7
    1344        IF ( tolerance_dp(4) == 999999.0_wp ) tolerance_dp(4) = SQRT(dx*dy)*.35
     1343       DO i = 0, 2
     1344          IF ( tolerance_dp(i) == 999999.0_wp ) THEN
     1345             tolerance_dp(i) = SQRT(dx*dy)*1.41/(2**i)
     1346          ELSE
     1347             tolerance_dp(i) = tolerance_dp(i)*SQRT(dx*dy)
     1348          ENDIF
     1349       ENDDO
     1350
    13451351!
    13461352!--    Allocate arrays
     
    27842790!--    of vertices would fall below 4 due to this procedure, the tolerance
    27852791!--    for the algorithm is reduced and it is run again.
    2786        DO i_sc = 0, 4
     2792       DO i_sc = 0, 2
    27872793          CALL simplify_polygon(1,nov+1,tolerance_dp(i_sc))
    27882794          i_cn = 0
Note: See TracChangeset for help on using the changeset viewer.