Index: palm/trunk/DOC/tec/message_identifiers
===================================================================
--- palm/trunk/DOC/tec/message_identifiers	(revision 256)
+++ palm/trunk/DOC/tec/message_identifiers	(revision 257)
@@ -380,2 +380,169 @@
     PA0240           The value for "topography_grid_convention" is not 
                       recognized. Choose ''cell_edge'' or ''cell_center''.
+    PA0241           netcdf_precision must contain a "_" 
+                      netcdf_precision(...)="..."
+    PA0242           illegal netcdf precision: netcdf_precision( ...)="..."
+    PA0243           unknown variable in inipar assignment:
+                      netcdf_precision(', i, ')="..."
+    PA0244           no grid defined for variable ...
+    PA0245           NetCDF file for volume data ... from previuos run found,
+                      but this file cannot be extended due to  variable mismatch. 
+                      New file is created instead.
+    PA0246           NetCDF file for volume data ... from previuos run found,
+                      but this file cannot be extended due to mismatch in 
+                      number of vertical grid points (nz_do3d).
+                      New file is created instead.
+    PA0247           NetCDF file for volume data ... from previuos run found,
+                      but this file cannot be extended because the current 
+                      output time is less or equal than the last output time 
+                      on this file. New file is created instead.
+    PA0248           NetCDF file for volume data ... from previous run found.
+                      This file will be extended.
+    PA0249           NetCDF file for cross-sections ... from previuos run found,
+                      but this file cannot be extended due to variable mismatch.
+                      New file is created instead.
+    PA0250           NetCDF file for cross-sections ... from previuos run found,
+                      but this file cannot be extended due to mismatch in 
+                      number of cross sections. New file is created instead.
+    PA0251           NetCDF file for cross-sections ... from previuos run found
+                     but this file cannot be extended due to mismatch in cross
+                      section levels. New file is created instead.
+    PA0252           NetCDF file for cross sections ... from previuos run found,
+                      but this file cannot be extended because the current output time 
+                      is less or equal than the last output time on this file.
+                      New file is created instead.
+    PA0253           NetCDF file for cross-sections ... from previous run found. 
+                      This file will be extended.
+    PA0254           NetCDF file for vertical profiles from previuos run found,
+                      but this file cannot be extended due to variable mismatch.
+                      New file is created instead. 
+    PA0255           NetCDF file for vertical profiles from previuos run found,
+                      but this file cannot be extended because the current 
+                      output time is less or equal than the last output time 
+                      on this file. New file is created instead.
+    PA0256           NetCDF file for vertical profiles from previous run found.
+                      This file will be extended.
+    PA0257           NetCDF file for time series from previuos run found
+                      but this file cannot be extended due tovariable mismatch. 
+                      New file is created instead.
+    PA0258           NetCDF file for time series from previuos run found,
+                      but this file cannot be extended because the current 
+                      output time is less or equal than the last output time 
+                      on this file. New file is created instead.
+    PA0259           NetCDF file for time series from previous run found.
+                      This file will be extended.
+    PA0260           NetCDF file for spectra from previuos run found, 
+                      but this file cannot be extended due to variable mismatch.
+                      New file is created instead.
+    PA0261           NetCDF file for spectra from previuos run found, 
+                      but this file cannot be extended due to mismatch in 
+                      number of vertical levels. New file is created instead. 
+    PA0262           NetCDF file for spectra from previuos run found, 
+                      but this file cannot be extended due to mismatch in 
+                      heights of vertical levels. New file is created instead.
+    PA0263           NetCDF file for spectra from previuos run found, 
+                      but this file cannot be extended because the current 
+                      output time is less or equal than the last output time 
+                      on this file. New file is created instead.
+    PA0264           NetCDF file for spectra from previous run found.
+                      This file will be extended.
+    PA0265           NetCDF file for particles from previuos run found,
+                      but this file cannot be extended because the current 
+                      output time is less or equal than the last output time 
+                      on this file. New file is created instead.
+    PA0266           NetCDF file for particles from previous run found. 
+                      This file will be extended.
+    PA0267           NetCDF file for particle time series from previuos run found,
+                      but this file cannot be extended due to variable mismatch. 
+                      New file is created instead.
+    PA0268           NetCDF file for particle time series from previuos run found, 
+                      but this file cannot be extended because the current 
+                      output time is less or equal than the last output time 
+                      on this file. New file is created instead.
+    PA0269           NetCDF file for particle time series from previous run found.
+                      This file will be extended.
+    PA0270           mode "..." not supported
+    PA0271           errors in \$inipar &or no \$inipar-namelist found (CRAY-machines only)
+    PA0272           no \$inipar-namelist found
+    PA0273           no value or wrong value given for nx: nx=...
+    PA0274           no value or wrong value given for ny: ny=...
+    PA0275           no value or wrong value given for nz: nz=...
+    PA0276           local file ENVPAR not found 
+                      some variables for steering may not be properly set
+    PA0277           errors in local file ENVPAR 
+                      some variables for steering may not be properly set
+    PA0278           no envpar-NAMELIST found in local file ENVPAR
+                      some variables for steering may not be properly set
+    PA0279           wrong component: ...
+    PA0280           Number of OpenMP threads = ...
+    PA0281           running optimized multinode version
+                      switch_per_lpar        = ...
+                      tasks_per_lpar         = ...
+                      tasks_per_logical_node = ...
+    PA0282           parallel environment (MPI) required
+    PA0283           no sufficient convergence within 1000 cycles
+    PA0284           data from subdomain of previous run mapped more 
+                      than 1000 times
+    PA0285           number of PEs or virtual PE-grid changed in restart run
+                      PE ... will read from files ...
+    PA0286           version mismatch concerning data from prior run
+                      version on file    = "..."
+                      version in program = "..."
+    PA0287           problem with index bound nxl on restart file "..."
+                      nxl = ... but it should be = ... from the index bound 
+                      information array
+    PA0288           problem with index bound nxr on restart file "..."
+                      nxr = ... but it should be = ... from the index bound 
+                      information array
+    PA0289           problem with index bound nys on restart file "..."
+                      nys = .. but it should be = ... from the index bound 
+                      information array  
+    PA0290           problem with index bound nyn on restart file "..."
+                      nyn = ... but it should be = ... from the index bound 
+                      information array
+    PA0291           mismatch between actual data and data 
+                      from prior run on PE ...
+                      nzb on file = ... 
+                      nzb         = ...
+    PA0292           mismatch between actual data and data 
+                      from prior run on PE ...
+                      nzt on file = ...
+                      nzt         = ...
+    PA0293           read_3d_binary: spectrum_x 
+                      on restart file ignored because total numbers of 
+                      grid points (nx) do not match
+    PA0294           read_3d_binary: spectrum_y 
+                      on restart file ignored because total numbers of 
+                      grid points (ny) do not match
+    PA0295           unknown field named "..." found in data from 
+                      prior run on PE ...
+    PA0296           version mismatch concerning control variables
+                      version on file    = "..."
+                      version on program = "..."
+    PA0297           numprocs not found in data from prior run on PE ...
+    PA0298           hor_index_bounds not found in data from prior 
+                      run on PE ...
+    PA0299           nz not found in data from prior run on PE ...
+    PA0300           max_pr_user not found in data from prior run on PE ...
+    PA0301           statistic_regions not found in data from prior 
+                      run on PE ...
+    PA0302           unknown variable named "..." found in data from 
+                      prior run on PE ...  
+    PA0303           nz not found in restart data file
+    PA0304           mismatch concerning number of gridpoints along z
+                      nz on file    = "..."
+                      nz from run   = "..."
+    PA0305           max_pr_user not found in restart data file
+    PA0306           number of user profiles on restart data file differs 
+                      from the current run
+                      max_pr_user on file    = "..."
+                      max_pr_user from run   = "..."
+    PA0307           statistic_regions not found in restart data file
+    PA0308           statistic regions on restart data file differ 
+                      from the current run
+                      statistic regions on file    = "..."
+                      statistic regions from run   = "..."
+                      statistic data may be lost!
+    PA0309           inflow profiles not temporally averaged.
+                      Averaging will be done now using ... samples.  
+    
Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 256)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 257)
@@ -24,4 +24,11 @@
 
 Output of messages replaced by message handling routine.
