Index: /palm/trunk/SOURCE/nesting_offl_mod.f90
===================================================================
--- /palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 4723)
+++ /palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 4724)
@@ -20,9 +20,13 @@
 ! Current revisions:
 ! ------------------
-! 
-! 
+!
+!
 ! Former revisions:
 ! -----------------
 ! $Id$
+! - Enable LOD=1 input of boundary conditions
+! - Minor bugfix - add missing initialization of the top boundary
+! 
+! 4582 2020-06-29 09:22:11Z suehring
 ! Remove unused variable
 ! 
@@ -220,6 +224,9 @@
 
     USE netcdf_data_input_mod,                                                 &
-        ONLY:  check_existence,                                                &
+        ONLY:  char_fill,                                                      &
+               char_lod,                                                       &
+               check_existence,                                                &
                close_input_file,                                               &
+               get_attribute,                                                  &
                get_dimension_length,                                           &
                get_variable,                                                   &
@@ -260,11 +267,41 @@
        CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names_chem_t  !< names of mesoscale nested chemistry variables at top boundary
 
-       INTEGER(iwp) ::  nt     !< number of time levels in dynamic input file
-       INTEGER(iwp) ::  nzu    !< number of vertical levels on scalar grid in dynamic input file
-       INTEGER(iwp) ::  nzw    !< number of vertical levels on w grid in dynamic input file
-       INTEGER(iwp) ::  tind   !< time index for reference time in mesoscale-offline nesting
-       INTEGER(iwp) ::  tind_p !< time index for following time in mesoscale-offline nesting
-
-       LOGICAL      ::  init         = .FALSE. !< flag indicating that offline nesting is already initialized
+       INTEGER(iwp) ::  lod_east_pt  = 2  !< level-of-detail of input data of potential temperature at the eastern boundary
+       INTEGER(iwp) ::  lod_east_qc  = 2  !< level-of-detail of input data of cloud-water mixture fraction at the eastern boundary
+       INTEGER(iwp) ::  lod_east_qv  = 2  !< level-of-detail of input data of specific humidity at the eastern boundary
+       INTEGER(iwp) ::  lod_east_u   = 2  !< level-of-detail of input data of the u-component at the eastern boundary
+       INTEGER(iwp) ::  lod_east_v   = 2  !< level-of-detail of input data of the v-component at the eastern boundary
+       INTEGER(iwp) ::  lod_east_w   = 2  !< level-of-detail of input data of the w-component at the eastern boundary
+       INTEGER(iwp) ::  lod_north_pt = 2  !< level-of-detail of input data of potential temperature at the northern boundary
+       INTEGER(iwp) ::  lod_north_qc = 2  !< level-of-detail of input data of cloud-water mixture fraction at the northern boundary
+       INTEGER(iwp) ::  lod_north_qv = 2  !< level-of-detail of input data of specific humidity at the northern boundary
+       INTEGER(iwp) ::  lod_north_u  = 2  !< level-of-detail of input data of the u-component at the northern boundary
+       INTEGER(iwp) ::  lod_north_v  = 2  !< level-of-detail of input data of the v-component at the northern boundary
+       INTEGER(iwp) ::  lod_north_w  = 2  !< level-of-detail of input data of the w-component at the northern boundary
+       INTEGER(iwp) ::  lod_south_pt = 2  !< level-of-detail of input data of potential temperature at the southern boundary
+       INTEGER(iwp) ::  lod_south_qc = 2  !< level-of-detail of input data of cloud-water mixture fraction at the southern boundary
+       INTEGER(iwp) ::  lod_south_qv = 2  !< level-of-detail of input data of specific humidity at the southern boundary
+       INTEGER(iwp) ::  lod_south_u  = 2  !< level-of-detail of input data of the u-component at the southern boundary
+       INTEGER(iwp) ::  lod_south_v  = 2  !< level-of-detail of input data of the v-component at the southern boundary
+       INTEGER(iwp) ::  lod_south_w  = 2  !< level-of-detail of input data of the w-component at the southern boundary
+       INTEGER(iwp) ::  lod_top_pt   = 2  !< level-of-detail of input data of potential temperature at the top boundary
+       INTEGER(iwp) ::  lod_top_qc   = 2  !< level-of-detail of input data of cloud-water mixture fraction at the top boundary
+       INTEGER(iwp) ::  lod_top_qv   = 2  !< level-of-detail of input data of specific humidity at the top boundary
+       INTEGER(iwp) ::  lod_top_u    = 2  !< level-of-detail of input data of the u-component at the top boundary
+       INTEGER(iwp) ::  lod_top_v    = 2  !< level-of-detail of input data of the v-component at the top boundary
+       INTEGER(iwp) ::  lod_top_w    = 2  !< level-of-detail of input data of the w-component at the top boundary
+       INTEGER(iwp) ::  lod_west_pt  = 2  !< level-of-detail of input data of potential temperature at the western boundary
+       INTEGER(iwp) ::  lod_west_qc  = 2  !< level-of-detail of input data of cloud-water mixture fraction at the western boundary
+       INTEGER(iwp) ::  lod_west_qv  = 2  !< level-of-detail of input data of specific humidity at the western boundary
+       INTEGER(iwp) ::  lod_west_u   = 2  !< level-of-detail of input data of the u-component at the western boundary
+       INTEGER(iwp) ::  lod_west_v   = 2  !< level-of-detail of input data of the v-component at the western boundary
+       INTEGER(iwp) ::  lod_west_w   = 2  !< level-of-detail of input data of the w-component at the western boundary
+       INTEGER(iwp) ::  nt                !< number of time levels in dynamic input file
+       INTEGER(iwp) ::  nzu               !< number of vertical levels on scalar grid in dynamic input file
+       INTEGER(iwp) ::  nzw               !< number of vertical levels on w grid in dynamic input file
+       INTEGER(iwp) ::  tind              !< time index for reference time in mesoscale-offline nesting
+       INTEGER(iwp) ::  tind_p            !< time index for following time in mesoscale-offline nesting
+
+       LOGICAL      ::  init = .FALSE.    !< flag indicating that offline nesting is already initialized
 
        LOGICAL, DIMENSION(:), ALLOCATABLE ::  chem_from_file_l !< flags inidicating whether left boundary data for chemistry is in dynamic input file  
@@ -282,41 +319,49 @@
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  vg         !< domain-averaged geostrophic component
 
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_left   !< u-component at left boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_left   !< v-component at left boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_left   !< w-component at left boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_left   !< mixing ratio at left boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_left  !< potentital temperautre at left boundary
-
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_north  !< u-component at north boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_north  !< v-component at north boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_north  !< w-component at north boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_north  !< mixing ratio at north boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_north !< potentital temperautre at north boundary
-
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_right  !< u-component at right boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_right  !< v-component at right boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_right  !< w-component at right boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_right  !< mixing ratio at right boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_right !< potentital temperautre at right boundary
-
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_south  !< u-component at south boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_south  !< v-component at south boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_south  !< w-component at south boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_south  !< mixing ratio at south boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_south !< potentital temperautre at south boundary
-
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_l      !< mixing ratio at left boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_n      !< mixing ratio at north boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_r      !< mixing ratio at right boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_s      !< mixing ratio at south boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_top    !< mixing ratio at top boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_l     !< potentital temperautre at left boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_n     !< potentital temperautre at north boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_r     !< potentital temperautre at right boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_s     !< potentital temperautre at south boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_top   !< potentital temperautre at top boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_l      !< u-component at left boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_n      !< u-component at north boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_r      !< u-component at right boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_s      !< u-component at south boundary
        REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  u_top    !< u-component at top boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_l      !< v-component at left boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_n      !< v-component at north boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_r      !< v-component at right boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_s      !< v-component at south boundary
        REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_top    !< v-component at top boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_l      !< w-component at left boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_n      !< w-component at north boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_r      !< w-component at right boundary
+       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_s      !< w-component at south boundary
        REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  w_top    !< w-component at top boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  q_top    !< mixing ratio at top boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  pt_top   !< potentital temperautre at top boundary
-       
-       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_left   !< chemical species at left boundary
-       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_north  !< chemical species at left boundary
-       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_right  !< chemical species at left boundary
-       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_south  !< chemical species at left boundary
-       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_top    !< chemical species at left boundary
+
+       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_l   !< chemical species at left boundary
+       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_n   !< chemical species at north boundary
+       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_r   !< chemical species at right boundary
+       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_s   !< chemical species at south boundary
+       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  chem_top !< chemical species at left boundary
 
     END TYPE nest_offl_type
+
+    INTEGER(iwp) ::  i_bound     !< boundary grid point in x-direction for scalars, v, and w
+    INTEGER(iwp) ::  i_bound_u   !< boundary grid point in x-direction for u
+    INTEGER(iwp) ::  i_start     !< start index for array allocation along x-direction at norther/southern boundary (scalars, v, w)
+    INTEGER(iwp) ::  i_start_u   !< start index for array allocation along x-direction at norther/southern boundary (u)
+    INTEGER(iwp) ::  i_end       !< end index for array allocation along x-direction at norther/southern boundary
+    INTEGER(iwp) ::  j_bound     !< boundary grid point in y-direction for scalars, u, and w
+    INTEGER(iwp) ::  j_bound_v   !< boundary grid point in y-direction for v
+    INTEGER(iwp) ::  j_start     !< start index for array allocation along y-direction at eastern/western boundary (scalars, u, w)
+    INTEGER(iwp) ::  j_start_v   !< start index for array allocation along y-direction at eastern/western boundary (v)
+    INTEGER(iwp) ::  j_end       !< end index for array allocation along y-direction at eastern/western boundary
+    INTEGER(iwp) ::  lod         !< level-of-detail of lateral input data
 
     REAL(wp) ::  fac_dt              !< interpolation factor
@@ -466,6 +511,6 @@
 !--    7200.0. Further, since time_since_reference_point is negativ here when 
 !--    spinup is applied, use MAX function to obtain correct time index. 
-       nest_offl%tind = MINLOC( ABS( nest_offl%time -                          &
-                                     MAX( time_since_reference_point, 0.0_wp)  &
+       nest_offl%tind = MINLOC( ABS( nest_offl%time -                                              &
+                                     MAX( time_since_reference_point, 0.0_wp)                      &
                                    ), DIM = 1 ) - 1
        nest_offl%tind_p = nest_offl%tind + 1
@@ -473,5 +518,5 @@
 !--    Open file in read-only mode
 #if defined ( __netcdf )
-       CALL open_read_file( TRIM( input_file_dynamic ) //                      &
+       CALL open_read_file( TRIM( input_file_dynamic ) //                                          &
                             TRIM( coupling_char ), pids_id )
 !
@@ -488,346 +533,592 @@
 !--    For the v-component, the data starts at nysv, while for the other
 !--    quantities the data starts at nys. This is equivalent at the north
-!--    and south domain boundary for the u-component. 
+!--    and south domain boundary for the u-component (nxlu).
 !--    Note, lateral data is also accessed by parallel IO, which is the reason
 !--    why different arguments are passed depending on the boundary control
-!--    flags. Cores that do not belong to the respective boundary just make
+!--    flags. Cores that do not belong to the respective boundary only do
 !--    a dummy read with count = 0, just in order to participate the collective
-!--    operation. 
-!--    Read data for western boundary    
-       CALL get_variable( pids_id, 'ls_forcing_left_u',                        &
-                          nest_offl%u_left,                                    & ! array to be read
-                          MERGE( nys+1, 1, bc_dirichlet_l),                    & ! start index y direction
-                          MERGE( nzb+1, 1, bc_dirichlet_l),                    & ! start index z direction
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),         & ! start index time dimension
-                          MERGE( nyn-nys+1, 0, bc_dirichlet_l),                & ! number of elements along y
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_l),            & ! number of elements alogn z
-                          MERGE( 2, 0, bc_dirichlet_l),                        & ! number of time steps (2 or 0)
-                          .TRUE. )                                               ! parallel IO when compiled accordingly
-      
-       CALL get_variable( pids_id, 'ls_forcing_left_v',                        &
-                          nest_offl%v_left,                                    &
-                          MERGE( nysv, 1, bc_dirichlet_l),                     &
-                          MERGE( nzb+1, 1, bc_dirichlet_l),                    &
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),         &
-                          MERGE( nyn-nysv+1, 0, bc_dirichlet_l),               &
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_l),            &
-                          MERGE( 2, 0, bc_dirichlet_l),                        &
-                          .TRUE. )                                        
-
-       CALL get_variable( pids_id, 'ls_forcing_left_w',                        &
-                          nest_offl%w_left,                                    &
-                          MERGE( nys+1, 1, bc_dirichlet_l),                    &
-                          MERGE( nzb+1, 1, bc_dirichlet_l),                    &
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),         &
-                          MERGE( nyn-nys+1, 0, bc_dirichlet_l),                &
-                          MERGE( nest_offl%nzw, 0, bc_dirichlet_l),            &
-                          MERGE( 2, 0, bc_dirichlet_l),                        &
-                          .TRUE. )   
-
-       IF ( .NOT. neutral )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_left_pt',                    &
-                             nest_offl%pt_left,                                &
-                             MERGE( nys+1, 1, bc_dirichlet_l),                 &
-                             MERGE( nzb+1, 1, bc_dirichlet_l),                 &
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),      &
-                             MERGE( nyn-nys+1, 0, bc_dirichlet_l),             &
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_l),         &
-                             MERGE( 2, 0, bc_dirichlet_l),                     &
+!--    operation. This is because collective parallel access shows better
+!--    performance than just a conditional access.
+!--    Read data for LOD 2, i.e. time-dependent xz-, yz-, and xy-slices.
+       IF ( lod == 2 )  THEN
+          CALL get_variable( pids_id, 'ls_forcing_left_u',                                         &
+                             nest_offl%u_l,                                                        & ! array to be read
+                             MERGE( nys+1, 1, bc_dirichlet_l),                                     & ! start index y direction
+                             MERGE( nzb+1, 1, bc_dirichlet_l),                                     & ! start index z direction
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                          & ! start index time dimension
+                             MERGE( nyn-nys+1, 0, bc_dirichlet_l),                                 & ! number of elements along y
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                             & ! number of elements alogn z
+                             MERGE( 2, 0, bc_dirichlet_l),                                         & ! number of time steps (2 or 0)
+                             .TRUE. )                                                                ! parallel IO when compiled accordingly
+
+          CALL get_variable( pids_id, 'ls_forcing_left_v',                                         &
+                             nest_offl%v_l,                                                        &
+                             MERGE( nysv, 1, bc_dirichlet_l),                                      &
+                             MERGE( nzb+1, 1, bc_dirichlet_l),                                     &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                          &
+                             MERGE( nyn-nysv+1, 0, bc_dirichlet_l),                                &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                             &
+                             MERGE( 2, 0, bc_dirichlet_l),                                         &
                              .TRUE. )
-       ENDIF
-
-       IF ( humidity )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_left_qv',                    &
-                             nest_offl%q_left,                                 &
-                             MERGE( nys+1, 1, bc_dirichlet_l),                 &
-                             MERGE( nzb+1, 1, bc_dirichlet_l),                 &
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),      &
-                             MERGE( nyn-nys+1, 0, bc_dirichlet_l),             &
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_l),         &
-                             MERGE( 2, 0, bc_dirichlet_l),                     &
+
+          CALL get_variable( pids_id, 'ls_forcing_left_w',                                         &
+                             nest_offl%w_l,                                                        &
+                             MERGE( nys+1, 1, bc_dirichlet_l),                                     &
+                             MERGE( nzb+1, 1, bc_dirichlet_l),                                     &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                          &
+                             MERGE( nyn-nys+1, 0, bc_dirichlet_l),                                 &
+                             MERGE( nest_offl%nzw, 0, bc_dirichlet_l),                             &
+                             MERGE( 2, 0, bc_dirichlet_l),                                         &
+                             .TRUE. )   
+
+          IF ( .NOT. neutral )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_left_pt',                                     &
+                                nest_offl%pt_l,                                                    &
+                                MERGE( nys+1, 1, bc_dirichlet_l),                                  &
+                                MERGE( nzb+1, 1, bc_dirichlet_l),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                       &
+                                MERGE( nyn-nys+1, 0, bc_dirichlet_l),                              &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                          &
+                                MERGE( 2, 0, bc_dirichlet_l),                                      &
+                                .TRUE. )
+          ENDIF
+
+          IF ( humidity )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_left_qv',                                     &
+                                nest_offl%q_l,                                                     &
+                                MERGE( nys+1, 1, bc_dirichlet_l),                                  &
+                                MERGE( nzb+1, 1, bc_dirichlet_l),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                       &
+                                MERGE( nyn-nys+1, 0, bc_dirichlet_l),                              &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                          &
+                                MERGE( 2, 0, bc_dirichlet_l),                                      &
+                                .TRUE. )
+          ENDIF
+
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND(nest_offl%var_names_chem_l, 1)
+                IF ( check_existence( nest_offl%var_names,                                         &
+                                      nest_offl%var_names_chem_l(n) ) )  THEN
+                   CALL get_variable( pids_id,                                                     &
+                                      TRIM( nest_offl%var_names_chem_l(n) ),                       &
+                                      nest_offl%chem_l(:,:,:,n),                                   &
+                                      MERGE( nys+1, 1, bc_dirichlet_l),                            &
+                                      MERGE( nzb+1, 1, bc_dirichlet_l),                            &
+                                      MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                 &
+                                      MERGE( nyn-nys+1, 0, bc_dirichlet_l),                        &
+                                      MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                    &
+                                      MERGE( 2, 0, bc_dirichlet_l),                                &
+                                      .TRUE. )
+                   nest_offl%chem_from_file_l(n) = .TRUE.
+                ENDIF
+             ENDDO
+          ENDIF
+!
+!--       Read data for eastern boundary    
+          CALL get_variable( pids_id, 'ls_forcing_right_u',                                        &
+                             nest_offl%u_r,                                                        &
+                             MERGE( nys+1, 1, bc_dirichlet_r),                                     &
+                             MERGE( nzb+1, 1, bc_dirichlet_r),                                     &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                          &
+                             MERGE( nyn-nys+1, 0, bc_dirichlet_r),                                 &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                             &
+                             MERGE( 2, 0, bc_dirichlet_r),                                         &
                              .TRUE. )
-       ENDIF
-
-       IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-          DO  n = 1, UBOUND(nest_offl%var_names_chem_l, 1)
-             IF ( check_existence( nest_offl%var_names,                        &
-                                   nest_offl%var_names_chem_l(n) ) )  THEN
-                CALL get_variable( pids_id,                                    &
-                           TRIM( nest_offl%var_names_chem_l(n) ),              &
-                           nest_offl%chem_left(:,:,:,n),                       &
-                           MERGE( nys+1, 1, bc_dirichlet_l),                   &
-                           MERGE( nzb+1, 1, bc_dirichlet_l),                   &
-                           MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),        &
-                           MERGE( nyn-nys+1, 0, bc_dirichlet_l),               &
-                           MERGE( nest_offl%nzu, 0, bc_dirichlet_l),           &
-                           MERGE( 2, 0, bc_dirichlet_l),                       &
-                           .TRUE. )
-                nest_offl%chem_from_file_l(n) = .TRUE.
-             ENDIF
-          ENDDO
-       ENDIF
-!
-!--    Read data for eastern boundary    
-       CALL get_variable( pids_id, 'ls_forcing_right_u',                       &
-                          nest_offl%u_right,                                   &
-                          MERGE( nys+1, 1, bc_dirichlet_r),                    &
-                          MERGE( nzb+1, 1, bc_dirichlet_r),                    &
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),         &
-                          MERGE( nyn-nys+1, 0, bc_dirichlet_r),                &
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_r),            &
-                          MERGE( 2, 0, bc_dirichlet_r),                        &
-                          .TRUE. )                                             
-      
-       CALL get_variable( pids_id, 'ls_forcing_right_v',                       &
-                          nest_offl%v_right,                                   &
-                          MERGE( nysv, 1, bc_dirichlet_r),                     &
-                          MERGE( nzb+1, 1, bc_dirichlet_r),                    &
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),         &
-                          MERGE( nyn-nysv+1, 0, bc_dirichlet_r),               &
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_r),            &
-                          MERGE( 2, 0, bc_dirichlet_r),                        &
-                          .TRUE. )                                             
-
-       CALL get_variable( pids_id, 'ls_forcing_right_w',                       &
-                          nest_offl%w_right,                                   &
-                          MERGE( nys+1, 1, bc_dirichlet_r),                    &
-                          MERGE( nzb+1, 1, bc_dirichlet_r),                    &
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),         &
-                          MERGE( nyn-nys+1, 0, bc_dirichlet_r),                &
-                          MERGE( nest_offl%nzw, 0, bc_dirichlet_r),            &
-                          MERGE( 2, 0, bc_dirichlet_r),                        &
-                          .TRUE. )   
-
-       IF ( .NOT. neutral )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_right_pt',                   &
-                             nest_offl%pt_right,                               &
-                             MERGE( nys+1, 1, bc_dirichlet_r),                 &
-                             MERGE( nzb+1, 1, bc_dirichlet_r),                 &
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),      &
-                             MERGE( nyn-nys+1, 0, bc_dirichlet_r),             &
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_r),         &
-                             MERGE( 2, 0, bc_dirichlet_r),                     &
+
+          CALL get_variable( pids_id, 'ls_forcing_right_v',                                        &
+                             nest_offl%v_r,                                                        &
+                             MERGE( nysv, 1, bc_dirichlet_r),                                      &
+                             MERGE( nzb+1, 1, bc_dirichlet_r),                                     &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                          &
+                             MERGE( nyn-nysv+1, 0, bc_dirichlet_r),                                &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                             &
+                             MERGE( 2, 0, bc_dirichlet_r),                                         &
                              .TRUE. )
