Index: palm/trunk/DOC/tec/message_identifiers
===================================================================
--- palm/trunk/DOC/tec/message_identifiers	(revision 230)
+++ palm/trunk/DOC/tec/message_identifiers	(revision 230)
@@ -0,0 +1,240 @@
+ List of message identifiers used in PALM message handling routine "message"
+
+    PA****  Identifier for messages in the PALM standard code
+    UI****  Identifier for messages in "user_" routines
+
+message_identifier   message string
+    PA0001            "host" is not set. Please check that environment 
+                        variable "localhost" is set before running PALM
+    PA0002            illegal coupling mode: ...
+    PA0003            dt_coupling is  not set but required for coupling 
+                       mode "..."
+    PA0004            coupling mode "...": dt_coupling = ... is not equal 
+                       to dt_coupling_remote = ...        
+    PA0005            coupling mode "...": dt_coupling <= 0.0 is not allowed 
+                       and is reset to MAX(dt_max(A,O)) = ...
+    PA0006            coupling mode "...": restart_time = ... is not equal 
+                       to restart_time_remote = ...
+    PA0007            coupling mode "...": dt_restart = ... is not equal 
+                       to dt_restart_remote = ...
+    PA0008            coupling mode "...": end_time = ... is not equal to
+                       end_time_remote = ...
+    PA0009            coupling mode "...":  dx = ... is not equal to 
+                       dx_remote = ...
+    PA0010            coupling mode "...":  dy = ... is not equal to 
+                       dy_remote = ...
+    PA0011            coupling mode "...": nx = ... is not equal to 
+                       nx_remote = ...
+    PA0012            coupling mode "...": ny = ... is not equal to 
+                       ny_remote = ...
+    PA0013            illegal value given for loop_optimization: "..."
+    PA0014            a non-flat topography does not allow ...
+    PA0015            ocean = .T. does not allow ...
+    PA0016            unknown solver for perturbation pressure: 
+                       psolver = "..."
+    PA0017            psolver = "..." only works for a 
+                       1d domain-decomposition along x 
+                      please do not set npey/=1 in the parameter file'
+    PA0018            psolver = ".." does not work for subdomains with 
+                       unequal size please set grid_matching = ''strict''
+                       in the parameter file
+    PA0019            psolver = "..." only works for a parallel environment
+    PA0020            unknown multigrid cycle: cycle_mg = "..."
+    PA0021            unknown fft-algorithm: fft_method = "..."
+    PA0022            unknown advection scheme: momentum_advec = "..."
+    PA0023            momentum_advec = "..." is not allowed with 
+                       timestep_scheme = "..."
+    PA0024            unknown advection scheme: scalar_advec = "..."
+    PA0025            use_upstream_for_tke set .TRUE. because 
+                       use_sgs_for_particles = .TRUE.
+    PA0026            use_upstream_for_tke = .TRUE. not allowed with 
+                       timestep_scheme = "..."
+    PA0027            unknown timestep scheme: timestep_scheme = "..."
+    PA0028            scalar advection scheme "..." does not work with 
+                       timestep_scheme ".."
+    PA0029            momentum advection scheme "..." does not work with 
+                       timestep_scheme "..."
+    PA0030            initializing_action = "..." unkown or not allowed
+    PA0031            initializing_actions = "set_constant_profiles" and 
+                       "set_1d-model_profiles" are not allowed simultaneously
+    PA0032            initializing_actions = "set_constant_profiles" and 
+                       "by_user" are not allowed simultaneously
+    PA0033            initializing_actions = "by_user" and  
+                       "set_1d-model_profiles" are not allowed simultaneously
+    PA0034            cloud_physics = ... is not allowed with humidity = ...
+    PA0035            precipitation = ... is not allowed with 
+                       cloud_physics = ...
+    PA0036            humidity = .TRUE. and sloping_surface = .TRUE. are not 
+                       allowed simultaneously
+    PA0037            UPS-scheme is not implemented for humidity = .TRUE.
+    PA0038            humidity = .TRUE. and passive_scalar = .TRUE. is not 
+                       allowed simultaneously'
+    PA0039            UPS-scheme is not implemented for passive_scalar = .TRUE.
+    PA0040            illegal value "..." found for parameter grid_matching
+    PA0041            plant_canopy = .TRUE. requires a non-zero 
+                       drag coefficient given value is drag_coefficient = 0.0
+    PA0042            use_top_fluxes must be .TRUE. in ocean version
+    PA0043            ABS( alpha_surface = ... ) must be < 90.0
+    PA0044            dt = ', dt , ' <= 0.0
+    PA0045            cfl_factor = ...  out of range 
+                       0.0 < cfl_factor <= 1.0 is required
+    PA0046            baroclinicity (ug) not allowed simultaneously with 
+                       galilei transformation
+    PA0047            baroclinicity (vg) not allowed simultaneously with 
+                       galilei transformation
+    PA0048            variable translation speed used for 
+                       galilei-transformation, which may cause instabilities 
+                       in stably stratified regions
+    PA0049            unknown boundary condition: bc_lr = "..."
+    PA0050            unknown boundary condition: bc_ns = "..."
+    PA0051            non-cyclic lateral boundaries do not 
+                       allow psolver = "..."
+    PA0052            non-cyclic lateral boundaries do not allow 
+                       momentum_advec = "..."
+    PA0053            non-cyclic lateral boundaries do not allow 
+                       scalar_advec = "..."
+    PA0054            non-cyclic lateral boundaries do not allow 
+                       galilei_transformation = .T. 
+    PA0055            adjust_mixing_length = TRUE and bc_e_b = "neumann"
+    PA0056            adjust_mixing_length = FALSE and bc_e_b = "..."
+    PA0057            boundary condition bc_e_b changed to "..."
+    PA0058            unknown boundary condition: bc_e_b = "..."
+    PA0059            unknown boundary condition: bc_p_b = "..."
+    PA0060            boundary condition: bc_p_b = "..." not allowed with 
+                       prandtl_layer = .FALSE.'
+    PA0061            unknown boundary condition: bc_p_t = "..."
+    PA0062            unknown boundary condition: bc_pt_b = "..."
+    PA0063            unknown boundary condition: bc_pt_t = "..."
+    PA0064            both, top_momentumflux_u AND top_momentumflux_v 
+                       must be set
+    PA0065            boundary_condition: bc_pt_b = "..." is not allowed 
+                       with constant_heatflux = .TRUE. 
+    PA0066            constant_heatflux = .TRUE. is not allowed with 
+                       pt_surface_initial_change (/=0) = ...
+    PA0067            boundary_condition: bc_pt_t = "..." is not allowed 
+                       with constant_top_heatflux = .TRUE.
+    PA0068            unknown boundary condition: bc_sa_t = "..."
+    PA0069            boundary condition: bc_sa_t = "..." requires to set 
+                       top_salinityflux
+    PA0070            boundary condition: bc_sa_t = "..." is not allowed 
+                       with constant_top_salinityflux = .TRUE.'
+    PA0071            unknown boundary condition: bc_..._b ="..."
+    PA0072            unknown boundary condition: bc_..._t ="..."
+    PA0073            boundary condition: bc_..._b = "..." is not allowed
+                       with prescribed surface flux
+    PA0074            a prescribed surface flux is not allowed 
+                       with ..._surface_initial_change (/=0) = ...
+    PA0075            boundary condition: bc_uv_b = "..." is not allowed 
+                       with prandtl_layer = .TRUE.
+    PA0076            unknown boundary condition: bc_uv_b = "..."
+    PA0077            unknown boundary condition: bc_uv_t = "..."
+    PA0078            rayleigh_damping_factor = ... out of range [0.0,1.0]
+    PA0079            rayleigh_damping_height = ... out of range [0.0, ...]
+    PA0080            overshoot_limit_... < 0.0 is not allowed
+    PA0081            ups_limit_... < 0.0 is not allowed
+    PA0082            number of statistic_regions = ...  but only 
+                      10 regions are allowed
+    PA0083            normalizing_region = ... must be >= 0 and <= ... (value 
+                       of statistic_regions)
+    PA0084            dt_sort_particles is reset to 0.0 because of 
+                       cloud_droplets = .TRUE.
+    PA0085            averaging_interval = ...  must be <= dt_data_output = ...
+    PA0086            averaging_interval_pr = ...  must be <= dt_dopr = ...
+    PA0087            averaging_interval_sp = ...  must be <= dt_dosp = ...
+    PA0088            dt_averaging_input = ...  must 
+                       be <= averaging_interval = ...
+    PA0089            dt_averaging_input_pr = ...  must be 
+                       <= averaging_interval_pr = ...
+    PA0090            precipitation_amount_interval = ...  must not be 
+                       larger than dt_do2d_xy = ...
+    PA0091            data_output_pr = ...  is not implemented for 
+                       ocean = .FALSE.'
+    PA0092            data_output_pr = ... is not implemented for 
+                       humidity = .FALSE.'
+    PA0093            data_output_pr = ... is not implemented for
+                       passive_scalar = .FALSE.'
+    PA0094            data_output_pr = ... is not implemented for 
+                       cloud_physics = .FALSE.'
+    PA0095            data_output_pr = ... is not implemented for 
+                       cloud_physics = .FALSE. and humidity = .FALSE.
+    PA0096            data_output_pr = ... is not implemented for 
+                       cloud_physics = .FALSE. or cloud_droplets = .FALSE.
+    PA0097            illegal value for data_output_pr or 
+                       data_output_pr_user = "..."       
+    PA0098            illegal value for data_output_pr = "..."
+    PA0099            z_max_do1d = ...  must be >= ... or <= ...
+    PA0100            unknown normalization method cross_normalized_x = "..."
+    PA0101            unknown normalization method cross_normalized_y = "..."
+    PA0102            number of output quantitities given by data_output 
+                       and data_output_user exceeds the limit of 100 
+    PA0103            output of "..." requires constant_diffusion = .FALSE.
+    PA0104           output of "..." requires a "particles_par"-NAMELIST 
+                      in the parameter file (PARIN)
+    PA0105           output of "..." requires humidity = .TRUE.
+    PA0106           output of "" requires cloud_physics = .TRUE. or 
+                      cloud_droplets = .TRUE.'
+    PA0107           output of "..." requires cloud_droplets = .TRUE.
+    PA0108           output of "..." requires cloud_physics = .TRUE.
+    PA0109           output of "..." requires ocean = .TRUE.
+    PA0110           output of "..." requires passive_scalar = .TRUE.
+    PA0111           illegal value for data_output: "..." only 
+                      2d-horizontal cross sections are allowed for this value 
+    PA0112           output of "..." requires precipitation = .TRUE.
+    PA0113           temporal averaging of precipitation amount "..." 
+                      is not possible'        
+    PA0114           illegal value for data_output or data_output_user = "..."
+    PA0115           illegal value for data_output = "..."
+    PA0116           z_max_do2d = ', z_max_do2d must be >= ... (zu(nzb+1)) 
+                      and <= ... (zu(nzt))
+    PA0117           do3d_compress = .TRUE. not allowed on host ""
+    PA0118           illegal precision: do3d_comp_prec ( ...) = "..."
+    PA0119           unknown variable "..." given for do3d_comp_prec(...)    
+    PA0120           unknown value for data_output_format "..."
+    PA0121           km_constant = ... < 0.0
+    PA0122           prandtl_number = ... < 0.0
+    PA0123           prandtl_layer is not allowed with fixed value of km
+    PA0124           outflow_damping width out of range
+    PA0125           rif_min = ...  must be less than rif_max = ...
+    PA0126           disturbance_level_b = ... must be >= ... (zu(3))
+    PA0127           disturbance_level_b = ... must be <= ... (zu(nzt-2))
+    PA0128           disturbance_level_t = ... must be <= ... (zu(nzt-2))
+    PA0129           disturbance_level_t = ... must 
+                      be >= disturbance_level_b = ...
+    PA0130           disturbance_level_ind_t =...  must 
+                      be >= disturbance_level_b = ...
+    PA0131           inflow_disturbance_begin out of range
+    PA0132           inflow_disturbance_end out of range
+    PA0133           turbulent_inflow = .T. requires a Dirichlet 
+                      condition at the inflow boundary
+    PA0134           illegal value for recycling_width: ...
+    PA0135           unknown random generator: random_generator = "..."
+    PA0136           damp_level_1d = ...  must be > 0.0 and < ... (zu(nzt+1))
+    PA0137           mixing_length_1d = "..." is unknown
+    PA0138           dissipation_1d = "..." is unknown
+    PA0139           termination_time_needed = ...  must be > 30.0 on host ..."
+    PA0140           termination_time_needed = ... should be >= 300.0 
+                      on host "..."     
+    PA0141           coupling requires PALM to be called with 
+                      ''mrun -K parallel''
+    PA0142           absolute temperature < 0.0 at zu(...) = ...
+    PA0143           k=... j=... i=... ql_c=... part(...)%wf=...  
+                      delta_r=...
+    PA0144           #1 k=... j=... i=... e_s=...  e_a=... t_int=... 
+                      d_radius=... delta_r=... particle_radius=...  
+    PA0145           collision_efficiency out of range: ...
+    PA0146           maximum_number_of_particles needs to be increased 
+                      but this is not allowed with NetCDF output switched on
+    PA0147           maximum_number_of_tails needs to be increased 
+                      but this is not allowed with NetCDF output switched on
+    PA0148           particle too fast.  n = ...
+    PA0149           particle out of range: i=... j=... k=... 
+                      nxl=... nxr=... nys=... nyn=... nzb=... nzt=...
+ 
+
+    UI0001           The value for "topography_grid_convention" is not set. 
+                      Its default value is only valid for 
+                      "topography" = ''single_building'' or 
+                      ''read_from_file'' Choose ''cell_edge'' or 
+                      ''cell_center''.
+    UI0002           The value for "topography_grid_convention" is not 
+                      recognized. Choose ''cell_edge'' or ''cell_center''.
Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 229)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 230)
@@ -6,4 +6,7 @@
 -------
 