+(advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, 
+check_open, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp,
+data_output_profiles, data_output_spectra, fft_xy, flow_statistics, header, 
+init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, 
+netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary, 
+read_var_list)
+
 First constant in array den also defined as type double. (eqn_state_seawater)
 
@@ -30,5 +37,5 @@
 user_init_grid, user_parin, write_var_list)
 
-advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_spectra,  eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, parin, read_var_list, sort_particles, user_check_parameters, user_header, user_init_grid, user_parin, write_var_list
+advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_spectra,  eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary, read_var_list, sort_particles, user_check_parameters, user_header, user_init_grid, user_parin, write_var_list
 
 
Index: palm/trunk/SOURCE/netcdf.f90
===================================================================
--- palm/trunk/SOURCE/netcdf.f90	(revision 256)
+++ palm/trunk/SOURCE/netcdf.f90	(revision 257)
@@ -7,5 +7,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Output of messages replaced by message handling routine.
+!
 !
 ! Former revisions:
@@ -108,10 +109,8 @@
           j = INDEX( netcdf_precision(i), '_' )
           IF ( j == 0 )  THEN
-             IF ( myid == 0 )  THEN
-                PRINT*, '+++ define_netcdf_header: netcdf_precision must ',  &
-                             'contain a "_"    netcdf_precision(', i, ')="', &
-                             TRIM( netcdf_precision(i) ),'"'
-             ENDIF
-             CALL local_stop
+             WRITE ( message_string, * ) 'netcdf_precision must contain a "_"', &    
+                                         'netcdf_precision(', i, ')="',         &
+                                         TRIM( netcdf_precision(i) ),'"'
+             CALL message( 'define_netcdf_header', 'PA0241', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -124,10 +123,8 @@
              j = NF90_REAL8
           ELSE
-             IF ( myid == 0 )  THEN
-                PRINT*, '+++ define_netcdf_header: illegal netcdf precision: ',&
-                             'netcdf_precision(', i, ')="', &
-                             TRIM( netcdf_precision(i) ),'"'
-             ENDIF
-             CALL local_stop
+             WRITE ( message_string, * ) 'illegal netcdf precision: ',  &
+                                         'netcdf_precision(', i, ')="', &
+                                         TRIM( netcdf_precision(i) ),'"'
+             CALL message( 'define_netcdf_header', 'PA0242', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -155,10 +152,8 @@
 
              CASE DEFAULT
-                IF ( myid == 0 )  THEN
-                   PRINT*, '+++ define_netcdf_header: unknown variable in ',   &
-                              'inipar assignment: netcdf_precision(', i, ')="',&
-                                TRIM( netcdf_precision(i) ),'"'
-                ENDIF
-                CALL local_stop                
+                WRITE ( message_string, * ) 'unknown variable in inipar assignment:',& 
+                                            'netcdf_precision(', i, ')="',           &
+                                            TRIM( netcdf_precision(i) ),'"'
+                CALL message( 'define_netcdf_header', 'PA0243', 1, 2, 0, 6, 0 )             
 
           END SELECT
@@ -420,6 +415,7 @@
 
              IF ( .NOT. found )  THEN
-                PRINT*, '+++ define_netcdf_header: no grid defined for', &
-                             ' variable ', do3d(av,i)
+                WRITE ( message_string, * ) 'no grid defined for', &
+                                            ' variable ', TRIM( do3d(av,i) )
+                CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, 6, 0 )  
              ENDIF
 
@@ -562,9 +558,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for volume data ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for volume data ' //             &  
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                      &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0245', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -586,10 +583,11 @@
 
           IF ( nz_do3d-nzb+1 /= nz_old )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for volume data ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' mismatch in number of'
-             PRINT*, '             vertical grid points (nz_do3d).'
-             PRINT*, '             New file is created instead.'
+              message_string = 'NetCDF file for volume data ' //             &
+                               TRIM( var ) // ' from previuos run found,' // &
+                               '&but this file cannot be extended due to' // &
+                               ' mismatch in number of' //                   &
+                               '&vertical grid points (nz_do3d).' //         &
+                               '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0246', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -620,11 +618,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for volume data ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for volume data ' // &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0247', 0, 1, 0, 6, 0 )
              do3d_time_count(av) = 0
              extend = .FALSE.
@@ -648,8 +647,8 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 96 )
-          PRINT*, '*** NetCDF file for volume data ' // TRIM( var ) // &
-                       ' from previous run found.'
-          PRINT*, '    This file will be extended.'
-
+          message_string = 'NetCDF file for volume data ' //             &
+                           TRIM( var ) // ' from previous run found.' // &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0248', 0, 0, 0, 6, 0 )
 
        CASE ( 'xy_new' )
@@ -945,6 +944,7 @@
 
                    IF ( .NOT. found )  THEN
-                      PRINT*, '+++ define_netcdf_header: no grid defined ', &
-                                   'for variable ', do2d(av,i)
+                      WRITE ( message_string, * ) 'no grid defined for', &
+                                            ' variable ', TRIM( do2d(av,i) )
+                      CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, 6, 0 )
                    ENDIF
 
@@ -1131,9 +1131,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross-sections ' //           &
+                              TRIM( var ) // ' from previuos run found,' //  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0249', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -1163,10 +1164,11 @@
 
           IF ( ns /= ns_old )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' mismatch in number of'
-             PRINT*, '             cross sections.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross-sections ' //          &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended due to' // &
+                              ' mismatch in number of' //                   &
+                              '&cross sections.' //                         &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0250', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -1183,10 +1185,11 @@
              IF ( section(i,1) /= -1 )  THEN
                 IF ( zu(section(i,1)) /= netcdf_data(i) )  THEN