-       ENDIF
-
-       IF ( humidity )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_right_qv',                   &
-                             nest_offl%q_right,                                &
-                             MERGE( nys+1, 1, bc_dirichlet_r),                 &
-                             MERGE( nzb+1, 1, bc_dirichlet_r),                 &
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),      &
-                             MERGE( nyn-nys+1, 0, bc_dirichlet_r),             &
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_r),         &
-                             MERGE( 2, 0, bc_dirichlet_r),                     &
+
+          CALL get_variable( pids_id, 'ls_forcing_right_w',                                        &
+                             nest_offl%w_r,                                                        &
+                             MERGE( nys+1, 1, bc_dirichlet_r),                                     &
+                             MERGE( nzb+1, 1, bc_dirichlet_r),                                     &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                          &
+                             MERGE( nyn-nys+1, 0, bc_dirichlet_r),                                 &
+                             MERGE( nest_offl%nzw, 0, bc_dirichlet_r),                             &
+                             MERGE( 2, 0, bc_dirichlet_r),                                         &
                              .TRUE. )
-       ENDIF
-
-       IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-          DO  n = 1, UBOUND(nest_offl%var_names_chem_r, 1)
-             IF ( check_existence( nest_offl%var_names,                        &
-                                   nest_offl%var_names_chem_r(n) ) )  THEN
-                CALL get_variable( pids_id,                                    &
-                           TRIM( nest_offl%var_names_chem_r(n) ),              &
-                           nest_offl%chem_right(:,:,:,n),                      &
-                           MERGE( nys+1, 1, bc_dirichlet_r),                   &
-                           MERGE( nzb+1, 1, bc_dirichlet_r),                   &
-                           MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),        &
-                           MERGE( nyn-nys+1, 0, bc_dirichlet_r),               &
-                           MERGE( nest_offl%nzu, 0, bc_dirichlet_r),           &
-                           MERGE( 2, 0, bc_dirichlet_r),                       &
-                           .TRUE. )
-                nest_offl%chem_from_file_r(n) = .TRUE.
-             ENDIF
-          ENDDO
-       ENDIF
-!
-!--    Read data for northern boundary
-       CALL get_variable( pids_id, 'ls_forcing_north_u',                       & ! array to be read
-                          nest_offl%u_north,                                   & ! start index x direction
-                          MERGE( nxlu, 1, bc_dirichlet_n ),                    & ! start index z direction
-                          MERGE( nzb+1, 1, bc_dirichlet_n ),                   & ! start index time dimension
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),        & ! number of elements along x
-                          MERGE( nxr-nxlu+1, 0, bc_dirichlet_n ),              & ! number of elements alogn z 
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),           & ! number of time steps (2 or 0)
-                          MERGE( 2, 0, bc_dirichlet_n ),                       & ! parallel IO when compiled accordingly
-                          .TRUE. )
-
-       CALL get_variable( pids_id, 'ls_forcing_north_v',                       & ! array to be read
-                          nest_offl%v_north,                                   & ! start index x direction
-                          MERGE( nxl+1, 1, bc_dirichlet_n ),                   & ! start index z direction
-                          MERGE( nzb+1, 1, bc_dirichlet_n ),                   & ! start index time dimension
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),        & ! number of elements along x
-                          MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),               & ! number of elements alogn z 
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),           & ! number of time steps (2 or 0)
-                          MERGE( 2, 0, bc_dirichlet_n ),                       & ! parallel IO when compiled accordingly
-                          .TRUE. )
-
-       CALL get_variable( pids_id, 'ls_forcing_north_w',                       & ! array to be read
-                          nest_offl%w_north,                                   & ! start index x direction
-                          MERGE( nxl+1, 1, bc_dirichlet_n ),                   & ! start index z direction
-                          MERGE( nzb+1, 1, bc_dirichlet_n ),                   & ! start index time dimension
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),        & ! number of elements along x
-                          MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),               & ! number of elements alogn z 
-                          MERGE( nest_offl%nzw, 0, bc_dirichlet_n ),           & ! number of time steps (2 or 0)
-                          MERGE( 2, 0, bc_dirichlet_n ),                       & ! parallel IO when compiled accordingly
-                          .TRUE. )
-
-       IF ( .NOT. neutral )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_north_pt',                   & ! array to be read
-                             nest_offl%pt_north,                               & ! start index x direction
-                             MERGE( nxl+1, 1, bc_dirichlet_n ),                & ! start index z direction
-                             MERGE( nzb+1, 1, bc_dirichlet_n ),                & ! start index time dimension
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),     & ! number of elements along x
-                             MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),            & ! number of elements alogn z 
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),        & ! number of time steps (2 or 0)
-                             MERGE( 2, 0, bc_dirichlet_n ),                    & ! parallel IO when compiled accordingly
+
+          IF ( .NOT. neutral )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_right_pt',                                    &
+                                nest_offl%pt_r,                                                    &
+                                MERGE( nys+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nzb+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                       &
+                                MERGE( nyn-nys+1, 0, bc_dirichlet_r),                              &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                          &
+                                MERGE( 2, 0, bc_dirichlet_r),                                      &
+                                .TRUE. )
+          ENDIF
+
+          IF ( humidity )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_right_qv',                                    &
+                                nest_offl%q_r,                                                     &
+                                MERGE( nys+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nzb+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                       &
+                                MERGE( nyn-nys+1, 0, bc_dirichlet_r),                              &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                          &
+                                MERGE( 2, 0, bc_dirichlet_r),                                      &
+                                .TRUE. )
+          ENDIF
+
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND(nest_offl%var_names_chem_r, 1)
+                IF ( check_existence( nest_offl%var_names,                                         &
+                                      nest_offl%var_names_chem_r(n) ) )  THEN
+                   CALL get_variable( pids_id,                                                     &
+                                      TRIM( nest_offl%var_names_chem_r(n) ),                       &
+                                      nest_offl%chem_r(:,:,:,n),                                   &
+                                      MERGE( nys+1, 1, bc_dirichlet_r),                            &
+                                      MERGE( nzb+1, 1, bc_dirichlet_r),                            &
+                                      MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                 &
+                                      MERGE( nyn-nys+1, 0, bc_dirichlet_r),                        &
+                                      MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                    &
+                                      MERGE( 2, 0, bc_dirichlet_r),                                &
+                                      .TRUE. )
+                   nest_offl%chem_from_file_r(n) = .TRUE.
+                ENDIF
+             ENDDO
+          ENDIF
+!
+!--       Read data for northern boundary
+          CALL get_variable( pids_id, 'ls_forcing_north_u',                                        &
+                             nest_offl%u_n,                                                        &
+                             MERGE( nxlu, 1, bc_dirichlet_n ),                                     &
+                             MERGE( nzb+1, 1, bc_dirichlet_n ),                                    &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),                         &
+                             MERGE( nxr-nxlu+1, 0, bc_dirichlet_n ),                               &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),                            &
+                             MERGE( 2, 0, bc_dirichlet_n ),                                        &
                              .TRUE. )
-       ENDIF
-       IF ( humidity )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_north_qv',                   & ! array to be read
-                             nest_offl%q_north,                                & ! start index x direction
-                             MERGE( nxl+1, 1, bc_dirichlet_n ),                & ! start index z direction
-                             MERGE( nzb+1, 1, bc_dirichlet_n ),                & ! start index time dimension
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),     & ! number of elements along x
-                             MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),            & ! number of elements alogn z 
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),        & ! number of time steps (2 or 0)
-                             MERGE( 2, 0, bc_dirichlet_n ),                    & ! parallel IO when compiled accordingly
+
+          CALL get_variable( pids_id, 'ls_forcing_north_v',                                        &
+                             nest_offl%v_n,                                                        &
+                             MERGE( nxl+1, 1, bc_dirichlet_n ),                                    &
+                             MERGE( nzb+1, 1, bc_dirichlet_n ),                                    &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),                         &
+                             MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),                                &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),                            &
+                             MERGE( 2, 0, bc_dirichlet_n ),                                        &
                              .TRUE. )
-       ENDIF
-
-       IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-          DO  n = 1, UBOUND(nest_offl%var_names_chem_n, 1)
-             IF ( check_existence( nest_offl%var_names,                        &
-                                   nest_offl%var_names_chem_n(n) ) )  THEN
-                CALL get_variable( pids_id,                                    &
-                           TRIM( nest_offl%var_names_chem_n(n) ),              &
-                           nest_offl%chem_north(:,:,:,n),                      &
-                           MERGE( nxl+1, 1, bc_dirichlet_n ),                  &
-                           MERGE( nzb+1, 1, bc_dirichlet_n ),                  &
-                           MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),       &
-                           MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),              &
-                           MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),          &
-                           MERGE( 2, 0, bc_dirichlet_n ),                      &
-                           .TRUE. )
-                nest_offl%chem_from_file_n(n) = .TRUE.
-             ENDIF
-          ENDDO
-       ENDIF
-!
-!--    Read data for southern boundary
-       CALL get_variable( pids_id, 'ls_forcing_south_u',                       & ! array to be read
-                          nest_offl%u_south,                                   & ! start index x direction
-                          MERGE( nxlu, 1, bc_dirichlet_s ),                    & ! start index z direction
-                          MERGE( nzb+1, 1, bc_dirichlet_s ),                   & ! start index time dimension
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),        & ! number of elements along x
-                          MERGE( nxr-nxlu+1, 0, bc_dirichlet_s ),              & ! number of elements alogn z 
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),           & ! number of time steps (2 or 0)
-                          MERGE( 2, 0, bc_dirichlet_s ),                       & ! parallel IO when compiled accordingly
-                          .TRUE. )
-
-       CALL get_variable( pids_id, 'ls_forcing_south_v',                       & ! array to be read
-                          nest_offl%v_south,                                   & ! start index x direction
-                          MERGE( nxl+1, 1, bc_dirichlet_s ),                   & ! start index z direction
-                          MERGE( nzb+1, 1, bc_dirichlet_s ),                   & ! start index time dimension
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),        & ! number of elements along x
-                          MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),               & ! number of elements alogn z 
-                          MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),           & ! number of time steps (2 or 0)
-                          MERGE( 2, 0, bc_dirichlet_s ),                       & ! parallel IO when compiled accordingly
-                          .TRUE. )
-
-       CALL get_variable( pids_id, 'ls_forcing_south_w',                       & ! array to be read
-                          nest_offl%w_south,                                   & ! start index x direction
-                          MERGE( nxl+1, 1, bc_dirichlet_s ),                   & ! start index z direction
-                          MERGE( nzb+1, 1, bc_dirichlet_s ),                   & ! start index time dimension
-                          MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),        & ! number of elements along x
-                          MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),               & ! number of elements alogn z 
-                          MERGE( nest_offl%nzw, 0, bc_dirichlet_s ),           & ! number of time steps (2 or 0)
-                          MERGE( 2, 0, bc_dirichlet_s ),                       & ! parallel IO when compiled accordingly
-                          .TRUE. )
-
-       IF ( .NOT. neutral )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_south_pt',                   & ! array to be read
-                             nest_offl%pt_south,                               & ! start index x direction
-                             MERGE( nxl+1, 1, bc_dirichlet_s ),                & ! start index z direction
-                             MERGE( nzb+1, 1, bc_dirichlet_s ),                & ! start index time dimension
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),     & ! number of elements along x
-                             MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),            & ! number of elements alogn z 
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),        & ! number of time steps (2 or 0)
-                             MERGE( 2, 0, bc_dirichlet_s ),                    & ! parallel IO when compiled accordingly
+
+          CALL get_variable( pids_id, 'ls_forcing_north_w',                                        &
+                             nest_offl%w_n,                                                        &
+                             MERGE( nxl+1, 1, bc_dirichlet_n ),                                    &
+                             MERGE( nzb+1, 1, bc_dirichlet_n ),                                    &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),                         &
+                             MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),                                &
+                             MERGE( nest_offl%nzw, 0, bc_dirichlet_n ),                            &
+                             MERGE( 2, 0, bc_dirichlet_n ),                                        &
                              .TRUE. )
-       ENDIF
-       IF ( humidity )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_south_qv',                   & ! array to be read
-                             nest_offl%q_south,                                & ! start index x direction
-                             MERGE( nxl+1, 1, bc_dirichlet_s ),                & ! start index z direction
-                             MERGE( nzb+1, 1, bc_dirichlet_s ),                & ! start index time dimension
-                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),     & ! number of elements along x
-                             MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),            & ! number of elements alogn z 
-                             MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),        & ! number of time steps (2 or 0)
-                             MERGE( 2, 0, bc_dirichlet_s ),                    & ! parallel IO when compiled accordingly
+
+          IF ( .NOT. neutral )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_north_pt',                                    &
+                                nest_offl%pt_n,                                                    &
+                                MERGE( nxl+1, 1, bc_dirichlet_n ),                                 &
+                                MERGE( nzb+1, 1, bc_dirichlet_n ),                                 &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),                      &
+                                MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),                             &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),                         &
+                                MERGE( 2, 0, bc_dirichlet_n ),                                     &
+                                .TRUE. )
+          ENDIF
+          IF ( humidity )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_north_qv',                                    &
+                                nest_offl%q_n,                                                     &
+                                MERGE( nxl+1, 1, bc_dirichlet_n ),                                 &
+                                MERGE( nzb+1, 1, bc_dirichlet_n ),                                 &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),                      &
+                                MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),                             &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),                         &
+                                MERGE( 2, 0, bc_dirichlet_n ),                                     &
+                                .TRUE. )
+          ENDIF
+
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND(nest_offl%var_names_chem_n, 1)
+                IF ( check_existence( nest_offl%var_names,                                         &
+                                      nest_offl%var_names_chem_n(n) ) )  THEN
+                   CALL get_variable( pids_id,                                                     &
+                                      TRIM( nest_offl%var_names_chem_n(n) ),                       &
+                                      nest_offl%chem_n(:,:,:,n),                                   &
+                                      MERGE( nxl+1, 1, bc_dirichlet_n ),                           &
+                                      MERGE( nzb+1, 1, bc_dirichlet_n ),                           &
+                                      MERGE( nest_offl%tind+1, 1, bc_dirichlet_n ),                &
+                                      MERGE( nxr-nxl+1, 0, bc_dirichlet_n ),                       &
+                                      MERGE( nest_offl%nzu, 0, bc_dirichlet_n ),                   &
+                                      MERGE( 2, 0, bc_dirichlet_n ),                               &
+                                      .TRUE. )
+                   nest_offl%chem_from_file_n(n) = .TRUE.
+                ENDIF
+             ENDDO
+          ENDIF
+!
+!--       Read data for southern boundary
+          CALL get_variable( pids_id, 'ls_forcing_south_u',                                        &
+                             nest_offl%u_s,                                                        &
+                             MERGE( nxlu, 1, bc_dirichlet_s ),                                     &
+                             MERGE( nzb+1, 1, bc_dirichlet_s ),                                    &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),                         &
+                             MERGE( nxr-nxlu+1, 0, bc_dirichlet_s ),                               &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),                            &
+                             MERGE( 2, 0, bc_dirichlet_s ),                                        &
                              .TRUE. )
-       ENDIF
-
-       IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-          DO  n = 1, UBOUND(nest_offl%var_names_chem_s, 1)
-             IF ( check_existence( nest_offl%var_names,                        &
-                                   nest_offl%var_names_chem_s(n) ) )  THEN
-                CALL get_variable( pids_id,                                    &
-                           TRIM( nest_offl%var_names_chem_s(n) ),              &
-                           nest_offl%chem_south(:,:,:,n),                      &
-                           MERGE( nxl+1, 1, bc_dirichlet_s ),                  &
-                           MERGE( nzb+1, 1, bc_dirichlet_s ),                  &
-                           MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),       &
-                           MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),              &
-                           MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),          &
-                           MERGE( 2, 0, bc_dirichlet_s ),                      &
-                           .TRUE. )
-                nest_offl%chem_from_file_s(n) = .TRUE.
-             ENDIF
-          ENDDO
-       ENDIF
-!
-!--    Top boundary
-       CALL get_variable( pids_id, 'ls_forcing_top_u',                         &
-                             nest_offl%u_top(0:1,nys:nyn,nxlu:nxr),            &
-                             nxlu, nys+1, nest_offl%tind+1,                    &
+
+          CALL get_variable( pids_id, 'ls_forcing_south_v',                                        &
+                             nest_offl%v_s,                                                        &
+                             MERGE( nxl+1, 1, bc_dirichlet_s ),                                    &
+                             MERGE( nzb+1, 1, bc_dirichlet_s ),                                    &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),                         &
+                             MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),                                &
+                             MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),                            &
+                             MERGE( 2, 0, bc_dirichlet_s ),                                        &
+                             .TRUE. )
+
+          CALL get_variable( pids_id, 'ls_forcing_south_w',                                        &
+                             nest_offl%w_s,                                                        &
+                             MERGE( nxl+1, 1, bc_dirichlet_s ),                                    &
+                             MERGE( nzb+1, 1, bc_dirichlet_s ),                                    &
+                             MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),                         &
+                             MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),                                &
+                             MERGE( nest_offl%nzw, 0, bc_dirichlet_s ),                            &
+                             MERGE( 2, 0, bc_dirichlet_s ),                                        &
+                             .TRUE. )
+
+          IF ( .NOT. neutral )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_south_pt',                                    &
+                                nest_offl%pt_s,                                                    &
+                                MERGE( nxl+1, 1, bc_dirichlet_s ),                                 &
+                                MERGE( nzb+1, 1, bc_dirichlet_s ),                                 &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),                      &
+                                MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),                             &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),                         &
+                                MERGE( 2, 0, bc_dirichlet_s ),                                     &
+                                .TRUE. )
+          ENDIF
+          IF ( humidity )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_south_qv',                                    &
+                                nest_offl%q_s,                                                     &
+                                MERGE( nxl+1, 1, bc_dirichlet_s ),                                 &
+                                MERGE( nzb+1, 1, bc_dirichlet_s ),                                 &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),                      &
+                                MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),                             &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),                         &
+                                MERGE( 2, 0, bc_dirichlet_s ),                                     &
+                                .TRUE. )
+          ENDIF
+
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND(nest_offl%var_names_chem_s, 1)
+                IF ( check_existence( nest_offl%var_names,                                         &
+                                      nest_offl%var_names_chem_s(n) ) )  THEN
+                   CALL get_variable( pids_id,                                                     &
+                                      TRIM( nest_offl%var_names_chem_s(n) ),                       &
+                                      nest_offl%chem_s(:,:,:,n),                                   &
+                                      MERGE( nxl+1, 1, bc_dirichlet_s ),                           &
+                                      MERGE( nzb+1, 1, bc_dirichlet_s ),                           &
+                                      MERGE( nest_offl%tind+1, 1, bc_dirichlet_s ),                &
+                                      MERGE( nxr-nxl+1, 0, bc_dirichlet_s ),                       &
+                                      MERGE( nest_offl%nzu, 0, bc_dirichlet_s ),                   &
+                                      MERGE( 2, 0, bc_dirichlet_s ),                               &
+                                      .TRUE. )
+                   nest_offl%chem_from_file_s(n) = .TRUE.
+                ENDIF
+             ENDDO
+          ENDIF
+!
+!--       Top boundary
+          CALL get_variable( pids_id, 'ls_forcing_top_u',                                          &
+                             nest_offl%u_top(0:1,nys:nyn,nxlu:nxr),                                &
+                             nxlu, nys+1, nest_offl%tind+1,                                        &
                              nxr-nxlu+1, nyn-nys+1, 2, .TRUE. )
 
