Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 3035)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 3045)
@@ -25,9 +25,12 @@
 ! -----------------
 ! $Id$
+! Error messages revised
+! 
+! 3035 2018-05-24 09:35:20Z schwenkel
 ! Add option to initialize warm air bubble close to surface
-! 
+!
 ! 3034 2018-05-24 08:41:20Z raasch
 ! bugfix: check that initializing_actions has been set
-! 
+!
 ! 2980 2018-04-17 15:19:27Z suehring
 ! Further improvement for spinup checks.
@@ -751,9 +754,10 @@
 !
 !-- Check the coupling mode
-!> @todo Check if any queries for other coupling modes (e.g. precursor_ocean) are missing
-    IF ( coupling_mode /= 'uncoupled'            .AND.  &
-         coupling_mode /= 'vnested_crse'         .AND.  &
-         coupling_mode /= 'vnested_fine'         .AND.  &
-         coupling_mode /= 'atmosphere_to_ocean'  .AND.  &
+    IF ( coupling_mode /= 'uncoupled'            .AND.                         &
+         coupling_mode /= 'precursor_atmos'      .AND.                         &
+         coupling_mode /= 'precursor_ocean'      .AND.                         &
+         coupling_mode /= 'vnested_crse'         .AND.                         &
+         coupling_mode /= 'vnested_fine'         .AND.                         &
+         coupling_mode /= 'atmosphere_to_ocean'  .AND.                         &
          coupling_mode /= 'ocean_to_atmosphere' )  THEN
        message_string = 'illegal coupling mode: ' // TRIM( coupling_mode )
@@ -764,6 +768,6 @@
 !-- Check if humidity is set to TRUE in case of the atmospheric run (for coupled runs)
     IF ( coupling_mode == 'atmosphere_to_ocean' .AND. .NOT. humidity) THEN
-       message_string = ' Humidity has to be set to .T. in the _p3d file for ' //      &
-                        'coupled runs between ocean and atmosphere.'
+       message_string = ' Humidity has to be set to .T. in the _p3d file ' //  &
+                        'for coupled runs between ocean and atmosphere.'
        CALL message( 'check_parameters', 'PA0476', 1, 2, 0, 6, 0 )
     ENDIF
@@ -771,6 +775,8 @@
 !
 !-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny
-    IF ( coupling_mode /= 'uncoupled'  .AND.                                   &
-         coupling_mode(1:8) /= 'vnested_' )  THEN
+    IF ( coupling_mode /= 'uncoupled'       .AND.                              &
+         coupling_mode(1:8) /= 'vnested_'   .AND.                              &
+         coupling_mode /= 'precursor_atmos' .AND.                              &
+         coupling_mode /= 'precursor_ocean' )  THEN
 
        IF ( dt_coupling == 9999999.9_wp )  THEN
@@ -914,5 +920,5 @@
              WRITE( message_string, * ) 'coupling mode "',                     &
                    TRIM( coupling_mode ),                                      &
-             '": nx+1 in ocean is not divisible by nx+1 in', &
+             '": nx+1 in ocean is not divisible by nx+1 in',                   &
              ' atmosphere without remainder'
              CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 )
@@ -1054,7 +1060,7 @@
 !
 !-- Check approximation