-                   PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                     TRIM( var ) // ' from previuos run found,'
-                   PRINT*, '             but this file cannot be extended' // &
-                                      ' due to mismatch in cross'
-                   PRINT*, '             section levels.'
-                   PRINT*, '             New file is created instead.'
+                   message_string = 'NetCDF file for cross-sections ' //          &
+                                    TRIM( var ) // ' from previuos run found,' // &
+                                    '&but this file cannot be extended' //        &
+                                    ' due to mismatch in cross' //                &
+                                    '&section levels.' //                         &
+                                    '&New file is created instead.'
+                   CALL message( 'define_netcdf_header', 'PA0251', 0, 1, 0, 6, 0 )
                    extend = .FALSE.
                    RETURN
@@ -1194,10 +1197,11 @@
              ELSE
                 IF ( -1.0 /= netcdf_data(i) )  THEN
-                   PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                     TRIM( var ) // ' from previuos run found,'
-                   PRINT*, '             but this file cannot be extended' // &
-                                      ' due to mismatch in cross'
-                   PRINT*, '             section levels.'
-                   PRINT*, '             New file is created instead.'
+                   message_string = 'NetCDF file for cross-sections ' //          &
+                                    TRIM( var ) // ' from previuos run found,' // &
+                                    '&but this file cannot be extended' //        &
+                                    ' due to mismatch in cross' //                &
+                                    '&section levels.' //                         &
+                                    '&New file is created instead.'
+                   CALL message( 'define_netcdf_header', 'PA0251', 0, 1, 0, 6, 0 )
                    extend = .FALSE.
                    RETURN
@@ -1232,11 +1236,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross sections ' //          &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0252', 0, 1, 0, 6, 0 )
              do2d_xy_time_count(av) = 0
              extend = .FALSE.
@@ -1264,8 +1269,9 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 139 )
-          PRINT*, '*** NetCDF file for cross-sections ' // TRIM( var ) // &
-                       ' from previous run found.'
-          PRINT*, '    This file will be extended.'
-
+          message_string = 'NetCDF file for cross-sections ' //           & 
+                            TRIM( var ) // ' from previous run found.' // &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0253', 0, 0, 0, 6, 0 )
+          
 
        CASE ( 'xz_new' )
@@ -1489,6 +1495,7 @@
 
                 IF ( .NOT. found )  THEN
-                   PRINT*, '+++ define_netcdf_header: no grid defined for', &
-                                ' variable ', do2d(av,i)
+                   WRITE ( message_string, * ) 'no grid defined for', &
+                                            ' variable ', TRIM( do2d(av,i) )
+                   CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, 6, 0 )  
                 ENDIF
 
@@ -1642,9 +1649,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross-sections ' //           &
+                              TRIM( var ) // ' from previuos run found,' //  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0249', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -1674,10 +1682,11 @@
 
           IF ( ns /= ns_old )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' mismatch in number of'
-             PRINT*, '             cross sections.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross-sections ' //          &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended due to' // &
+                              ' mismatch in number of' //                   & 
+                              '&cross sections.' //                         &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0250', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -1694,10 +1703,11 @@
              IF ( section(i,2) /= -1 )  THEN
                 IF ( ( section(i,2) * dy ) /= netcdf_data(i) )  THEN
-                   PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                     TRIM( var ) // ' from previuos run found,'
-                   PRINT*, '             but this file cannot be extended' // &
-                                      ' due to mismatch in cross'
-                   PRINT*, '             section indices.'
-                   PRINT*, '             New file is created instead.'
+                   message_string = 'NetCDF file for cross-sections ' //          &
+                                    TRIM( var ) // ' from previuos run found,' // &
+                                    '&but this file cannot be extended' //        &
+                                    ' due to mismatch in cross' //                &
+                                    '&section levels.' //                         &
+                                    '&New file is created instead.'
+                   CALL message( 'define_netcdf_header', 'PA0251', 0, 1, 0, 6, 0 )
                    extend = .FALSE.
                    RETURN
@@ -1705,10 +1715,11 @@
              ELSE
                 IF ( -1.0 /= netcdf_data(i) )  THEN
-                   PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                     TRIM( var ) // ' from previuos run found,'
-                   PRINT*, '             but this file cannot be extended' // &
-                                      ' due to mismatch in cross'
-                   PRINT*, '             section indices.'
-                   PRINT*, '             New file is created instead.'
+                   message_string = 'NetCDF file for cross-sections ' //          &
+                                    TRIM( var ) // ' from previuos run found,' // &
+                                    '&but this file cannot be extended' //        &
+                                    ' due to mismatch in cross' //                &
+                                    '&section levels.' //                         &               
+                                    '&New file is created instead.'
+                   CALL message( 'define_netcdf_header', 'PA0251', 0, 1, 0, 6, 0 )
                    extend = .FALSE.
                    RETURN
@@ -1743,11 +1754,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross sections ' //          &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0252', 0, 1, 0, 6, 0 )
              do2d_xz_time_count(av) = 0
              extend = .FALSE.
@@ -1775,7 +1787,8 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 178 )
-          PRINT*, '*** NetCDF file for cross-sections ' // TRIM( var ) // &
-                       ' from previous run found.'
-          PRINT*, '    This file will be extended.'
+          message_string = 'NetCDF file for cross-sections ' //           & 
+                            TRIM( var ) // ' from previous run found.' // &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0253', 0, 0, 0, 6, 0 )
 
 
@@ -2000,6 +2013,7 @@
 
                 IF ( .NOT. found )  THEN
-                   PRINT*, '+++ define_netcdf_header: no grid defined for', &
-                                ' variable ', do2d(av,i)
+                   WRITE ( message_string, * ) 'no grid defined for', &
+                                            ' variable ', TRIM( do2d(av,i) )
+                   CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, 6, 0 )  
                 ENDIF
 
@@ -2152,9 +2166,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross-sections ' //           &
+                              TRIM( var ) // ' from previuos run found,' //  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       & 
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0249', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -2184,10 +2199,11 @@
 
           IF ( ns /= ns_old )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' mismatch in number of'
-             PRINT*, '             cross sections.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross-sections ' //          &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended due to' // &
+                              ' mismatch in number of' //                   &
+                              '&cross sections.' //                         &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0250', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -2204,10 +2220,11 @@
              IF ( section(i,3) /= -1 )  THEN
                 IF ( ( section(i,3) * dx ) /= netcdf_data(i) )  THEN
-                   PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                     TRIM( var ) // ' from previuos run found,'
-                   PRINT*, '             but this file cannot be extended' // &
-                                      ' due to mismatch in cross'
-                   PRINT*, '             section indices.'
-                   PRINT*, '             New file is created instead.'
+                   message_string = 'NetCDF file for cross-sections ' //          &
+                                    TRIM( var ) // ' from previuos run found,' // &
+                                    '&but this file cannot be extended' //        &
+                                    ' due to mismatch in cross' //                &
+                                    '&section levels.' //                         &
+                                    '&New file is created instead.'
+                   CALL message( 'define_netcdf_header', 'PA0251', 0, 1, 0, 6, 0 )
                    extend = .FALSE.
                    RETURN
@@ -2215,10 +2232,11 @@
              ELSE
                 IF ( -1.0 /= netcdf_data(i) )  THEN
