Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3208)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3209)
@@ -22,5 +22,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! +nest_chemistry
 ! 
 ! Former revisions:
@@ -148,6 +148,7 @@
    SAVE
 
+   LOGICAL ::  nest_chemistry = .TRUE. !< flag for nesting mode of chemical species, independent on parent or not
+!
 !- Define chemical variables
-
    TYPE   species_def
       CHARACTER(LEN=8)                                   :: name
@@ -194,5 +195,5 @@
                                          ! 'fastj'  (Wild et al., 2000, J. Atmos. Chem., 37, 245-282) STILL NOT IMPLEMENTED
 
-   PUBLIC nspec
+   PUBLIC nest_chemistry, nspec
    PUBLIC nvar       
    PUBLIC spc_names
@@ -834,4 +835,5 @@
                                         max_street_id,                    &
                                         my_steps,                         &
+                                        nest_chemistry,                   &
                                         rcntrl,                           &
                                         side_street_id,                   &
Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3208)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3209)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Enable optional initialization of soil properties directly from dynamic 
+! input file.
 ! 
 ! Former revisions:
@@ -465,5 +466,5 @@
     USE netcdf_data_input_mod,                                                 &
         ONLY :  building_type_f, init_3d, input_pids_static,                   &
-                netcdf_data_input_interpolate,                                 &
+                netcdf_data_input_interpolate, netcdf_data_input_init_lsm,     &
                 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f,  &
                 root_area_density_lsm_f, soil_pars_f, soil_type_f,             &
@@ -2454,5 +2455,5 @@
        IMPLICIT NONE
 
-       LOGICAL      ::  init_soil_dynamically_in_child !< flag controlling initialization of soil in child domains
+       LOGICAL      ::  init_soil_from_parent   !< flag controlling initialization of soil in child domains
 
        INTEGER(iwp) ::  i                       !< running index
@@ -4020,18 +4021,21 @@
        IF (  TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
 !
-!--       In case of nested runs, check if soil is initialized via dynamic
-!--       input file in root domain and distribute this information
-!--       to all embedded child domains. This case, soil moisture and
-!--       temperature will be initialized via root domain.  
-          init_soil_dynamically_in_child = .FALSE. 
+!--       Read soil properties from dynamic input file
+          CALL netcdf_data_input_init_lsm
+!
+!--       In case no dynamic input is available for a child domain but root 
+!--       domain is initialized with dynamic input file, the different soil 
+!--       properties can lead to significant discrepancies in the atmospheric 
+!--       surface forcing. For this reason, the child domain
+!--       is initialized with mean soil profiles from the root domain.          
+          init_soil_from_parent = .FALSE. 
           IF ( nested_run )  THEN
 #if defined( __parallel )
              CALL MPI_ALLREDUCE( init_3d%from_file_tsoil  .OR.                 &
                                  init_3d%from_file_msoil,                      &
-                                 init_soil_dynamically_in_child,               &
+                                 init_soil_from_parent,                        &
                                  1, MPI_LOGICAL, MPI_LOR, MPI_COMM_WORLD, ierr )
 #endif
           ENDIF
-
 !
 !--       First, initialize soil temperature and moisture. 
@@ -4065,8 +4069,8 @@
 !
 !--       Initialization of soil moisture and temperature from file. 
-!--       In case of nested runs, only root parent reads dynamic input file. 
-!--       This case, transfer respective soil information provide
-!--       by dynamic input file from root parent domain onto all other domains.
-          IF ( init_soil_dynamically_in_child )  THEN
+!--       In case of no dynamic input file is available for the child domain, 
+!--       transfer soil mean profiles from the root-parent domain onto all 
+!--       child domains.
+          IF ( init_soil_from_parent )  THEN
 !
 !--          Child domains will be only initialized with horizontally 
@@ -4079,17 +4083,17 @@
 
                 DO  k = 0, init_3d%nzs-1
-                   pr_soil_init(k) = SUM( init_3d%msoil(k,nys:nyn,nxl:nxr)  )
+                   pr_soil_init(k) = SUM( init_3d%msoil_3d(k,nys:nyn,nxl:nxr)  )
                 ENDDO
 !
 !--             Allocate 1D array for soil-moisture profile (will not be 
 !--             allocated in lod==2 case). 
-                ALLOCATE( init_3d%msoil_init(0:init_3d%nzs-1) )
-                init_3d%msoil_init = 0.0_wp
+                ALLOCATE( init_3d%msoil_1d(0:init_3d%nzs-1) )
+                init_3d%msoil_1d = 0.0_wp
 #if defined( __parallel )
-                CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%msoil_init(0),    &
+                CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%msoil_1d(0),      &
                                     SIZE(pr_soil_init),                        &
                                     MPI_REAL, MPI_SUM, comm2d, ierr )
 #endif
-                init_3d%msoil_init = init_3d%msoil_init /                      &
+                init_3d%msoil_1d = init_3d%msoil_1d /                          &
                                         REAL( ( nx + 1 ) * ( ny + 1), KIND=wp )
                 DEALLOCATE( pr_soil_init )
@@ -4099,17 +4103,17 @@
 
                 DO  k = 0, init_3d%nzs-1
-                   pr_soil_init(k) = SUM( init_3d%tsoil(k,nys:nyn,nxl:nxr)  )
+                   pr_soil_init(k) = SUM( init_3d%tsoil_3d(k,nys:nyn,nxl:nxr)  )
                 ENDDO
 !
 !--             Allocate 1D array for soil-temperature profile (will not be 
 !--             allocated in lod==2 case). 
-                ALLOCATE( init_3d%tsoil_init(0:init_3d%nzs-1) )
-                init_3d%tsoil_init = 0.0_wp
+                ALLOCATE( init_3d%tsoil_1d(0:init_3d%nzs-1) )
+                init_3d%tsoil_1d = 0.0_wp
 #if defined( __parallel )