-       CALL get_variable( pids_id, 'ls_forcing_top_v',                         &
-                             nest_offl%v_top(0:1,nysv:nyn,nxl:nxr),            &
-                             nxl+1, nysv, nest_offl%tind+1,                    &
+          CALL get_variable( pids_id, 'ls_forcing_top_v',                                          &
+                             nest_offl%v_top(0:1,nysv:nyn,nxl:nxr),                                &
+                             nxl+1, nysv, nest_offl%tind+1,                                        &
                              nxr-nxl+1, nyn-nysv+1, 2, .TRUE. )
 
-       CALL get_variable( pids_id, 'ls_forcing_top_w',                         &
-                             nest_offl%w_top(0:1,nys:nyn,nxl:nxr),             &
-                             nxl+1, nys+1, nest_offl%tind+1,                   &
+          CALL get_variable( pids_id, 'ls_forcing_top_w',                                          &
+                             nest_offl%w_top(0:1,nys:nyn,nxl:nxr),                                 &
+                             nxl+1, nys+1, nest_offl%tind+1,                                       &
                              nxr-nxl+1, nyn-nys+1, 2, .TRUE. )
 
-       IF ( .NOT. neutral )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_top_pt',                     &
-                                nest_offl%pt_top(0:1,nys:nyn,nxl:nxr),         &
-                                nxl+1, nys+1, nest_offl%tind+1,                &
+          IF ( .NOT. neutral )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_top_pt',                                      &
+                                nest_offl%pt_top(0:1,nys:nyn,nxl:nxr),                             &
+                                nxl+1, nys+1, nest_offl%tind+1,                                    &
                                 nxr-nxl+1, nyn-nys+1, 2, .TRUE. )
-       ENDIF
-       IF ( humidity )  THEN
-          CALL get_variable( pids_id, 'ls_forcing_top_qv',                     &
-                                nest_offl%q_top(0:1,nys:nyn,nxl:nxr),          &
-                                nxl+1, nys+1, nest_offl%tind+1,                &
+          ENDIF
+          IF ( humidity )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_top_qv',                                      &
+                                nest_offl%q_top(0:1,nys:nyn,nxl:nxr),                              &
+                                nxl+1, nys+1, nest_offl%tind+1,                                    &
                                 nxr-nxl+1, nyn-nys+1, 2, .TRUE. )
-       ENDIF
-
-       IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-          DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
-             IF ( check_existence( nest_offl%var_names,                        &
-                                   nest_offl%var_names_chem_t(n) ) )  THEN
-                CALL get_variable( pids_id,                                    &
-                              TRIM( nest_offl%var_names_chem_t(n) ),           &
-                              nest_offl%chem_top(0:1,nys:nyn,nxl:nxr,n),       &
-                              nxl+1, nys+1, nest_offl%tind+1,                  &
-                              nxr-nxl+1, nyn-nys+1, 2, .TRUE. )
-                nest_offl%chem_from_file_t(n) = .TRUE.
-             ENDIF
-          ENDDO
-       ENDIF
+          ENDIF
+
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
+                IF ( check_existence( nest_offl%var_names,                                         &
+                                      nest_offl%var_names_chem_t(n) ) )  THEN
+                   CALL get_variable( pids_id,                                                     &
+                                 TRIM( nest_offl%var_names_chem_t(n) ),                            &
+                                 nest_offl%chem_top(0:1,nys:nyn,nxl:nxr,n),                        &
+                                 nxl+1, nys+1, nest_offl%tind+1,                                   &
+                                 nxr-nxl+1, nyn-nys+1, 2, .TRUE. )
+                   nest_offl%chem_from_file_t(n) = .TRUE.
+                ENDIF
+             ENDDO
+          ENDIF
+!
+!--    Read data for LOD 1, i.e. time-dependent profiles. In constrast to LOD 2 where the amount of
+!--    IO is larger, only the respective boundary processes read the data.
+       ELSE
+          IF ( bc_dirichlet_l )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_left_u',                                      &
+                                nest_offl%u_l(0:1,:,1:1),                                          & ! array to be read
+                                MERGE( nzb+1, 1, bc_dirichlet_l),                                  & ! start index z direction
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                       & ! start index time dimension
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                          & ! number of elements along z
+                                MERGE( 2, 0, bc_dirichlet_l) )                                       ! number of time steps (2 or 0)
+             CALL get_variable( pids_id, 'ls_forcing_left_v',                                      &
+                                nest_offl%v_l(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_l),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                          &
+                                MERGE( 2, 0, bc_dirichlet_l) )
+             CALL get_variable( pids_id, 'ls_forcing_left_w',                                      &
+                                nest_offl%w_l(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_l),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                       &
+                                MERGE( nest_offl%nzw, 0, bc_dirichlet_l),                          &
+                                MERGE( 2, 0, bc_dirichlet_l) )
+             IF ( .NOT. neutral )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_left_pt',                                  &
+                                   nest_offl%pt_l(0:1,:,1:1),                                      &
+                                   MERGE( nzb+1, 1, bc_dirichlet_l),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                       &
+                                   MERGE( 2, 0, bc_dirichlet_l) ) 
+             ENDIF
+             IF ( humidity )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_left_qv',                                  &
+                                   nest_offl%q_l(0:1,:,1:1),                                       &
+                                   MERGE( nzb+1, 1, bc_dirichlet_l),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                       &
+                                   MERGE( 2, 0, bc_dirichlet_l) )
+             ENDIF
+             IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
+                   IF ( check_existence( nest_offl%var_names,                                      &
+                                         nest_offl%var_names_chem_t(n) ) )  THEN
+                      CALL get_variable( pids_id, TRIM( nest_offl%var_names_chem_t(n) ),           &
+                                         nest_offl%chem_l(0:1,:,1:1,n),                            &
+                                         MERGE( nzb+1, 1, bc_dirichlet_l),                         &
+                                         MERGE( nest_offl%tind+1, 1, bc_dirichlet_l),              &
+                                         MERGE( nest_offl%nzu, 0, bc_dirichlet_l),                 &
+                                         MERGE( 2, 0, bc_dirichlet_l) )
+                      nest_offl%chem_from_file_l(n) = .TRUE.
+                   ENDIF
+                ENDDO
+             ENDIF
+          ENDIF
+          IF ( bc_dirichlet_r )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_right_u',                                     &
+                                nest_offl%u_r(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                          &
+                                MERGE( 2, 0, bc_dirichlet_r) )
+             CALL get_variable( pids_id, 'ls_forcing_right_v',                                     &
+                                nest_offl%v_r(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                          &
+                                MERGE( 2, 0, bc_dirichlet_r) )
+             CALL get_variable( pids_id, 'ls_forcing_right_w',                                     &
+                                nest_offl%w_r(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_r),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                       &
+                                MERGE( nest_offl%nzw, 0, bc_dirichlet_r),                          &
+                                MERGE( 2, 0, bc_dirichlet_r) )
+             IF ( .NOT. neutral )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_right_pt',                                 &
+                                   nest_offl%pt_r(0:1,:,1:1),                                      &
+                                   MERGE( nzb+1, 1, bc_dirichlet_r),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                       &
+                                   MERGE( 2, 0, bc_dirichlet_r) ) 
+             ENDIF
+             IF ( humidity )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_right_qv',                                 &
+                                   nest_offl%q_r(0:1,:,1:1),                                       &
+                                   MERGE( nzb+1, 1, bc_dirichlet_r),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                       &
+                                   MERGE( 2, 0, bc_dirichlet_r) )
+             ENDIF
+             IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
+                   IF ( check_existence( nest_offl%var_names,                                      &
+                                         nest_offl%var_names_chem_t(n) ) )  THEN
+                      CALL get_variable( pids_id, TRIM( nest_offl%var_names_chem_t(n) ),           &
+                                         nest_offl%chem_r(0:1,:,1:1,n),                            &
+                                         MERGE( nzb+1, 1, bc_dirichlet_r),                         &
+                                         MERGE( nest_offl%tind+1, 1, bc_dirichlet_r),              &
+                                         MERGE( nest_offl%nzu, 0, bc_dirichlet_r),                 &
+                                         MERGE( 2, 0, bc_dirichlet_r) )
+                      nest_offl%chem_from_file_r(n) = .TRUE.
+                   ENDIF
+                ENDDO
+             ENDIF
+          ENDIF
+          IF ( bc_dirichlet_n )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_north_u',                                     &
+                                nest_offl%u_n(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_n),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_n),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_n),                          &
+                                MERGE( 2, 0, bc_dirichlet_n) )
+             CALL get_variable( pids_id, 'ls_forcing_north_v',                                     &
+                                nest_offl%v_n(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_n),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_n),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_n),                          &
+                                MERGE( 2, 0, bc_dirichlet_n) )
+             CALL get_variable( pids_id, 'ls_forcing_north_w',                                     &
+                                nest_offl%w_n(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_n),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_n),                       &
+                                MERGE( nest_offl%nzw, 0, bc_dirichlet_n),                          &
+                                MERGE( 2, 0, bc_dirichlet_n) )
+             IF ( .NOT. neutral )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_north_pt',                                 &
+                                   nest_offl%pt_n(0:1,:,1:1),                                      &
+                                   MERGE( nzb+1, 1, bc_dirichlet_n),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_n),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_n),                       &
+                                   MERGE( 2, 0, bc_dirichlet_n) ) 
+             ENDIF
+             IF ( humidity )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_north_qv',                                 &
+                                   nest_offl%q_n(0:1,:,1:1),                                       &
+                                   MERGE( nzb+1, 1, bc_dirichlet_n),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_n),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_n),                       &
+                                   MERGE( 2, 0, bc_dirichlet_n) )
+             ENDIF
+             IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
+                   IF ( check_existence( nest_offl%var_names,                                      &
+                                         nest_offl%var_names_chem_t(n) ) )  THEN
+                      CALL get_variable( pids_id, TRIM( nest_offl%var_names_chem_t(n) ),           &
+                                         nest_offl%chem_n(0:1,:,1:1,n),                            &
+                                         MERGE( nzb+1, 1, bc_dirichlet_n),                         &
+                                         MERGE( nest_offl%tind+1, 1, bc_dirichlet_n),              &
+                                         MERGE( nest_offl%nzu, 0, bc_dirichlet_n),                 &
+                                         MERGE( 2, 0, bc_dirichlet_n) )
+                      nest_offl%chem_from_file_n(n) = .TRUE.
+                   ENDIF
+                ENDDO
+             ENDIF
+          ENDIF
+          IF ( bc_dirichlet_s )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_south_u',                                     &
+                                nest_offl%u_s(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_s),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_s),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_s),                          &
+                                MERGE( 2, 0, bc_dirichlet_s) )
+             CALL get_variable( pids_id, 'ls_forcing_south_v',                                     &
+                                nest_offl%v_s(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_s),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_s),                       &
+                                MERGE( nest_offl%nzu, 0, bc_dirichlet_s),                          &
+                                MERGE( 2, 0, bc_dirichlet_s) )
+             CALL get_variable( pids_id, 'ls_forcing_south_w',                                     &
+                                nest_offl%w_s(0:1,:,1:1),                                          &
+                                MERGE( nzb+1, 1, bc_dirichlet_s),                                  &
+                                MERGE( nest_offl%tind+1, 1, bc_dirichlet_s),                       &
+                                MERGE( nest_offl%nzw, 0, bc_dirichlet_s),                          &
+                                MERGE( 2, 0, bc_dirichlet_s) )
+             IF ( .NOT. neutral )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_south_pt',                                 &
+                                   nest_offl%pt_s(0:1,:,1:1),                                      &
+                                   MERGE( nzb+1, 1, bc_dirichlet_s),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_s),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_s),                       &
+                                   MERGE( 2, 0, bc_dirichlet_s) ) 
+             ENDIF
+             IF ( humidity )  THEN
+                CALL get_variable( pids_id, 'ls_forcing_south_qv',                                 &
+                                   nest_offl%q_s(0:1,:,1:1),                                       &
+                                   MERGE( nzb+1, 1, bc_dirichlet_s),                               &
+                                   MERGE( nest_offl%tind+1, 1, bc_dirichlet_s),                    &
+                                   MERGE( nest_offl%nzu, 0, bc_dirichlet_s),                       &
+                                   MERGE( 2, 0, bc_dirichlet_s) )
+             ENDIF
+             IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
+                   IF ( check_existence( nest_offl%var_names,                                      &
+                                         nest_offl%var_names_chem_t(n) ) )  THEN
+                      CALL get_variable( pids_id, TRIM( nest_offl%var_names_chem_t(n) ),           &
+                                         nest_offl%chem_s(0:1,:,1:1,n),                            &
+                                         MERGE( nzb+1, 1, bc_dirichlet_s),                         &
+                                         MERGE( nest_offl%tind+1, 1, bc_dirichlet_s),              &
+                                         MERGE( nest_offl%nzu, 0, bc_dirichlet_s),                 &
+                                         MERGE( 2, 0, bc_dirichlet_s) )
+                      nest_offl%chem_from_file_s(n) = .TRUE.
+                   ENDIF
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       Read top boundary data, which is actually only a scalar value in the LOD 1 case.
+          CALL get_variable( pids_id, 'ls_forcing_top_u',                                          &
+                             nest_offl%u_top(0:1,1,1),                                             & ! array to be read
+                             nest_offl%tind+1,                                                     & ! start index in time
+                             2 )                                                                     ! number of elements to be read
+          CALL get_variable( pids_id, 'ls_forcing_top_v',                                          &
+                             nest_offl%v_top(0:1,1,1),                                             &
+                             nest_offl%tind+1,                                                     &
+                             2 )
+          CALL get_variable( pids_id, 'ls_forcing_top_w',                                          &
+                             nest_offl%w_top(0:1,1,1),                                             &
+                             nest_offl%tind+1,                                                     &
+                             2 )
+          IF ( .NOT. neutral )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_top_pt',                                      &
+                                nest_offl%pt_top(0:1,1,1),                                         &
+                                nest_offl%tind+1,                                                  &
+                                2 )
+          ENDIF
+          IF ( humidity )  THEN
+             CALL get_variable( pids_id, 'ls_forcing_top_qv',                                      &
+                                nest_offl%q_top(0:1,1,1),                                          &
+                                nest_offl%tind+1,                                                  &
+                                2 )
+          ENDIF
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND(nest_offl%var_names_chem_t, 1)
+                IF ( check_existence( nest_offl%var_names,                                         &
+                                      nest_offl%var_names_chem_t(n) ) )  THEN
+                   CALL get_variable( pids_id, TRIM( nest_offl%var_names_chem_t(n) ),              &
+                                      nest_offl%chem_top(0:1,1,1,n),                               &
+                                      nest_offl%tind+1,                                            &
+                                      2 )
+                   nest_offl%chem_from_file_t(n) = .TRUE.
+                ENDIF
+             ENDDO
+          ENDIF
+       ENDIF
+
 
 !
@@ -967,5 +1258,5 @@
 !> layer. 
 !------------------------------------------------------------------------------!
-    SUBROUTINE nesting_offl_bc                     
+    SUBROUTINE nesting_offl_bc
 
        USE exchange_horiz_mod,                                                    &
@@ -976,5 +1267,5 @@
        INTEGER(iwp) ::  k !< running index z-direction
        INTEGER(iwp) ::  n !< running index for chemical species
-       
+
        REAL(wp), DIMENSION(nzb:nzt+1) ::  pt_ref   !< reference profile for potential temperature
        REAL(wp), DIMENSION(nzb:nzt+1) ::  pt_ref_l !< reference profile for potential temperature on subdomain
@@ -985,4 +1276,5 @@
        REAL(wp), DIMENSION(nzb:nzt+1) ::  v_ref    !< reference profile for v-component
        REAL(wp), DIMENSION(nzb:nzt+1) ::  v_ref_l  !< reference profile for v-component on subdomain
+       REAL(wp), DIMENSION(nzb:nzt+1) ::  var_1d   !< pre-interpolated profile for LOD1 mode
 
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ref_chem   !< reference profile for chemical species
@@ -991,7 +1283,7 @@
        IF ( debug_output_timestep )  CALL debug_message( 'nesting_offl_bc', 'start' )
 
-       CALL  cpu_log( log_point(58), 'offline nesting', 'start' )      
-!
-!--    Initialize mean profiles, derived from boundary data, to zero
+       CALL  cpu_log( log_point(58), 'offline nesting', 'start' )
+!
+!--    Initialize mean profiles, derived from boundary data, to zero.
        pt_ref   = 0.0_wp
        q_ref    = 0.0_wp
@@ -1020,78 +1312,164 @@
 !--    boundary_conditions() to restore prognostic values.
 !--    Further, sum up data to calculate mean profiles from boundary data, 
-!--    used for Rayleigh damping. 
-       IF ( bc_dirichlet_l )  THEN
-
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt
-                u(k,j,0) = interpolate_in_time( nest_offl%u_left(0,k,j),       &
-                                                nest_offl%u_left(1,k,j),       &
-                                                fac_dt ) *                     &
-                             MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_total_0(k,j,0), 1 ) )
-                u(k,j,-1) = u(k,j,0)
-             ENDDO
-             u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j,0)
-          ENDDO
-
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt-1
-                w(k,j,-1) = interpolate_in_time( nest_offl%w_left(0,k,j),      &
-                                                 nest_offl%w_left(1,k,j),      &
-                                                 fac_dt ) *                    &
-                            MERGE( 1.0_wp, 0.0_wp,                             &
-                                   BTEST( wall_flags_total_0(k,j,-1), 3 ) )
-             ENDDO
-             w(nzt,j,-1) = w(nzt-1,j,-1)
-          ENDDO
-
-          DO  j = nysv, nyn
-             DO  k = nzb+1, nzt
-                v(k,j,-1) = interpolate_in_time( nest_offl%v_left(0,k,j),      &
-                                                 nest_offl%v_left(1,k,j),      &
-                                                 fac_dt ) *                    &
-                               MERGE( 1.0_wp, 0.0_wp,                          &
-                                      BTEST( wall_flags_total_0(k,j,-1), 2 ) )
-             ENDDO
-             v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j,-1)
-          ENDDO
-
-          IF ( .NOT. neutral )  THEN
+!--    used for Rayleigh damping.
+       IF ( bc_dirichlet_l  )  THEN
+!
+!--       u-component
+          IF ( lod == 2 )  THEN
              DO  j = nys, nyn
                 DO  k = nzb+1, nzt