-    IF ( TRIM( approximation ) /= 'boussinesq'   .AND.   &
+    IF ( TRIM( approximation ) /= 'boussinesq'   .AND.                         &
          TRIM( approximation ) /= 'anelastic' )  THEN
-       message_string = 'unknown approximation: approximation = "' //    &
+       message_string = 'unknown approximation: approximation = "' //          &
                         TRIM( approximation ) // '"'
        CALL message( 'check_parameters', 'PA0446', 1, 2, 0, 6, 0 )
@@ -1063,21 +1069,21 @@
 !
 !-- Check approximation requirements
-    IF ( TRIM( approximation ) == 'anelastic'   .AND.   &
+    IF ( TRIM( approximation ) == 'anelastic'   .AND.                          &
          TRIM( momentum_advec ) /= 'ws-scheme' )  THEN
-       message_string = 'Anelastic approximation requires: ' //                &
+       message_string = 'Anelastic approximation requires ' //                 &
                         'momentum_advec = "ws-scheme"'
        CALL message( 'check_parameters', 'PA0447', 1, 2, 0, 6, 0 )
     ENDIF
-    IF ( TRIM( approximation ) == 'anelastic'   .AND.   &
+    IF ( TRIM( approximation ) == 'anelastic'   .AND.                          &
          TRIM( psolver ) == 'multigrid' )  THEN
-       message_string = 'Anelastic approximation currently only supports: ' // &
-                        'psolver = "poisfft", ' // &
-                        'psolver = "sor" and ' // &
+       message_string = 'Anelastic approximation currently only supports ' //  &
+                        'psolver = "poisfft", ' //                             &
+                        'psolver = "sor" and ' //                              &
                         'psolver = "multigrid_noopt"'
        CALL message( 'check_parameters', 'PA0448', 1, 2, 0, 6, 0 )
     ENDIF
-    IF ( TRIM( approximation ) == 'anelastic'   .AND.   &
+    IF ( TRIM( approximation ) == 'anelastic'   .AND.                          &
          conserve_volume_flow )  THEN
-       message_string = 'Anelastic approximation is not allowed with:' //      &
+       message_string = 'Anelastic approximation is not allowed with ' //      &
                         'conserve_volume_flow = .TRUE.'
        CALL message( 'check_parameters', 'PA0449', 1, 2, 0, 6, 0 )
@@ -1086,6 +1092,6 @@
 !
 !-- Check flux input mode
-    IF ( TRIM( flux_input_mode ) /= 'dynamic'    .AND.   &
-         TRIM( flux_input_mode ) /= 'kinematic'  .AND.   &
+    IF ( TRIM( flux_input_mode ) /= 'dynamic'    .AND.                         &
+         TRIM( flux_input_mode ) /= 'kinematic'  .AND.                         &
          TRIM( flux_input_mode ) /= 'approximation-specific' )  THEN
        message_string = 'unknown flux input mode: flux_input_mode = "' //      &
@@ -1104,6 +1110,6 @@
 !
 !-- Check flux output mode
-    IF ( TRIM( flux_output_mode ) /= 'dynamic'    .AND.   &
-         TRIM( flux_output_mode ) /= 'kinematic'  .AND.   &
+    IF ( TRIM( flux_output_mode ) /= 'dynamic'    .AND.                        &
+         TRIM( flux_output_mode ) /= 'kinematic'  .AND.                        &
          TRIM( flux_output_mode ) /= 'approximation-specific' )  THEN
        message_string = 'unknown flux output mode: flux_output_mode = "' //    &
@@ -1248,5 +1254,7 @@
 !
 !-- Advection schemes:
-    IF ( momentum_advec /= 'pw-scheme'  .AND.  momentum_advec /= 'ws-scheme' ) &
+    IF ( momentum_advec /= 'pw-scheme'  .AND.                                  &  
+         momentum_advec /= 'ws-scheme'  .AND.                                  &
+         momentum_advec /= 'up-scheme' )                                       &
     THEN
        message_string = 'unknown advection scheme: momentum_advec = "' //      &
@@ -1259,10 +1267,10 @@
     THEN
        message_string = 'momentum_advec or scalar_advec = "'                   &
-         // TRIM( momentum_advec ) // '" is not allowed with timestep_scheme = "' // &
-         TRIM( timestep_scheme ) // '"'
+         // TRIM( momentum_advec ) // '" is not allowed with ' //              &
+         'timestep_scheme = "' // TRIM( timestep_scheme ) // '"'
        CALL message( 'check_parameters', 'PA0023', 1, 2, 0, 6, 0 )
     ENDIF
     IF ( scalar_advec /= 'pw-scheme'  .AND.  scalar_advec /= 'ws-scheme' .AND. &
-         scalar_advec /= 'bc-scheme' )                                         &
+         scalar_advec /= 'bc-scheme' .AND. scalar_advec /= 'up-scheme' )       &
     THEN
        message_string = 'unknown advection scheme: scalar_advec = "' //        &
@@ -1273,6 +1281,6 @@
     THEN
        message_string = 'advection_scheme scalar_advec = "'                    &
-         // TRIM( scalar_advec ) // '" not implemented for & loop_optimization = "' // &
-         TRIM( loop_optimization ) // '"'
+         // TRIM( scalar_advec ) // '" not implemented for ' //                &
+         'loop_optimization = "' // TRIM( loop_optimization ) // '"'
        CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 )
     ENDIF
@@ -1325,5 +1333,5 @@
 !-- Check for proper settings for microphysics
     IF ( cloud_physics  .AND.  cloud_droplets )  THEN
-       message_string = 'cloud_physics = .TRUE. is not allowed with ' //  &
+       message_string = 'cloud_physics = .TRUE. is not allowed with ' //       &
                         'cloud_droplets = .TRUE.'
        CALL message( 'check_parameters', 'PA0442', 1, 2, 0, 6, 0 )
@@ -1355,5 +1363,5 @@
     IF ( TRIM( initializing_actions ) == '' )  THEN
        message_string = 'no value specified for initializing_actions'
-       CALL message( 'check_parameters', 'PA0017', 1, 2, 0, 6, 0 )
+       CALL message( 'check_parameters', 'PA0149', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1373,5 +1381,5 @@
 
              CASE DEFAULT
-                message_string = 'initializing_actions = "' //                 &
+                message_string = 'initializing_action = "' //                  &
                                  TRIM( action ) // '" unknown or not allowed'
                 CALL message( 'check_parameters', 'PA0030', 1, 2, 0, 6, 0 )
@@ -1472,14 +1480,4 @@
     IF ( large_scale_forcing  .OR.  nudging )  CALL lsf_nudging_check_parameters
 
-
-
-    IF ( .NOT. ( loop_optimization == 'cache'  .OR.                            &
-                 loop_optimization == 'vector' )                               &
-         .AND.  cloud_physics  .AND.  microphysics_seifert )  THEN
-       message_string = 'cloud_scheme = seifert_beheng requires ' //           &
-                        'loop_optimization = "cache" or "vector"'
-       CALL message( 'check_parameters', 'PA0362', 1, 2, 0, 6, 0 )
-    ENDIF
-
 !
 !-- In case of no model continuation run, check initialising parameters and
@@ -1825,5 +1823,5 @@
 !-- Check time step and cfl_factor
     IF ( dt /= -1.0_wp )  THEN
-       IF ( dt <= 0.0_wp  .AND.  dt /= -1.0_wp )  THEN
+       IF ( dt <= 0.0_wp )  THEN
           WRITE( message_string, * ) 'dt = ', dt , ' <= 0.0'
           CALL message( 'check_parameters', 'PA0044', 1, 2, 0, 6, 0 )
@@ -1844,5 +1842,5 @@
        ELSE
           WRITE( message_string, * ) 'cfl_factor = ', cfl_factor,              &
-                 ' out of range & 0.0 < cfl_factor <= 1.0 is required'
+                 ' out of range 0.0 < cfl_factor <= 1.0 is required'
           CALL message( 'check_parameters', 'PA0045', 1, 2, 0, 6, 0 )
        ENDIF
@@ -1887,6 +1885,6 @@
           CALL message( 'check_parameters', 'PA0047', 1, 2, 0, 6, 0 )
        ELSE
-          message_string = 'variable translation speed used for galilei-' //   &
-             'transformation, which may cause & instabilities in stably ' //   &
+          message_string = 'variable translation speed used for Galilei-' //   &
+             'transformation, which may cause instabilities in stably ' //     &
              'stratified regions'
           CALL message( 'check_parameters', 'PA0048', 0, 1, 0, 6, 0 )
@@ -2064,5 +2062,5 @@
          surface_heatflux /= 0.0_wp )  THEN
        message_string = 'boundary_condition: bc_pt_b = "' // TRIM( bc_pt_b ) //&
-                        '& is not allowed with constant_heatflux = .TRUE.'
+                        'is not allowed with constant_heatflux = .TRUE.'
        CALL message( 'check_parameters', 'PA0065', 1, 2, 0, 6, 0 )
     ENDIF
@@ -2154,7 +2152,7 @@
     IF ( passive_scalar )  THEN
 
-       IF ( ANY( wall_scalarflux /= 0.0_wp )  .AND.                        &
+       IF ( ANY( wall_scalarflux /= 0.0_wp )  .AND.                            &
             surface_scalarflux == 9999999.9_wp )  THEN
-          message_string = 'wall_scalarflux additionally requires ' //     &
+          message_string = 'wall_scalarflux additionally requires ' //         &
                            'setting of surface_scalarflux'
           CALL message( 'check_parameters', 'PA0445', 1, 2, 0, 6, 0 )
@@ -2326,5 +2324,6 @@
     IF ( averaging_interval > dt_data_output_av )  THEN
        WRITE( message_string, * )  'averaging_interval = ',                    &
-             averaging_interval, ' must be <= dt_data_output = ', dt_data_output
+             averaging_interval, ' must be <= dt_data_output_av = ',           &
+             dt_data_output_av
        CALL message( 'check_parameters', 'PA0085', 1, 2, 0, 6, 0 )
     ENDIF
@@ -2549,5 +2548,5 @@
           CASE ( 'sa', '#sa' )
              IF ( .NOT. ocean )  THEN
-                message_string = 'data_output_pr = ' // &
+                message_string = 'data_output_pr = ' //                        &
                                  TRIM( data_output_pr(i) ) // ' is not imp' // &
                                  'lemented for ocean = .FALSE.'
@@ -2622,5 +2621,5 @@
           CASE ( 'q', '#q' )
              IF ( .NOT. humidity )  THEN
-                message_string = 'data_output_pr = ' // &
+                message_string = 'data_output_pr = ' //                        &
                                  TRIM( data_output_pr(i) ) // ' is not imp' // &
                                  'lemented for humidity = .FALSE.'
@@ -2807,5 +2806,5 @@
                 message_string = 'data_output_pr = ' //                        &
                                  TRIM( data_output_pr(i) ) // ' is not imp' // &
-                                 'lemented for cloud_physics = .FALSE. an&' // &
+                                 'lemented for cloud_physics = .FALSE. an'  // &
                                  'd humidity = .FALSE.'
                 CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 )
@@ -2825,5 +2824,5 @@
                 message_string = 'data_output_pr = ' //                        &
                                  TRIM( data_output_pr(i) ) // ' is not imp' // &
-                                 'lemented for cloud_physics = .FALSE. an&' // &
+                                 'lemented for cloud_physics = .FALSE. an'  // &
                                  'd humidity = .FALSE.'
                 CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 )
@@ -2842,5 +2841,5 @@
                 message_string = 'data_output_pr = ' //                        &
                                  TRIM( data_output_pr(i) ) // ' is not imp' // &
-                                 'lemented for cloud_physics = .FALSE. an&' // &
+                                 'lemented for cloud_physics = .FALSE. an'  // &
                                  'd humidity = .FALSE.'
                 CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 )
@@ -2851,6 +2850,6 @@
                 message_string = 'data_output_pr = ' //                        &
                                  TRIM( data_output_pr(i) ) // ' is not imp' // &
-                                 'lemented for cloud_physics = .FALSE. or'  // &
-                                 '&cloud_droplets = .FALSE.'
+                                 'lemented for cloud_physics = .FALSE. and' // &
+                                 'cloud_droplets = .FALSE.'
                 CALL message( 'check_parameters', 'PA0096', 1, 2, 0, 6, 0 )
              ELSE
@@ -3249,5 +3248,5 @@
              ELSEIF ( .NOT.  microphysics_morrison )  THEN
                 message_string = 'output of "' // TRIM( var ) // '" requi' //  &
-                         'res = microphysics morrison '
+                         'res = morrison '
                 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 )
              ENDIF
@@ -3269,5 +3268,6 @@
              IF (  .NOT.  particle_advection )  THEN
                 message_string = 'output of "' // TRIM( var ) // '" requir' // &
-                   'es a "particle_parameters"-NAMELIST in the parameter file (PARIN)'
+                   'es a "particle_parameters"-NAMELIST in the parameter ' //  &
+                   'file (PARIN)'
                 CALL message( 'check_parameters', 'PA0104', 1, 2, 0, 6, 0 )
              ENDIF
@@ -3281,5 +3281,5 @@
                 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 )
              ELSEIF ( microphysics_sat_adjust )  THEN
