Index: palm/trunk/SOURCE/nesting_offl_mod.f90
===================================================================
--- palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 4168)
+++ palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 4169)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Additional check added.
+! 
+! 4168 2019-08-16 13:50:17Z suehring
 ! Replace function get_topography_top_index by topo_top_ind
 ! 
@@ -107,11 +110,28 @@
 
     USE control_parameters,                                                    &
-        ONLY:  air_chemistry, bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,  &
-               bc_dirichlet_s, dt_3d, dz, constant_diffusion,                  &
+        ONLY:  air_chemistry,                                                  & 
+               bc_dirichlet_l,                                                 & 
+               bc_dirichlet_n,                                                 &
+               bc_dirichlet_r,                                                 &
+               bc_dirichlet_s,                                                 &
+               dt_3d,                                                          &
+               dz,                                                             &
+               constant_diffusion,                                             &
+               child_domain,                                                   &
                debug_output_timestep,                                          &
+               end_time,                                                       &
                humidity,                                                       &
                initializing_actions,                                           &
-               message_string, nesting_offline, neutral, passive_scalar,       &
-               rans_mode, rans_tke_e, time_since_reference_point, volume_flow
+               message_string,                                                 &
+               nesting_offline,                                                &
+               neutral,                                                        &
+               passive_scalar,                                                 &
+               rans_mode,                                                      &
+               rans_tke_e,                                                     &
+               rayleigh_damping_factor,                                        & 
+               rayleigh_damping_height,                                        &
+               spinup_time,                                                    &
+               time_since_reference_point,                                     &
+               volume_flow
                
     USE cpulog,                                                                &
@@ -1060,7 +1080,4 @@
        USE basic_constants_and_equations_mod,                                  &
            ONLY:  pi
-           
-       USE control_parameters,                                                 &
-           ONLY:  rayleigh_damping_height, rayleigh_damping_factor
        
        USE kinds
@@ -1103,16 +1120,12 @@
 !------------------------------------------------------------------------------!
     SUBROUTINE nesting_offl_check_parameters 
-    
-       USE control_parameters,                                                    &
-        ONLY:  child_domain, message_string, nesting_offline
 
        IMPLICIT NONE
 !
-!--    Perform checks
+!--    Check if offline nesting is applied in nested child domain.
        IF ( nesting_offline  .AND.  child_domain )  THEN
           message_string = 'Offline nesting is only applicable in root model.'
-          CALL message( 'stg_check_parameters', 'PA0622', 1, 2, 0, 6, 0 )       
-       ENDIF
-
+          CALL message( 'offline_nesting_check_parameters', 'PA0622', 1, 2, 0, 6, 0 )       
+       ENDIF     
 
     END SUBROUTINE nesting_offl_check_parameters
@@ -1334,4 +1347,14 @@
        CALL netcdf_data_input_offline_nesting
 !
+!--    Check if sufficient time steps are provided to cover the entire 
+!--    simulation. Note, dynamic input is only required for the 3D simulation,
+!--    not for the soil/wall spinup. However, as the spinup time is added
+!--    to the end_time, this must be considered here. 
+       IF ( end_time - spinup_time > nest_offl%time(nest_offl%nt-1) )  THEN
+          message_string = 'end_time > provided time in offline nesting.'
+          CALL message( 'offline_nesting_check_parameters', 'PA0183',          &
+                        1, 2, 0, 6, 0 ) 
+       ENDIF
+!
 !--    Initialize boundary data. Please note, do not initialize boundaries in 
 !--    case of restart runs. This case the boundaries are already initialized