-                   pt(k,j,-1) = interpolate_in_time( nest_offl%pt_left(0,k,j), &
-                                                     nest_offl%pt_left(1,k,j), &
-                                                     fac_dt )
- 
-                ENDDO
-                pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j,-1)
-             ENDDO
-          ENDIF
-
+                   u(k,j,i_bound_u) = interpolate_in_time( nest_offl%u_l(0,k,j),                   &
+                                                           nest_offl%u_l(1,k,j),                   &
+                                                           fac_dt ) *                              &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(k,j,i_bound_u), 1 ) )
+                ENDDO
+                u(:,j,i_bound_u-1) = u(:,j,i_bound_u)
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j,i_bound_u)
+             ENDDO
+          ELSE
+!
+!--          Pre-interpolate profile before mapping onto the boundaries.
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%u_l(0,k,1),                             &
+                                                 nest_offl%u_l(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  j = nys, nyn
+                u(nzb+1:nzt,j,i_bound_u) = var_1d(nzb+1:nzt) *                                     &
+                                     MERGE( 1.0_wp, 0.0_wp,                                        &
+                                            BTEST( wall_flags_total_0(nzb+1:nzt,j,i_bound_u), 1 ) )
+                u(:,j,i_bound_u-1) = u(:,j,i_bound_u)
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j,i_bound_u)
+             ENDDO
+          ENDIF
+!
+!--       w-component
+          IF ( lod == 2 )  THEN
+             DO  j = nys, nyn
+                DO  k = nzb+1, nzt-1
+                   w(k,j,i_bound) = interpolate_in_time( nest_offl%w_l(0,k,j),                     &
+                                                         nest_offl%w_l(1,k,j),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j,i_bound), 3 ) )
+                ENDDO
+                w(nzt,j,i_bound) = w(nzt-1,j,i_bound)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt-1
+                var_1d(k) = interpolate_in_time( nest_offl%w_l(0,k,1),                             &
+                                                 nest_offl%w_l(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  j = nys, nyn
+                w(nzb+1:nzt-1,j,i_bound) = var_1d(nzb+1:nzt-1) *                                   &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzb+1:nzt-1,j,i_bound), 3 ) )
+                w(nzt,j,i_bound) = w(nzt-1,j,i_bound)
+             ENDDO
+          ENDIF
+!
+!--       v-component
+          IF ( lod == 2 )  THEN
+             DO  j = nysv, nyn
+                DO  k = nzb+1, nzt
+                   v(k,j,i_bound) = interpolate_in_time( nest_offl%v_l(0,k,j),                     &
+                                                         nest_offl%v_l(1,k,j),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j,i_bound), 2 ) )
+                ENDDO
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j,i_bound)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%v_l(0,k,1),                             &
+                                                 nest_offl%v_l(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  j = nysv, nyn
+                v(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt) *                                       &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzb+1:nzt,j,i_bound), 2 ) )
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j,i_bound)
+             ENDDO
+          ENDIF
+!
+!--       potential temperature
+          IF ( .NOT. neutral )  THEN
+             IF ( lod == 2 )  THEN
+                DO  j = nys, nyn
+                   DO  k = nzb+1, nzt
+                      pt(k,j,i_bound) = interpolate_in_time( nest_offl%pt_l(0,k,j),                &
+                                                             nest_offl%pt_l(1,k,j),                &
+                                                             fac_dt )
+                   ENDDO
+                   pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ELSE
+                DO  k = nzb+1, nzt
+                   var_1d(k) = interpolate_in_time( nest_offl%pt_l(0,k,1),                         &
+                                                    nest_offl%pt_l(1,k,1),                         &
+                                                    fac_dt )
+                ENDDO
+                DO  j = nys, nyn
+                   pt(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt)
+                   pt_ref_l(nzb+1:nzt)     = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       humidity
           IF ( humidity )  THEN
-             DO  j = nys, nyn
+             IF ( lod == 2 )  THEN
+                DO  j = nys, nyn
+                   DO  k = nzb+1, nzt
+                      q(k,j,i_bound) = interpolate_in_time( nest_offl%q_l(0,k,j),                  &
+                                                            nest_offl%q_l(1,k,j),                  &
+                                                            fac_dt )
+                   ENDDO
+                   q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ELSE
                 DO  k = nzb+1, nzt
-                   q(k,j,-1) = interpolate_in_time( nest_offl%q_left(0,k,j),   &
-                                                    nest_offl%q_left(1,k,j),   &
+                   var_1d(k) = interpolate_in_time( nest_offl%q_l(0,k,1),                          &
+                                                    nest_offl%q_l(1,k,1),                          &
                                                     fac_dt )
- 
-                ENDDO
-                q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j,-1)
-             ENDDO
-          ENDIF
-
+                ENDDO
+                DO  j = nys, nyn
+                   q(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt)
+                   q_ref_l(nzb+1:nzt)     = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       chemistry
           IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
              DO  n = 1, UBOUND( chem_species, 1 )
                 IF ( nest_offl%chem_from_file_l(n) )  THEN
-                   DO  j = nys, nyn
+                   IF ( lod == 2 )  THEN
+                      DO  j = nys, nyn
+                         DO  k = nzb+1, nzt
+                            chem_species(n)%conc(k,j,i_bound) = interpolate_in_time(               &
+                                                                        nest_offl%chem_l(0,k,j,n), &
+                                                                        nest_offl%chem_l(1,k,j,n), &
+                                                                        fac_dt                   )
+                         ENDDO
+                         ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)                         &
+                                            + chem_species(n)%conc(nzb+1:nzt,j,i_bound)
+                      ENDDO
+                   ELSE
                       DO  k = nzb+1, nzt
-                         chem_species(n)%conc(k,j,-1) = interpolate_in_time(   &
-                                                  nest_offl%chem_left(0,k,j,n),&
-                                                  nest_offl%chem_left(1,k,j,n),&
-                                                  fac_dt                   )
+                         var_1d(k) = interpolate_in_time( nest_offl%chem_l(0,k,1,n),               &
+                                                          nest_offl%chem_l(1,k,1,n),               &
+                                                          fac_dt )
                       ENDDO
-                      ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)        &
-                                         + chem_species(n)%conc(nzb+1:nzt,j,-1)
-                   ENDDO
+                      DO  j = nys, nyn
+                         chem_species(n)%conc(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt)
+                         ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)                         &
+                                                 + chem_species(n)%conc(nzb+1:nzt,j,i_bound)
+                      ENDDO
+                   ENDIF
                 ENDIF
              ENDDO
@@ -1100,76 +1478,159 @@
        ENDIF
 
-       IF ( bc_dirichlet_r )  THEN
-
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt
-                u(k,j,nxr+1) = interpolate_in_time( nest_offl%u_right(0,k,j),  &
-                                                    nest_offl%u_right(1,k,j),  &
-                                                    fac_dt ) *                 &
-                             MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_total_0(k,j,nxr+1), 1 ) )
-             ENDDO
-             u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j,nxr+1)
-          ENDDO
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt-1
-                w(k,j,nxr+1) = interpolate_in_time( nest_offl%w_right(0,k,j),  &
-                                                    nest_offl%w_right(1,k,j),  &
-                                                    fac_dt ) *                 &
-                             MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_total_0(k,j,nxr+1), 3 ) )
-             ENDDO
-             w(nzt,j,nxr+1) = w(nzt-1,j,nxr+1)
-          ENDDO
-
-          DO  j = nysv, nyn
-             DO  k = nzb+1, nzt
-                v(k,j,nxr+1) = interpolate_in_time( nest_offl%v_right(0,k,j),  &
-                                                    nest_offl%v_right(1,k,j),  &
-                                                    fac_dt ) *                 &
-                             MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_total_0(k,j,nxr+1), 2 ) )
-             ENDDO
-             v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j,nxr+1)
-          ENDDO
-
-          IF ( .NOT. neutral )  THEN
+       IF ( bc_dirichlet_r  )  THEN
+!
+!--       u-component
+          IF ( lod == 2 )  THEN
              DO  j = nys, nyn
                 DO  k = nzb+1, nzt
-                   pt(k,j,nxr+1) = interpolate_in_time(                        &
-                                                  nest_offl%pt_right(0,k,j),   &
-                                                  nest_offl%pt_right(1,k,j),   &
-                                                  fac_dt )
-                ENDDO
-                pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j,nxr+1)
-             ENDDO
-          ENDIF
-
+                   u(k,j,i_bound_u) = interpolate_in_time( nest_offl%u_r(0,k,j),                   &
+                                                           nest_offl%u_r(1,k,j),                   &
+                                                           fac_dt ) *                              &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(k,j,i_bound_u), 1 ) )
+                ENDDO
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j,i_bound_u)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%u_r(0,k,1),                             &
+                                                 nest_offl%u_r(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  j = nys, nyn
+                u(nzb+1:nzt,j,i_bound_u) = var_1d(nzb+1:nzt) *                                     &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzb+1:nzt,j,i_bound_u), 1 ) )
+                u_ref_l(nzb+1:nzt)       = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j,i_bound_u)
+             ENDDO
+          ENDIF
+!
+!--       w-component
+          IF ( lod == 2 )  THEN
+             DO  j = nys, nyn
+                DO  k = nzb+1, nzt-1
+                   w(k,j,i_bound) = interpolate_in_time( nest_offl%w_r(0,k,j),                     &
+                                                         nest_offl%w_r(1,k,j),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j,i_bound), 3 ) )
+                ENDDO
+                w(nzt,j,i_bound) = w(nzt-1,j,i_bound)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt-1
+                var_1d(k) = interpolate_in_time( nest_offl%w_r(0,k,1),                             &
+                                                 nest_offl%w_r(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  j = nys, nyn
+                w(nzb+1:nzt-1,j,i_bound) = var_1d(nzb+1:nzt-1) *                                   &
+                                     MERGE( 1.0_wp, 0.0_wp,                                        &
+                                            BTEST( wall_flags_total_0(nzb+1:nzt-1,j,i_bound), 3 ) )
+                w(nzt,j,i_bound) = w(nzt-1,j,i_bound)
+             ENDDO
+          ENDIF
+!
+!--       v-component
+          IF ( lod == 2 )  THEN
+             DO  j = nysv, nyn
+                DO  k = nzb+1, nzt
+                   v(k,j,i_bound) = interpolate_in_time( nest_offl%v_r(0,k,j),                     &
+                                                         nest_offl%v_r(1,k,j),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j,i_bound), 2 ) )
+                ENDDO
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j,i_bound)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%v_r(0,k,1),                             &
+                                                 nest_offl%v_r(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  j = nysv, nyn
+                v(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt) *                                       &
+                                       MERGE( 1.0_wp, 0.0_wp,                                      &
+                                              BTEST( wall_flags_total_0(nzb+1:nzt,j,i_bound), 2 ) )
+                v_ref_l(nzb+1:nzt)     = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j,i_bound)
+             ENDDO
+          ENDIF
+!
+!--       potential temperature
+          IF ( .NOT. neutral )  THEN
+             IF ( lod == 2 )  THEN
+                DO  j = nys, nyn
+                   DO  k = nzb+1, nzt
+                      pt(k,j,i_bound) = interpolate_in_time( nest_offl%pt_r(0,k,j),                &
+                                                             nest_offl%pt_r(1,k,j),                &
+                                                             fac_dt )
+                   ENDDO
+                   pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ELSE
+                DO  k = nzb+1, nzt
+                   var_1d(k) = interpolate_in_time( nest_offl%pt_r(0,k,1),                         &
+                                                    nest_offl%pt_r(1,k,1),                         &
+                                                    fac_dt )
+                ENDDO
+                DO  j = nys, nyn
+                   pt(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt)
+                   pt_ref_l(nzb+1:nzt)     = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       humidity
           IF ( humidity )  THEN
-             DO  j = nys, nyn
+             IF ( lod == 2 )  THEN
+                DO  j = nys, nyn
+                   DO  k = nzb+1, nzt
+                      q(k,j,i_bound) = interpolate_in_time( nest_offl%q_r(0,k,j),                  &
+                                                            nest_offl%q_r(1,k,j),                  &
+                                                            fac_dt )
+                   ENDDO
+                   q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ELSE
                 DO  k = nzb+1, nzt
-                   q(k,j,nxr+1) = interpolate_in_time(                         &
-                                                  nest_offl%q_right(0,k,j),    &
-                                                  nest_offl%q_right(1,k,j),    &
-                                                  fac_dt ) 
- 
-                ENDDO
-                q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j,nxr+1)
-             ENDDO
-          ENDIF
-
+                   var_1d(k) = interpolate_in_time( nest_offl%q_r(0,k,1),                          &
+                                                    nest_offl%q_r(1,k,1),                          &
+                                                    fac_dt )
+                ENDDO
+                DO  j = nys, nyn
+                   q(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt)
+                   q_ref_l(nzb+1:nzt)     = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j,i_bound)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       chemistry
           IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
              DO  n = 1, UBOUND( chem_species, 1 )
                 IF ( nest_offl%chem_from_file_r(n) )  THEN
-                   DO  j = nys, nyn
+                   IF ( lod == 2 )  THEN
+                      DO  j = nys, nyn
+                         DO  k = nzb+1, nzt
+                            chem_species(n)%conc(k,j,i_bound) = interpolate_in_time(               &
+                                                                        nest_offl%chem_r(0,k,j,n), &
+                                                                        nest_offl%chem_r(1,k,j,n), &
+                                                                        fac_dt                   )
+                         ENDDO
+                         ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)                         &
+                                            + chem_species(n)%conc(nzb+1:nzt,j,i_bound)
+                      ENDDO
+                   ELSE
                       DO  k = nzb+1, nzt
-                         chem_species(n)%conc(k,j,nxr+1) = interpolate_in_time(&
-                                                 nest_offl%chem_right(0,k,j,n),&
-                                                 nest_offl%chem_right(1,k,j,n),&
-                                                 fac_dt                       )
+                         var_1d(k) = interpolate_in_time( nest_offl%chem_r(0,k,1,n),               &
+                                                          nest_offl%chem_r(1,k,1,n),               &
+                                                          fac_dt )
                       ENDDO
-                      ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)        &
-                                       + chem_species(n)%conc(nzb+1:nzt,j,nxr+1)
-                   ENDDO
+                      DO  j = nys, nyn
+                         chem_species(n)%conc(nzb+1:nzt,j,i_bound) = var_1d(nzb+1:nzt)
+                         ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)                         &
+                                                 + chem_species(n)%conc(nzb+1:nzt,j,i_bound)
+                      ENDDO
+                   ENDIF
                 ENDIF
              ENDDO
@@ -1178,176 +1639,347 @@
        ENDIF
 
-       IF ( bc_dirichlet_s )  THEN
-
-          DO  i = nxl, nxr
-             DO  k = nzb+1, nzt
-                v(k,0,i) = interpolate_in_time( nest_offl%v_south(0,k,i),      &
-                                                nest_offl%v_south(1,k,i),      &
-                                                fac_dt ) *                     &
-                           MERGE( 1.0_wp, 0.0_wp,                              &
-                                  BTEST( wall_flags_total_0(k,0,i), 2 ) )
-                v(k,-1,i) = v(k,0,i) 
-             ENDDO
-             v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,0,i)
-          ENDDO
-
-          DO  i = nxl, nxr
-             DO  k = nzb+1, nzt-1
-                w(k,-1,i) = interpolate_in_time( nest_offl%w_south(0,k,i),     &
-                                                 nest_offl%w_south(1,k,i),     &
-                                                 fac_dt ) *                    &
-                           MERGE( 1.0_wp, 0.0_wp,                              &
-                                  BTEST( wall_flags_total_0(k,-1,i), 3 ) )
-             ENDDO
-             w(nzt,-1,i) = w(nzt-1,-1,i)
-          ENDDO
-
-          DO  i = nxlu, nxr
-             DO  k = nzb+1, nzt
-                u(k,-1,i) = interpolate_in_time( nest_offl%u_south(0,k,i),     &
-                                                 nest_offl%u_south(1,k,i),     &
-                                                 fac_dt ) *                    &
-                           MERGE( 1.0_wp, 0.0_wp,                              &
-                                  BTEST( wall_flags_total_0(k,-1,i), 1 ) )
-             ENDDO
-             u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,-1,i)
-          ENDDO
-
-          IF ( .NOT. neutral )  THEN
+       IF ( bc_dirichlet_n )  THEN
+!
+!--       v-component
+          IF ( lod == 2 )  THEN
              DO  i = nxl, nxr
                 DO  k = nzb+1, nzt
-                   pt(k,-1,i) = interpolate_in_time(                           &
-                                                 nest_offl%pt_south(0,k,i),    &
-                                                 nest_offl%pt_south(1,k,i),    &
+                   v(k,j_bound_v,i) = interpolate_in_time( nest_offl%v_n(0,k,i),                   &
+                                                           nest_offl%v_n(1,k,i),                   &
+                                                           fac_dt ) *                              &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(k,j_bound_v,i), 2 ) )
+                ENDDO
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j_bound_v,i)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%v_n(0,k,1),                             &
+                                                 nest_offl%v_n(1,k,1),                             &
                                                  fac_dt )
- 
-                ENDDO
-                pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,-1,i)
-             ENDDO
-          ENDIF
-
+             ENDDO
+             DO  i = nxl, nxr
+                v(nzb+1:nzt,j_bound_v,i) = var_1d(nzb+1:nzt) *                                     &
+                                     MERGE( 1.0_wp, 0.0_wp,                                        &
+                                            BTEST( wall_flags_total_0(nzb+1:nzt,j_bound_v,i), 2 ) )
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j_bound_v,i)
+             ENDDO
+          ENDIF
+!
+!--       w-component
+          IF ( lod == 2 )  THEN
+             DO  i = nxl, nxr
+                DO  k = nzb+1, nzt-1
+                   w(k,j_bound,i) = interpolate_in_time( nest_offl%w_n(0,k,i),                     &
+                                                         nest_offl%w_n(1,k,i),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j_bound,i), 3 ) )
+                ENDDO
+                w(nzt,j_bound,i) = w(nzt-1,j_bound,i)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt-1
+                var_1d(k) = interpolate_in_time( nest_offl%w_n(0,k,1),                             &
+                                                 nest_offl%w_n(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  i = nxl, nxr
+                w(nzb+1:nzt-1,j_bound,i) = var_1d(nzb+1:nzt-1) *                                   &
+                                     MERGE( 1.0_wp, 0.0_wp,                                        &
+                                            BTEST( wall_flags_total_0(nzb+1:nzt-1,j_bound,i), 3 ) )
+                w(nzt,j_bound,i) = w(nzt-1,j_bound,i)
+             ENDDO
+          ENDIF
+!
+!--       u-component
+          IF ( lod == 2 )  THEN
+             DO  i = nxlu, nxr
+                DO  k = nzb+1, nzt
+                   u(k,j_bound,i) = interpolate_in_time( nest_offl%u_n(0,k,i),                     &
+                                                         nest_offl%u_n(1,k,i),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j_bound,i), 1 ) )
+                ENDDO
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j_bound,i)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%u_n(0,k,1),                             &
+                                                 nest_offl%u_n(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  i = nxlu, nxr
+                u(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt) *                                       &
+                                       MERGE( 1.0_wp, 0.0_wp,                                      &
+                                              BTEST( wall_flags_total_0(nzb+1:nzt,j_bound,i), 1 ) )
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j_bound,i)
+             ENDDO
+          ENDIF
+!
+!--       potential temperature
+          IF ( .NOT. neutral )  THEN
+             IF ( lod == 2 )  THEN
+                DO  i = nxl, nxr
+                   DO  k = nzb+1, nzt
+                      pt(k,j_bound,i) = interpolate_in_time( nest_offl%pt_n(0,k,i),                &
+                                                             nest_offl%pt_n(1,k,i),                &
+                                                             fac_dt )
+                   ENDDO
+                   pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ELSE
+                DO  k = nzb+1, nzt
+                   var_1d(k) = interpolate_in_time( nest_offl%pt_n(0,k,1),                         &
+                                                    nest_offl%pt_n(1,k,1),                         &
+                                                    fac_dt )
+                ENDDO
+                DO  i = nxl, nxr
+                   pt(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt)
+                   pt_ref_l(nzb+1:nzt)     = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       humidity
           IF ( humidity )  THEN