+Output of messages replaced by message handling routine 
+
+advec_particles, sort_particles
 
 Errors:
Index: palm/trunk/SOURCE/advec_particles.f90
===================================================================
--- palm/trunk/SOURCE/advec_particles.f90	(revision 229)
+++ palm/trunk/SOURCE/advec_particles.f90	(revision 230)
@@ -2,6 +2,7 @@
 
 !------------------------------------------------------------------------------!
-! Actual revisions:
+! Current revisions:
 ! -----------------
+! Output of messages replaced by message handling routine
 ! Bugfix: several tail counters are initialized, particle_tail_coordinates is
 ! only written to file if its third index is > 0
@@ -314,12 +315,8 @@
                                       ( rho_surface * dx * dy * dz )
           IF ( ql_c(k,j,i) > 100.0 )  THEN
-             print*,'+++ advec_particles k=',k,' j=',j,' i=',i, &
-                          ' ql_c=',ql_c(k,j,i), ' part(',n,')%wf=', &
+             WRITE( message_string, * ) 'k=',k,' j=',j,' i=',i, &
+                          ' ql_c=',ql_c(k,j,i), ' &part(',n,')%wf=', &
                           particles(n)%weight_factor,' delta_r=',delta_r
-#if defined( __parallel )
-             CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-             STOP
-#endif
+             CALL message( 'advec_particles', 'PA0143', 2, 2, 0, 6, 0 )
           ENDIF
 