-                   PRINT*, '+++ WARNING: NetCDF file for cross-sections ' // &
-                                     TRIM( var ) // ' from previuos run found,'
-                   PRINT*, '             but this file cannot be extended' // &
-                                      ' due to mismatch in cross'
-                   PRINT*, '             section indices.'
-                   PRINT*, '             New file is created instead.'
+                   message_string = 'NetCDF file for cross-sections ' //          &
+                                    TRIM( var ) // ' from previuos run found,' // &
+                                    '&but this file cannot be extended' //        &
+                                    ' due to mismatch in cross' //                &
+                                    '&section levels.' //                         &
+                                    '&New file is created instead.'
+                   CALL message( 'define_netcdf_header', 'PA0251', 0, 1, 0, 6, 0 )
                    extend = .FALSE.
                    RETURN
@@ -2253,11 +2271,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for cross sections ' // &
-                                   TRIM( var ) // ' from previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for cross sections ' //          &
+                              TRIM( var ) // ' from previuos run found,' // &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0252', 0, 1, 0, 6, 0 )
              do2d_yz_time_count(av) = 0
              extend = .FALSE.
@@ -2285,7 +2304,8 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 217 )
-          PRINT*, '*** NetCDF file for cross-sections ' // TRIM( var ) // &
-                       ' from previous run found.'
-          PRINT*, '    This file will be extended.'
+          message_string = 'NetCDF file for cross-sections ' //           & 
+                            TRIM( var ) // ' from previous run found.' // &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0253', 0, 0, 0, 6, 0 )
 
 
@@ -2492,9 +2512,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for vertical profiles from' // &
-                                   ' previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for vertical profiles ' //        &
+                              'from previuos run found,' //                  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0254', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -2525,11 +2546,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for vertical profiles from' // &
-                                   ' previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for vertical profiles ' //       &
+                              'from previuos run found,' //                 &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0255', 0, 1, 0, 6, 0 )
              dopr_time_count = 0
              extend = .FALSE.
@@ -2576,7 +2598,8 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 248 )
-          PRINT*, '*** NetCDF file for vertical profiles from previous run' // &
-                       ' found.'
-          PRINT*, '    This file will be extended.'
+          message_string = 'NetCDF file for vertical profiles ' // & 
+                           'from previous run found.' //           &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0256', 0, 0, 0, 6, 0 )
 
 
@@ -2700,9 +2723,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for time series from' //&
-                                   ' previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for time series ' //              &
+                              'from previuos run found,' //                  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0257', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -2733,11 +2757,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for time series from' // &
-                                   ' previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for time series ' //             &
+                              'from previuos run found,' //                 &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0258', 0, 1, 0, 6, 0 )
              dots_time_count = 0
              extend = .FALSE.
@@ -2775,6 +2800,8 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 267 )
-          PRINT*, '*** NetCDF file for time series from previous run found.'
-          PRINT*, '    This file will be extended.'
+          message_string = 'NetCDF file for time series ' // & 
+                           'from previous run found.' //     &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0259', 0, 0, 0, 6, 0 )
 
 
@@ -3053,9 +3080,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for spectra from previous ' //&
-                                   'run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for spectra  ' //                 &
+                              'from previuos run found,' //                  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0260', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -3086,10 +3114,11 @@
 
           IF ( ns /= ns_old )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for spectra from previous ' //&
-                                   'run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' mismatch in number of'
-             PRINT*, '             vertical levels.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for spectra ' //                 &
+                              ' from previuos run found,' //                &
+                              '&but this file cannot be extended due to' // &
+                              ' mismatch in number of' //                   &
+                              '&vertical levels.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0261', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -3105,10 +3134,11 @@
           DO  i = 1, ns
              IF ( zu(comp_spectra_level(i)) /= netcdf_data(i) )  THEN
-                PRINT*, '+++ WARNING: NetCDF file for spectra from previou' // &
-                                   's run found,'
-                PRINT*, '             but this file cannot be extended due' // &
-                                   ' to mismatch in heights'
-                PRINT*, '             of vertical levels.'
-                PRINT*, '             New file is created instead.'
+                message_string = 'NetCDF file for spectra ' //                 &
+                                 ' from previuos run found,' //                &
+                                 '&but this file cannot be extended due to' // &
+                                 ' mismatch in heights of' //                  &
+                                 '&vertical levels.' //                        &
+                                 '&New file is created instead.'
+                CALL message( 'define_netcdf_header', 'PA0262', 0, 1, 0, 6, 0 )
                 extend = .FALSE.
                 RETURN
@@ -3142,11 +3172,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for spectra from previous ' // &
-                                   'run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for spectra ' //                 &
+                              'from previuos run found,' //                 &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                & 
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0263', 0, 1, 0, 6, 0 )
              dosp_time_count = 0
              extend = .FALSE.
@@ -3196,7 +3227,8 @@
           ENDIF
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 309 )
-
-          PRINT*, '*** NetCDF file for spectra from previous run found.'
-          PRINT*, '    This file will be extended.'
+          message_string = 'NetCDF file for spectra ' //     & 
+                           'from previous run found.' //     &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0264', 0, 0, 0, 6, 0 )
 
 
@@ -3299,11 +3331,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for particles from previous ' //&
-                                   'run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for particles ' //               &
+                              'from previuos run found,' //                 &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0265', 0, 1, 0, 6, 0 )
              prt_time_count = 0
              extend = .FALSE.
@@ -3326,8 +3359,9 @@
           ENDDO
 
-          IF ( myid == 0 )  THEN
-             PRINT*, '*** NetCDF file for particles from previous run found.'
-             PRINT*, '    This file will be extended.'
-          ENDIF
+          message_string = 'NetCDF file for particles ' // & 
+                           'from previous run found.' //   &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0266', 0, 0, 0, 6, 0 )
+        
 
 
@@ -3454,9 +3488,10 @@
 
           IF ( TRIM( var_list ) /= TRIM( var_list_old ) )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for particle time series ' //&
-                                   'from previuos run found,'
-             PRINT*, '             but this file cannot be extended due to' // &
-                                   ' variable mismatch.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for particle time series ' //     &
+                              'from previuos run found,' //                  &
+                              '& but this file cannot be extended due to' // &
+                              ' variable mismatch.' //                       &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0267', 0, 1, 0, 6, 0 )
              extend = .FALSE.
              RETURN
@@ -3487,11 +3522,12 @@
 
           IF ( last_time_coordinate(1) >= simulated_time )  THEN
-             PRINT*, '+++ WARNING: NetCDF file for time series from' // &
-                                   ' previuos run found,'
-             PRINT*, '             but this file cannot be extended becaus' // &
-                                   'e the current output time'
-             PRINT*, '             is less or equal than the last output t' // &
-                                   'ime on this file.'
-             PRINT*, '             New file is created instead.'
+             message_string = 'NetCDF file for particle time series ' //    &
+                              'from previuos run found,' //                 &
+                              '&but this file cannot be extended becaus' // &
+                              'e the current output time' //                &
+                              '&is less or equal than the last output t' // &
+                              'ime on this file.' //                        &
+                              '&New file is created instead.'
+             CALL message( 'define_netcdf_header', 'PA0268', 0, 1, 0, 6, 0 )
              dopts_time_count = 0
              extend = .FALSE.
