Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2921)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2932)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! renamed lsm_par to land_surface_parameters. Bugfix in message calls
+! 
+! 2921 2018-03-22 15:05:23Z Giersch
 ! The activation of spinup has been moved to parin
 ! 
@@ -1063,5 +1066,5 @@
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
                       'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           unit = 'm3/m3'
@@ -1071,5 +1074,5 @@
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
                       'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           unit = 'K'   
@@ -1081,30 +1084,30 @@
                               TRIM( var ) // '" & only 2d-horizontal ' //      &
                               'cross sections are allowed for this value'
-             CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0111', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'lai*'  .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 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'c_liq*'  .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 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'c_soil*'  .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 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'c_veg*'  .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 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'm_liq*'  .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 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'qsws_liq*'  .AND.  .NOT. land_surface )         &
@@ -1112,5 +1115,5 @@
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
                               'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'qsws_soil*'  .AND.  .NOT.  land_surface )       &
@@ -1118,5 +1121,5 @@
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
                               'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'qsws_veg*'  .AND.  .NOT. land_surface )         &
@@ -1124,5 +1127,5 @@
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
                               'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
           IF ( TRIM( var ) == 'r_s*'  .AND.  .NOT.  land_surface )             &
@@ -1130,5 +1133,5 @@
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
                               'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1185,5 +1188,5 @@
                               TRIM( data_output_pr(var_count) ) // ' is' //    &
                               'not implemented for land_surface = .FALSE.'
-             CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output_pr', 'PA0402', 1, 2, 0, 6, 0 )
           ELSE
              dopr_index(var_count) = 89
@@ -1203,5 +1206,5 @@
                               TRIM( data_output_pr(var_count) ) // ' is' //    &
                               ' not implemented for land_surface = .FALSE.'
-             CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_data_output_pr', 'PA0402', 1, 2, 0, 6, 0 )
           ELSE
              dopr_index(var_count) = 91
@@ -1251,5 +1254,5 @@
        message_string = 'unknown surface type surface_type = "' //             &
                         TRIM( surface_type ) // '"'