@@ -328,13 +325,9 @@
           IF ( ( new_r - particles(n)%radius ) < 0.0  .AND.  new_r < 0.0 ) &
           THEN
-             print*,'+++ advec_particles #1 k=',k,' j=',j,' i=',i, &
+             WRITE( message_string, * ) '#1 k=',k,' j=',j,' i=',i, &
                           ' e_s=',e_s, ' e_a=',e_a,' t_int=',t_int, &
-                          ' d_radius=',d_radius,' delta_r=',delta_r,&
+                          ' &d_radius=',d_radius,' delta_r=',delta_r,&
                           ' particle_radius=',particles(n)%radius
-#if defined( __parallel )
-             CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-             STOP
-#endif
+             CALL message( 'advec_particles', 'PA0144', 2, 2, 0, 6, 0 )
           ENDIF
           particles(n)%radius = new_r
@@ -427,12 +420,8 @@
                            effective_coll_efficiency < 0.0 )     &
                       THEN
-                         print*,'+++ advec_particles  collision_efficiency ', &
-                                   'out of range:', effective_coll_efficiency
-#if defined( __parallel )
-                         CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-                         STOP
-#endif
-                      ENDIF
+                         WRITE( message_string, * )   'collision_efficiency ' , &
+                                   'out of range:' ,effective_coll_efficiency
+                         CALL message( 'advec_particles', 'PA0145', 2, 2, 0, 6, 0 )
+                      END IF
 
 !