-                message_string = 'output of "' // TRIM( var ) // '" is ' //  &
+                message_string = 'output of "' // TRIM( var ) // '" is ' //    &
                          'not available for cloud_scheme = saturation_adjust'
                 CALL message( 'check_parameters', 'PA0423', 1, 2, 0, 6, 0 )
@@ -3378,5 +3378,5 @@
              IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
                 message_string = 'illegal value for data_output: "' //         &
-                                 TRIM( var ) // '" & only 2d-horizontal ' //   &
+                                 TRIM( var ) // '" only 2d-horizontal ' //     &
                                  'cross sections are allowed for this value'
                 CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 )
@@ -3411,9 +3411,9 @@
              ENDIF
 
-          IF ( TRIM( var ) == 'ghf*'  .AND.  .NOT.  land_surface )  THEN
-             message_string = 'output of "' // TRIM( var ) // '" requi' //     &
-                              'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
-          ENDIF
+             IF ( TRIM( var ) == 'ghf*'  .AND.  .NOT.  land_surface )  THEN
+                message_string = 'output of "' // TRIM( var ) // '" requi' //  &
+                                 'res land_surface = .TRUE.'
+                CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             ENDIF
 
              IF ( ( TRIM( var ) == 'r_a*' .OR.  TRIM( var ) == 'ghf*' )        &
@@ -3558,5 +3558,5 @@
        WRITE( message_string, * )  'output of averaged quantity "',            &
                                    TRIM( doav(1) ), '_av" requires to set a ', &
-                                   'non-zero & averaging interval'
+                                   'non-zero averaging interval'
        CALL message( 'check_parameters', 'PA0323', 1, 2, 0, 6, 0 )
     ENDIF
@@ -3579,14 +3579,4 @@
     section(:,2) = section_xz
     section(:,3) = section_yz
-
-!
-!-- Upper plot limit for 2D vertical sections
-    IF ( z_max_do2d == -1.0_wp )  z_max_do2d = zu(nzt)
-    IF ( z_max_do2d < zu(nzb+1)  .OR.  z_max_do2d > zu(nzt) )  THEN
-       WRITE( message_string, * )  'z_max_do2d = ', z_max_do2d,                &
-                    ' must be >= ', zu(nzb+1), '(zu(nzb+1)) and <= ', zu(nzt), &
-                    ' (zu(nzt))'
-       CALL message( 'check_parameters', 'PA0116', 1, 2, 0, 6, 0 )
-    ENDIF
 
 !
@@ -3647,6 +3637,6 @@
                            '5 (parallel netCDF 4) and ' //                     &
                            '6 (parallel netCDF 4 Classic model) '//            &
-                           '&are currently not supported (not yet tested) ' // &
-                           'for masked data.&Using respective non-parallel' // &
+                           ' are currently not supported (not yet tested) ' // &
+                           'for masked data. Using respective non-parallel' // &
                            ' output for masked data.'
           CALL message( 'check_parameters', 'PA0383', 0, 0, 0, 6, 0 )
@@ -3663,5 +3653,5 @@
 #else
        message_string = 'netCDF: netCDF4 format requested but no ' //          &
-                        'cpp-directive __netcdf4 given & switch '  //          &
+                        'cpp-directive __netcdf4 given  switch '  //           &
                         'back to 64-bit offset format'
        CALL message( 'check_parameters', 'PA0171', 0, 1, 0, 6, 0 )
@@ -3674,5 +3664,5 @@
 #else
        message_string = 'netCDF: netCDF4 parallel output requested but no ' // &
-                        'cpp-directive __netcdf4_parallel given & switch '  // &
+                        'cpp-directive __netcdf4_parallel given, switch '   // &
                         'back to netCDF4 non-parallel output'
        CALL message( 'check_parameters', 'PA0099', 0, 1, 0, 6, 0 )
@@ -3865,6 +3855,6 @@
     IF ( disturbance_level_ind_t < disturbance_level_ind_b )  THEN
        WRITE( message_string, * )  'disturbance_level_ind_t = ',               &
-                disturbance_level_ind_t, ' must be >= disturbance_level_ind_b = ', &
-                disturbance_level_ind_b
+                disturbance_level_ind_t, ' must be >= ',                       &
+                'disturbance_level_ind_b = ', disturbance_level_ind_b
        CALL message( 'check_parameters', 'PA0130', 1, 2, 0, 6, 0 )
     ENDIF
@@ -3984,6 +3974,6 @@
     IF ( turbulent_inflow )  THEN
        IF ( recycling_width <= dx  .OR.  recycling_width >= nx * dx )  THEN
-          WRITE( message_string, * )  'illegal value for recycling_width:', &
-                                      ' ', recycling_width
+          WRITE( message_string, * )  'illegal value for recycling_width: ',   &
+                                      recycling_width
           CALL message( 'check_parameters', 'PA0134', 1, 2, 0, 6, 0 )
        ENDIF
@@ -4087,10 +4077,10 @@
        IF ( dp_level_b < zu(nzb)  .OR.  dp_level_b > zu(nzt) )  THEN
           WRITE( message_string, * )  'dp_level_b = ', dp_level_b, ' is out ', &
-               ' of range'
+               ' of range [zu(nzb), zu(nzt)]'
           CALL message( 'check_parameters', 'PA0151', 1, 2, 0, 6, 0 )
        ENDIF
        IF ( .NOT. ANY( dpdxy /= 0.0_wp ) )  THEN
           WRITE( message_string, * )  'dp_external is .TRUE. but dpdxy is ze', &
-               'ro, i.e. the external pressure gradient & will not be applied'
+               'ro, i.e. the external pressure gradient will not be applied'
           CALL message( 'check_parameters', 'PA0152', 0, 1, 0, 6, 0 )
        ENDIF
@@ -4147,5 +4137,5 @@
        IF ( particle_dvrpsize /= 'absw' )  THEN
           message_string = 'illegal value for parameter particle_dvrpsize:' // &
-                           ' ' // TRIM( particle_color)
+                           ' ' // TRIM( particle_dvrpsize)
           CALL message( 'check_parameters', 'PA0314', 1, 2, 0, 6, 0 )
        ELSE
@@ -4183,5 +4173,5 @@
 !-- Check roughness length, which has to be smaller than dz/2
     IF ( ( constant_flux_layer .OR.  &
-           INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) &
+           INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )       &
          .AND. roughness_length >= 0.5 * dz )  THEN
        message_string = 'roughness_length must be smaller than dz/2'
@@ -4237,7 +4227,7 @@
           IF ( dt_fixed )  THEN
              WRITE( message_string, '(A,F9.4,A)' )  'Output at every '  //     &
-                    'timestep is wanted (' // dt_do_name // ' = 0.0).&'//      &
-                    'Setting the output interval to the fixed timestep '//     &
-                    'dt = ', dt, 's.'
+                    'timestep is wanted (' // dt_do_name // ' = 0.0). '//      &
+                    'The output interval is set to the fixed timestep dt '//   &
+                    '= ', dt, 's.'
              CALL message( 'check_parameters', 'PA0060', 0, 0, 0, 6, 0 )
              dt_do = dt
