Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 4190)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 4226)
@@ -25,4 +25,11 @@
 ! -----------------
 ! $Id$
+! - Netcdf input routine for dimension length renamed
+! - Move offline-nesting-specific checks to nesting_offl_mod
+! - Module-specific input of boundary data for offline nesting moved to 
+!   nesting_offl_mod
+! - Define module specific data type for offline nesting in nesting_offl_mod
+! 
+! 4190 2019-08-27 15:42:37Z suehring
 ! type real_1d changed to real_1d_3d
 ! 
@@ -169,82 +176,4 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE :: z       !< dimension array in z
     END TYPE dims_xy
-!
-!-- Define data type for nesting in larger-scale models like COSMO.
-!-- Data type comprises u, v, w, pt, and q at lateral and top boundaries.
-    TYPE nest_offl_type
-
-       CHARACTER(LEN=16) ::  char_l = 'ls_forcing_left_'  !< leading substring for variables at left boundary 
-       CHARACTER(LEN=17) ::  char_n = 'ls_forcing_north_' !< leading substring for variables at north boundary  
-       CHARACTER(LEN=17) ::  char_r = 'ls_forcing_right_' !< leading substring for variables at right boundary  
-       CHARACTER(LEN=17) ::  char_s = 'ls_forcing_south_' !< leading substring for variables at south boundary 
-       CHARACTER(LEN=15) ::  char_t = 'ls_forcing_top_'   !< leading substring for variables at top boundary 
-
-       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names         !< list of variable in dynamic input file
-       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names_chem_l  !< names of mesoscale nested chemistry variables at left boundary
-       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names_chem_n  !< names of mesoscale nested chemistry variables at north boundary
-       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names_chem_r  !< names of mesoscale nested chemistry variables at right boundary
-       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE ::  var_names_chem_s  !< names of mesoscale nested chemistry variables at south boundary
-       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
-
-       LOGICAL, DIMENSION(:), ALLOCATABLE ::  chem_from_file_l !< flags inidicating whether left boundary data for chemistry is in dynamic input file  
-       LOGICAL, DIMENSION(:), ALLOCATABLE ::  chem_from_file_n !< flags inidicating whether north boundary data for chemistry is in dynamic input file 
-       LOGICAL, DIMENSION(:), ALLOCATABLE ::  chem_from_file_r !< flags inidicating whether right boundary data for chemistry is in dynamic input file 
-       LOGICAL, DIMENSION(:), ALLOCATABLE ::  chem_from_file_s !< flags inidicating whether south boundary data for chemistry is in dynamic input file 
-       LOGICAL, DIMENSION(:), ALLOCATABLE ::  chem_from_file_t !< flags inidicating whether top boundary data for chemistry is in dynamic input file 
-
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  surface_pressure !< time dependent surface pressure
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  time             !< time levels in dynamic input file
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  zu_atmos         !< vertical levels at scalar grid in dynamic input file
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  zw_atmos         !< vertical levels at w grid in dynamic input file
-
-       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ug         !< domain-averaged geostrophic component
-       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 ::  u_top    !< u-component at top boundary
-       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  v_top    !< v-component at top 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
-
-    END TYPE nest_offl_type
-
     TYPE init_type
 
@@ -571,7 +500,5 @@
     TYPE(crs_type)   ::  coord_ref_sys  !< coordinate reference system
 
-    TYPE(dims_xy)    ::  dim_static     !< data structure for x, y-dimension in static input file
-
-    TYPE(nest_offl_type) ::  nest_offl  !< data structure for data input at lateral and top boundaries (provided by Inifor)  
+    TYPE(dims_xy)    ::  dim_static     !< data structure for x, y-dimension in static input file 
 
     TYPE(init_type) ::  init_3d    !< data structure for the initialization of the 3D flow and soil fields
@@ -679,7 +606,7 @@
     END INTERFACE netcdf_data_input_chemistry_data
     