@@ -1927,13 +1916,9 @@
                maximum_number_of_particles  )  THEN
              IF ( netcdf_output )  THEN
-                PRINT*, '+++ advec_particles:  maximum_number_of_particles ', &
-                                               'needs to be increased'
-                PRINT*, '                      but this is not allowed with ', &
-                                               'NetCDF output switched on'
-#if defined( __parallel )
-                CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-                CALL local_stop
-#endif
+                message_string = 'maximum_number_of_particles ' // &
+                                 'needs to be increased ' // &
+                                 '&but this is not allowed with ' // &
+                                 'NetCDF output switched on'
+                CALL message( 'advec_particles', 'PA0146', 2, 2, 0, 6, 0 )
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory dt_prel'
@@ -1951,13 +1936,9 @@
                   maximum_number_of_tails  )  THEN
                 IF ( netcdf_output )  THEN
-                   PRINT*, '+++ advec_particles:  maximum_number_of_tails ', &
-                                                  'needs to be increased'
-                   PRINT*, '                      but this is not allowed wi', &
-                                                  'th NetCDF output switched on'
-#if defined( __parallel )
-                   CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-                   CALL local_stop
-#endif
+                   message_string = 'maximum_number_of_tails ' // &
+                                    'needs to be increased ' // &
+                                    '&but this is not allowed wi' // &
+                                    'th NetCDF output switched on'
+                   CALL message( 'advec_particles', 'PA0147', 2, 2, 0, 6, 0 )
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory dt_prel'
@@ -2340,9 +2321,9 @@
           THEN
              IF ( netcdf_output )  THEN