@@ -3533,12 +3569,14 @@
                                   TRIM( run_description_header ) )
           IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 411 )
-          PRINT*, '*** NetCDF file for particle time series from previous ', &
-                       'run found.'
-          PRINT*, '    This file will be extended.'
+          message_string = 'NetCDF file for particle time series ' // & 
+                           'from previous run found.' //              &
+                           '&This file will be extended.'
+          CALL message( 'define_netcdf_header', 'PA0269', 0, 0, 0, 6, 0 )
 
 
        CASE DEFAULT
 
-          PRINT*, '+++ define_netcdf_header: mode "', mode, '" not supported'
+          message_string = 'mode "' // TRIM( mode) // '" not supported'
+          CALL message( 'define_netcdf_header', 'PA0270', 0, 0, 0, 6, 0 )
 
     END SELECT
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 256)
+++ palm/trunk/SOURCE/parin.f90	(revision 257)
@@ -2,6 +2,7 @@
 
 !------------------------------------------------------------------------------!
-! Actual revisions:
+! Current revisions:
 ! -----------------
+! Output of messages replaced by message handling routine.
 ! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left, 
 ! canyon_wall_south, conserve_volume_flow_mode, dp_external, dp_level_b, 
@@ -176,13 +177,9 @@
     READ ( 11, inipar, ERR=10, END=11 )
     GOTO 12
- 10 IF ( myid == 0 )  THEN
-       PRINT*, '+++ parin: errors in \$inipar'
-       PRINT*, '           or no \$inipar-namelist found (CRAY-machines only)' 
-    ENDIF
-    CALL local_stop
- 11 IF ( myid == 0 )  THEN
-       PRINT*, '+++ parin: no \$inipar-namelist found'
-    ENDIF
-    CALL local_stop
+ 10 message_string = 'errors in \$inipar &or no \$inipar-namelist found (CRAY-machines only)'
+    CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0 )
+
+ 11 message_string = 'no \$inipar-namelist found'
+    CALL message( 'parin', 'PA0272', 1, 2, 0, 6, 0 )
 
 !
@@ -230,20 +227,14 @@
 
        IF ( nx <= 0 )  THEN
-          IF ( myid == 0 )  THEN
-             PRINT*, '+++ parin: no value or wrong value given for nx: nx=', nx
-          ENDIF
-          CALL local_stop
+          WRITE( message_string, * ) 'no value or wrong value given for nx: nx=', nx
+          CALL message( 'parin', 'PA0273', 1, 2, 0, 6, 0 )
        ENDIF
        IF ( ny <= 0 )  THEN
-          IF ( myid == 0 )  THEN
-             PRINT*, '+++ parin: no value or wrong value given for ny: ny=', ny
-          ENDIF
-          CALL local_stop
+          WRITE( message_string, * ) 'no value or wrong value given for ny: ny=', ny
+          CALL message( 'parin', 'PA0274', 1, 2, 0, 6, 0 )
        ENDIF
        IF ( nz <= 0 )  THEN