-    INTERFACE netcdf_data_input_get_dimension_length                        
-       MODULE PROCEDURE netcdf_data_input_get_dimension_length
-    END INTERFACE netcdf_data_input_get_dimension_length
+    INTERFACE get_dimension_length                        
+       MODULE PROCEDURE get_dimension_length
+    END INTERFACE get_dimension_length
 
     INTERFACE netcdf_data_input_inquire_file
@@ -705,8 +632,4 @@
        MODULE PROCEDURE netcdf_data_input_init_lsm
     END INTERFACE netcdf_data_input_init_lsm
-
-    INTERFACE netcdf_data_input_offline_nesting
-       MODULE PROCEDURE netcdf_data_input_offline_nesting
-    END INTERFACE netcdf_data_input_offline_nesting
 
     INTERFACE netcdf_data_input_surface_data
@@ -770,5 +693,5 @@
            input_pids_static,                                                  &
            input_pids_dynamic, input_pids_vm, input_file_vm,                   &
-           leaf_area_density_f, nest_offl,                                     &
+           leaf_area_density_f,                                                &
            num_var_pids,                                                       &
            pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f,       &
@@ -790,12 +713,18 @@
     PUBLIC netcdf_data_input_check_dynamic, netcdf_data_input_check_static,    &
            netcdf_data_input_chemistry_data,                                   &
-           netcdf_data_input_get_dimension_length,                             &
+           get_dimension_length,                                               &
            netcdf_data_input_inquire_file,                                     &
            netcdf_data_input_init, netcdf_data_input_init_lsm,                 &
            netcdf_data_input_init_3d, netcdf_data_input_att,                   &
-           netcdf_data_input_interpolate, netcdf_data_input_offline_nesting,   &
+           netcdf_data_input_interpolate,                                      &
            netcdf_data_input_surface_data, netcdf_data_input_topo,             &
-           netcdf_data_input_var, get_attribute, get_variable, open_read_file, &
-           check_existence, inquire_num_variables, inquire_variable_names,     &
+           netcdf_data_input_var,                                              &
+           get_attribute,                                                      &
+           get_variable,                                                       &
+           get_variable_pr,                                                    &
+           open_read_file,                                                     &
+           check_existence,                                                    &
+           inquire_num_variables,                                              &
+           inquire_variable_names,                                             &
            close_input_file
 
@@ -1347,6 +1276,5 @@
 !-- Tther dimensions depend on the emission mode or specific components
 
-          CALL netcdf_data_input_get_dimension_length (    &
-                                 id_emis, emt_att%n_emiss_species, 'nspecies' )
+          CALL get_dimension_length ( id_emis, emt_att%n_emiss_species, 'nspecies' )
 
 !
@@ -1408,6 +1336,5 @@
 !-- get number of emission categories
 
-             CALL netcdf_data_input_get_dimension_length (           &
-                                    id_emis, emt_att%ncat, 'ncat' )
+             CALL get_dimension_length ( id_emis, emt_att%ncat, 'ncat' )
 
 !-- READING IN EMISSION CATEGORIES INDICES
@@ -1445,6 +1372,5 @@
 !
 !-- VOC name
-                   CALL netcdf_data_input_get_dimension_length (     &
-                                          id_emis, emt_att%nvoc, 'nvoc' )
+                   CALL get_dimension_length ( id_emis, emt_att%nvoc, 'nvoc' )
                    ALLOCATE ( emt_att%voc_name(emt_att%nvoc) )
                    CALL get_variable ( id_emis,"emission_voc_name",  &
@@ -1471,6 +1397,5 @@
 !-- PM name
 
-                   CALL netcdf_data_input_get_dimension_length (     &
-                                          id_emis, emt_att%npm, 'npm' )
+                   CALL get_dimension_length ( id_emis, emt_att%npm, 'npm' )
                    ALLOCATE ( emt_att%pm_name(emt_att%npm) )
                    CALL get_variable ( id_emis, "pm_name", string_values, emt_att%npm )
@@ -1522,6 +1447,5 @@
                    TRIM(time_fac_type) == "hour" )  THEN
 