-                PRINT*, '+++ advec_particles:  maximum_number_of_particles ', &
-                                               'needs to be increased'
-                PRINT*, '                      but this is not allowed with ', &
-                                               'NetCDF output switched on'
-                CALL MPI_ABORT( comm2d, 9999, ierr )
+                 message_string = 'maximum_number_of_particles ' // &
+                                  'needs to be increased ' // &
+                                  '&but this is not allowed with ' //  &
+                                  'NetCDF output switched on'
+                CALL message( 'advec_particles', 'PA0146', 2, 2, 0, 6, 0 )
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trrp'
@@ -2368,9 +2349,9 @@
              THEN
                 IF ( netcdf_output )  THEN
-                   PRINT*, '+++ advec_particles:  maximum_number_of_tails ', &
-                                                  'needs to be increased'
-                   PRINT*, '                      but this is not allowed wi', &
-                                                  'th NetCDF output switched on'
-                   CALL MPI_ABORT( comm2d, 9999, ierr )
+                   message_string = 'maximum_number_of_tails ' // &
+                                    'needs to be increased ' // &
+                                    '&but this is not allowed wi'// &
+                                    'th NetCDF output switched on'
+                CALL message( 'advec_particles', 'PA0147', 2, 2, 0, 6, 0 )
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trrpt'
@@ -2417,9 +2398,9 @@
           THEN
              IF ( netcdf_output )  THEN
-                PRINT*, '+++ advec_particles:  maximum_number_of_particles ', &
-                                               'needs to be increased'
-                PRINT*, '                      but this is not allowed with ', &
-                                               'NetCDF output switched on'
-                CALL MPI_ABORT( comm2d, 9999, ierr )
+                message_string = 'maximum_number_of_particles ' // &
+                                 'needs to be increased ' // &
+                                 '&but this is not allowed with '// &
+                                 'NetCDF output switched on'
+                CALL message( 'advec_particles', 'PA0146', 2, 2, 0, 6, 0 )
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trlp'
@@ -2445,9 +2426,9 @@
              THEN
                 IF ( netcdf_output )  THEN
-                   PRINT*, '+++ advec_particles:  maximum_number_of_tails ', &
-                                                  'needs to be increased'
-                   PRINT*, '                      but this is not allowed wi', &
-                                                  'th NetCDF output switched on'
-                   CALL MPI_ABORT( comm2d, 9999, ierr )
+                   message_string = 'maximum_number_of_tails ' // &
+                                    'needs to be increased ' // &
+                                    '&but this is not allowed wi'// &
+                                    'th NetCDF output switched on'
+                   CALL message( 'advec_particles', 'PA0147', 2, 2, 0, 6, 0 ) 
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trlpt'
@@ -2781,9 +2762,9 @@
           THEN
              IF ( netcdf_output )  THEN