-          IF ( myid == 0 )  THEN
-             PRINT*, '+++ parin: no value or wrong value given for nz: nz=', nz
-          ENDIF
-          CALL local_stop
+          WRITE( message_string, * ) 'no value or wrong value given for nz: nz=', nz
+          CALL message( 'parin', 'PA0275', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -270,21 +261,17 @@
     RETURN
 
- 30 IF ( myid == 0 )  THEN
-       PRINT*, '+++ parin: WARNING: local file ENVPAR not found'
-       PRINT*, '           some variables for steering may not be properly set'
-    ENDIF
+ 30 message_string = 'local file ENVPAR not found' // &
+                     '&some variables for steering may not be properly set'
+    CALL message( 'parin', 'PA0276', 0, 1, 0, 6, 0 )
     RETURN
 
- 31 IF ( myid == 0 )  THEN
-       PRINT*, '+++ parin: WARNING: errors in local file ENVPAR'
-       PRINT*, '           some variables for steering may not be properly set'
-    ENDIF
+ 31 message_string = 'errors in local file ENVPAR' // &
+                     '&some variables for steering may not be properly set'
+    CALL message( 'parin', 'PA0277', 0, 1, 0, 6, 0 )
     RETURN
 
- 32 IF ( myid == 0 )  THEN
-       PRINT*, '+++ parin: WARNING: no envpar-NAMELIST found in local file ', &
-                           'ENVPAR'
-       PRINT*, '           some variables for steering may not be properly set'
-    ENDIF
+ 32 message_string = 'no envpar-NAMELIST found in local file ENVPAR'  // &
+                     '&some variables for steering may not be properly set'
+    CALL message( 'parin', 'PA0278', 0, 1, 0, 6, 0 )
 
  END SUBROUTINE parin
Index: palm/trunk/SOURCE/plant_canopy_model.f90
===================================================================
--- palm/trunk/SOURCE/plant_canopy_model.f90	(revision 256)
+++ palm/trunk/SOURCE/plant_canopy_model.f90	(revision 257)
@@ -2,7 +2,8 @@
 
 !------------------------------------------------------------------------------!
-! Actual revisions:
+! Current revisions:
 ! -----------------
-! 
+! Output of messages replaced by message handling routine.
+!
 !
 ! Bugfix: remove IF statement in plant_canopy_model_ij
@@ -187,7 +188,6 @@
           CASE DEFAULT
 
-             IF ( myid == 0 )  PRINT*,'+++ pcm:  wrong component: ', &
-                                      component
-             CALL local_stop
+             WRITE( message_string, * ) 'wrong component: ', component
+             CALL message( 'plant_canopy_model', 'PA0279', 1, 2, 0, 6, 0 ) 
 
        END SELECT
@@ -324,7 +324,6 @@
        CASE DEFAULT
 
-          IF ( myid == 0 )  PRINT*,'+++ pcm:  wrong component: ', &
-                                      component
-          CALL local_stop
+          WRITE( message_string, * ) 'wrong component: ', component
+          CALL message( 'plant_canopy_model', 'PA0279', 1, 2, 0, 6, 0 ) 
 
        END SELECT
Index: palm/trunk/SOURCE/poisfft_hybrid.f90
===================================================================
--- palm/trunk/SOURCE/poisfft_hybrid.f90	(revision 256)
+++ palm/trunk/SOURCE/poisfft_hybrid.f90	(revision 257)
@@ -2,7 +2,8 @@
 !------------------------------------------------------------------------------
 ! 
-! Actual revisions: 
+! Current revisions: 
 ! ----------------- 
-! 
+! Output of messages replaced by message handling routine.
+!
 !
 ! Former revisions: 
@@ -145,7 +146,8 @@
        CALL LOCAL_GETENV( 'OMP_NUM_THREADS', 15, cdummy, idummy )
        READ ( cdummy, '(I8)' )  n_omp_threads
-       IF ( myid == 0  .AND.  n_omp_threads > 1 )  THEN
-          PRINT*, '*** poisfft_hybrid_ini:  Number of OpenMP threads = ', &
-                  n_omp_threads
+       IF ( n_omp_threads > 1 )  THEN
+          WRITE( message_string, * ) 'Number of OpenMP threads = ', &
+                                     n_omp_threads
+          CALL message( 'poisfft_hybrid_ini', 'PA0280', 0, 0, 0, 6, 0 ) 
        ENDIF
 #else
@@ -175,11 +177,16 @@
                 ENDIF
 
-                IF ( myid == 0  .AND.  tasks_per_logical_node > -1 )  THEN
-                   PRINT*, '*** poisfft_hybrid_ini:  running optimized ', &
-                           'multinode version'
-                   PRINT*, '    switch_per_lpar        = ', switch_per_lpar
-                   PRINT*, '    tasks_per_lpar         = ', tasks_per_node
-                   PRINT*, '    tasks_per_logical_node = ', &
-                                                         tasks_per_logical_node
+                IF ( tasks_per_logical_node > -1 )  THEN
+
+                   WRITE( message_string, * ) 'running optimized ',         &
+                                              'multinode version',          &
+                                              '&switch_per_lpar        = ', &
+                                              switch_per_lpar,              &
+                                              '&tasks_per_lpar         = ', &
+                                              tasks_per_node,               &
+                                              'tasks_per_logical_node = ',  &
+                                              tasks_per_logical_node
+                   CALL message( 'poisfft_hybrid_ini', 'PA0281', 0, 0, 0, 6, 0 ) 
+
                 ENDIF
 
@@ -215,6 +222,6 @@
 !                     tasks_per_logical_node
 #else
-          PRINT*, '+++ poisfft_hybrid_ini: parallel environment (MPI) required'
-          CALL local_stop
+          message_string = 'parallel environment (MPI) required'
+          CALL message( 'poisfft_hybrid_ini', 'PA0282', 1, 2, 0, 6, 0 )
 #endif
        ENDIF
Index: palm/trunk/SOURCE/poismg.f90
===================================================================
--- palm/trunk/SOURCE/poismg.f90	(revision 256)
+++ palm/trunk/SOURCE/poismg.f90	(revision 257)
@@ -6,7 +6,8 @@
 !            is required.
 !
-! Actual revisions:
+! Current revisions:
 ! -----------------
-! 
+! Output of messages replaced by message handling routine.
+!
 !
 ! Former revisions:
@@ -117,8 +118,6 @@
 !--    of insufficient convergence
        IF ( mgcycles > 1000  .AND.  mg_cycles == -1 )  THEN
-          IF ( myid == 0 )  THEN
-             PRINT*, '+++ poismg: no sufficient convergence within 1000 cycles'
-          ENDIF
-          CALL local_stop 
+          message_string = 'no sufficient convergence within 1000 cycles'
+          CALL message( 'poismg', 'PA0283', 1, 2, 0, 6, 0 )
        ENDIF
 
Index: palm/trunk/SOURCE/read_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/read_3d_binary.f90	(revision 256)
+++ palm/trunk/SOURCE/read_3d_binary.f90	(revision 257)
@@ -2,7 +2,8 @@
 
 !------------------------------------------------------------------------------!
-! Actual revisions:
+! Current revisions:
 ! -----------------
-! 
+! Output of messages replaced by message handling routine.
+!
 !
 ! Former revisions:
@@ -138,11 +139,8 @@
 !
 !--             Array bound exceeded
-                PRINT*, '+++ read_3d_binary: data from subdomain of previous', &
-                             ' run mapped more than 1000 times'
-#if defined( __parallel )
-                CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-                STOP
-#endif
+                message_string = 'data from subdomain of previous' // &
+                                 ' run mapped more than 1000 times'
+                CALL message( 'read_3d_binary', 'PA0284', 2, 2, 0, 6, 0 )
+ 
              ENDIF
 
@@ -206,7 +204,8 @@
     IF ( files_to_be_opened /= 1  .OR.  numprocs /= numprocs_previous_run ) &
     THEN
-       PRINT*, '*** number of PEs or virtual PE-grid changed in restart run'
-       PRINT*, '    PE', myid, ' will read from files ', &
-               file_list(1:files_to_be_opened)
+       WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed in ',     &
+                                  'restart run&  PE', myid, ' will read from files ', &
+                                  file_list(1:files_to_be_opened)
+       CALL message( 'read_3d_binary', 'PA0285', 0, 0, 0, 6, 0 )
     ENDIF
 
@@ -238,13 +237,9 @@
        binary_version = '3.1'
        IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
-          IF ( myid == 0 )  THEN
-             PRINT*, '+++ init_3d_model: version mismatch concerning data ', &
-                     'from prior run'
-             PRINT*, '        version on file    = "', TRIM( version_on_file ),&
-                     '"'
-             PRINT*, '        version in program = "', TRIM( binary_version ), &
-                     '"'
-          ENDIF
-          CALL local_stop
+          WRITE( message_string, * ) 'version mismatch concerning data ',                    &
+                                     'from prior run',                                       &
+                                     '&version on file    = "', TRIM( version_on_file ), '"',&
+                                     '&version in program = "', TRIM( binary_version ), '"'
+          CALL message( 'read_3d_binary', 'PA0286', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -256,69 +251,54 @@
 
        IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) )  THEN
-          PRINT*, '+++ read_3d_binary: problem with index bound nxl on ', &
-                       ' restart file "', myid_char, '"'
-          PRINT*, '                    nxl = ', nxl_on_file, ' but it should be'
-          PRINT*, '                    = ', hor_index_bounds_previous_run(1,j)
-          PRINT*, '                    from the index bound information array'
-#if defined( __parallel )
-          CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-          CALL local_stop
-#endif
+          WRITE( message_string, * ) 'problem with index bound nxl on ',          &
+                                     'restart file "', myid_char, '"',            &
+                                     '&nxl = ', nxl_on_file, ' but it should be', &
+                                     '&= ', hor_index_bounds_previous_run(1,j),   &
+                                     '&from the index bound information array'
+          CALL message( 'read_3d_binary', 'PA0287', 2, 2, 0, 6, 0 )
        ENDIF
 
        IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) )  THEN
-          PRINT*, '+++ read_3d_binary: problem with index bound nxr on ', &
-                       ' restart file "', myid_char, '"'
-          PRINT*, '                    nxr = ', nxr_on_file, ' but it should be'
-          PRINT*, '                    = ', hor_index_bounds_previous_run(2,j)
-          PRINT*, '                    from the index bound information array'
-#if defined( __parallel )
-          CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-          CALL local_stop
-#endif
+           WRITE( message_string, * ) 'problem with index bound nxr on ',          &
+                                      'restart file "', myid_char, '"'  ,          &
+                                      '&nxr = ', nxr_on_file, ' but it should be', &
+                                      '&= ', hor_index_bounds_previous_run(2,j),   &
+                                      '&from the index bound information array' 
+          CALL message( 'read_3d_binary', 'PA0288', 2, 2, 0, 6, 0 )
+
        ENDIF
 
        IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) )  THEN