-       CALL message( 'check_parameters', 'PA0019', 1, 2, 0, 6, 0 )
+       CALL message( 'lsm_check_parameters', 'PA0019', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1262,5 +1265,5 @@
                         'bc_pt_b = "dirichlet" and '//                         &
                         'bc_q_b  = "dirichlet"'
-       CALL message( 'check_parameters', 'PA0399', 1, 2, 0, 6, 0 )
+       CALL message( 'lsm_check_parameters', 'PA0399', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1268,5 +1271,5 @@
        message_string = 'lsm requires '//                                      &
                         'constant_flux_layer = .T.'
-       CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 )
+       CALL message( 'lsm_check_parameters', 'PA0400', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1278,5 +1281,5 @@
                               'requires setting of min_canopy_resistance'//    &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1285,5 +1288,5 @@
                               'requires setting of leaf_area_index'//          &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1292,5 +1295,5 @@
                               'requires setting of vegetation_coverage'//      &
                               '/= 9999999.9'
-                CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+                CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1299,5 +1302,5 @@
                               'requires setting of'//                          &
                               'canopy_resistance_coefficient /= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1306,5 +1309,5 @@
                               'requires setting of lambda_surface_stable'//    &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1313,5 +1316,5 @@
                               'requires setting of lambda_surface_unstable'//  &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1320,5 +1323,5 @@
                               'requires setting of f_shortwave_incoming'//     &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1327,5 +1330,5 @@
                               'requires setting of z0_vegetation'//            &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1334,5 +1337,5 @@
                               'requires setting of z0h_vegetation'//           &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -1343,5 +1346,5 @@
              message_string = 'vegetation_type = 1 (bare soil)'//              &
                               ' requires vegetation_coverage = 0'
-             CALL message( 'check_parameters', 'PA0471', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0471', 1, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -1355,5 +1358,5 @@
                                      ' is not allowed in combination with ',   &
                                      'most_method = ', most_method
-          CALL message( 'check_parameters', 'PA0417', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0417', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1364,5 +1367,5 @@
                               'requires setting of z0_water'//                 &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0415', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0415', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1371,5 +1374,5 @@
                               'requires setting of z0h_water'//                &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0392', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0392', 1, 2, 0, 6, 0 )
           ENDIF
           
@@ -1378,5 +1381,5 @@
                               'requires setting of water_temperature'//        &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0379', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0379', 1, 2, 0, 6, 0 )
           ENDIF       
           
@@ -1390,5 +1393,5 @@
           message_string = 'non-default setting of dz_soil '//                  &
                            'does not allow to use pavement_type /= 0)'
-             CALL message( 'check_parameters', 'PA0341', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0341', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1399,5 +1402,5 @@
                               'requires setting of z0_pavement'//              &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0352', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0352', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -1406,5 +1409,5 @@
                               'requires setting of z0h_pavement'//             &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0353', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0353', 1, 2, 0, 6, 0 )
           ENDIF
           
@@ -1413,5 +1416,5 @@
                               'requires setting of pavement_heat_conduct'//    &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0342', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0342', 1, 2, 0, 6, 0 )
           ENDIF 
           
@@ -1420,5 +1423,5 @@
                               'requires setting of pavement_heat_capacity'//   &
                               '/= 9999999.9'
-             CALL message( 'check_parameters', 'PA0139', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0139', 1, 2, 0, 6, 0 )
           ENDIF 
 
@@ -1427,5 +1430,5 @@
                               'requires setting of pavement_depth_level'//     &
                               '/= 0'
-             CALL message( 'check_parameters', 'PA0474', 1, 2, 0, 6, 0 )
+             CALL message( 'lsm_check_parameters', 'PA0474', 1, 2, 0, 6, 0 )
           ENDIF 
 
@@ -1440,5 +1443,5 @@
                                      'combination with most_method = ',        &
                                      TRIM( most_method )
-          CALL message( 'check_parameters', 'PA0999', 2, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0999', 2, 2, 0, 6, 0 )
        ENDIF
 !
@@ -1449,5 +1452,5 @@
           message_string = 'pavement-surfaces are not allowed in ' //           &
                            'combination with a non-default setting of dz_soil'
-          CALL message( 'check_parameters', 'PA0999', 2, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0999', 2, 2, 0, 6, 0 )
        ENDIF
     ENDIF
@@ -1458,5 +1461,5 @@
     THEN
        message_string = 'surface_type = netcdf requires static input file.'
-       CALL message( 'check_parameters', 'PA0465', 1, 2, 0, 6, 0 )
+       CALL message( 'lsm_check_parameters', 'PA0465', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1467,5 +1470,5 @@
                            'requires setting of alpha_vangenuchten'//          &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1474,5 +1477,5 @@
                            'requires setting of l_vangenuchten'//              &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1481,5 +1484,5 @@
                            'requires setting of n_vangenuchten'//              &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1488,5 +1491,5 @@
                            'requires setting of hydraulic_conductivity'//      &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1495,5 +1498,5 @@
                            'requires setting of saturation_moisture'//         &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1502,5 +1505,5 @@
                            'requires setting of field_capacity'//              &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1509,5 +1512,5 @@
                            'requires setting of wilting_point'//               &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1516,5 +1519,5 @@
                            'requires setting of residual_moisture'//           &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0403', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -1548,5 +1551,5 @@
                                   ' in soil_temperature (', COUNT(             &
                                    soil_temperature /= 9999999.9_wp ), ')'
-          CALL message( 'check_parameters', 'PA0471', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0471', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1554,5 +1557,5 @@
           message_string = 'deep_soil_temperature is not set but must be'//    &
                            '/= 9999999.9'
-          CALL message( 'check_parameters', 'PA0472', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0472', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1564,5 +1567,5 @@
                            'requires setting of root_fraction'//               &
                            '/= 9999999.9 and SUM(root_fraction) = 1'
-          CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
        ENDIF
     ENDIF    
@@ -1576,5 +1579,5 @@
           message_string = 'soil_moisture must not exceed its saturation' //    &
                             ' value'
-          CALL message( 'check_parameters', 'PA0458', 1, 2, 0, 6, 0 )
+          CALL message( 'lsm_check_parameters', 'PA0458', 1, 2, 0, 6, 0 )
        ENDIF
     ENDDO
@@ -4538,4 +4541,6 @@
     SUBROUTINE lsm_parin
 
+       USE control_parameters,                                                 &
+           ONLY:  message_string
 
        IMPLICIT NONE
@@ -4569,12 +4574,40 @@
                                   z0h_water, z0q_water, z0_pavement,           &
                                   z0h_pavement, z0q_pavement
-       
+
+       NAMELIST /land_surface_parameters/                                      &
+                                  alpha_vangenuchten, c_surface,               &
+                                  canopy_resistance_coefficient,               &
+                                  constant_roughness,                          &
+                                  conserve_water_content,                      &
+                                  deep_soil_temperature,                       &
+                                  dz_soil,                                     &
+                                  f_shortwave_incoming, field_capacity,        & 
+                                  aero_resist_kray, hydraulic_conductivity,    &
+                                  lambda_surface_stable,                       &
+                                  lambda_surface_unstable, leaf_area_index,    &
+                                  l_vangenuchten, min_canopy_resistance,       &
+                                  min_soil_resistance, n_vangenuchten,         &
+                                  pavement_depth_level,                        &
+                                  pavement_heat_capacity,                      &
+                                  pavement_heat_conduct, pavement_type,        &
+                                  residual_moisture, root_fraction,            &
+                                  saturation_moisture, skip_time_do_lsm,       &
+                                  soil_moisture, soil_temperature,             &
+                                  soil_type,                                   &
+                                  surface_type,                                &
+                                  vegetation_coverage, vegetation_type,        &
+                                  water_temperature, water_type,               &
+                                  wilting_point, z0_vegetation,                &
+                                  z0h_vegetation, z0q_vegetation, z0_water,    &
+                                  z0h_water, z0q_water, z0_pavement,           &
+                                  z0h_pavement, z0q_pavement
+                                  
        line = ' '
-       
+  
 !
 !--    Try to find land surface model package
        REWIND ( 11 )
        line = ' '
-       DO   WHILE ( INDEX( line, '&lsm_par' ) == 0 )
+       DO   WHILE ( INDEX( line, '&land_surface_parameters' ) == 0 )
           READ ( 11, '(A)', END=10 )  line
        ENDDO
@@ -4583,12 +4616,35 @@
 !
 !--    Read user-defined namelist
-       READ ( 11, lsm_par )
+       READ ( 11, land_surface_parameters )
 
 !
 !--    Set flag that indicates that the land surface model is switched on
        land_surface = .TRUE.
-
-
- 10    CONTINUE
+       
+       GOTO 12
+!
+!--    Try to find old namelist
+ 10    REWIND ( 11 )
+       line = ' '
+       DO   WHILE ( INDEX( line, '&lsm_par' ) == 0 )
+          READ ( 11, '(A)', END=12 )  line
+       ENDDO
+       BACKSPACE ( 11 )
+
+!
+!--    Read user-defined namelist
+       READ ( 11, lsm_par )
+
+       message_string = 'namelist lsm_par is deprecated and will be ' // &
+                     'removed in near future. Please &use namelist ' //  &
+                     'land_surface_parameters instead'
+       CALL message( 'lsm_parin', 'PA0487', 0, 1, 0, 6, 0 )
+       
+!
+!--    Set flag that indicates that the land surface model is switched on
+       land_surface = .TRUE.
+
+
+ 12    CONTINUE
        
 