-                CALL netcdf_data_input_get_dimension_length (                  &
-                                       id_emis, emt_att%nhoursyear, 'nhoursyear' )
+                CALL get_dimension_length ( id_emis, emt_att%nhoursyear, 'nhoursyear' )
                 ALLOCATE ( emt_att%hourly_emis_time_factor(emt_att%ncat,emt_att%nhoursyear) )
                 CALL get_variable ( id_emis, "emission_time_factors",          &
@@ -1535,6 +1459,5 @@
                         TRIM(time_fac_type)  ==  "mdh" )  THEN
 
-                CALL netcdf_data_input_get_dimension_length (                  &
-                                       id_emis, emt_att%nmonthdayhour, 'nmonthdayhour' )
+                CALL get_dimension_length ( id_emis, emt_att%nmonthdayhour, 'nmonthdayhour' )
                 ALLOCATE ( emt_att%mdh_emis_time_factor(emt_att%ncat,emt_att%nmonthdayhour) )
                 CALL get_variable ( id_emis, "emission_time_factors",          &
@@ -1652,6 +1575,5 @@
 !
 !-- VOC name
-                   CALL netcdf_data_input_get_dimension_length (                         &
-                                          id_emis, emt_att%nvoc, 'nvoc' )
+                   CALL get_dimension_length ( id_emis, emt_att%nvoc, 'nvoc' )
                    ALLOCATE ( emt_att%voc_name(emt_att%nvoc) )
                    CALL get_variable ( id_emis, "emission_voc_name",                     &
@@ -1673,6 +1595,5 @@
 !-- EMISSION DATA
 
-             CALL netcdf_data_input_get_dimension_length (                               &
-                                    id_emis, emt_att%dt_emission, 'time' )   
+             CALL get_dimension_length ( id_emis, emt_att%dt_emission, 'time' )   
  
 !
@@ -1805,7 +1726,7 @@
 !
 !--          Inquire number of vertical vegetation layer
-             CALL netcdf_data_input_get_dimension_length( id_surf,             &
-                                                 leaf_area_density_f%nz,       &
-                                                 'zlad' )
+             CALL get_dimension_length( id_surf,                               &
+                                        leaf_area_density_f%nz,                &
+                                        'zlad' )
 !
 !--          Allocate variable for leaf-area density
@@ -1830,7 +1751,7 @@
 !
 !--          Inquire number of vertical vegetation layer
-             CALL netcdf_data_input_get_dimension_length( id_surf,             &
-                                                 basal_area_density_f%nz,      &
-                                                 'zlad' )
+             CALL get_dimension_length( id_surf,                               &
+                                        basal_area_density_f%nz,               & 
+                                        'zlad' )
 !
 !--          Allocate variable
@@ -1854,5 +1775,5 @@
 !
 !--          Inquire number of vertical soil layers
-             CALL netcdf_data_input_get_dimension_length( id_surf,             &
+             CALL get_dimension_length( id_surf,             &
                                                    root_area_density_lad_f%nz, &
                                                   'zsoil' )
@@ -1936,6 +1857,5 @@
 !
 !--          Obtain number of soil layers from file.
-             CALL netcdf_data_input_get_dimension_length( id_surf, nz_soil,    &
-                                                          'zsoil' )
+             CALL get_dimension_length( id_surf, nz_soil, 'zsoil' )
 
              ALLOCATE ( soil_type_f%var_3d(0:nz_soil,nys:nyn,nxl:nxr) )
@@ -1989,7 +1909,7 @@
 !
 !--       Inquire number of surface fractions
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       surface_fraction_f%nf,  &
-                                                       'nsurface_fraction' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     surface_fraction_f%nf,                    &
+                                     'nsurface_fraction' )
 !
 !--       Allocate dimension array and input array for surface fractions
@@ -2018,7 +1938,7 @@
 !
 !--       Inquire number of building parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       building_pars_f%np,     &
-                                                       'nbuilding_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                      building_pars_f%np,                      &
+                                      'nbuilding_pars' )
 !
 !--       Allocate dimension array and input array for building parameters
@@ -2061,7 +1981,7 @@
 !
 !--       Inquire number of albedo parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       albedo_pars_f%np,       &
-                                                       'nalbedo_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     albedo_pars_f%np,                         &
+                                     'nalbedo_pars' )
 !
 !--       Allocate dimension array and input array for albedo parameters