-          PRINT*, '+++ read_3d_binary: problem with index bound nys on ', &
-                       ' restart file "', myid_char, '"'
-          PRINT*, '                    nys = ', nys_on_file, ' but it should be'
-          PRINT*, '                    = ', hor_index_bounds_previous_run(3,j)
-          PRINT*, '                    from the index bound information array'
-#if defined( __parallel )
-          CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-          CALL local_stop
-#endif
+          WRITE( message_string, * ) 'problem with index bound nys on ',          &
+                                     'restart file "', myid_char, '"',            &
+                                     '&nys = ', nys_on_file, ' but it should be', &
+                                     '&= ', hor_index_bounds_previous_run(3,j),   &
+                                     '&from the index bound information array'
+          CALL message( 'read_3d_binary', 'PA0289', 2, 2, 0, 6, 0 ) 
        ENDIF
 
        IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) )  THEN
-          PRINT*, '+++ read_3d_binary: problem with index bound nyn on ', &
-                       ' restart file "', myid_char, '"'
-          PRINT*, '                    nyn = ', nyn_on_file, ' but it should be'
-          PRINT*, '                    = ', hor_index_bounds_previous_run(4,j)
-          PRINT*, '                    from the index bound information array'
-#if defined( __parallel )
-          CALL MPI_ABORT( comm2d, 9999, ierr )
-#else
-          CALL local_stop
-#endif
+          WRITE( message_string, * ) 'problem with index bound nyn on ',          &
+                                     'restart file "', myid_char, '"',            &
+                                     '&nyn = ', nyn_on_file, ' but it should be', &
+                                     '&= ', hor_index_bounds_previous_run(4,j),   &
+                                     '&from the index bound information array'
+          CALL message( 'read_3d_binary', 'PA0290', 2, 2, 0, 6, 0 ) 
        ENDIF
 
        IF ( nzb_on_file /= nzb )  THEN
-          PRINT*, '+++ read_3d_binary: mismatch between actual data and data '
-          PRINT*, '                    from prior run on PE ', myid
-          PRINT*, '                    nzb on file = ', nzb_on_file
-          PRINT*, '                    nzb         = ', nzb
-          CALL local_stop
+          WRITE( message_string, * ) 'mismatch between actual data and data ', &
+                                     '&from prior run on PE ', myid,           &
+                                     '&nzb on file = ', nzb_on_file,           &
+                                     '&nzb         = ', nzb
+          CALL message( 'read_3d_binary', 'PA0291', 1, 2, 0, 6, 0 )  
        ENDIF
 
        IF ( nzt_on_file /= nzt )  THEN
-          PRINT*, '+++ read_3d_binary: mismatch between actual data and data '
-          PRINT*, '                    from prior run on PE ', myid
-          PRINT*, '                    nzt on file = ', nzt_on_file
-          PRINT*, '                    nzt         = ', nzt
-          CALL local_stop
+          WRITE( message_string, * ) 'mismatch between actual data and data ', &
+                                     '&from prior run on PE ', myid,           &
+                                     '&nzt on file = ', nzt_on_file,           &
+                                     '&nzt         = ', nzt
+          CALL message( 'read_3d_binary', 'PA0292', 1, 2, 0, 6, 0 )  
        ENDIF
 
@@ -634,10 +614,9 @@
                    IF ( k == 1 )  THEN
                       IF ( nx_on_file /= nx )  THEN
-                         IF ( myid == 0 )  THEN
-                            PRINT*, '+++ WARNING: read_3d_binary: spectrum_x', &
-                                         ' on restart file ignored because'
-                            PRINT*, '    total numbers of grid points (nx) ', &
-                                         'do not match'
-                         ENDIF
+                         message_string = 'read_3d_binary: spectrum_x ' //         &
+                                          'on restart file ignored because' //     &
+                                          '&total numbers of grid points (nx) ' // &
+                                          'do not match'
+                         CALL message( 'read_3d_binary', 'PA0293', 0, 1, 0, 6, 0 )  
                          READ ( 13 )  rdummy
                       ELSE
@@ -649,10 +628,9 @@
                    IF ( k == 1 )  THEN
                       IF ( ny_on_file /= ny )  THEN
-                         IF ( myid == 0 )  THEN
-                            PRINT*, '+++ WARNING: read_3d_binary: spectrum_y', &
-                                         ' on restart file ignored because'
-                            PRINT*, '    total numbers of grid points (ny) ', &
-                                         'do not match'
-                         ENDIF
+                         message_string = 'read_3d_binary: spectrum_y ' //        &
+                                          'on restart file ignored because' //    &
+                                          '&total numbers of grid points (ny) '// &
+                                          'do not match'
+                         CALL message( 'read_3d_binary', 'PA0294', 0, 1, 0, 6, 0 )  
                          READ ( 13 )  rdummy
                       ELSE
@@ -944,9 +922,9 @@
 
                 CASE DEFAULT
-                   PRINT*, '+++ read_3d_binary: unknown field named "', &
-                           TRIM( field_chr ), '" found in'
-                   PRINT*, '                    data from prior run on PE ',myid
-                   CALL local_stop
-
+                   WRITE( message_string, * ) 'unknown field named "', &
+                                              TRIM( field_chr ), '" found in', &
+                                              '&data from prior run on PE ',myid
+                    CALL message( 'read_3d_binary', 'PA0295', 1, 2, 0, 6, 0 )  
+                   
              END SELECT
 
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 256)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 257)
@@ -2,6 +2,7 @@
 
 !------------------------------------------------------------------------------!
-! Actual revisions:
+! Current revisions:
 ! -----------------
+! Output of messages replaced by message handling routine.
 ! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left, 
 ! canyon_wall_south, conserve_volume_flow_mode, dp_external, dp_level_b, 
@@ -84,13 +85,11 @@
     binary_version = '3.4'
     IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