-                CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%tsoil_init(0),    &
+                CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%tsoil_1d(0),      &
                                     SIZE(pr_soil_init),                        &
                                     MPI_REAL, MPI_SUM, comm2d, ierr )
 #endif
-                init_3d%tsoil_init = init_3d%tsoil_init /                      &
+                init_3d%tsoil_1d = init_3d%tsoil_1d /                          &
                                         REAL( ( nx + 1 ) * ( ny + 1), KIND=wp )
                 DEALLOCATE( pr_soil_init )
@@ -4132,12 +4136,16 @@
 !
 !--          ALLOCATE arrays on child domains and set control attributes.
-             IF ( .NOT. init_3d%from_file_msoil )  THEN
-                ALLOCATE( init_3d%msoil_init(0:init_3d%nzs-1) )
-                init_3d%lod_msoil = 1
+!--          Note, 1d soil profiles are allocated even though soil information
+!--          is already read from dynamic file in one child domain. 
+!--          This case, however, data is not used for further initialization 
+!--          since the LoD=2. 
+             IF ( .NOT. ALLOCATED( init_3d%msoil_1d ) )  THEN
+                ALLOCATE( init_3d%msoil_1d(0:init_3d%nzs-1) )
+                IF( .NOT. init_3d%from_file_msoil )  init_3d%lod_msoil = 1
                 init_3d%from_file_msoil = .TRUE.
              ENDIF
-             IF ( .NOT. init_3d%from_file_tsoil )  THEN
-                ALLOCATE( init_3d%tsoil_init(0:init_3d%nzs-1) )
-                init_3d%lod_tsoil = 1
+             IF ( .NOT. ALLOCATED( init_3d%tsoil_1d ) )  THEN
+                ALLOCATE( init_3d%tsoil_1d(0:init_3d%nzs-1) )
+                IF( .NOT. init_3d%from_file_tsoil )  init_3d%lod_tsoil = 1
                 init_3d%from_file_tsoil = .TRUE.
              ENDIF
@@ -4147,7 +4155,7 @@
 !
 !--          Distribute soil profiles from root to all childs