@@ -2089,7 +2009,7 @@
 !
 !--       Inquire number of pavement parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       pavement_pars_f%np,     &
-                                                       'npavement_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     pavement_pars_f%np,                       &
+                                     'npavement_pars' )
 !
 !--       Allocate dimension array and input array for pavement parameters
@@ -2118,12 +2038,12 @@
 !
 !--       Inquire number of parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                pavement_subsurface_pars_f%np, &
-                                               'npavement_subsurface_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     pavement_subsurface_pars_f%np,            &
+                                     'npavement_subsurface_pars' )
 !
 !--       Inquire number of soil layers
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                pavement_subsurface_pars_f%nz, &
-                                                'zsoil' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     pavement_subsurface_pars_f%nz,            &
+                                     'zsoil' )
 !
 !--       Allocate dimension array and input array for pavement parameters
@@ -2158,7 +2078,7 @@
 !
 !--       Inquire number of vegetation parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       vegetation_pars_f%np,   &
-                                                       'nvegetation_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     vegetation_pars_f%np,                     &
+                                     'nvegetation_pars' )
 !
 !--       Allocate dimension array and input array for surface fractions
@@ -2192,7 +2112,7 @@
 !
 !--       Inquire number of soil parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       soil_pars_f%np,         &
-                                                       'nsoil_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     soil_pars_f%np,                           &
+                                     'nsoil_pars' )
 !
 !--       Read parameters array
@@ -2204,7 +2124,7 @@
 !--       soil layers, allocate memory and read the respective dimension
           IF ( soil_pars_f%lod == 2 )  THEN
-             CALL netcdf_data_input_get_dimension_length( id_surf,             &
-                                                          soil_pars_f%nz,      &
-                                                          'zsoil' )
+             CALL get_dimension_length( id_surf,                               &
+                                        soil_pars_f%nz,                        &
+                                        'zsoil' )
 
              ALLOCATE( soil_pars_f%layers(0:soil_pars_f%nz-1) )
@@ -2245,7 +2165,7 @@
 !
 !--       Inquire number of water parameters
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                       water_pars_f%np,        &
-                                                       'nwater_pars' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     water_pars_f%np,                          &
+                                     'nwater_pars' )
 !
 !--       Allocate dimension array and input array for water parameters
@@ -2271,7 +2191,7 @@
 !
 !--       Obtain number of soil layers from file and allocate variable