-                PRINT*, '+++ advec_particles:  maximum_number_of_particles ', &
-                                               'needs to be increased'
-                PRINT*, '                      but this is not allowed with ', &
-                                               'NetCDF output switched on'
-                CALL MPI_ABORT( comm2d, 9999, ierr )
+                message_string = 'maximum_number_of_particles ' // &
+                                 'needs to be increased ' // &
+                                 '&but this is not allowed with '// &
+                                 'NetCDF output switched on'
+                CALL message( 'advec_particles', 'PA0146', 2, 2, 0, 6, 0 ) 
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trnp'
@@ -2809,9 +2790,9 @@
              THEN
                 IF ( netcdf_output )  THEN
-                   PRINT*, '+++ advec_particles:  maximum_number_of_tails ', &
-                                                  'needs to be increased'
-                   PRINT*, '                      but this is not allowed wi', &
-                                                  'th NetCDF output switched on'
-                   CALL MPI_ABORT( comm2d, 9999, ierr )
+                   message_string = 'maximum_number_of_tails ' // &
+                                    'needs to be increased ' // &
+                                    '&but this is not allowed wi' // &
+                                    'th NetCDF output switched on'
+                   CALL message( 'advec_particles', 'PA0147', 2, 2, 0, 6, 0 ) 
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trnpt'
@@ -2858,9 +2839,9 @@
           THEN
              IF ( netcdf_output )  THEN
-                PRINT*, '+++ advec_particles:  maximum_number_of_particles ', &
-                                               'needs to be increased'
-                PRINT*, '                      but this is not allowed with ', &
-                                               'NetCDF output switched on'
-                CALL MPI_ABORT( comm2d, 9999, ierr )
+                message_string = 'maximum_number_of_particles ' // &
+                                 'needs to be increased ' // &
+                                 '&but this is not allowed with ' // &
+                                 'NetCDF output switched on'
+               CALL message( 'advec_particles', 'PA0146', 2, 2, 0, 6, 0 )  
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trsp'
@@ -2886,9 +2867,9 @@
              THEN
                 IF ( netcdf_output )  THEN
-                   PRINT*, '+++ advec_particles:  maximum_number_of_tails ', &
-                                                  'needs to be increased'
-                   PRINT*, '                      but this is not allowed wi', &
-                                                  'th NetCDF output switched on'
-                   CALL MPI_ABORT( comm2d, 9999, ierr )
+                   message_string = 'maximum_number_of_tails ' // &
+                                    'needs to be increased ' // &
+                                    '&but this is not allowed wi'// &
+                                    'th NetCDF output switched on'
+                   CALL message( 'advec_particles', 'PA0147', 2, 2, 0, 6, 0 )
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trspt'
@@ -3091,10 +3072,6 @@
                ((nyn-nys+2)*dy)/(particles(n)%age-particles(n)%age_m) )  THEN
 
-             PRINT*, '+++ advec_particles: particle too fast.  n = ', n
-#if defined( __parallel )
-             CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-             CALL local_stop
-#endif
+               WRITE( message_string, * )  'particle too fast.  n = ',  n 
+               CALL message( 'advec_particles', 'PA0148', 2, 2, 0, 6, 0 )
           ENDIF
 
@@ -3908,9 +3885,10 @@
        IF ( i < nxl .OR. i > nxr .OR. j < nys .OR. j > nyn .OR. k < nzb+1 .OR. &
             k > nzt )  THEN
-          PRINT*, '+++ sort_particles: particle out of range: i=', i, ' j=', &
-                                       j, ' k=', k
-          PRINT*, '                    nxl=', nxl, ' nxr=', nxr, &
-                                     ' nys=', nys, ' nyn=', nyn, &
-                                     ' nzb=', nzb, ' nzt=', nzt
+          WRITE( message_string, * ) ' particle out of range: i=', i, ' j=', &
+                          j, ' k=', k, &
+                          ' &nxl=', nxl, ' nxr=', nxr, &
+                          ' nys=', nys, ' nyn=', nyn, &
+                          ' nzb=', nzb, ' nzt=', nzt
+         CALL message( 'sort_particles', 'PA0149', 1, 2, 0, 6, 0 ) 
        ENDIF
 