+             IF ( lod == 2 )  THEN
+                DO  i = nxl, nxr
+                   DO  k = nzb+1, nzt
+                      q(k,j_bound,i) = interpolate_in_time( nest_offl%q_n(0,k,i),                  &
+                                                            nest_offl%q_n(1,k,i),                  &
+                                                            fac_dt )
+                   ENDDO
+                   q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ELSE
+                DO  k = nzb+1, nzt
+                   var_1d(k) = interpolate_in_time( nest_offl%q_n(0,k,1),                          &
+                                                    nest_offl%q_n(1,k,1),                          &
+                                                    fac_dt )
+                ENDDO
+                DO  i = nxl, nxr
+                   q(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt)
+                   q_ref_l(nzb+1:nzt)     = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       chemistry
+          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+             DO  n = 1, UBOUND( chem_species, 1 )
+                IF ( nest_offl%chem_from_file_n(n) )  THEN
+                   IF ( lod == 2 )  THEN
+                      DO  i = nxl, nxr
+                         DO  k = nzb+1, nzt
+                            chem_species(n)%conc(k,j_bound,i) = interpolate_in_time(               &
+                                                                        nest_offl%chem_n(0,k,i,n), &
+                                                                        nest_offl%chem_n(1,k,i,n), &
+                                                                        fac_dt                    )
+                         ENDDO
+                         ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)                         &
+                                          + chem_species(n)%conc(nzb+1:nzt,j_bound,i)
+                      ENDDO
+                   ELSE
+                      DO  k = nzb+1, nzt
+                         var_1d(k) = interpolate_in_time( nest_offl%chem_n(0,k,1,n),               &
+                                                          nest_offl%chem_n(1,k,1,n),               &
+                                                          fac_dt )
+                      ENDDO
+                      DO  i = nxl, nxr
+                         chem_species(n)%conc(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt)
+                         ref_chem_l(nzb+1:nzt,n)                   = ref_chem_l(nzb+1:nzt,n) +     &
+                                                                     chem_species(n)%conc(nzb+1:nzt,j_bound,i)
+                      ENDDO
+                   ENDIF
+                ENDIF
+             ENDDO
+          ENDIF
+       ENDIF
+
+       IF ( bc_dirichlet_s )  THEN
+!
+!--       v-component
+          IF ( lod == 2 )  THEN
              DO  i = nxl, nxr
                 DO  k = nzb+1, nzt
-                   q(k,-1,i) = interpolate_in_time(                            &
-                                                 nest_offl%q_south(0,k,i),     &
-                                                 nest_offl%q_south(1,k,i),     &
+                   v(k,j_bound_v,i) = interpolate_in_time( nest_offl%v_s(0,k,i),                   &
+                                                           nest_offl%v_s(1,k,i),                   &
+                                                           fac_dt ) *                              &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(k,j_bound_v,i), 2 ) )
+                ENDDO
+                v(:,j_bound_v-1,i) = v(:,j_bound_v,i) 
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j_bound_v,i)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%v_s(0,k,1),                             &
+                                                 nest_offl%v_s(1,k,1),                             &
                                                  fac_dt )
- 
-                ENDDO
-                q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,-1,i)
-             ENDDO
-          ENDIF
-
+             ENDDO
+             DO  i = nxl, nxr
+                v(nzb+1:nzt,j_bound_v,i) = var_1d(nzb+1:nzt) *                                     &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzb+1:nzt,j_bound_v,i), 2 ) )
+                v(:,j_bound_v-1,i) = v(:,j_bound_v,i) 
+                v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,j_bound_v,i)
+             ENDDO
+          ENDIF
+!
+!--       w-component
+          IF ( lod == 2 )  THEN
+             DO  i = nxl, nxr
+                DO  k = nzb+1, nzt-1
+                   w(k,j_bound,i) = interpolate_in_time( nest_offl%w_s(0,k,i),                     &
+                                                         nest_offl%w_s(1,k,i),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j_bound,i), 3 ) )
+                ENDDO
+                w(nzt,j_bound,i) = w(nzt-1,j_bound,i)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt-1
+                var_1d(k) = interpolate_in_time( nest_offl%w_s(0,k,1),                             &
+                                                 nest_offl%w_s(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  i = nxl, nxr
+                w(nzb+1:nzt-1,j_bound,i) = var_1d(nzb+1:nzt-1) *                                   &
+                                     MERGE( 1.0_wp, 0.0_wp,                                        &
+                                            BTEST( wall_flags_total_0(nzb+1:nzt-1,j_bound,i), 3 ) )
+                w(nzt,j_bound,i) = w(nzt-1,j_bound,i)
+             ENDDO
+          ENDIF
+!
+!--       u-component
+          IF ( lod == 2 )  THEN
+             DO  i = nxlu, nxr
+                DO  k = nzb+1, nzt
+                   u(k,j_bound,i) = interpolate_in_time( nest_offl%u_s(0,k,i),                     &
+                                                         nest_offl%u_s(1,k,i),                     &
+                                                         fac_dt ) *                                &
+                                    MERGE( 1.0_wp, 0.0_wp,                                         &
+                                           BTEST( wall_flags_total_0(k,j_bound,i), 1 ) )
+                ENDDO
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j_bound,i)
+             ENDDO
+          ELSE
+             DO  k = nzb+1, nzt
+                var_1d(k) = interpolate_in_time( nest_offl%u_s(0,k,1),                             &
+                                                 nest_offl%u_s(1,k,1),                             &
+                                                 fac_dt )
+             ENDDO
+             DO  i = nxlu, nxr
+                u(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt) *                                       &
+                                       MERGE( 1.0_wp, 0.0_wp,                                      &
+                                              BTEST( wall_flags_total_0(nzb+1:nzt,j_bound,i), 1 ) )
+                u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,j_bound,i)
+             ENDDO
+          ENDIF
+!
+!--       potential temperature
+          IF ( .NOT. neutral )  THEN
+             IF ( lod == 2 )  THEN
+                DO  i = nxl, nxr
+                   DO  k = nzb+1, nzt
+                      pt(k,j_bound,i) = interpolate_in_time( nest_offl%pt_s(0,k,i),                &
+                                                             nest_offl%pt_s(1,k,i),                &
+                                                             fac_dt )
+                   ENDDO
+                   pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ELSE
+                DO  k = nzb+1, nzt
+                   var_1d(k) = interpolate_in_time( nest_offl%pt_s(0,k,1),                         &
+                                                    nest_offl%pt_s(1,k,1),                         &
+                                                    fac_dt )
+                ENDDO
+                DO  i = nxl, nxr
+                   pt(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt)
+                   pt_ref_l(nzb+1:nzt)     = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       humidity
+          IF ( humidity )  THEN
+             IF ( lod == 2 )  THEN
+                DO  i = nxl, nxr
+                   DO  k = nzb+1, nzt
+                      q(k,j_bound,i) = interpolate_in_time( nest_offl%q_s(0,k,i),                  &
+                                                            nest_offl%q_s(1,k,i),                  &
+                                                            fac_dt )
+                   ENDDO
+                   q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ELSE
+                DO  k = nzb+1, nzt
+                   var_1d(k) = interpolate_in_time( nest_offl%q_s(0,k,1),                          &
+                                                    nest_offl%q_s(1,k,1),                          &
+                                                    fac_dt )
+                ENDDO
+                DO  i = nxl, nxr
+                   q(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt)
+                   q_ref_l(nzb+1:nzt)     = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,j_bound,i)
+                ENDDO
+             ENDIF
+          ENDIF
+!
+!--       chemistry
           IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
              DO  n = 1, UBOUND( chem_species, 1 )
                 IF ( nest_offl%chem_from_file_s(n) )  THEN
-                   DO  i = nxl, nxr
+                   IF ( lod == 2 )  THEN
+                      DO  i = nxl, nxr
+                         DO  k = nzb+1, nzt
+                            chem_species(n)%conc(k,j_bound,i) = interpolate_in_time(               &
+                                                                        nest_offl%chem_s(0,k,i,n), &
+                                                                        nest_offl%chem_s(1,k,i,n), &
+                                                                        fac_dt                    )
+                         ENDDO
+                         ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)                         &
+                                          + chem_species(n)%conc(nzb+1:nzt,j_bound,i)
+                      ENDDO
+                   ELSE
                       DO  k = nzb+1, nzt
-                         chem_species(n)%conc(k,-1,i) = interpolate_in_time(   &
-                                                 nest_offl%chem_south(0,k,i,n),&
-                                                 nest_offl%chem_south(1,k,i,n),&
-                                                 fac_dt                    )
+                         var_1d(k) = interpolate_in_time( nest_offl%chem_s(0,k,1,n),               &
+                                                          nest_offl%chem_s(1,k,1,n),               &
+                                                          fac_dt )
                       ENDDO
-                      ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)        &
-                                       + chem_species(n)%conc(nzb+1:nzt,-1,i)
-                   ENDDO
+                      DO  i = nxl, nxr
+                         chem_species(n)%conc(nzb+1:nzt,j_bound,i) = var_1d(nzb+1:nzt)
+                         ref_chem_l(nzb+1:nzt,n)                   = ref_chem_l(nzb+1:nzt,n) +     &
+                                                                     chem_species(n)%conc(nzb+1:nzt,j_bound,i)
+                      ENDDO
+                   ENDIF
                 ENDIF
              ENDDO
           ENDIF
-
-       ENDIF
-
-       IF ( bc_dirichlet_n )  THEN
-
-          DO  i = nxl, nxr
-             DO  k = nzb+1, nzt
-                v(k,nyn+1,i) = interpolate_in_time( nest_offl%v_north(0,k,i),  &
-                                                    nest_offl%v_north(1,k,i),  &
-                                                    fac_dt ) *                 &
-                               MERGE( 1.0_wp, 0.0_wp,                          &
-                                    BTEST( wall_flags_total_0(k,nyn+1,i), 2 ) )
-             ENDDO
-             v_ref_l(nzb+1:nzt) = v_ref_l(nzb+1:nzt) + v(nzb+1:nzt,nyn+1,i)
+       ENDIF
+!
+!--    Top boundary
+!--    u-component
+       IF ( lod == 2 )  THEN
+          DO  i = nxlu, nxr
+             DO  j = nys, nyn
+                u(nzt+1,j,i) = interpolate_in_time( nest_offl%u_top(0,j,i),                        &
+                                                    nest_offl%u_top(1,j,i),                        &
+                                                    fac_dt ) *                                     &
+                              MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(nzt+1,j,i), 1 ) )
+                u_ref_l(nzt+1) = u_ref_l(nzt+1) + u(nzt+1,j,i)
+             ENDDO
           ENDDO
-          DO  i = nxl, nxr
-             DO  k = nzb+1, nzt-1
-                w(k,nyn+1,i) = interpolate_in_time( nest_offl%w_north(0,k,i),  &
-                                                    nest_offl%w_north(1,k,i),  &
-                                                    fac_dt ) *                 &
-                               MERGE( 1.0_wp, 0.0_wp,                          &
-                                    BTEST( wall_flags_total_0(k,nyn+1,i), 3 ) )
-             ENDDO
-             w(nzt,nyn+1,i) = w(nzt-1,nyn+1,i)
-          ENDDO
-
-          DO  i = nxlu, nxr
-             DO  k = nzb+1, nzt
-                u(k,nyn+1,i) = interpolate_in_time( nest_offl%u_north(0,k,i),  &
-                                                    nest_offl%u_north(1,k,i),  &
-                                                    fac_dt ) *                 &
-                               MERGE( 1.0_wp, 0.0_wp,                          &
-                                    BTEST( wall_flags_total_0(k,nyn+1,i), 1 ) )
-
-             ENDDO
-             u_ref_l(nzb+1:nzt) = u_ref_l(nzb+1:nzt) + u(nzb+1:nzt,nyn+1,i)
-          ENDDO
-
-          IF ( .NOT. neutral )  THEN
-             DO  i = nxl, nxr
-                DO  k = nzb+1, nzt
-                   pt(k,nyn+1,i) = interpolate_in_time(                        &
-                                                    nest_offl%pt_north(0,k,i), &
-                                                    nest_offl%pt_north(1,k,i), &
-                                                    fac_dt )
- 
-                ENDDO
-                pt_ref_l(nzb+1:nzt) = pt_ref_l(nzb+1:nzt) + pt(nzb+1:nzt,nyn+1,i)
-             ENDDO
-          ENDIF
-
-          IF ( humidity )  THEN
-             DO  i = nxl, nxr
-                DO  k = nzb+1, nzt
-                   q(k,nyn+1,i) = interpolate_in_time(                         &
-                                                    nest_offl%q_north(0,k,i),  &
-                                                    nest_offl%q_north(1,k,i),  &
-                                                    fac_dt )
- 
-                ENDDO
-                q_ref_l(nzb+1:nzt) = q_ref_l(nzb+1:nzt) + q(nzb+1:nzt,nyn+1,i)
-             ENDDO
-          ENDIF
-
-          IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-             DO  n = 1, UBOUND( chem_species, 1 )
-                IF ( nest_offl%chem_from_file_n(n) )  THEN
-                   DO  i = nxl, nxr
-                      DO  k = nzb+1, nzt
-                         chem_species(n)%conc(k,nyn+1,i) = interpolate_in_time(&
-                                                 nest_offl%chem_north(0,k,i,n),&
-                                                 nest_offl%chem_north(1,k,i,n),&
-                                                 fac_dt                       )
-                      ENDDO
-                      ref_chem_l(nzb+1:nzt,n) = ref_chem_l(nzb+1:nzt,n)        &
-                                       + chem_species(n)%conc(nzb+1:nzt,nyn+1,i)
-                   ENDDO
-                ENDIF
-             ENDDO
-          ENDIF
-
-       ENDIF
-!
-!--    Top boundary
-       DO  i = nxlu, nxr
-          DO  j = nys, nyn
-             u(nzt+1,j,i) = interpolate_in_time( nest_offl%u_top(0,j,i),       &
-                                                 nest_offl%u_top(1,j,i),       &
-                                                 fac_dt ) *                    &
-                           MERGE( 1.0_wp, 0.0_wp,                              &
-                                  BTEST( wall_flags_total_0(nzt+1,j,i), 1 ) )
-             u_ref_l(nzt+1) = u_ref_l(nzt+1) + u(nzt+1,j,i)
-          ENDDO
-       ENDDO
+       ELSE
+          var_1d(nzt+1) = interpolate_in_time( nest_offl%u_top(0,1,1),                             &
+                                               nest_offl%u_top(1,1,1),                             &
+                                               fac_dt )
+          u(nzt+1,nys:nyn,nxlu:nxr) = var_1d(nzt+1) *                                              &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzt+1,nys:nyn,nxlu:nxr), 1 ) )
+          u_ref_l(nzt+1) = u_ref_l(nzt+1) + SUM( u(nzt+1,nys:nyn,nxlu:nxr) )
+       ENDIF
 !
 !--    For left boundary set boundary condition for u-component also at top 
@@ -1355,15 +1987,25 @@
 !--    Note, this has no effect on the numeric solution, only for data output.
        IF ( bc_dirichlet_l )  u(nzt+1,:,nxl) = u(nzt+1,:,nxlu)
-
-       DO  i = nxl, nxr
-          DO  j = nysv, nyn
-             v(nzt+1,j,i) = interpolate_in_time( nest_offl%v_top(0,j,i),       &
-                                                 nest_offl%v_top(1,j,i),       &
-                                                 fac_dt ) *                    &
-                           MERGE( 1.0_wp, 0.0_wp,                              &
-                                  BTEST( wall_flags_total_0(nzt+1,j,i), 2 ) )
-             v_ref_l(nzt+1) = v_ref_l(nzt+1) + v(nzt+1,j,i)
+!
+!--    v-component
+       IF ( lod == 2 )  THEN
+          DO  i = nxl, nxr
+             DO  j = nysv, nyn
+                v(nzt+1,j,i) = interpolate_in_time( nest_offl%v_top(0,j,i),                        &
+                                                    nest_offl%v_top(1,j,i),                        &
+                                                    fac_dt ) *                                     &
+                              MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(nzt+1,j,i), 2 ) )
+                v_ref_l(nzt+1) = v_ref_l(nzt+1) + v(nzt+1,j,i)
+             ENDDO
           ENDDO
-       ENDDO
+       ELSE
+          var_1d(nzt+1) = interpolate_in_time( nest_offl%v_top(0,1,1),                             &
+                                               nest_offl%v_top(1,1,1),                             &
+                                               fac_dt )
+          v(nzt+1,nysv:nyn,nxl:nxr) = var_1d(nzt+1) *                                              &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzt+1,nysv:nyn,nxl:nxr), 2 ) )
+          v_ref_l(nzt+1) = v_ref_l(nzt+1) + SUM( v(nzt+1,nysv:nyn,nxl:nxr) )
+       ENDIF
 !
 !--    For south boundary set boundary condition for v-component also at top 
@@ -1371,37 +2013,64 @@
 !--    Note, this has no effect on the numeric solution, only for data output.
        IF ( bc_dirichlet_s )  v(nzt+1,nys,:) = v(nzt+1,nysv,:)
-
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-             w(nzt,j,i) = interpolate_in_time( nest_offl%w_top(0,j,i),         &
-                                               nest_offl%w_top(1,j,i),         &
-                                               fac_dt ) *                      &
-                           MERGE( 1.0_wp, 0.0_wp,                              &
-                                  BTEST( wall_flags_total_0(nzt,j,i), 3 ) )
-             w(nzt+1,j,i) = w(nzt,j,i)
-          ENDDO
-       ENDDO
-
-
-       IF ( .NOT. neutral )  THEN
+!
+!--    w-component
+       IF ( lod == 2 )  THEN
           DO  i = nxl, nxr
              DO  j = nys, nyn
-                pt(nzt+1,j,i) = interpolate_in_time( nest_offl%pt_top(0,j,i),  &
-                                                     nest_offl%pt_top(1,j,i),  &
-                                                     fac_dt )
-                pt_ref_l(nzt+1) = pt_ref_l(nzt+1) + pt(nzt+1,j,i)
+                w(nzt,j,i) = interpolate_in_time( nest_offl%w_top(0,j,i),                          &
+                                                  nest_offl%w_top(1,j,i),                          &
+                                                  fac_dt ) *                                       &
+                              MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(nzt,j,i), 3 ) )
+                w(nzt+1,j,i) = w(nzt,j,i)
              ENDDO
           ENDDO
-       ENDIF
-
+       ELSE
+          var_1d(nzt) = interpolate_in_time( nest_offl%w_top(0,1,1),                               &
+                                             nest_offl%w_top(1,1,1),                               &
+                                             fac_dt )
+          w(nzt,nys:nyn,nxl:nxr) = var_1d(nzt) *                                                   &
+                                      MERGE( 1.0_wp, 0.0_wp,                                       &
+                                             BTEST( wall_flags_total_0(nzt,nys:nyn,nxl:nxr), 3 ) )
+          w(nzt+1,nys:nyn,nxl:nxr) = w(nzt,nys:nyn,nxl:nxr)
+       ENDIF
+!
+!--    potential temperture
+       IF ( .NOT. neutral )  THEN
+          IF ( lod == 2 )  THEN
+             DO  i = nxl, nxr
+                DO  j = nys, nyn
+                   pt(nzt+1,j,i) = interpolate_in_time( nest_offl%pt_top(0,j,i),                   &
+                                                        nest_offl%pt_top(1,j,i),                   &
+                                                        fac_dt )
+                   pt_ref_l(nzt+1) = pt_ref_l(nzt+1) + pt(nzt+1,j,i)
+                ENDDO
+             ENDDO
+          ELSE
+             var_1d(nzt+1) = interpolate_in_time( nest_offl%pt_top(0,1,1),                         &
+                                                  nest_offl%pt_top(1,1,1),                         &
+                                                  fac_dt )
+             pt(nzt+1,nys:nyn,nxl:nxr) = var_1d(nzt+1)
+             pt_ref_l(nzt+1) = pt_ref_l(nzt+1) + SUM( pt(nzt+1,nys:nyn,nxl:nxr) )
+          ENDIF
+       ENDIF
+!
+!--    humidity
        IF ( humidity )  THEN
-          DO  i = nxl, nxr
-             DO  j = nys, nyn
-                q(nzt+1,j,i) = interpolate_in_time( nest_offl%q_top(0,j,i),    &
-                                                    nest_offl%q_top(1,j,i),    &
-                                                    fac_dt )
-                q_ref_l(nzt+1) = q_ref_l(nzt+1) + q(nzt+1,j,i)
-             ENDDO
-          ENDDO
+          IF ( lod == 2 )  THEN
+             DO  i = nxl, nxr
+                DO  j = nys, nyn
+                   q(nzt+1,j,i) = interpolate_in_time( nest_offl%q_top(0,j,i),                     &
+                                                       nest_offl%q_top(1,j,i),                     &
+                                                       fac_dt )
+                   q_ref_l(nzt+1) = q_ref_l(nzt+1) + q(nzt+1,j,i)
+                ENDDO
+             ENDDO
+          ELSE
+             var_1d(nzt+1) = interpolate_in_time( nest_offl%q_top(0,1,1),                          &
+                                                  nest_offl%q_top(1,1,1),                          &
+                                                  fac_dt )
+             q(nzt+1,nys:nyn,nxl:nxr) = var_1d(nzt+1)
+             q_ref_l(nzt+1) = q_ref_l(nzt+1) + SUM( q(nzt+1,nys:nyn,nxl:nxr) )
+          ENDIF
        ENDIF
 