-          CALL netcdf_data_input_get_dimension_length( id_surf,                &
-                                                   root_area_density_lsm_f%nz, &
-                                                   'zsoil' )
+          CALL get_dimension_length( id_surf,                                  &
+                                     root_area_density_lsm_f%nz,               &
+                                     'zsoil' )
           ALLOCATE( root_area_density_lsm_f%var                                &
                                         (0:root_area_density_lsm_f%nz-1,       &
@@ -2645,6 +2565,6 @@
 !
 !--       Read x, y - dimensions. Only required for consistency checks.
-          CALL netcdf_data_input_get_dimension_length( id_topo, dim_static%nx, 'x' )
-          CALL netcdf_data_input_get_dimension_length( id_topo, dim_static%ny, 'y' )
+          CALL get_dimension_length( id_topo, dim_static%nx, 'x' )
+          CALL get_dimension_length( id_topo, dim_static%ny, 'y' )
           ALLOCATE( dim_static%x(0:dim_static%nx-1) )
           ALLOCATE( dim_static%y(0:dim_static%ny-1) )
@@ -2725,6 +2645,5 @@
                                  .FALSE., 'buildings_3d' )
 
-             CALL netcdf_data_input_get_dimension_length( id_topo,             &
-                                                          buildings_f%nz, 'z' )
+             CALL get_dimension_length( id_topo, buildings_f%nz, 'z' )
 !
 !--          Read 3D buildings
@@ -2941,13 +2860,13 @@
 !
 !--    Read vertical dimension of scalar und w grid. 
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nzu, 'z'     )
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nzw, 'zw'    )
+       CALL get_dimension_length( id_dynamic, init_3d%nzu, 'z'     )
+       CALL get_dimension_length( id_dynamic, init_3d%nzw, 'zw'    )
 !
 !--    Read also the horizontal dimensions. These are used just used fo
 !--    checking the compatibility with the PALM grid before reading.
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nx,  'x'  )
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nxu, 'xu' )
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%ny,  'y'  )
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nyv, 'yv' )
+       CALL get_dimension_length( id_dynamic, init_3d%nx,  'x'  )
+       CALL get_dimension_length( id_dynamic, init_3d%nxu, 'xu' )
+       CALL get_dimension_length( id_dynamic, init_3d%ny,  'y'  )
+       CALL get_dimension_length( id_dynamic, init_3d%nyv, 'yv' )
 
 !
@@ -3444,6 +3363,5 @@
 !--    Read vertical dimension for soil depth. 
        IF ( check_existence( var_names, 'zsoil' ) )                            &
-          CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nzs,&
-                                                       'zsoil' )
+          CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' )
 !
 !--    Read also the horizontal dimensions required for soil initialization.
@@ -3451,8 +3369,6 @@
 !--    these data is already available, but will be read again for the sake
 !--    of clearness. 
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nx,    &
-                                                    'x'  )
-       CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%ny,    &
-                                                    'y'  )
+       CALL get_dimension_length( id_dynamic, init_3d%nx, 'x'  )
+       CALL get_dimension_length( id_dynamic, init_3d%ny, 'y'  )
 !
 !--    Check for correct horizontal and vertical dimension. Please note,
@@ -3544,481 +3460,12 @@
 ! Description:
 ! ------------
-!> Reads data at lateral and top boundaries derived from larger-scale model
-!> (COSMO) by Inifor.
-!------------------------------------------------------------------------------!
-    SUBROUTINE netcdf_data_input_offline_nesting
+!> Checks input file for consistency and minimum requirements.
+!------------------------------------------------------------------------------!
+    SUBROUTINE netcdf_data_input_check_dynamic
 
        USE control_parameters,                                                 &
-           ONLY:  air_chemistry, bc_dirichlet_l, bc_dirichlet_n,               &
-                  bc_dirichlet_r, bc_dirichlet_s, humidity, neutral,           &
-                  nesting_offline, time_since_reference_point
-
-       USE indices,                                                            &
-           ONLY:  nxl, nxlu, nxr, nyn, nys, nysv, nzb, nzt
+           ONLY:  initializing_actions, message_string
 
        IMPLICIT NONE