-             CALL MPI_BCAST( init_3d%msoil_init, SIZE(init_3d%msoil_init),     &
+             CALL MPI_BCAST( init_3d%msoil_1d, SIZE(init_3d%msoil_1d),         &
                              MPI_REAL, 0, MPI_COMM_WORLD, ierr )
-             CALL MPI_BCAST( init_3d%tsoil_init, SIZE(init_3d%tsoil_init),     &
+             CALL MPI_BCAST( init_3d%tsoil_1d, SIZE(init_3d%tsoil_1d),         &
                              MPI_REAL, 0, MPI_COMM_WORLD, ierr )
 #endif
@@ -4155,6 +4163,5 @@
           ENDIF
 !
-!--       Proceed with Level 2 initialization. Information from dynamic input
-!--       is now available on all processes. 
+!--       Proceed with Level 2 initialization. 
           IF ( init_3d%from_file_msoil )  THEN
 
@@ -4164,5 +4171,5 @@
                    CALL netcdf_data_input_interpolate(                         &
                                        m_soil_h%var_2d(nzb_soil:nzt_soil,m),   &
-                                       init_3d%msoil_init(:),                  &
+                                       init_3d%msoil_1d(:),                    &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4174,5 +4181,5 @@
                       CALL netcdf_data_input_interpolate(                      &
                                        m_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),&
-                                       init_3d%msoil_init(:),                  &
+                                       init_3d%msoil_1d(:),                    &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4186,8 +4193,8 @@
                    j = surf_lsm_h%j(m)
 
-                   IF ( init_3d%msoil(0,j,i) /= init_3d%fill_msoil )           &
+                   IF ( init_3d%msoil_3d(0,j,i) /= init_3d%fill_msoil )        &
                       CALL netcdf_data_input_interpolate(                      &
                                        m_soil_h%var_2d(nzb_soil:nzt_soil,m),   &
-                                       init_3d%msoil(:,j,i),                   &
+                                       init_3d%msoil_3d(:,j,i),                &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4201,8 +4208,8 @@
                                              surf_lsm_v(l)%building_covered(m) ) 
 
-                      IF ( init_3d%msoil(0,j,i) /= init_3d%fill_msoil )        &
+                      IF ( init_3d%msoil_3d(0,j,i) /= init_3d%fill_msoil )     &
                          CALL netcdf_data_input_interpolate(                   &
                                        m_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),&
-                                       init_3d%msoil(:,j,i),                   &
+                                       init_3d%msoil_3d(:,j,i),                &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4221,5 +4228,5 @@
                    CALL netcdf_data_input_interpolate(                         &
                                        t_soil_h%var_2d(nzb_soil:nzt_soil,m),   &
-                                       init_3d%tsoil_init(:),                  &
+                                       init_3d%tsoil_1d(:),                    &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4232,5 +4239,5 @@
                       CALL netcdf_data_input_interpolate(                      &
                                        t_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),&
-                                       init_3d%tsoil_init(:),                  &
+                                       init_3d%tsoil_1d(:),                    &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4246,8 +4253,8 @@
                    j = surf_lsm_h%j(m)
 
-                   IF ( init_3d%msoil(0,j,i) /= init_3d%fill_msoil )           &
+                   IF ( init_3d%tsoil_3d(0,j,i) /= init_3d%fill_tsoil )        &
                       CALL netcdf_data_input_interpolate(                      &
                                        t_soil_h%var_2d(nzb_soil:nzt_soil,m),   &
-                                       init_3d%tsoil(:,j,i),                   &
+                                       init_3d%tsoil_3d(:,j,i),                &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4262,8 +4269,8 @@
                                                 surf_lsm_v(l)%building_covered(m) ) 
 
-                      IF ( init_3d%msoil(0,j,i) /= init_3d%fill_msoil )        &
+                      IF ( init_3d%tsoil_3d(0,j,i) /= init_3d%fill_tsoil )     &
                          CALL netcdf_data_input_interpolate(                   &
                                        t_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),&
-                                       init_3d%tsoil(:,j,i),                   &
+                                       init_3d%tsoil_3d(:,j,i),                &
                                        zs(nzb_soil:nzt_soil), init_3d%z_soil,  &
                                        nzb_soil, nzt_soil,                     &
@@ -4311,8 +4318,8 @@
              surf_lsm_h%shf(m)  = - surf_lsm_h%us(m) * surf_lsm_h%ts(m)        &
                                   * rho_surface
-         ENDDO
-!
-!--      Vertical surfaces
-         DO  l = 0, 3
+          ENDDO
+!
+!--       Vertical surfaces
+          DO  l = 0, 3
              DO  m = 1, surf_lsm_v(l)%ns
                 i   = surf_lsm_v(l)%i(m)            
Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3208)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3209)
@@ -20,5 +20,11 @@
 ! Current revisions:
 ! -----------------
-! 
+! - Separate input of soil properties from input of atmospheric data. This 
+!   enables input of soil properties also in child domains without any 
+!   dependence on atmospheric input
+! - Check for missing initial 1D/3D data in dynamic input file
+! - Revise checks for matching grid spacing in model and input file 
+! - Bugfix, add netcdf4_parallel directive for collective read operation
+! - Revise error message numbers
 ! 
 ! Former revisions:
@@ -303,8 +309,8 @@
        REAL(wp) ::  rotation_angle   !< rotation angle of input data
 
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  msoil_init   !< initial vertical profile of soil moisture
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  msoil_1d     !< initial vertical profile of soil moisture
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  pt_init      !< initial vertical profile of pt
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  q_init       !< initial vertical profile of q
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  tsoil_init   !< initial vertical profile of soil temperature
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  tsoil_1d     !< initial vertical profile of soil temperature
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  u_init       !< initial vertical profile of u
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  ug_init      !< initial vertical profile of ug
@@ -317,6 +323,6 @@
 
 
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  msoil        !< initial 3d soil moisture provide by Inifor and interpolated onto soil grid
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  tsoil        !< initial 3d soil temperature provide by Inifor and interpolated onto soil grid
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  msoil_3d !< initial 3d soil moisture provide by Inifor and interpolated onto soil grid
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  tsoil_3d !< initial 3d soil temperature provide by Inifor and interpolated onto soil grid
 
     END TYPE init_type
@@ -573,4 +579,8 @@
        MODULE PROCEDURE netcdf_data_input_init_3d
     END INTERFACE netcdf_data_input_init_3d
+    
+    INTERFACE netcdf_data_input_init_lsm
+       MODULE PROCEDURE netcdf_data_input_init_lsm
+    END INTERFACE netcdf_data_input_init_lsm
 
     INTERFACE netcdf_data_input_lsf
@@ -595,5 +605,4 @@
        MODULE PROCEDURE get_variable_3d_real
        MODULE PROCEDURE get_variable_3d_real_dynamic
-!        MODULE PROCEDURE get_variable_3d_real_v
        MODULE PROCEDURE get_variable_4d_real
     END INTERFACE get_variable
@@ -626,5 +635,6 @@
     PUBLIC netcdf_data_input_check_dynamic, netcdf_data_input_check_static,    &
            netcdf_data_input_inquire_file,                                     &
-           netcdf_data_input_init, netcdf_data_input_init_3d,                  &
+           netcdf_data_input_init, netcdf_data_input_init_lsm,                 &
+           netcdf_data_input_init_3d,                                          &
            netcdf_data_input_interpolate, netcdf_data_input_lsf,               &
            netcdf_data_input_surface_data, netcdf_data_input_topo
@@ -1864,5 +1874,5 @@
                                  '(level of detail) is not set ' //            &
                                  'properly for buildings_2d.'
-                CALL message( 'netcdf_data_input_mod', 'NDI000',               &
+                CALL message( 'netcdf_data_input_mod', 'PA0540',               &
                                1, 2, 0, 6, 0 )
              ENDIF
@@ -1897,5 +1907,5 @@
                                  '(level of detail) is not set ' //            &
                                  'properly for buildings_3d.'
-                CALL message( 'netcdf_data_input_mod', 'NDI001',               &
+                CALL message( 'netcdf_data_input_mod', 'PA0541',               &
                                1, 2, 0, 6, 0 )
              ENDIF
@@ -1999,5 +2009,5 @@
              message_string = 'If building heigths are prescribed in ' //      &
                               'static input file, also an ID is required.'
-             CALL message( 'netcdf_data_input_mod', 'NDI002', 1, 2, 0, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0542', 1, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2120,11 +2130,7 @@
        CALL inquire_variable_names( id_dynamic, var_names )
 !
-!--    Read vertical dimension of scalar und w grid. Will be used for
-!--    inter- and extrapolation in case of stretched numeric grid.
-!--    This will be removed when Inifor is able to handle stretched grids.
+!--    Read vertical dimension of scalar und w grid. 
        CALL get_dimension_length( id_dynamic, init_3d%nzu, 'z'     )
        CALL get_dimension_length( id_dynamic, init_3d%nzw, 'zw'    )
-       IF ( check_existence( var_names, 'zsoil' ) )                            &
-          CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' )
 !
 !--    Read also the horizontal dimensions. These are used just used fo
@@ -2146,5 +2152,5 @@
                            'does not match the number of numeric grid '//      &
                            'points.'
-          CALL message( 'netcdf_data_input_mod', 'NDI003', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0543', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -2153,5 +2159,5 @@
                            'does not match the number of numeric grid '//      &
                            'points.'
-          CALL message( 'netcdf_data_input_mod', 'NDI003', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0543', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2165,8 +2171,4 @@
           ALLOCATE( init_3d%zw_atmos(1:init_3d%nzw) )
           CALL get_variable( id_dynamic, 'zw', init_3d%zw_atmos )
-       ENDIF
-       IF ( check_existence( var_names, 'zsoil' ) )  THEN
-          ALLOCATE( init_3d%z_soil(1:init_3d%nzs) )
-          CALL get_variable( id_dynamic, 'zsoil', init_3d%z_soil )
        ENDIF
 !
@@ -2184,5 +2186,5 @@
           message_string = 'Vertical grid in dynamic driver does not '// &
                            'match the numeric grid.'
-          CALL message( 'netcdf_data_input_mod', 'NDI003', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0543', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2264,4 +2266,7 @@
           ENDIF
           init_3d%from_file_u = .TRUE.
+       ELSE
+          message_string = 'Missing initial data for u-component'
+          CALL message( 'netcdf_data_input_mod', 'PA0544', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2307,4 +2312,7 @@
           ENDIF
           init_3d%from_file_v = .TRUE.
+       ELSE
+          message_string = 'Missing initial data for v-component'
+          CALL message( 'netcdf_data_input_mod', 'PA0544', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2345,4 +2353,7 @@
           ENDIF
           init_3d%from_file_w = .TRUE.
+       ELSE
+          message_string = 'Missing initial data for w-component'
+          CALL message( 'netcdf_data_input_mod', 'PA0544', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2385,4 +2396,8 @@
              ENDIF
              init_3d%from_file_pt = .TRUE.
+          ELSE
+             message_string = 'Missing initial data for ' //                   &
+                              'potential temperature'
+             CALL message( 'netcdf_data_input_mod', 'PA0544', 1, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2425,67 +2440,8 @@
              ENDIF
              init_3d%from_file_q = .TRUE.
-          ENDIF
-       ENDIF
-!
-!--    Read soil moisture
-       IF ( land_surface )  THEN
-
-          IF ( check_existence( var_names, 'init_soil_m' ) )  THEN
-!
-!--          Read attributes for the fill value and level-of-detail
-             CALL get_attribute( id_dynamic, char_fill,                        &
-                                 init_3d%fill_msoil,                           &
-                                 .FALSE., 'init_soil_m' )
-             CALL get_attribute( id_dynamic, char_lod,                         &
-                                 init_3d%lod_msoil,                            &
-                                 .FALSE., 'init_soil_m' )
-!
-!--          level-of-detail 1 - read initialization profile
-             IF ( init_3d%lod_msoil == 1 )  THEN
-                ALLOCATE( init_3d%msoil_init(0:init_3d%nzs-1) )
-
-                CALL get_variable( id_dynamic, 'init_soil_m',                  &
-                                   init_3d%msoil_init(0:init_3d%nzs-1) )
-!
-!--          level-of-detail 2 - read 3D initialization data
-             ELSEIF ( init_3d%lod_msoil == 2 )  THEN
-                ALLOCATE ( init_3d%msoil(0:init_3d%nzs-1,nys:nyn,nxl:nxr) )
-
-               CALL get_variable( id_dynamic, 'init_soil_m',                   &   
-                                init_3d%msoil(0:init_3d%nzs-1,nys:nyn,nxl:nxr),&
-                                nxl, nxr, nys, nyn, 0, init_3d%nzs-1 )
-
-             ENDIF
-             init_3d%from_file_msoil = .TRUE.
-          ENDIF
-!
-!--       Read soil temperature
-          IF ( check_existence( var_names, 'init_soil_t' ) )  THEN
-!
-!--          Read attributes for the fill value and level-of-detail
-             CALL get_attribute( id_dynamic, char_fill,                        &
-                                 init_3d%fill_tsoil,                           &
-                                 .FALSE., 'init_soil_t' )
-             CALL get_attribute( id_dynamic, char_lod,                         &
-                                 init_3d%lod_tsoil,                            &
-                                 .FALSE., 'init_soil_t' )
-!
-!--          level-of-detail 1 - read initialization profile
-             IF ( init_3d%lod_tsoil == 1 )  THEN
-                ALLOCATE( init_3d%tsoil_init(0:init_3d%nzs-1) )
-
-                CALL get_variable( id_dynamic, 'init_soil_t',                  &
-                                   init_3d%tsoil_init(0:init_3d%nzs-1) )
-
-!
-!--          level-of-detail 2 - read 3D initialization data
-             ELSEIF ( init_3d%lod_tsoil == 2 )  THEN
-                ALLOCATE ( init_3d%tsoil(0:init_3d%nzs-1,nys:nyn,nxl:nxr) )
-                
-                CALL get_variable( id_dynamic, 'init_soil_t',                  &   
-                                init_3d%tsoil(0:init_3d%nzs-1,nys:nyn,nxl:nxr),&
-                                nxl, nxr, nys, nyn, 0, init_3d%nzs-1 )
-             ENDIF
-             init_3d%from_file_tsoil = .TRUE.
+          ELSE
+             message_string = 'Missing initial data for ' //                   &
+                              'mixing ratio'
+             CALL message( 'netcdf_data_input_mod', 'PA0544', 1, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2512,5 +2468,5 @@
              message_string = 'NetCDF input for init_atmosphere_u must ' //    &
                               'not contain any _FillValues'
-             CALL message( 'netcdf_data_input_mod', 'NDI004', 2, 2, 0, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0545', 2, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2528,5 +2484,5 @@
              message_string = 'NetCDF input for init_atmosphere_v must ' //    &
                               'not contain any _FillValues'
-             CALL message( 'netcdf_data_input_mod', 'NDI005', 2, 2, 0, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0545', 2, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2544,5 +2500,5 @@
              message_string = 'NetCDF input for init_atmosphere_w must ' //    &
                               'not contain any _FillValues'
-             CALL message( 'netcdf_data_input_mod', 'NDI006', 2, 2, 0, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0545', 2, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2560,5 +2516,5 @@
              message_string = 'NetCDF input for init_atmosphere_pt must ' //   &
                               'not contain any _FillValues'
-             CALL message( 'netcdf_data_input_mod', 'NDI007', 2, 2, 0, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0545', 2, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2576,5 +2532,5 @@
              message_string = 'NetCDF input for init_atmosphere_q must ' //    &
                               'not contain any _FillValues'
-             CALL message( 'netcdf_data_input_mod', 'NDI008', 2, 2, 0, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0545', 2, 2, 0, 6, 0 )
           ENDIF
        ENDIF
@@ -2585,4 +2541,147 @@
 
     END SUBROUTINE netcdf_data_input_init_3d
+    
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Reads initialization data of u, v, w, pt, q, geostrophic wind components,
+!> as well as soil moisture and soil temperature, derived from larger-scale
+!> model (COSMO) by Inifor.
+!------------------------------------------------------------------------------!
+    SUBROUTINE netcdf_data_input_init_lsm
+
+       USE arrays_3d,                                                          &
+           ONLY:  q, pt, u, v, w, zu, zw
+
+       USE control_parameters,                                                 &
+           ONLY:  bc_lr_cyc, bc_ns_cyc, humidity, land_surface, message_string,&
+                  nesting_offline, neutral, surface_pressure
+
+       USE indices,                                                            &
+           ONLY:  nx, nxl, nxlu, nxr, ny, nyn, nys, nysv, nzb, nz, nzt
+
+       IMPLICIT NONE
+
+       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names
+      
+       INTEGER(iwp) ::  id_dynamic !< NetCDF id of dynamic input file
+       INTEGER(iwp) ::  num_vars   !< number of variables in netcdf input file
+
+!
+!--    Skip routine if no input file with dynamic input data is available.
+       IF ( .NOT. input_pids_dynamic )  RETURN
+!
+!--    CPU measurement
+       CALL cpu_log( log_point_s(85), 'NetCDF input init', 'start' )
+
+#if defined ( __netcdf )
+!
+!--    Open file in read-only mode
+       CALL open_read_file( TRIM( input_file_dynamic ) //                      &
+                            TRIM( coupling_char ), id_dynamic )
+
+!
+!--    At first, inquire all variable names.
+       CALL inquire_num_variables( id_dynamic, num_vars )
+!
+!--    Allocate memory to store variable names.
+       ALLOCATE( var_names(1:num_vars) )
+       CALL inquire_variable_names( id_dynamic, var_names )
+!
+!--    Read vertical dimension for soil depth. 
+       IF ( check_existence( var_names, 'zsoil' ) )                            &
+          CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' )
+!
+!--    Read also the horizontal dimensions required for soil initialization.
+!--    Please note, in case of non-nested runs or in case of root domain, 
+!--    these data is already available, but will be read again for the sake
+!--    of clearness. 
+       CALL get_dimension_length( id_dynamic, init_3d%nx,  'x'  )
+       CALL get_dimension_length( id_dynamic, init_3d%ny,  'y'  )
+!
+!--    Check for correct horizontal and vertical dimension. Please note,
+!--    in case of non-nested runs or in case of root domain, these checks 
+!--    are already performed
+       IF ( init_3d%nx-1 /= nx  .OR.  init_3d%ny-1 /= ny )  THEN
+          message_string = 'Number of inifor horizontal grid points  '//       &
+                           'does not match the number of numeric grid points.'
+          CALL message( 'netcdf_data_input_mod', 'PA0543', 1, 2, 0, 6, 0 )
+       ENDIF
+!
+!--    Read vertical dimensions. Later, these are required for eventual
+!--    inter- and extrapolations of the initialization data.
+       IF ( check_existence( var_names, 'zsoil' ) )  THEN
+          ALLOCATE( init_3d%z_soil(1:init_3d%nzs) )
+          CALL get_variable( id_dynamic, 'zsoil', init_3d%z_soil )
+       ENDIF
+!
+!--    Read initial data for soil moisture
+       IF ( check_existence( var_names, 'init_soil_m' ) )  THEN
+!
+!--       Read attributes for the fill value and level-of-detail
+          CALL get_attribute( id_dynamic, char_fill,                           &
+                              init_3d%fill_msoil,                              &
+                              .FALSE., 'init_soil_m' )
+          CALL get_attribute( id_dynamic, char_lod,                            &
+                              init_3d%lod_msoil,                               &
+                              .FALSE., 'init_soil_m' )
+!
+!--       level-of-detail 1 - read initialization profile
+          IF ( init_3d%lod_msoil == 1 )  THEN
+             ALLOCATE( init_3d%msoil_1d(0:init_3d%nzs-1) )
+
+             CALL get_variable( id_dynamic, 'init_soil_m',                     &
+                                init_3d%msoil_1d(0:init_3d%nzs-1) )
+!
+!--       level-of-detail 2 - read 3D initialization data
+          ELSEIF ( init_3d%lod_msoil == 2 )  THEN
+             ALLOCATE ( init_3d%msoil_3d(0:init_3d%nzs-1,nys:nyn,nxl:nxr) )
+
+            CALL get_variable( id_dynamic, 'init_soil_m',                      &   
+                             init_3d%msoil_3d(0:init_3d%nzs-1,nys:nyn,nxl:nxr),&
+                             nxl, nxr, nys, nyn, 0, init_3d%nzs-1 )
+
+          ENDIF
+          init_3d%from_file_msoil = .TRUE.
+       ENDIF
+!
+!--    Read soil temperature
+       IF ( check_existence( var_names, 'init_soil_t' ) )  THEN
+!
+!--       Read attributes for the fill value and level-of-detail
+          CALL get_attribute( id_dynamic, char_fill,                           &
+                              init_3d%fill_tsoil,                              &
+                              .FALSE., 'init_soil_t' )
+          CALL get_attribute( id_dynamic, char_lod,                            &
+                              init_3d%lod_tsoil,                               &
+                              .FALSE., 'init_soil_t' )
+!
+!--       level-of-detail 1 - read initialization profile
+          IF ( init_3d%lod_tsoil == 1 )  THEN
+             ALLOCATE( init_3d%tsoil_1d(0:init_3d%nzs-1) )
+
+             CALL get_variable( id_dynamic, 'init_soil_t',                     &
+                                init_3d%tsoil_1d(0:init_3d%nzs-1) )
+
+!
+!--       level-of-detail 2 - read 3D initialization data
+          ELSEIF ( init_3d%lod_tsoil == 2 )  THEN
+             ALLOCATE ( init_3d%tsoil_3d(0:init_3d%nzs-1,nys:nyn,nxl:nxr) )
+             
+             CALL get_variable( id_dynamic, 'init_soil_t',                     &   
+                             init_3d%tsoil_3d(0:init_3d%nzs-1,nys:nyn,nxl:nxr),&
+                             nxl, nxr, nys, nyn, 0, init_3d%nzs-1 )
+          ENDIF
+          init_3d%from_file_tsoil = .TRUE.
+       ENDIF
+!
+!--    Close input file
+       CALL close_input_file( id_dynamic )
+#endif
+!
+!--    End of CPU measurement
+       CALL cpu_log( log_point_s(85), 'NetCDF input init', 'stop' )
+
+    END SUBROUTINE netcdf_data_input_init_lsm    
 
 !------------------------------------------------------------------------------!
@@ -2889,5 +2988,5 @@
                             'input file ' //                                   &
                             TRIM( input_file_dynamic ) // TRIM( coupling_char )
-          CALL message( 'netcdf_data_input_mod', 'NDI009', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0546', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2899,5 +2998,5 @@
                            'input file ' // TRIM( input_file_dynamic ) //      &
                            TRIM( coupling_char )
-          CALL message( 'netcdf_data_input_mod', 'NDI010', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0547', 1, 2, 0, 6, 0 )
        ENDIF
 
@@ -2940,15 +3039,15 @@
                            'x- and/or y-direction ' //                         &
                            'do not match the respective model dimension'
-          CALL message( 'netcdf_data_input_mod', 'NDI011', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0548', 1, 2, 0, 6, 0 )
        ENDIF
 !
 !--    Check if grid spacing of provided input data matches the respective
-!--    grid spacing in the model.
-       IF ( dim_static%x(1) - dim_static%x(0) /= dx  .OR.                      &
-            dim_static%y(1) - dim_static%y(0) /= dy )  THEN
+!--    grid spacing in the model. 
+       IF ( ABS( dim_static%x(1) - dim_static%x(0) - dx ) > 10E-6_wp  .OR.     &
+            ABS( dim_static%y(1) - dim_static%y(0) - dy ) > 10E-6_wp )  THEN
           message_string = 'Static input file: horizontal grid spacing ' //    &
                            'in x- and/or y-direction ' //                      &
                            'do not match the respective model grid spacing.'
-          CALL message( 'netcdf_data_input_mod', 'NDI012', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0549', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -2960,5 +3059,5 @@
           message_string = 'NetCDF variable zt is not ' //                     &
                            'allowed to have missing data'
-          CALL message( 'netcdf_data_input_mod', 'NDI013', 2, 2, myid, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0550', 2, 2, myid, 6, 0 )
        ENDIF
 !
@@ -2967,5 +3066,5 @@
           message_string = 'NetCDF variable zt is not ' //                     &
                            'allowed to have negative values'
-          CALL message( 'netcdf_data_input_mod', 'NDI013', 2, 2, myid, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0551', 2, 2, myid, 6, 0 )
        ENDIF
 !
@@ -2977,5 +3076,5 @@
                 message_string = 'Reading 3D building data - too much ' //     &
                                  'data points along the vertical coordinate.'
-                CALL message( 'netcdf_data_input_mod', 'NDI014', 2, 2, 0, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0552', 2, 2, 0, 6, 0 )
              ENDIF
 
@@ -2984,5 +3083,5 @@
                 message_string = 'Reading 3D building data - vertical ' //     &
                                  'coordinate do not match numeric grid.'
-                CALL message( 'netcdf_data_input_mod', 'NDI015', 2, 2, 0, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0553', 2, 2, 0, 6, 0 )
              ENDIF
           ENDIF
@@ -3007,5 +3106,5 @@
                            'required. If urban-surface model is applied, ' //  &
                            'also building_type ist required'
-          CALL message( 'netcdf_data_input_mod', 'NDI016', 1, 2, 0, 6, 0 )
+          CALL message( 'netcdf_data_input_mod', 'PA0554', 1, 2, 0, 6, 0 )
        ENDIF
 !
@@ -3016,12 +3115,12 @@
           IF ( ANY( vegetation_type_f%var == 0 ) )  THEN
              IF ( .NOT. vegetation_pars_f%from_file )  THEN
-                message_string = 'If vegegation_type = 0 at any location, ' // &
+                message_string = 'If vegetation_type = 0 at any location, ' // &
                                  'vegetation_pars is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI017', 2, 2, -1, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0555', 2, 2, -1, 6, 0 )
              ENDIF
              IF ( .NOT. root_area_density_lsm_f%from_file )  THEN
-                message_string = 'If vegegation_type = 0 at any location, ' // &
+                message_string = 'If vegetation_type = 0 at any location, ' // &
                                  'root_area_dens_s is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI018', 2, 2, myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0556', 2, 2, myid, 6, 0 )
              ENDIF
           ENDIF
@@ -3043,5 +3142,5 @@
              message_string = 'If soil_type = 0 at any location, ' //          &
                               'soil_pars is required'
-             CALL message( 'netcdf_data_input_mod', 'NDI019', 2, 2, myid, 6, 0 )
+             CALL message( 'netcdf_data_input_mod', 'PA0557', 2, 2, myid, 6, 0 )
           ENDIF
        ENDIF
@@ -3053,5 +3152,5 @@
                 message_string = 'If building_type = 0 at any location, ' //   &
                                  'building_pars is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI020', 2, 2, myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0558', 2, 2, myid, 6, 0 )
              ENDIF
           ENDIF
@@ -3064,5 +3163,5 @@
                 message_string = 'If albedo_type = 0 at any location, ' //     &
                                  'albedo_pars is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI021', 2, 2, myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0559', 2, 2, myid, 6, 0 )
              ENDIF
           ENDIF
@@ -3075,5 +3174,5 @@
                 message_string = 'If pavement_type = 0 at any location, ' //   &
                                  'pavement_pars is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI022', 2, 2, myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0560', 2, 2, myid, 6, 0 )
              ENDIF
           ENDIF
@@ -3087,5 +3186,5 @@
                 message_string = 'If pavement_type = 0 at any location, ' //   &
                                  'pavement_subsurface_pars is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI023', 2, 2, myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0561', 2, 2, myid, 6, 0 )
              ENDIF
           ENDIF
@@ -3098,5 +3197,5 @@
                 message_string = 'If water_type = 0 at any location, ' //      &
                                  'water_pars is required'
-                CALL message( 'netcdf_data_input_mod', 'NDI024', 2, 2,myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0562', 2, 2,myid, 6, 0 )
              ENDIF
           ENDIF
@@ -3118,5 +3217,5 @@
                                  'building_type, or water_type must be set '// &
                                  'to a non-missing value. Grid point: ', j, i
-                CALL message( 'netcdf_data_input_mod', 'NDI025', 2, 2, myid, 6, 0 )
+                CALL message( 'netcdf_data_input_mod', 'PA0563', 2, 2, myid, 6, 0 )
              ENDIF
 !
@@ -3138,5 +3237,5 @@
                                  'location (y,x) where vegetation_type or ' // &
                                  'pavement_type is a non-missing value.'
-                   CALL message( 'netcdf_data_input_mod', 'NDI026',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0564',            &
                                   2, 2, myid, 6, 0 )
                 ENDIF
@@ -3159,5 +3258,5 @@
                                  'given at a location, surface_fraction ' //   &
                                  'must be provided.'
-                   CALL message( 'netcdf_data_input_mod', 'NDI027',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0565',            &
                                   2, 2, myid, 6, 0 )
                 ELSEIF ( ANY ( surface_fraction_f%frac(:,j,i) ==               &
@@ -3166,5 +3265,5 @@
                                  'given at a location, surface_fraction ' //   &
                                  'must be provided.'
-                   CALL message( 'netcdf_data_input_mod', 'NDI027',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0565',            &
                                   2, 2, myid, 6, 0 )
                 ENDIF
@@ -3179,5 +3278,5 @@
                 IF ( SUM ( surface_fraction_f%frac(0:2,j,i) ) > 1.0_wp )  THEN
                    message_string = 'surface_fraction must not exceed 1'
-                   CALL message( 'netcdf_data_input_mod', 'NDI028',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0566',            &
                                   2, 2, myid, 6, 0 )
                 ENDIF
@@ -3205,5 +3304,5 @@
                              'water surface is given at (i,j) = ( ', i, j,     &
                              ' ), but surface fraction is 0 for the given type.'
-                   CALL message( 'netcdf_data_input_mod', 'NDI029',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0567',            &
                                   2, 2, myid, 6, 0 )
                 ENDIF
@@ -3232,5 +3331,5 @@
                              ' ), but surface fraction is not 0 for the ' //   &
                              'given type.'
-                   CALL message( 'netcdf_data_input_mod', 'NDI030',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0568',            &
                                   2, 2, myid, 6, 0 )
                 ENDIF
@@ -3247,5 +3346,5 @@
                                        'parameters of vegetation_pars at '//   &
                                        'this location must be set.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI031',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0569',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3262,5 +3361,5 @@
                                        'levels of root_area_dens_s ' //        &
                                        'must be set at this location.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI032',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0570',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3286,5 +3385,5 @@
                    message_string = 'If soil_type(y,x) = 0, all levels of '  //&
                                     'soil_pars at this location must be set.'
-                   CALL message( 'netcdf_data_input_mod', 'NDI033',            &
+                   CALL message( 'netcdf_data_input_mod', 'PA0571',            &
                                   2, 2, myid, 6, 0 )
                 ENDIF
@@ -3301,5 +3400,5 @@
                                        'parameters of building_pars at this '//&
                                        'location must be set.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI034',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0572',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3318,5 +3417,5 @@
                                          'urban-surface model is applied. ' // &
                                          'i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'NDI035',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0573',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3330,5 +3429,5 @@
                                          'urban-surface model is applied. ' // &
                                          'i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'NDI035',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0573',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3345,5 +3444,5 @@
                                          'building is set requires an ID ' //  &
                                          '( and vice versa ). i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'NDI036',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0574',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3354,5 +3453,5 @@
                                          'building is set requires an ID ' //  &
                                          '( and vice versa ). i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'NDI036',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0574',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3368,5 +3467,5 @@
                       WRITE( message_string, * ) 'Each building grid point '// &
                                                  'requires an ID.', i, j
-                      CALL message( 'netcdf_data_input_mod', 'NDI036',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0575',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3376,5 +3475,5 @@
                       WRITE( message_string, * ) 'Each building grid point '// &
                                                  'requires an ID.', i, j
-                      CALL message( 'netcdf_data_input_mod', 'NDI036',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0575',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3391,5 +3490,5 @@
                                        'parameters of albedo_pars at this ' // &
                                        'location must be set.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI037',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0576',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3407,5 +3506,5 @@
                                        'parameters of pavement_pars at this '//&
                                        'location must be set.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI038',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0577',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3424,5 +3523,5 @@
                                        'pavement_subsurface_pars at this '//   &
                                        'location must be set.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI039',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0578',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -3440,5 +3539,5 @@
                                        'parameters of water_pars at this ' //  &
                                        'location must be set.'
-                      CALL message( 'netcdf_data_input_mod', 'NDI040',         &
+                      CALL message( 'netcdf_data_input_mod', 'PA0579',         &
                                      2, 2, myid, 6, 0 )
                    ENDIF
@@ -4140,5 +4239,7 @@
 !--    required. 
        IF ( collective_read )  THEN
+#if defined( __netcdf4_parallel )
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif
        ENDIF
 !
@@ -4200,5 +4301,7 @@
 !--    required. 
        IF ( collective_read )  THEN
+#if defined( __netcdf4_parallel )       
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif
        ENDIF
 !
@@ -4260,5 +4363,7 @@
 !--    required. 
        IF ( collective_read )  THEN
+#if defined( __netcdf4_parallel )        
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif          
        ENDIF
 !
@@ -4326,5 +4431,7 @@
 !--    required. 
        IF ( collective_read )  THEN
+#if defined( __netcdf4_parallel )
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif          
        ENDIF
 !
@@ -4394,5 +4501,7 @@
 !--    required. 
        IF ( collective_read )  THEN
+#if defined( __netcdf4_parallel )       
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif
        ENDIF
 !
@@ -4466,5 +4575,7 @@
 ! !--    required. 
 !        IF ( collective_read )  THEN
+! #if defined( __netcdf4_parallel )
 !           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+! #endif
 !        ENDIF
 ! 
@@ -4542,5 +4653,7 @@
 !--    required. 
        IF ( collective_read )  THEN
+#if defined( __netcdf4_parallel )       
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif
        ENDIF
 !
@@ -4632,5 +4745,7 @@
 !--    read operations are only enabled for top-boundary data.
        IF ( collective_read  .AND.  par_access )  THEN
+#if defined( __netcdf4_parallel )       
           nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)
+#endif
        ENDIF    
 !
Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3208)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3209)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Apply an additional switch controlling the nesting of chemical species
 ! 
 ! Former revisions:
@@ -327,5 +327,5 @@
 
     USE chemistry_model_mod,                                                   &
-        ONLY:  chem_species, spec_conc_2
+        ONLY:  chem_species, nest_chemistry, spec_conc_2
 
     USE cpulog,                                                                &
@@ -1291,5 +1291,5 @@
        ENDIF
        
-       IF ( air_chemistry )  THEN
+       IF ( air_chemistry  .AND.  nest_chemistry )  THEN
           DO  n = 1, nspec
              CALL pmc_set_dataarray_name( 'coarse',                            &
@@ -3515,5 +3515,5 @@
     IF ( TRIM(name) == "s"          )  p_3d => s
     IF ( TRIM(name) == "diss"       )  p_3d => diss   
-    IF ( TRIM(name) == "nr_part"    )   i_2d => nr_part
+    IF ( TRIM(name) == "nr_part"    )  i_2d => nr_part
     IF ( TRIM(name) == "part_adr"   )  i_2d => part_adr
     IF ( INDEX( TRIM(name), "chem_" ) /= 0 )  p_3d => chem_species(n)%conc
@@ -3873,5 +3873,5 @@
        ENDIF
 
-       IF ( air_chemistry )  THEN
+       IF ( air_chemistry  .AND.  nest_chemistry)  THEN
           DO  n = 1, nspec
              CALL pmci_interp_tril_all ( chem_species(n)%conc,                 &
@@ -4632,5 +4632,5 @@
              ENDIF
 
-             IF ( air_chemistry )  THEN
+             IF ( air_chemistry  .AND.  nest_chemistry )  THEN
                 DO  n = 1, nspec
                    CALL pmci_interp_tril_lr( chem_species(n)%conc,             &
@@ -4746,5 +4746,5 @@
              ENDIF
 
-             IF ( air_chemistry )  THEN
+             IF ( air_chemistry  .AND.  nest_chemistry )  THEN
                 DO  n = 1, nspec
                    CALL pmci_interp_tril_lr( chem_species(n)%conc,             &
@@ -4857,5 +4857,5 @@
              ENDIF
 
-             IF ( air_chemistry )  THEN
+             IF ( air_chemistry  .AND.  nest_chemistry )  THEN
                 DO  n = 1, nspec
                    CALL pmci_interp_tril_sn( chem_species(n)%conc,             &
@@ -4968,5 +4968,5 @@
              ENDIF
 
-             IF ( air_chemistry )  THEN
+             IF ( air_chemistry  .AND.  nest_chemistry )  THEN
                 DO  n = 1, nspec
                    CALL pmci_interp_tril_sn( chem_species(n)%conc,             &
@@ -5041,5 +5041,5 @@
        ENDIF
 
-       IF ( air_chemistry )  THEN
+       IF ( air_chemistry  .AND.  nest_chemistry )  THEN
           DO  n = 1, nspec
              CALL pmci_interp_tril_t( chem_species(n)%conc,                    &
@@ -5124,5 +5124,5 @@
       ENDIF
 
-      IF ( air_chemistry )  THEN
+      IF ( air_chemistry  .AND.  nest_chemistry )  THEN
          DO  n = 1, nspec
             CALL pmci_anterp_tophat( chem_species(n)%conc,                     &
@@ -5987,5 +5987,5 @@
 !
 !-- Set Neumann boundary conditions for chemical species
-    IF ( air_chemistry )  THEN
+    IF ( air_chemistry  .AND.  nest_chemistry )  THEN
        IF ( ibc_cs_b == 1 )  THEN
           DO  n = 1, nspec