-       IF ( myid == 0 )  THEN
-          PRINT*, '+++ read_var_list: version mismatch concerning control', &
-                  ' variables'
-          PRINT*, '                   version on file    = "', &
-                  TRIM( version_on_file ), '"'
-          PRINT*, '                   version on program = "', &
-                  TRIM( binary_version ), '"'
-       ENDIF
-       CALL local_stop
+       WRITE( message_string, * ) 'version mismatch concerning control ', &
+                                  'variables',                            &
+                                  '&version on file    = "',              &
+                                  TRIM( version_on_file ), '"',           &
+                                  '&version on program = "',              &
+                                  TRIM( binary_version ), '"'
+       CALL message( 'read_var_list', 'PA0296', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -100,7 +99,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
-       PRINT*, '+++ read_var_list: numprocs not found in data from prior run', &
-                    ' on PE ', myid
-       CALL local_stop
+       WRITE( message_string, * ) 'numprocs not found in data from prior run ', &
+                                  'on PE ', myid
+       CALL message( 'read_var_list', 'PA0297', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  numprocs_previous_run
@@ -112,7 +111,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
-       PRINT*, '+++ read_var_list: hor_index_bounds not found in data from ', &
-                    'prior run on PE ', myid
-       CALL local_stop
+       WRITE( message_string, * ) 'hor_index_bounds not found in data from ', &
+                                  'prior run on PE ', myid
+       CALL message( 'read_var_list', 'PA0298', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  hor_index_bounds_previous_run
@@ -124,7 +123,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'nz' )  THEN
-       PRINT*, '+++ read_var_list: nz not found in data from prior run on PE ',&
-               myid
-       CALL local_stop
+       WRITE( message_string, * ) 'nz not found in data from prior run on PE ',&
+                                  myid
+       CALL message( 'read_var_list', 'PA0299', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  nz
@@ -132,7 +131,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'max_pr_user' )  THEN
-       PRINT*, '+++ read_var_list: max_pr_user not found in data from ', &
+       WRITE( message_string, * ) 'max_pr_user not found in data from ', &
                     'prior run on PE ', myid
-       CALL local_stop
+       CALL message( 'read_var_list', 'PA0300', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  max_pr_user    ! This value is checked against the number of
@@ -142,7 +141,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'statistic_regions' )  THEN
-       PRINT*, '+++ read_var_list: statistic_regions not found in data from ', &
+       WRITE( message_string, * ) 'statistic_regions not found in data from ', &
                     'prior run on PE ', myid
-       CALL local_stop
+       CALL message( 'read_var_list', 'PA0301', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  statistic_regions
@@ -579,8 +578,8 @@
 
           CASE DEFAULT
-             PRINT*, '+++ read_var_list: unknown variable named "', &
-                     TRIM( variable_chr ), '" found in'
-             PRINT*, '                   data from prior run on PE ', myid
-             CALL local_stop
+             WRITE( message_string, * ) 'unknown variable named "',         &
+                                        TRIM( variable_chr ), '" found in', &
+                                        ' data from prior run on PE ', myid 
+             CALL message( 'read_var_list', 'PA0302', 1, 2, 0, 6, 0 )
         END SELECT
 !
@@ -634,7 +633,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
-       PRINT*, '+++ read_parts_of_var_list: numprocs not found in data from ', &
-                    'prior run on PE ', myid
-       CALL local_stop
+       WRITE( message_string, * ) 'numprocs not found in data from prior run ', &
+                                  'on PE ', myid
+       CALL message( 'read_parts_of_var_list', 'PA0297', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  numprocs_previous_run
@@ -646,7 +645,7 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
-       PRINT*, '+++ read_parts_of_var_list: hor_index_bounds not found in da', &
-                    'ta from prior run on PE ', myid
-       CALL local_stop
+       WRITE( message_string, * ) 'hor_index_bounds not found in data from ', &
+                                  'prior run on PE ', myid
+       CALL message( 'read_parts_of_var_list', 'PA0298', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  hor_index_bounds_previous_run
@@ -658,34 +657,30 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'nz' )  THEN
-       PRINT*, '+++ read_parts_of_var_list: nz not found in restart data file'
-       CALL local_stop
+       message_string = 'nz not found in restart data file'
+       CALL message( 'read_parts_of_var_list', 'PA0303', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  nz_on_file
     IF ( nz_on_file /= nz )  THEN
-       IF ( myid == 0 )  THEN
-          PRINT*, '+++ read_parts_of_var_list: mismatch concerning number of', &
-                       ' gridpoints along z'
-          PRINT*, '                   nz on file    = "', nz_on_file, '"'
-          PRINT*, '                   nz from run   = "', nz, '"'
-       ENDIF
-       CALL local_stop
+       WRITE( message_string, * ) 'mismatch concerning number of ',      &
+                                 'gridpoints along z',                  &
+                                 '&nz on file    = "', nz_on_file, '"', &
+                                 '&nz from run   = "', nz, '"'
+       CALL message( 'read_parts_of_var_list', 'PA0304', 1, 2, 0, 6, 0 )
     ENDIF
 
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'max_pr_user' )  THEN
-       PRINT*, '+++ read_parts_of_var_list: max_pr_user not found in restart', &
-                    ' data file'
-       CALL local_stop
+       message_string = 'max_pr_user not found in restart data file'
+       CALL message( 'read_parts_of_var_list', 'PA0305', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  max_pr_user_on_file
     IF ( max_pr_user_on_file /= max_pr_user )  THEN
-       IF ( myid == 0 )  THEN
-          PRINT*, '+++ read_parts_of_var_list: number of user profiles on res', &
-                       'tart data file differs from the current run'
-          PRINT*, '                   max_pr_user on file    = "', &
-                  max_pr_user_on_file, '"'
-          PRINT*, '                   max_pr_user from run   = "', &
-                  max_pr_user, '"'
-       ENDIF
+       WRITE( message_string, * ) 'number of user profiles on res', &
+                                  'tart data file differs from the current run', &
+                                  '&max_pr_user on file    = "', &
+                                  max_pr_user_on_file, '"', &
+                                  '&max_pr_user from run   = "', &
+                                  max_pr_user, '"'
+       CALL message( 'read_parts_of_var_list', 'PA0306', 0, 0, 0, 6, 0 )
        tmp_mpru = MIN( max_pr_user_on_file, max_pr_user )
     ELSE
@@ -695,19 +690,17 @@
     READ ( 13 )  variable_chr
     IF ( TRIM( variable_chr ) /= 'statistic_regions' )  THEN
-       PRINT*, '+++ read_parts_of_var_list: statistic_regions not found in ', &
-                    'restart data file'
-       CALL local_stop
+       message_string = 'statistic_regions not found in restart data file'
+       CALL message( 'read_parts_of_var_list', 'PA0307', 1, 2, 0, 6, 0 )
     ENDIF
     READ ( 13 )  statistic_regions_on_file
     IF ( statistic_regions_on_file /= statistic_regions )  THEN
-       IF ( myid == 0 )  THEN
-          PRINT*, '+++ read_parts_of_var_list: WARNING: statistic regions on', &
-                       ' restart data file differ from the current run'
-          PRINT*, '                            statistic regions on file    = "', &
-                  statistic_regions_on_file, '"'
-          PRINT*, '                            statistic regions from run   = "', &
-                  statistic_regions, '"'
-          PRINT*, '                            statistic data may be lost!'
-       ENDIF
+       WRITE( message_string, * ) 'statistic regions on restart data file differ ',& 
+                                  'from the current run',&
+                                  '&statistic regions on file    = "', &
+                                  statistic_regions_on_file, '"', &
+                                  '&statistic regions from run   = "', &
+                                   statistic_regions, '"', &
+                                  '&statistic data may be lost!'
+       CALL message( 'read_parts_of_var_list', 'PA0308', 0, 1, 0, 6, 0 )
        tmp_sr = MIN( statistic_regions_on_file, statistic_regions )
     ELSE
@@ -731,9 +724,9 @@
           CASE ( 'average_count_pr' )
              READ ( 13 )  average_count_pr
-             IF ( average_count_pr /= 0  .AND.  myid == 0 )  THEN
-                PRINT*, '+++ read_parts_of_var_list:'
-                PRINT*, '    WARNING: inflow profiles not temporally averaged.'
-                PRINT*, '    Averaging will be done now using ', &
-                        average_count_pr, ' samples.'
+             IF ( average_count_pr /= 0 )  THEN
+                WRITE( message_string, * ) 'inflow profiles not temporally averaged.',&
+                                           '&Averaging will be done now using ',      &
+                                           average_count_pr, ' samples.'
+                CALL message( 'read_parts_of_var_list', 'PA0309', 0, 1, 0, 6, 0 )
              ENDIF
 