-       
-       INTEGER(iwp) ::  id_dynamic !< NetCDF id of dynamic input file
-       INTEGER(iwp) ::  n          !< running index for chemistry variables
-       INTEGER(iwp) ::  num_vars   !< number of variables in netcdf input file
-       INTEGER(iwp) ::  t          !< running index time dimension
-!
-!--    Skip input if no forcing from larger-scale models is applied.
-       IF ( .NOT. nesting_offline )  RETURN
-
-!
-!--    CPU measurement
-       CALL cpu_log( log_point_s(86), 'NetCDF input forcing', 'start' )
-
-#if defined ( __netcdf )
-!
-!--    Open file in read-only mode
-       CALL open_read_file( TRIM( input_file_dynamic ) //                      &
-                            TRIM( coupling_char ), id_dynamic )
-!
-!--    Initialize INIFOR forcing. 
-       IF ( .NOT. nest_offl%init )  THEN
-!
-!--       At first, inquire all variable names.
-          CALL inquire_num_variables( id_dynamic, num_vars )
-!
-!--       Allocate memory to store variable names.
-          ALLOCATE( nest_offl%var_names(1:num_vars) )
-          CALL inquire_variable_names( id_dynamic, nest_offl%var_names )
-!
-!--       Read time dimension, allocate memory and finally read time array
-          CALL netcdf_data_input_get_dimension_length( id_dynamic,             &
-                                                       nest_offl%nt, 'time' )
-
-          IF ( check_existence( nest_offl%var_names, 'time' ) )  THEN
-             ALLOCATE( nest_offl%time(0:nest_offl%nt-1) )
-             CALL get_variable( id_dynamic, 'time', nest_offl%time )
-          ENDIF
-!
-!--       Read vertical dimension of scalar und w grid
-          CALL netcdf_data_input_get_dimension_length( id_dynamic,             &
-                                                       nest_offl%nzu, 'z' )
-          CALL netcdf_data_input_get_dimension_length( id_dynamic,             &
-                                                       nest_offl%nzw, 'zw' )
-
-          IF ( check_existence( nest_offl%var_names, 'z' ) )  THEN
-             ALLOCATE( nest_offl%zu_atmos(1:nest_offl%nzu) )
-             CALL get_variable( id_dynamic, 'z', nest_offl%zu_atmos )
-          ENDIF
-          IF ( check_existence( nest_offl%var_names, 'zw' ) )  THEN
-             ALLOCATE( nest_offl%zw_atmos(1:nest_offl%nzw) )
-             CALL get_variable( id_dynamic, 'zw', nest_offl%zw_atmos )
-          ENDIF
-
-!
-!--       Read surface pressure
-          IF ( check_existence( nest_offl%var_names,                           &
-                                'surface_forcing_surface_pressure' ) )  THEN
-             ALLOCATE( nest_offl%surface_pressure(0:nest_offl%nt-1) )
-             CALL get_variable( id_dynamic,                                    &
-                                'surface_forcing_surface_pressure',            &
-                                nest_offl%surface_pressure )
-          ENDIF
-!
-!--       Set control flag to indicate that initialization is already done
-          nest_offl%init = .TRUE.
-
-       ENDIF
-
-!
-!--    Obtain time index for current input starting at 0.
-!--    @todo: At the moment INIFOR and simulated time correspond
-!--           to each other. If required, adjust to daytime.
-       nest_offl%tind = MINLOC( ABS( nest_offl%time -                          &
-                                     time_since_reference_point ), DIM = 1 )   &
-                        - 1
-       nest_offl%tind_p = nest_offl%tind + 1       
-!
-!--    Read geostrophic wind components
-       DO  t = nest_offl%tind, nest_offl%tind_p
-          CALL get_variable_pr( id_dynamic, 'ls_forcing_ug', t+1,              &
-                                nest_offl%ug(t-nest_offl%tind,nzb+1:nzt) )
-          CALL get_variable_pr( id_dynamic, 'ls_forcing_vg', t+1,              &
-                                nest_offl%vg(t-nest_offl%tind,nzb+1:nzt) )
-       ENDDO
-!
-!--    Read data at lateral and top boundaries. Please note, at left and
-!--    right domain boundary, yz-layers are read for u, v, w, pt and q.
-!--    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. 
-!--    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
-!--    a dummy read with count = 0, just in order to participate the collective
-!--    operation. 
-!--    Read data for western boundary    
-       CALL get_variable( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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),                     &
-                             .TRUE. )
-       ENDIF
-
-       IF ( humidity )  THEN
-          CALL get_variable( id_dynamic, '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),                     &
-                             .TRUE. )
-       ENDIF
-       
-       IF ( air_chemistry )  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( id_dynamic,                                 &
-                           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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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),                     &
-                             .TRUE. )
-       ENDIF
-
-       IF ( humidity )  THEN
-          CALL get_variable( id_dynamic, '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),                     &
-                             .TRUE. )
-       ENDIF
-       
-       IF ( air_chemistry )  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( id_dynamic,                                 &
-                           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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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
-                             .TRUE. )                                             
-       ENDIF                                                                   
-       IF ( humidity )  THEN                                                   
-          CALL get_variable( id_dynamic, '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
-                             .TRUE. )                                             
-       ENDIF                                                                   
-                                                                               
-       IF ( air_chemistry )  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( id_dynamic,                                 &
-                           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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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
-                             .TRUE. )                                             
-       ENDIF                                                                   
-       IF ( humidity )  THEN                                                   
-          CALL get_variable( id_dynamic, '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
-                             .TRUE. )                                             
-       ENDIF                                                                   
-                                                                               
-       IF ( air_chemistry )  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( id_dynamic,                                 &
-                           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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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( id_dynamic, '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 )  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( id_dynamic,                                 &
-                              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
-
-!
-!--    Close input file
-       CALL close_input_file( id_dynamic )
-#endif
-!
-!--    End of CPU measurement
-       CALL cpu_log( log_point_s(86), 'NetCDF input forcing', 'stop' )
-
-    END SUBROUTINE netcdf_data_input_offline_nesting
-
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> Checks input file for consistency and minimum requirements.
-!------------------------------------------------------------------------------!
-    SUBROUTINE netcdf_data_input_check_dynamic
-
-       USE control_parameters,                                                 &
-           ONLY:  initializing_actions, message_string, nesting_offline 
-
-       IMPLICIT NONE
-
-!
-!--    In case of forcing, check whether dynamic input file is present
-       IF ( .NOT. input_pids_dynamic  .AND.  nesting_offline  )  THEN
-          message_string = 'nesting_offline = .TRUE. requires dynamic '  //    &
-                            'input file ' //                                   &
-                            TRIM( input_file_dynamic ) // TRIM( coupling_char )
-          CALL message( 'netcdf_data_input_mod', 'PA0546', 1, 2, 0, 6, 0 )
-       ENDIF
 !
 !--    Dynamic input file must also be present if initialization via inifor is
@@ -5269,6 +4716,5 @@
 !> Get dimension array for a given dimension
 !------------------------------------------------------------------------------!
-     SUBROUTINE netcdf_data_input_get_dimension_length( id, dim_len,           &
-                                                        variable_name )
+     SUBROUTINE get_dimension_length( id, dim_len, variable_name )
        USE pegrid
 
@@ -5286,14 +4732,12 @@
 !--    First, inquire dimension ID
        nc_stat = NF90_INQ_DIMID( id, TRIM( variable_name ), id_dim )
-       CALL handle_error( 'netcdf_data_input_get_dimension_length', 526,       &
-                          variable_name )
+       CALL handle_error( 'get_dimension_length', 526, variable_name )
 !
 !--    Inquire dimension length
        nc_stat = NF90_INQUIRE_DIMENSION( id, id_dim, dum, LEN = dim_len )
-       CALL handle_error( 'netcdf_data_input_get_dimension_length', 526,       &
-                          variable_name )
+       CALL handle_error( 'get_dimension_length', 526, variable_name )
 
 #endif
-    END SUBROUTINE netcdf_data_input_get_dimension_length
+    END SUBROUTINE get_dimension_length
 
 !------------------------------------------------------------------------------!