@@ -1409,14 +2078,23 @@
           DO  n = 1, UBOUND( chem_species, 1 )
              IF ( nest_offl%chem_from_file_t(n) )  THEN
-                DO  i = nxl, nxr
-                   DO  j = nys, nyn
-                      chem_species(n)%conc(nzt+1,j,i) = interpolate_in_time(   &
-                                              nest_offl%chem_top(0,j,i,n),     &
-                                              nest_offl%chem_top(1,j,i,n),     &
-                                              fac_dt                       )
-                      ref_chem_l(nzt+1,n) = ref_chem_l(nzt+1,n) +              &
-                                            chem_species(n)%conc(nzt+1,j,i)
+                IF ( lod == 2 )  THEN
+                   DO  i = nxl, nxr
+                      DO  j = nys, nyn
+                         chem_species(n)%conc(nzt+1,j,i) = interpolate_in_time(                    &
+                                                 nest_offl%chem_top(0,j,i,n),                      &
+                                                 nest_offl%chem_top(1,j,i,n),                      &
+                                                 fac_dt                       )
+                         ref_chem_l(nzt+1,n) = ref_chem_l(nzt+1,n) +                               &
+                                               chem_species(n)%conc(nzt+1,j,i)
+                      ENDDO
                    ENDDO
-                ENDDO
+                ELSE
+                   var_1d(nzt+1) = interpolate_in_time( nest_offl%chem_top(0,1,1,n),               &
+                                                        nest_offl%chem_top(1,1,1,n),               &
+                                                        fac_dt )
+                   chem_species(n)%conc(nzt+1,nys:nyn,nxl:nxr) = var_1d(nzt+1)
+                   ref_chem_l(nzt+1,n) = ref_chem_l(nzt+1,n) +                                     &
+                                         SUM( chem_species(n)%conc(nzt+1,nys:nyn,nxl:nxr) )
+                ENDIF
              ENDIF
           ENDDO
@@ -1455,6 +2133,5 @@
 !--          Do local exchange only when necessary, i.e. when data is coming 
 !--          from dynamic file.
-             IF ( nest_offl%chem_from_file_t(n) )                              &
-                CALL exchange_horiz( chem_species(n)%conc, nbgp )
+             IF ( nest_offl%chem_from_file_t(n) )  CALL exchange_horiz( chem_species(n)%conc, nbgp )
           ENDDO
        ENDIF
@@ -1467,24 +2144,19 @@
        IF ( salsa )  CALL salsa_nesting_offl_bc
 !
-!--    In case of Rayleigh damping, where the profiles u_init, v_init
-!--    q_init and pt_init are still used, update these profiles from the
-!--    averaged boundary data. 
-!--    But first, average these data.
+!--    Calculate the mean profiles. These are later stored on u_init, v_init, 
+!--    etc., in order to adjust the Rayleigh damping under time-evolving atmospheric conditions
+!--    accordingly - damping against the representative mean profiles, not against the initial
+!--    profiles. Note, in LOD = 1 case no averaging is required.
 #if defined( __parallel )
-       CALL MPI_ALLREDUCE( u_ref_l, u_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM,     &
-                           comm2d, ierr )
-       CALL MPI_ALLREDUCE( v_ref_l, v_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM,     &
-                           comm2d, ierr )
+       CALL MPI_ALLREDUCE( u_ref_l, u_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM, comm2d, ierr )
+       CALL MPI_ALLREDUCE( v_ref_l, v_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM, comm2d, ierr )
        IF ( humidity )  THEN
-          CALL MPI_ALLREDUCE( q_ref_l, q_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM,  &
-                              comm2d, ierr )
+          CALL MPI_ALLREDUCE( q_ref_l, q_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM, comm2d, ierr )
        ENDIF
        IF ( .NOT. neutral )  THEN
-          CALL MPI_ALLREDUCE( pt_ref_l, pt_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM,&
-                              comm2d, ierr )
+          CALL MPI_ALLREDUCE( pt_ref_l, pt_ref, nzt+1-nzb+1, MPI_REAL, MPI_SUM, comm2d, ierr )
        ENDIF
        IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-          CALL MPI_ALLREDUCE( ref_chem_l, ref_chem,                            &
-                              ( nzt+1-nzb+1 ) * SIZE( ref_chem(nzb,:) ),       &
+          CALL MPI_ALLREDUCE( ref_chem_l, ref_chem, ( nzt+1-nzb+1 ) * SIZE( ref_chem(nzb,:) ),  &
                               MPI_REAL, MPI_SUM, comm2d, ierr )
        ENDIF
@@ -1501,33 +2173,22 @@
 !--    number of input data is different from nzb:nzt compared to nzt+1. 
 !--    Derived from lateral boundaries. 
-       u_ref(nzb:nzt) = u_ref(nzb:nzt) / REAL( 2.0_wp * ( ny + 1 + nx     ),   &
-                                               KIND = wp )  
-       v_ref(nzb:nzt) = v_ref(nzb:nzt) / REAL( 2.0_wp * ( ny   + nx + 1   ),   &
-                                               KIND = wp )
-       IF ( humidity )                                                         &
-          q_ref(nzb:nzt) = q_ref(nzb:nzt)   / REAL( 2.0_wp *                   &
-                                                          ( ny + 1 + nx + 1 ), &
-                                                    KIND = wp )
-       IF ( .NOT. neutral )                                                    &
-          pt_ref(nzb:nzt) = pt_ref(nzb:nzt) / REAL( 2.0_wp *                   &
-                                                          ( ny + 1 + nx + 1 ), &
-                                              KIND = wp )
-       IF ( air_chemistry  .AND.  nesting_offline_chem )                       &
-          ref_chem(nzb:nzt,:) = ref_chem(nzb:nzt,:) / REAL( 2.0_wp *           &
-                                                          ( ny + 1 + nx + 1 ), &
-                                                            KIND = wp )
-!
-!--    Derived from top boundary.    
+       u_ref(nzb:nzt) = u_ref(nzb:nzt) / REAL( 2.0_wp * ( ny + 1 + nx     ), KIND = wp )  
+       v_ref(nzb:nzt) = v_ref(nzb:nzt) / REAL( 2.0_wp * ( ny   + nx + 1   ), KIND = wp )
+       IF ( humidity )                                                                          &
+          q_ref(nzb:nzt) = q_ref(nzb:nzt)   / REAL( 2.0_wp * ( ny + 1 + nx + 1 ), KIND = wp )
+       IF ( .NOT. neutral )                                                                     &
+          pt_ref(nzb:nzt) = pt_ref(nzb:nzt) / REAL( 2.0_wp * ( ny + 1 + nx + 1 ), KIND = wp )
+       IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
+          ref_chem(nzb:nzt,:) = ref_chem(nzb:nzt,:) / REAL( 2.0_wp * ( ny + 1 + nx + 1 ), KIND = wp )
+!
+!--    Derived from top boundary.
        u_ref(nzt+1) = u_ref(nzt+1) / REAL( ( ny + 1 ) * ( nx     ), KIND = wp ) 
        v_ref(nzt+1) = v_ref(nzt+1) / REAL( ( ny     ) * ( nx + 1 ), KIND = wp )
-       IF ( humidity )                                                         &
-          q_ref(nzt+1) = q_ref(nzt+1)   / REAL( ( ny + 1 ) * ( nx + 1 ),       &
-                                                KIND = wp )
-       IF ( .NOT. neutral )                                                    &
-          pt_ref(nzt+1) = pt_ref(nzt+1) / REAL( ( ny + 1 ) * ( nx + 1 ),       &
-                                                KIND = wp )
-       IF ( air_chemistry  .AND.  nesting_offline_chem )                       &
-          ref_chem(nzt+1,:) = ref_chem(nzt+1,:) /                              &
-                              REAL( ( ny + 1 ) * ( nx + 1 ),KIND = wp )
+       IF ( humidity )                                                                          &
+          q_ref(nzt+1) = q_ref(nzt+1)   / REAL( ( ny + 1 ) * ( nx + 1 ), KIND = wp )
+       IF ( .NOT. neutral )                                                                     &
+          pt_ref(nzt+1) = pt_ref(nzt+1) / REAL( ( ny + 1 ) * ( nx + 1 ), KIND = wp )
+       IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
+          ref_chem(nzt+1,:) = ref_chem(nzt+1,:) / REAL( ( ny + 1 ) * ( nx + 1 ),KIND = wp )
 !
 !--    Write onto init profiles, which are used for damping. Also set lower
@@ -1548,11 +2209,9 @@
           DO  n = 1, UBOUND( chem_species, 1 )
              IF ( nest_offl%chem_from_file_t(n) )  THEN 
-                chem_species(n)%conc_pr_init(:) = ref_chem(:,n)
-                chem_species(n)%conc_pr_init(nzb) =                            &
-                                            chem_species(n)%conc_pr_init(nzb+1)
+                chem_species(n)%conc_pr_init(:)   = ref_chem(:,n)
+                chem_species(n)%conc_pr_init(nzb) = chem_species(n)%conc_pr_init(nzb+1)
              ENDIF
           ENDDO
        ENDIF
-
        IF ( ALLOCATED( ref_chem   ) )  DEALLOCATE( ref_chem   )
        IF ( ALLOCATED( ref_chem_l ) )  DEALLOCATE( ref_chem_l )
@@ -1561,5 +2220,5 @@
 !--    Therefore, calculate boundary-layer depth first. 
        CALL nesting_offl_calc_zi
-       CALL adjust_sponge_layer 
+       CALL adjust_sponge_layer
 
        CALL  cpu_log( log_point(58), 'offline nesting', 'stop' )
@@ -1907,7 +2566,118 @@
 !------------------------------------------------------------------------------!
     SUBROUTINE nesting_offl_init
-           
-       INTEGER(iwp) ::  n !< running index for chemical species
-
+
+       INTEGER(iwp) ::  i   !< loop index for x-direction
+       INTEGER(iwp) ::  j   !< loop index for y-direction
+       INTEGER(iwp) ::  n   !< running index for chemical species
+
+!
+!--    Before arrays for the boundary data are allocated, the LOD of the dynamic input data
+!--    at the boundaries is read.
+#if defined ( __netcdf )
+!
+!--    Open file in read-only mode
+       CALL open_read_file( TRIM( input_file_dynamic ) // TRIM( coupling_char ), pids_id )
+!
+!--    Read attributes for LOD. In order to gurantee that also older drivers, where attribute is not given,
+!--    are working, do not abort the run but assume LOD2 forcing.
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_east_pt,  .FALSE., 'ls_forcing_left_pt', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_east_qv,  .FALSE., 'ls_forcing_left_qv', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_east_u,   .FALSE., 'ls_forcing_left_u',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_east_v,   .FALSE., 'ls_forcing_left_v',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_east_w,   .FALSE., 'ls_forcing_left_w',  .FALSE. )
+
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_north_pt, .FALSE., 'ls_forcing_north_pt', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_north_qv, .FALSE., 'ls_forcing_north_qv', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_north_u,  .FALSE., 'ls_forcing_north_u',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_north_v,  .FALSE., 'ls_forcing_north_v',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_north_w,  .FALSE., 'ls_forcing_north_w',  .FALSE. )
+
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_south_pt, .FALSE., 'ls_forcing_south_pt', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_south_qv, .FALSE., 'ls_forcing_south_qv', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_south_u,  .FALSE., 'ls_forcing_south_u',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_south_v,  .FALSE., 'ls_forcing_south_v',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_south_w,  .FALSE., 'ls_forcing_south_w',  .FALSE. )
+
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_west_pt,  .FALSE., 'ls_forcing_right_pt', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_west_qv,  .FALSE., 'ls_forcing_right_qv', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_west_u,   .FALSE., 'ls_forcing_right_u',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_west_v,   .FALSE., 'ls_forcing_right_v',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_west_w,   .FALSE., 'ls_forcing_right_w',  .FALSE. )
+
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_top_pt,   .FALSE., 'ls_forcing_top_pt', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_top_qv,   .FALSE., 'ls_forcing_top_qv', .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_top_u,    .FALSE., 'ls_forcing_top_u',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_top_v,    .FALSE., 'ls_forcing_top_v',  .FALSE. )
+       CALL get_attribute( pids_id, char_lod, nest_offl%lod_top_w,    .FALSE., 'ls_forcing_top_w',  .FALSE. )
+
+       CALL close_input_file( pids_id )
+#endif
+!
+!--    Temporary workaround until most of the dynamic drivers contain a LOD attribute. So far INIFOR
+!--    did not provide the LOD attribute. In order to still use these older dynamic drivers, provide
+!--    a temporary workaround. If the LOD is not given, a NetCDF interal error will occur but the simulation
+!--    will not be aborted since the no_abort flag is passed. However, the respective attribute value
+!--    might be given an arbitrary number. Hence, check for valid LOD's and manually set them to LOD 2 
+!--    (as assumed so far). Note, this workaround should be removed later (date of reference: 6. Oct. 2020).
+       IF ( nest_offl%lod_east_pt /= 1  .AND.  nest_offl%lod_east_pt /= 2 )  nest_offl%lod_east_pt = 2
+       IF ( nest_offl%lod_east_qv /= 1  .AND.  nest_offl%lod_east_qv /= 2 )  nest_offl%lod_east_qv = 2
+       IF ( nest_offl%lod_east_u  /= 1  .AND.  nest_offl%lod_east_u  /= 2 )  nest_offl%lod_east_u  = 2
+       IF ( nest_offl%lod_east_v  /= 1  .AND.  nest_offl%lod_east_v  /= 2 )  nest_offl%lod_east_v  = 2
+       IF ( nest_offl%lod_east_w  /= 1  .AND.  nest_offl%lod_east_w  /= 2 )  nest_offl%lod_east_w  = 2
+
+       IF ( nest_offl%lod_north_pt /= 1  .AND.  nest_offl%lod_north_pt /= 2 )  nest_offl%lod_north_pt = 2
+       IF ( nest_offl%lod_north_qv /= 1  .AND.  nest_offl%lod_north_qv /= 2 )  nest_offl%lod_north_qv = 2
+       IF ( nest_offl%lod_north_u  /= 1  .AND.  nest_offl%lod_north_u  /= 2 )  nest_offl%lod_north_u  = 2
+       IF ( nest_offl%lod_north_v  /= 1  .AND.  nest_offl%lod_north_v  /= 2 )  nest_offl%lod_north_v  = 2
+       IF ( nest_offl%lod_north_w  /= 1  .AND.  nest_offl%lod_north_w  /= 2 )  nest_offl%lod_north_w  = 2
+
+       IF ( nest_offl%lod_south_pt /= 1  .AND.  nest_offl%lod_south_pt /= 2 )  nest_offl%lod_south_pt = 2
+       IF ( nest_offl%lod_south_qv /= 1  .AND.  nest_offl%lod_south_qv /= 2 )  nest_offl%lod_south_qv = 2
+       IF ( nest_offl%lod_south_u  /= 1  .AND.  nest_offl%lod_south_u  /= 2 )  nest_offl%lod_south_u  = 2
+       IF ( nest_offl%lod_south_v  /= 1  .AND.  nest_offl%lod_south_v  /= 2 )  nest_offl%lod_south_v  = 2
+       IF ( nest_offl%lod_south_w  /= 1  .AND.  nest_offl%lod_south_w  /= 2 )  nest_offl%lod_south_w  = 2
+
+       IF ( nest_offl%lod_west_pt /= 1  .AND.  nest_offl%lod_west_pt /= 2 )  nest_offl%lod_west_pt = 2
+       IF ( nest_offl%lod_west_qv /= 1  .AND.  nest_offl%lod_west_qv /= 2 )  nest_offl%lod_west_qv = 2
+       IF ( nest_offl%lod_west_u  /= 1  .AND.  nest_offl%lod_west_u  /= 2 )  nest_offl%lod_west_u  = 2
+       IF ( nest_offl%lod_west_v  /= 1  .AND.  nest_offl%lod_west_v  /= 2 )  nest_offl%lod_west_v  = 2
+       IF ( nest_offl%lod_west_w  /= 1  .AND.  nest_offl%lod_west_w  /= 2 )  nest_offl%lod_west_w  = 2
+
+       IF ( nest_offl%lod_top_pt /= 1  .AND.  nest_offl%lod_top_pt /= 2 )  nest_offl%lod_top_pt = 2
+       IF ( nest_offl%lod_top_qv /= 1  .AND.  nest_offl%lod_top_qv /= 2 )  nest_offl%lod_top_qv = 2
+       IF ( nest_offl%lod_top_u  /= 1  .AND.  nest_offl%lod_top_u  /= 2 )  nest_offl%lod_top_u  = 2
+       IF ( nest_offl%lod_top_v  /= 1  .AND.  nest_offl%lod_top_v  /= 2 )  nest_offl%lod_top_v  = 2
+       IF ( nest_offl%lod_top_w  /= 1  .AND.  nest_offl%lod_top_w  /= 2 )  nest_offl%lod_top_w  = 2
+!
+!--    For consistency, check if all boundary input variables have the same LOD.
+       IF ( MAX( nest_offl%lod_east_pt,  nest_offl%lod_east_qv,  nest_offl%lod_east_u,             &
+                 nest_offl%lod_east_v,   nest_offl%lod_east_w,                                     &
+                 nest_offl%lod_north_pt, nest_offl%lod_north_qv, nest_offl%lod_north_u,            &
+                 nest_offl%lod_north_v,  nest_offl%lod_north_w,                                    &
+                 nest_offl%lod_south_pt, nest_offl%lod_south_qv, nest_offl%lod_south_u,            &
+                 nest_offl%lod_south_v,  nest_offl%lod_south_w,                                    &
+                 nest_offl%lod_north_pt, nest_offl%lod_north_qv, nest_offl%lod_north_u,            &
+                 nest_offl%lod_north_v,  nest_offl%lod_north_w,                                    &
+                 nest_offl%lod_top_pt,   nest_offl%lod_top_qv,   nest_offl%lod_top_u,              &
+                 nest_offl%lod_top_v,    nest_offl%lod_top_w )                                     &
+               /=                                                                                  &
+            MIN( nest_offl%lod_east_pt,  nest_offl%lod_east_qv,  nest_offl%lod_east_u,             &
+                 nest_offl%lod_east_v,   nest_offl%lod_east_w,                                     &
+                 nest_offl%lod_north_pt, nest_offl%lod_north_qv, nest_offl%lod_north_u,            &
+                 nest_offl%lod_north_v,  nest_offl%lod_north_w,                                    &
+                 nest_offl%lod_south_pt, nest_offl%lod_south_qv, nest_offl%lod_south_u,            &
+                 nest_offl%lod_south_v,  nest_offl%lod_south_w,                                    &
+                 nest_offl%lod_north_pt, nest_offl%lod_north_qv, nest_offl%lod_north_u,            &
+                 nest_offl%lod_north_v,  nest_offl%lod_north_w,                                    &
+                 nest_offl%lod_top_pt,   nest_offl%lod_top_qv,   nest_offl%lod_top_u,              &
+                 nest_offl%lod_top_v,    nest_offl%lod_top_w ) )  THEN
+          message_string = 'A mixture of different LOD for the provided boundary data is not ' //  &
+                           'possible.'
+          CALL message( 'nesting_offl_init', 'PA0504', 1, 2, 0, 6, 0 )
+       ENDIF
+!
+!--    As all LODs are the same, store it.
+       lod = nest_offl%lod_east_u
+!
 !--    Allocate arrays for geostrophic wind components. Arrays will 
 !--    incorporate 2 time levels in order to interpolate in between. 
@@ -1915,41 +2685,68 @@
        ALLOCATE( nest_offl%vg(0:1,1:nzt) )
 !
-!--    Allocate arrays for reading left/right boundary values. Arrays will 
-!--    incorporate 2  time levels in order to interpolate in between. If the core has 
-!--    no boundary, allocate a dummy array, in order to enable netcdf parallel
-!--    access. Dummy arrays will be allocated with dimension length zero.
+!--    Set index range according to the given LOD in order to allocate the input arrays
+       IF ( bc_dirichlet_l  .OR.  bc_dirichlet_r  )  THEN
+          IF ( lod == 2 )  THEN
+             j_start   = nys
+             j_start_v = nysv
+             j_end     = nyn
+          ELSE
+             j_start   = 1
+             j_start_v = 1
+             j_end     = 1
+          ENDIF
+       ENDIF
+
+       IF ( bc_dirichlet_n  .OR.  bc_dirichlet_s )  THEN
+          IF( lod == 2 )  THEN
+             i_start   = nxl
+             i_start_u = nxlu
+             i_end     = nxr
+          ELSE
+             i_start   = 1
+             i_start_u = 1
+             i_end     = 1
+          ENDIF
+       ENDIF
+!
+!--    Allocate arrays for reading left/right boundary values. Arrays will
+!--    incorporate 2 time levels in order to interpolate in between. Depending on the given LOD,
+!--    the x-, or y-dimension will be either nxl:nxr, or nys:nyn (for LOD=2), or it reduces to
+!--    one element for LOD=1. If the core has no lateral boundary, allocate a dummy array as well,
+!--    in order to enable netcdf parallel access. Dummy arrays will be allocated with dimension
+!--    length zero.
        IF ( bc_dirichlet_l )  THEN
-          ALLOCATE( nest_offl%u_left(0:1,nzb+1:nzt,nys:nyn)  )
-          ALLOCATE( nest_offl%v_left(0:1,nzb+1:nzt,nysv:nyn) )
-          ALLOCATE( nest_offl%w_left(0:1,nzb+1:nzt-1,nys:nyn) )
-          IF ( humidity )       ALLOCATE( nest_offl%q_left(0:1,nzb+1:nzt,nys:nyn)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_left(0:1,nzb+1:nzt,nys:nyn) )
+          ALLOCATE( nest_offl%u_l(0:1,nzb+1:nzt,j_start:j_end)  )
+          ALLOCATE( nest_offl%v_l(0:1,nzb+1:nzt,j_start_v:j_end) )
+          ALLOCATE( nest_offl%w_l(0:1,nzb+1:nzt-1,j_start:j_end) )
+          IF ( humidity )       ALLOCATE( nest_offl%q_l(0:1,nzb+1:nzt,j_start:j_end)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_l(0:1,nzb+1:nzt,j_start:j_end) )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_left(0:1,nzb+1:nzt,nys:nyn,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_l(0:1,nzb+1:nzt,j_start:j_end,1:UBOUND( chem_species, 1 )) )
        ELSE
-          ALLOCATE( nest_offl%u_left(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%v_left(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%w_left(1:1,1:1,1:1)  )
-          IF ( humidity )       ALLOCATE( nest_offl%q_left(1:1,1:1,1:1)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_left(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%u_l(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_l(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_l(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_l(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_l(1:1,1:1,1:1)  )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_left(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_l(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
        ENDIF
        IF ( bc_dirichlet_r )  THEN
-          ALLOCATE( nest_offl%u_right(0:1,nzb+1:nzt,nys:nyn)  )
-          ALLOCATE( nest_offl%v_right(0:1,nzb+1:nzt,nysv:nyn) )
-          ALLOCATE( nest_offl%w_right(0:1,nzb+1:nzt-1,nys:nyn) )
-          IF ( humidity )       ALLOCATE( nest_offl%q_right(0:1,nzb+1:nzt,nys:nyn)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_right(0:1,nzb+1:nzt,nys:nyn) )
+          ALLOCATE( nest_offl%u_r(0:1,nzb+1:nzt,j_start:j_end)  )
+          ALLOCATE( nest_offl%v_r(0:1,nzb+1:nzt,j_start_v:j_end) )
+          ALLOCATE( nest_offl%w_r(0:1,nzb+1:nzt-1,j_start:j_end) )
+          IF ( humidity )       ALLOCATE( nest_offl%q_r(0:1,nzb+1:nzt,j_start:j_end)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_r(0:1,nzb+1:nzt,j_start:j_end) )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_right(0:1,nzb+1:nzt,nys:nyn,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_r(0:1,nzb+1:nzt,j_start:j_end,1:UBOUND( chem_species, 1 )) )
        ELSE
-          ALLOCATE( nest_offl%u_right(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%v_right(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%w_right(1:1,1:1,1:1)  )
-          IF ( humidity )       ALLOCATE( nest_offl%q_right(1:1,1:1,1:1)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_right(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%u_r(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_r(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_r(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_r(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_r(1:1,1:1,1:1)  )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_right(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_r(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
        ENDIF
 !
@@ -1959,36 +2756,36 @@
 !--    access. Dummy arrays will be allocated with dimension length zero.
        IF ( bc_dirichlet_n )  THEN
-          ALLOCATE( nest_offl%u_north(0:1,nzb+1:nzt,nxlu:nxr) )
-          ALLOCATE( nest_offl%v_north(0:1,nzb+1:nzt,nxl:nxr)  )
-          ALLOCATE( nest_offl%w_north(0:1,nzb+1:nzt-1,nxl:nxr) )
-          IF ( humidity )       ALLOCATE( nest_offl%q_north(0:1,nzb+1:nzt,nxl:nxr)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_north(0:1,nzb+1:nzt,nxl:nxr) )
+          ALLOCATE( nest_offl%u_n(0:1,nzb+1:nzt,i_start_u:i_end) )
+          ALLOCATE( nest_offl%v_n(0:1,nzb+1:nzt,i_start:i_end)  )
+          ALLOCATE( nest_offl%w_n(0:1,nzb+1:nzt-1,i_start:i_end) )
+          IF ( humidity )       ALLOCATE( nest_offl%q_n(0:1,nzb+1:nzt,i_start:i_end)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_n(0:1,nzb+1:nzt,i_start:i_end) )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_north(0:1,nzb+1:nzt,nxl:nxr,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_n(0:1,nzb+1:nzt,i_start:i_end,1:UBOUND( chem_species, 1 )) )
        ELSE
-          ALLOCATE( nest_offl%u_north(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%v_north(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%w_north(1:1,1:1,1:1)  )
-          IF ( humidity )       ALLOCATE( nest_offl%q_north(1:1,1:1,1:1)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_north(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%u_n(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_n(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_n(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_n(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_n(1:1,1:1,1:1)  )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_north(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_n(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
        ENDIF
        IF ( bc_dirichlet_s )  THEN
-          ALLOCATE( nest_offl%u_south(0:1,nzb+1:nzt,nxlu:nxr) )
-          ALLOCATE( nest_offl%v_south(0:1,nzb+1:nzt,nxl:nxr)  )
-          ALLOCATE( nest_offl%w_south(0:1,nzb+1:nzt-1,nxl:nxr)    )
-          IF ( humidity )       ALLOCATE( nest_offl%q_south(0:1,nzb+1:nzt,nxl:nxr)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_south(0:1,nzb+1:nzt,nxl:nxr) )
+          ALLOCATE( nest_offl%u_s(0:1,nzb+1:nzt,i_start_u:i_end) )
+          ALLOCATE( nest_offl%v_s(0:1,nzb+1:nzt,i_start:i_end)  )
+          ALLOCATE( nest_offl%w_s(0:1,nzb+1:nzt-1,i_start:i_end) )
+          IF ( humidity )       ALLOCATE( nest_offl%q_s(0:1,nzb+1:nzt,i_start:i_end)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_s(0:1,nzb+1:nzt,i_start:i_end) )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_south(0:1,nzb+1:nzt,nxl:nxr,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_s(0:1,nzb+1:nzt,i_start:i_end,1:UBOUND( chem_species, 1 )) )
        ELSE
-          ALLOCATE( nest_offl%u_south(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%v_south(1:1,1:1,1:1)  )
-          ALLOCATE( nest_offl%w_south(1:1,1:1,1:1)  )
-          IF ( humidity )       ALLOCATE( nest_offl%q_south(1:1,1:1,1:1)  )
-          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_south(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%u_s(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_s(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_s(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_s(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_s(1:1,1:1,1:1)  )
           IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
-             ALLOCATE( nest_offl%chem_south(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
+             ALLOCATE( nest_offl%chem_s(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
        ENDIF
 !
@@ -1996,11 +2793,21 @@
 !--    lateral boundaries, every core reads these data so that no dummy
 !--    arrays need to be allocated.
-       ALLOCATE( nest_offl%u_top(0:1,nys:nyn,nxlu:nxr) )
-       ALLOCATE( nest_offl%v_top(0:1,nysv:nyn,nxl:nxr) )
-       ALLOCATE( nest_offl%w_top(0:1,nys:nyn,nxl:nxr)  )
-       IF ( humidity )       ALLOCATE( nest_offl%q_top(0:1,nys:nyn,nxl:nxr)  )
-       IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_top(0:1,nys:nyn,nxl:nxr) )
-       IF ( air_chemistry  .AND.  nesting_offline_chem )                                           &
-          ALLOCATE( nest_offl%chem_top(0:1,nys:nyn,nxl:nxr,1:UBOUND( chem_species, 1 )) )
+       IF ( lod == 2 )  THEN
+          ALLOCATE( nest_offl%u_top(0:1,nys:nyn,nxlu:nxr) )
+          ALLOCATE( nest_offl%v_top(0:1,nysv:nyn,nxl:nxr) )
+          ALLOCATE( nest_offl%w_top(0:1,nys:nyn,nxl:nxr)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_top(0:1,nys:nyn,nxl:nxr)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_top(0:1,nys:nyn,nxl:nxr) )
+          IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
+             ALLOCATE( nest_offl%chem_top(0:1,nys:nyn,nxl:nxr,1:UBOUND( chem_species, 1 )) )
+       ELSE
+          ALLOCATE( nest_offl%u_top(0:1,1:1,1:1) )
+          ALLOCATE( nest_offl%v_top(0:1,1:1,1:1) )
+          ALLOCATE( nest_offl%w_top(0:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_top(0:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_top(0:1,1:1,1:1) )
+          IF ( air_chemistry  .AND.  nesting_offline_chem )                                        &
+             ALLOCATE( nest_offl%chem_top(0:1,1:1,1:1,1:UBOUND( chem_species, 1 )) )
+       ENDIF
 !
 !--    For chemical species, create the names of the variables. This is necessary
@@ -2067,72 +2874,218 @@
        ENDIF
 !
+!--    Set indicies for boundary grid points
+       IF ( bc_dirichlet_l  .OR.  bc_dirichlet_r )  THEN
+          i_bound   = MERGE( nxl  - 1, nxr + 1, bc_dirichlet_l )
+          i_bound_u = MERGE( nxlu - 1, nxr + 1, bc_dirichlet_l )
+       ENDIF
+       IF ( bc_dirichlet_n  .OR.  bc_dirichlet_s )  THEN
+          j_bound   = MERGE( nys  - 1, nyn + 1, bc_dirichlet_s )
+          j_bound_v = MERGE( nysv - 1, nyn + 1, bc_dirichlet_s )
+       ENDIF
+!
 !--    Initialize boundary data. Please note, do not initialize boundaries in 
 !--    case of restart runs. This case the boundaries are already initialized
-!--    and the boundary data from file would be on the wrong time level.  
+!--    and the boundary data from file would be on the wrong time level.
        IF ( TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
-          IF ( bc_dirichlet_l )  THEN
-             u(nzb+1:nzt,nys:nyn,0)    = nest_offl%u_left(0,nzb+1:nzt,nys:nyn)
-             v(nzb+1:nzt,nysv:nyn,-1)  = nest_offl%v_left(0,nzb+1:nzt,nysv:nyn) 
-             w(nzb+1:nzt-1,nys:nyn,-1) = nest_offl%w_left(0,nzb+1:nzt-1,nys:nyn)
-             IF ( .NOT. neutral )  pt(nzb+1:nzt,nys:nyn,-1) =                  &
-                                      nest_offl%pt_left(0,nzb+1:nzt,nys:nyn)
-             IF ( humidity      )  q(nzb+1:nzt,nys:nyn,-1)  =                  &
-                                      nest_offl%q_left(0,nzb+1:nzt,nys:nyn)
+!
+!--       Distinguish between LOD = 1 and LOD = 2 inititialization
+          IF ( lod == 2 )  THEN
+             IF ( bc_dirichlet_l )  THEN
+                u(nzb+1:nzt,nys:nyn,i_bound_u) = nest_offl%u_l(0,nzb+1:nzt,nys:nyn)
+                v(nzb+1:nzt,nysv:nyn,i_bound)  = nest_offl%v_l(0,nzb+1:nzt,nysv:nyn) 
+                w(nzb+1:nzt-1,nys:nyn,i_bound) = nest_offl%w_l(0,nzb+1:nzt-1,nys:nyn)
+                IF ( .NOT. neutral )  pt(nzb+1:nzt,nys:nyn,i_bound) = nest_offl%pt_l(0,nzb+1:nzt,nys:nyn)
+                IF ( humidity      )  q(nzb+1:nzt,nys:nyn,i_bound)  = nest_offl%q_l(0,nzb+1:nzt,nys:nyn)
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_l(n) )  THEN
+                         chem_species(n)%conc(nzb+1:nzt,nys:nyn,i_bound) = nest_offl%chem_l(0,nzb+1:nzt,nys:nyn,n)
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+             IF ( bc_dirichlet_r )  THEN
+                u(nzb+1:nzt,nys:nyn,i_bound_u) = nest_offl%u_r(0,nzb+1:nzt,nys:nyn)
+                v(nzb+1:nzt,nysv:nyn,i_bound)  = nest_offl%v_r(0,nzb+1:nzt,nysv:nyn) 
+                w(nzb+1:nzt-1,nys:nyn,i_bound) = nest_offl%w_r(0,nzb+1:nzt-1,nys:nyn)
+                IF ( .NOT. neutral )  pt(nzb+1:nzt,nys:nyn,i_bound) = nest_offl%pt_r(0,nzb+1:nzt,nys:nyn)
+                IF ( humidity      )  q(nzb+1:nzt,nys:nyn,i_bound)  = nest_offl%q_r(0,nzb+1:nzt,nys:nyn)
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_r(n) )  THEN
+                         chem_species(n)%conc(nzb+1:nzt,nys:nyn,i_bound) = nest_offl%chem_r(0,nzb+1:nzt,nys:nyn,n)
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+
+             IF ( bc_dirichlet_n)  THEN
+                u(nzb+1:nzt,j_bound,nxlu:nxr)  = nest_offl%u_n(0,nzb+1:nzt,nxlu:nxr)
+                v(nzb+1:nzt,j_bound_v,nxl:nxr) = nest_offl%v_n(0,nzb+1:nzt,nxl:nxr) 
+                w(nzb+1:nzt-1,j_bound,nxl:nxr) = nest_offl%w_n(0,nzb+1:nzt-1,nxl:nxr) 
+                IF ( .NOT. neutral )  pt(nzb+1:nzt,j_bound,nxl:nxr) = nest_offl%pt_n(0,nzb+1:nzt,nxl:nxr)
+                IF ( humidity      )  q(nzb+1:nzt,j_bound,nxl:nxr)  = nest_offl%q_n(0,nzb+1:nzt,nxl:nxr) 
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_n(n) )  THEN
+                         chem_species(n)%conc(nzb+1:nzt,j_bound,nxl:nxr) = nest_offl%chem_n(0,nzb+1:nzt,nxl:nxr,n)
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+             IF ( bc_dirichlet_s)  THEN
+                u(nzb+1:nzt,j_bound,nxlu:nxr)  = nest_offl%u_s(0,nzb+1:nzt,nxlu:nxr)
+                v(nzb+1:nzt,j_bound_v,nxl:nxr) = nest_offl%v_s(0,nzb+1:nzt,nxl:nxr) 
+                w(nzb+1:nzt-1,j_bound,nxl:nxr) = nest_offl%w_s(0,nzb+1:nzt-1,nxl:nxr) 
+                IF ( .NOT. neutral )  pt(nzb+1:nzt,j_bound,nxl:nxr) = nest_offl%pt_s(0,nzb+1:nzt,nxl:nxr)
+                IF ( humidity      )  q(nzb+1:nzt,j_bound,nxl:nxr)  = nest_offl%q_s(0,nzb+1:nzt,nxl:nxr) 
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_s(n) )  THEN
+                         chem_species(n)%conc(nzb+1:nzt,j_bound,nxl:nxr) = nest_offl%chem_s(0,nzb+1:nzt,nxl:nxr,n)
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+
+             u(nzt+1,nys:nyn,nxlu:nxr) = nest_offl%u_top(0,nys:nyn,nxlu:nxr)
+             v(nzt+1,nysv:nyn,nxl:nxr) = nest_offl%v_top(0,nysv:nyn,nxl:nxr)
+             w(nzt,nys:nyn,nxl:nxr)    = nest_offl%w_top(0,nys:nyn,nxl:nxr)
+             w(nzt+1,nys:nyn,nxl:nxr)  = nest_offl%w_top(0,nys:nyn,nxl:nxr)
+             IF ( .NOT. neutral )  pt(nzt+1,nys:nyn,nxl:nxr) = nest_offl%pt_top(0,nys:nyn,nxl:nxr)
+             IF ( humidity )       q(nzt+1,nys:nyn,nxl:nxr)  = nest_offl%q_top(0,nys:nyn,nxl:nxr)
              IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
                 DO  n = 1, UBOUND( chem_species, 1 )
-                   IF( nest_offl%chem_from_file_l(n) )  THEN
-                      chem_species(n)%conc(nzb+1:nzt,nys:nyn,-1) =             &
-                                      nest_offl%chem_left(0,nzb+1:nzt,nys:nyn,n)
+                   IF( nest_offl%chem_from_file_t(n) )  THEN
+                      chem_species(n)%conc(nzt+1,nys:nyn,nxl:nxr) = nest_offl%chem_top(0,nys:nyn,nxl:nxr,n)
                    ENDIF
                 ENDDO
              ENDIF
-          ENDIF
-          IF ( bc_dirichlet_r )  THEN
-             u(nzb+1:nzt,nys:nyn,nxr+1)   = nest_offl%u_right(0,nzb+1:nzt,nys:nyn) 
-             v(nzb+1:nzt,nysv:nyn,nxr+1)  = nest_offl%v_right(0,nzb+1:nzt,nysv:nyn)
-             w(nzb+1:nzt-1,nys:nyn,nxr+1) = nest_offl%w_right(0,nzb+1:nzt-1,nys:nyn)
-             IF ( .NOT. neutral )  pt(nzb+1:nzt,nys:nyn,nxr+1) =               &
-                                      nest_offl%pt_right(0,nzb+1:nzt,nys:nyn)
-             IF ( humidity      )  q(nzb+1:nzt,nys:nyn,nxr+1)  =               &
-                                      nest_offl%q_right(0,nzb+1:nzt,nys:nyn)
+!
+!--       LOD 1
+          ELSE
+             IF ( bc_dirichlet_l )  THEN
+                DO  j = nys, nyn
+                   u(nzb+1:nzt,j,i_bound_u) = nest_offl%u_l(0,nzb+1:nzt,1)
+                   w(nzb+1:nzt-1,j,i_bound) = nest_offl%w_l(0,nzb+1:nzt-1,1)
+                ENDDO
+                DO  j = nysv, nyn
+                   v(nzb+1:nzt,j,i_bound)  = nest_offl%v_l(0,nzb+1:nzt,1) 
+                ENDDO
+                IF ( .NOT. neutral )  THEN
+                   DO  j = nys, nyn
+                      pt(nzb+1:nzt,j,i_bound) = nest_offl%pt_l(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( humidity      )  THEN
+                   DO  j = nys, nyn
+                      q(nzb+1:nzt,j,i_bound)  = nest_offl%q_l(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_l(n) )  THEN
+                         DO  j = nys, nyn 
+                            chem_species(n)%conc(nzb+1:nzt,j,i_bound) = nest_offl%chem_l(0,nzb+1:nzt,1,n)
+                         ENDDO
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+             IF ( bc_dirichlet_r )  THEN
+                DO  j = nys, nyn
+                   u(nzb+1:nzt,j,i_bound_u) = nest_offl%u_r(0,nzb+1:nzt,1)
+                   w(nzb+1:nzt-1,j,i_bound) = nest_offl%w_r(0,nzb+1:nzt-1,1)
+                ENDDO
+                DO  j = nysv, nyn
+                   v(nzb+1:nzt,j,i_bound)  = nest_offl%v_r(0,nzb+1:nzt,1) 
+                ENDDO
+                IF ( .NOT. neutral )  THEN
+                   DO  j = nys, nyn
+                      pt(nzb+1:nzt,j,i_bound) = nest_offl%pt_r(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( humidity      )  THEN
+                   DO  j = nys, nyn
+                      q(nzb+1:nzt,j,i_bound)  = nest_offl%q_r(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_r(n) )  THEN
+                         DO  j = nys, nyn 
+                            chem_species(n)%conc(nzb+1:nzt,j,i_bound) = nest_offl%chem_r(0,nzb+1:nzt,1,n)
+                         ENDDO
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+             IF ( bc_dirichlet_n )  THEN
+                DO  i = nxlu, nxr
+                   u(nzb+1:nzt,j_bound,i)  = nest_offl%u_n(0,nzb+1:nzt,1)
+                ENDDO
+                DO  i = nxl, nxr
+                   v(nzb+1:nzt,j_bound_v,i) = nest_offl%v_n(0,nzb+1:nzt,1) 
+                   w(nzb+1:nzt-1,j_bound,i) = nest_offl%w_n(0,nzb+1:nzt-1,1)
+                ENDDO
+                IF ( .NOT. neutral )  THEN
+                   DO  i = nxl, nxr
+                      pt(nzb+1:nzt,j_bound,i) = nest_offl%pt_n(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( humidity      )  THEN
+                   DO  i = nxl, nxr
+                      q(nzb+1:nzt,j_bound,i)  = nest_offl%q_n(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_n(n) )  THEN
+                         DO  i = nxl, nxr
+                            chem_species(n)%conc(nzb+1:nzt,j_bound,i) = nest_offl%chem_n(0,nzb+1:nzt,1,n)
+                         ENDDO
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+             IF ( bc_dirichlet_s )  THEN
+                DO  i = nxlu, nxr
+                   u(nzb+1:nzt,j_bound,i)  = nest_offl%u_s(0,nzb+1:nzt,1)
+                ENDDO
+                DO  i = nxl, nxr
+                   v(nzb+1:nzt,j_bound_v,i) = nest_offl%v_s(0,nzb+1:nzt,1) 
+                   w(nzb+1:nzt-1,j_bound,i) = nest_offl%w_s(0,nzb+1:nzt-1,1)
+                ENDDO
+                IF ( .NOT. neutral )  THEN
+                   DO  i = nxl, nxr
+                      pt(nzb+1:nzt,j_bound,i) = nest_offl%pt_s(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( humidity      )  THEN
+                   DO  i = nxl, nxr
+                      q(nzb+1:nzt,j_bound,i)  = nest_offl%q_s(0,nzb+1:nzt,1)
+                   ENDDO
+                ENDIF
+                IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
+                   DO  n = 1, UBOUND( chem_species, 1 )
+                      IF( nest_offl%chem_from_file_s(n) )  THEN
+                         DO  i = nxl, nxr
+                            chem_species(n)%conc(nzb+1:nzt,j_bound,i) = nest_offl%chem_s(0,nzb+1:nzt,1,n)
+                         ENDDO
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
+
+             u(nzt+1,nys:nyn,nxlu:nxr) = nest_offl%u_top(0,1,1)
+             v(nzt+1,nysv:nyn,nxl:nxr) = nest_offl%v_top(0,1,1)
+             w(nzt,nys:nyn,nxl:nxr)    = nest_offl%w_top(0,1,1)
+             w(nzt+1,nys:nyn,nxl:nxr)  = nest_offl%w_top(0,1,1)
+             IF ( .NOT. neutral )  pt(nzt+1,nys:nyn,nxl:nxr) = nest_offl%pt_top(0,1,1)
+             IF ( humidity )       q(nzt+1,nys:nyn,nxl:nxr)  = nest_offl%q_top(0,1,1)
              IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
                 DO  n = 1, UBOUND( chem_species, 1 )
-                   IF( nest_offl%chem_from_file_r(n) )  THEN
-                      chem_species(n)%conc(nzb+1:nzt,nys:nyn,nxr+1) =          &
-                                      nest_offl%chem_right(0,nzb+1:nzt,nys:nyn,n)
-                   ENDIF
-                ENDDO
-             ENDIF
-          ENDIF
-          IF ( bc_dirichlet_s )  THEN
-             u(nzb+1:nzt,-1,nxlu:nxr)  = nest_offl%u_south(0,nzb+1:nzt,nxlu:nxr)
-             v(nzb+1:nzt,0,nxl:nxr)    = nest_offl%v_south(0,nzb+1:nzt,nxl:nxr) 
-             w(nzb+1:nzt-1,-1,nxl:nxr) = nest_offl%w_south(0,nzb+1:nzt-1,nxl:nxr) 
-             IF ( .NOT. neutral )  pt(nzb+1:nzt,-1,nxl:nxr) =                  &
-                                      nest_offl%pt_south(0,nzb+1:nzt,nxl:nxr)
-             IF ( humidity      )  q(nzb+1:nzt,-1,nxl:nxr)  =                  &
-                                      nest_offl%q_south(0,nzb+1:nzt,nxl:nxr) 
-             IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-                DO  n = 1, UBOUND( chem_species, 1 )
-                   IF( nest_offl%chem_from_file_s(n) )  THEN
-                      chem_species(n)%conc(nzb+1:nzt,-1,nxl:nxr) =             &
-                                      nest_offl%chem_south(0,nzb+1:nzt,nxl:nxr,n)
-                   ENDIF
-                ENDDO
-             ENDIF
-          ENDIF
-          IF ( bc_dirichlet_n )  THEN
-             u(nzb+1:nzt,nyn+1,nxlu:nxr)  = nest_offl%u_north(0,nzb+1:nzt,nxlu:nxr)
-             v(nzb+1:nzt,nyn+1,nxl:nxr)   = nest_offl%v_north(0,nzb+1:nzt,nxl:nxr) 
-             w(nzb+1:nzt-1,nyn+1,nxl:nxr) = nest_offl%w_north(0,nzb+1:nzt-1,nxl:nxr)
-             IF ( .NOT. neutral )  pt(nzb+1:nzt,nyn+1,nxl:nxr) =               &
-                                      nest_offl%pt_north(0,nzb+1:nzt,nxl:nxr) 
-             IF ( humidity      )  q(nzb+1:nzt,nyn+1,nxl:nxr)  =               &
-                                      nest_offl%q_north(0,nzb+1:nzt,nxl:nxr)
-             IF ( air_chemistry  .AND.  nesting_offline_chem )  THEN
-                DO  n = 1, UBOUND( chem_species, 1 )
-                   IF( nest_offl%chem_from_file_n(n) )  THEN
-                      chem_species(n)%conc(nzb+1:nzt,nyn+1,nxl:nxr) =          &
-                                      nest_offl%chem_north(0,nzb+1:nzt,nxl:nxr,n)
+                   IF( nest_offl%chem_from_file_t(n) )  THEN
+                      chem_species(n)%conc(nzt+1,nys:nyn,nxl:nxr) = nest_offl%chem_top(0,1,1,n)
                    ENDIF
                 ENDDO
@@ -2159,5 +3112,4 @@
 !--    generator correctly. 
        CALL nesting_offl_calc_zi
-       
 !
 !--    After boundary data is initialized, ensure mass conservation. Not 
Index: /palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 4723)
+++ /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 4724)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! - New routines to read LOD=1 variables from dynamic input file
+! - add no_abort option to all get_attribute routines
+!
+! 4641 2020-08-13 09:57:07Z suehring
 ! To follow (UC)2 standard, change default of attribute data_content
 ! 
@@ -741,4 +745,5 @@
        MODULE PROCEDURE get_variable_2d_int32
        MODULE PROCEDURE get_variable_2d_real
+       MODULE PROCEDURE get_variable_2d_real_dynamic
        MODULE PROCEDURE get_variable_3d_int8
        MODULE PROCEDURE get_variable_3d_real
@@ -3996,5 +4001,5 @@
 !------------------------------------------------------------------------------!
      SUBROUTINE get_attribute_int32( id, attribute_name, value, global,        &
-                                     variable_name )
+                                     variable_name, no_abort )
 
        USE pegrid
@@ -4009,12 +4014,19 @@
        INTEGER(iwp), INTENT(INOUT) ::  value            !< read value
 
-       LOGICAL, INTENT(IN) ::  global                   !< flag indicating global attribute
+       LOGICAL                       ::  check_error    !< flag indicating if handle_error shall be checked
+       LOGICAL, INTENT(IN)           ::  global         !< flag indicating global attribute
+       LOGICAL, INTENT(IN), OPTIONAL ::  no_abort       !< flag indicating if errors should be checked
 #if defined( __netcdf )
 
+       IF ( PRESENT( no_abort ) )  THEN
+          check_error = no_abort
+       ELSE
+          check_error = .TRUE.
+       ENDIF
 !
 !--    Read global attribute
        IF ( global )  THEN
           nc_stat = NF90_GET_ATT( id, NF90_GLOBAL, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_int32 global', 522, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_int32 global', 522, attribute_name )
 !
 !--    Read attributes referring to a single variable. Therefore, first inquire
@@ -4022,7 +4034,7 @@
        ELSE
           nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
-          CALL handle_error( 'get_attribute_int32', 522, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_int32', 522, attribute_name )
           nc_stat = NF90_GET_ATT( id, id_var, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_int32', 522, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_int32', 522, attribute_name )
        ENDIF
 #endif
@@ -4035,5 +4047,5 @@
 !------------------------------------------------------------------------------!
      SUBROUTINE get_attribute_int8( id, attribute_name, value, global,         &
-                                    variable_name )
+                                    variable_name, no_abort )
 
        USE pegrid
@@ -4048,12 +4060,19 @@
        INTEGER(KIND=1), INTENT(INOUT) ::  value         !< read value
 
-       LOGICAL, INTENT(IN) ::  global                   !< flag indicating global attribute
+       LOGICAL                       ::  check_error    !< flag indicating if handle_error shall be checked
+       LOGICAL, INTENT(IN), OPTIONAL ::  no_abort       !< flag indicating if errors should be checked
+       LOGICAL, INTENT(IN)           ::  global         !< flag indicating global attribute
 #if defined( __netcdf )
 
+       IF ( PRESENT( no_abort ) )  THEN
+          check_error = no_abort
+       ELSE
+          check_error = .TRUE.
+       ENDIF
 !
 !--    Read global attribute
        IF ( global )  THEN
           nc_stat = NF90_GET_ATT( id, NF90_GLOBAL, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_int8 global', 523, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_int8 global', 523, attribute_name )
 !
 !--    Read attributes referring to a single variable. Therefore, first inquire
@@ -4061,7 +4080,7 @@
        ELSE
           nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
-          CALL handle_error( 'get_attribute_int8', 523, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_int8', 523, attribute_name )
           nc_stat = NF90_GET_ATT( id, id_var, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_int8', 523, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_int8', 523, attribute_name )
        ENDIF
 #endif
@@ -4074,5 +4093,5 @@
 !------------------------------------------------------------------------------!
      SUBROUTINE get_attribute_real( id, attribute_name, value, global,         &
-                                    variable_name )
+                                    variable_name, no_abort )
 
        USE pegrid
@@ -4086,23 +4105,29 @@
        INTEGER(iwp)                ::  id_var           !< variable id
 
-       LOGICAL, INTENT(IN) ::  global                   !< flag indicating global attribute
+       LOGICAL                       ::  check_error    !< flag indicating if handle_error shall be checked
+       LOGICAL, INTENT(IN)           ::  global         !< flag indicating global attribute
+       LOGICAL, INTENT(IN), OPTIONAL ::  no_abort       !< flag indicating if errors should be checked
 
        REAL(wp), INTENT(INOUT)     ::  value            !< read value
 #if defined( __netcdf )
 
-
-!
-!-- Read global attribute
+       IF ( PRESENT( no_abort ) )  THEN
+          check_error = no_abort
+       ELSE
+          check_error = .TRUE.
+       ENDIF
+!
+!--    Read global attribute
        IF ( global )  THEN
           nc_stat = NF90_GET_ATT( id, NF90_GLOBAL, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_real global', 524, attribute_name )
-!
-!-- Read attributes referring to a single variable. Therefore, first inquire
-!-- variable id
+          IF ( check_error)  CALL handle_error( 'get_attribute_real global', 524, attribute_name )
+!
+!--    Read attributes referring to a single variable. Therefore, first inquire
+!--    variable id
        ELSE
           nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
-          CALL handle_error( 'get_attribute_real', 524, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_real', 524, attribute_name )
           nc_stat = NF90_GET_ATT( id, id_var, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_real', 524, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_real', 524, attribute_name )
        ENDIF
 #endif
@@ -4332,7 +4357,7 @@
 
 !------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> Reads a character variable in a 1D array
+!    Description:
+!    ------------
+!>   Reads a character variable in a 1D array
 !------------------------------------------------------------------------------!
      SUBROUTINE get_variable_1d_char( id, variable_name, var )
@@ -4405,5 +4430,5 @@
        CALL handle_error( 'get_variable_1d_int', 527, variable_name )
 !
-!--    Inquire dimension length
+!--    Read variable
        nc_stat = NF90_GET_VAR( id, id_var, var )
        CALL handle_error( 'get_variable_1d_int', 527, variable_name )
@@ -4417,5 +4442,5 @@
 !> Reads a 1D float variable from file.
 !------------------------------------------------------------------------------!
-     SUBROUTINE get_variable_1d_real( id, variable_name, var )
+     SUBROUTINE get_variable_1d_real( id, variable_name, var, is, count_elements )
 
        USE pegrid
@@ -4428,7 +4453,9 @@
        INTEGER(iwp)                ::  id_var           !< dimension id
 
+       INTEGER(iwp), INTENT(IN), OPTIONAL ::  count_elements !< number of elements to be read
+       INTEGER(iwp), INTENT(IN), OPTIONAL ::  is             !< start index
+
        REAL(wp), DIMENSION(:), INTENT(INOUT) ::  var    !< variable to be read
 #if defined( __netcdf )
-
 !
 !--    First, inquire variable ID
@@ -4436,7 +4463,12 @@
        CALL handle_error( 'get_variable_1d_real', 528, variable_name )
 !
-!--    Inquire dimension length
-       nc_stat = NF90_GET_VAR( id, id_var, var )
-       CALL handle_error( 'get_variable_1d_real', 528, variable_name )
+!--    Read variable
+       IF ( PRESENT( is ) )  THEN
+          nc_stat = NF90_GET_VAR( id, id_var, var, start = (/ is /), count = (/ count_elements /) )
+          CALL handle_error( 'get_variable_1d_real', 528, variable_name )
+       ELSE
+          nc_stat = NF90_GET_VAR( id, id_var, var )
+          CALL handle_error( 'get_variable_1d_real', 528, variable_name )
+       ENDIF
 
 #endif
@@ -4463,5 +4495,5 @@
        INTEGER(iwp), INTENT(IN)              ::  t                !< timestep number
 
-       REAL(wp), DIMENSION(:), INTENT(INOUT) ::  var  !< variable to be read
+       REAL(wp), DIMENSION(:), INTENT(INOUT) ::  var              !< variable to be read
 
 #if defined( __netcdf )
@@ -4743,21 +4775,21 @@
 
 !
-!-- Allocate temporary variable according to memory access on file. 
+!--    Allocate temporary variable according to memory access on file. 
        ALLOCATE( tmp(is:ie,js:je) )
 !
-!-- Get variable
+!--    Get variable
        nc_stat = NF90_GET_VAR( id, id_var, tmp,            &
                       start = (/ is+1,      js+1 /),       &
                       count = (/ ie-is + 1, je-js+1 /) )   
-          CALL handle_error( 'get_variable_2d_real', 530, variable_name )
-!
-!-- Resort data. Please note, dimension subscripts of var all start at 1. 
-          DO  i = is, ie 
-             DO  j = js, je 
-                var(j-js+1,i-is+1) = tmp(i,j)
-             ENDDO
+       CALL handle_error( 'get_variable_2d_real', 530, variable_name )
+!
+!--    Resort data. Please note, dimension subscripts of var all start at 1. 
+       DO  i = is, ie 
+          DO  j = js, je 
+             var(j-js+1,i-is+1) = tmp(i,j)
           ENDDO
+       ENDDO
        
-          DEALLOCATE( tmp )
+       DEALLOCATE( tmp )
 
 #endif
@@ -5171,4 +5203,74 @@
 #endif
     END SUBROUTINE get_variable_4d_to_3d_real
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Reads a 3D float variables from dynamic driver with the last dimension only
+!> having 1 entry (time,z). Please note, 
+!> the passed arguments are start indices and number of elements in each 
+!> dimension, which is in contrast to the other 3d versions where start- and 
+!> end indices are passed. The different handling compared to get_variable_2d_real
+!> is due to its different start-index treatment.
+!------------------------------------------------------------------------------!
+    SUBROUTINE get_variable_2d_real_dynamic( id, variable_name, var,           &
+                                             i1s, i2s,                         &
+                                             count_1, count_2 )
+                                
+       USE indices
+       USE pegrid
+
+       IMPLICIT NONE
+
+       CHARACTER(LEN=*)              ::  variable_name   !< variable name
+
+       INTEGER(iwp)                  ::  count_1         !< number of elements to be read along 1st dimension (with respect to file)
+       INTEGER(iwp)                  ::  count_2         !< number of elements to be read along 2nd dimension (with respect to file)
+       INTEGER(iwp)                  ::  i1              !< running index along 1st dimension on file
+       INTEGER(iwp)                  ::  i1s             !< start index for subdomain input along 1st dimension (with respect to file)
+       INTEGER(iwp)                  ::  i2              !< running index along 2nd dimension on file       
+       INTEGER(iwp)                  ::  i2s             !< start index for subdomain input along 2nd dimension (with respect to file)
+       INTEGER(iwp), INTENT(IN)      ::  id              !< file id
+       INTEGER(iwp)                  ::  id_var          !< variable id
+       INTEGER(iwp)                  ::  lb1             !< lower bound of 1st dimension (with respect to file)
+       INTEGER(iwp)                  ::  lb2             !< lower bound of 2nd dimension (with respect to file)
+       INTEGER(iwp)                  ::  ub1             !< upper bound of 1st dimension (with respect to file)
+       INTEGER(iwp)                  ::  ub2             !< upper bound of 2nd dimension (with respect to file)
+
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE   ::  tmp   !< temporary variable to read data from file according to its reverse memory access
+
+       REAL(wp), DIMENSION(:,:,:), INTENT(INOUT) ::  var !< input variable
+
+#if defined( __netcdf )
+!
+!--    Inquire variable id.
+       nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
+!
+!--    Allocate temporary variable according to memory access on file. 
+!--    Therefore, determine dimension bounds of input array. 
+       lb1 = LBOUND(var,2)
+       ub1 = UBOUND(var,2)
+       lb2 = LBOUND(var,1)
+       ub2 = UBOUND(var,1)
+
+       ALLOCATE( tmp(lb1:ub1,lb2:ub2) )
+!
+!--    Get variable
+       nc_stat = NF90_GET_VAR( id, id_var, tmp,                                &
+                               start = (/ i1s,     i2s /),                     &
+                               count = (/ count_1, count_2 /) )
+
+       CALL handle_error( 'get_variable_2d_real_dynamic', 537, variable_name )
+!
+!--    Resort data. Please note, dimension subscripts of var all start at 1. 
+       DO i2 = lb2, ub2
+          DO  i1 = lb1, ub1
+             var(i2,i1,1) = tmp(i1,i2)
+          ENDDO
+       ENDDO
+
+       DEALLOCATE( tmp )       
+#endif
+    END SUBROUTINE get_variable_2d_real_dynamic
 
 !------------------------------------------------------------------------------!
