Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 2881)
+++ palm/trunk/SOURCE/parin.f90	(revision 2894)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! read_var_list has been renamed to rrd_global, all module related _parin 
+! routines are called before reading the global restart data to overwrite them
+! in case of restart runs
+! 
+! 2881 2018-03-13 16:24:40Z suehring
 ! Added flag for switching on/off calculation of soil moisture
 ! 
@@ -408,5 +413,8 @@
 
     USE radiation_model_mod,                                                   &
-        ONLY: radiation_parin  
+        ONLY: radiation_parin
+
+    USE read_restart_data_mod,                                                 &
+        ONLY:  rrd_global     
 
     USE spectra_mod,                                                           &
@@ -614,10 +622,79 @@
 
 !
+!--       Try to read runtime parameters given by the user for this run
+!--       (namelist "d3par"). The namelist "d3par" can be omitted. In that case
+!--       default values are used for the parameters.
+ 12       line = ' '
+
+          REWIND ( 11 )
+          line = ' '
+          DO   WHILE ( INDEX( line, '&d3par' ) == 0 )
+             READ ( 11, '(A)', END=20 )  line
+          ENDDO
+          BACKSPACE ( 11 )
+
+!
+!--       Read namelist
+          READ ( 11, d3par )
+
+ 20       CONTINUE
+
+!
+!--       Check if land surface model is used and read &lsm_par if required
+          CALL lsm_parin
+
+!
+!--       Check if urban surface model is used and read &urban_surface_par if required
+          CALL usm_parin
+
+!
+!--       Check if spectra shall be calculated and read spectra_par if required
+          CALL spectra_parin
+
+!
+!--       Check if radiation model is used and read &radiation_par if required
+          CALL radiation_parin
+
+!
+!--       Check if gust module is used and read &gust_par if required
+          CALL gust_parin
+ 
+ 
+!--       Check if plant canopy model is used and read &canopy_par if required
+          CALL pcm_parin
+ 
+!
+!--       Read control parameters for optionally used model software packages
+          CALL package_parin
+
+!
+!--       Check if wind turbine model is used and read &wind_turbine_par if
+!--       required
+          CALL wtm_parin
+!
+!--       Check if virtual flights should be carried out and read &flight_par
+!--       if required
+          CALL flight_parin
+!
+!--       Check if synthetic turbulence generator is used and read stg_par if
+!--       required
+          CALL stg_parin
+!
+!--       Read chemistry variables
+          CALL chem_parin
+!
+!--       Check if uv exposure model is used and read &uvexposure_par
+          CALL uvem_parin
+!
+!--       Read user-defined variables
+          CALL user_parin
+
+!
 !--       If required, read control parameters from restart file (produced by
 !--       a prior run). All PEs are reading from file created by PE0 (see
 !--       check_open)
- 12       IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
-             CALL read_var_list
-
+          IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
+
+             CALL rrd_global
 !
 !--          Increment the run count
@@ -724,83 +801,8 @@
 
 !
-!--       Try to read runtime parameters given by the user for this run
-!--       (namelist "d3par"). The namelist "d3par" can be omitted. In that case
-!--       default values are used for the parameters.
-          line = ' '
-
-          REWIND ( 11 )
-          line = ' '
-          DO   WHILE ( INDEX( line, '&d3par' ) == 0 )
-             READ ( 11, '(A)', END=20 )  line
-          ENDDO
-          BACKSPACE ( 11 )
-
-!
-!--       Read namelist
-          READ ( 11, d3par )
-
- 20       CONTINUE
-
-!
-!--       Check if land surface model is used and read &lsm_par if required
-          CALL lsm_parin
-
-!
-!--       Check if urban surface model is used and read &urban_surface_par if required
-          CALL usm_parin
-
-!
-!--       Check if spectra shall be calculated and read spectra_par if required
-          CALL spectra_parin
-
-!
-!--       Check if radiation model is used and read &radiation_par if required
-          CALL radiation_parin
-
-!
-!--       Check if gust module is used and read &gust_par if required
-          CALL gust_parin
- 
- 
-!--       Check if plant canopy model is used and read &canopy_par if required
-          CALL pcm_parin
- 
-!
-!--       Read control parameters for optionally used model software packages
-          CALL package_parin
-
-!
-!--       Check if wind turbine model is used and read &wind_turbine_par if
-!--       required
-          CALL wtm_parin
-!
-!--       Check if virtual flights should be carried out and read &flight_par
-!--       if required
-          CALL flight_parin
-!
-!--       Check if synthetic turbulence generator is used and read stg_par if
-!--       required
-          CALL stg_parin
-!
-!--       Read chemistry variables
-          CALL chem_parin
-!
-!--       Check if uv exposure model is used and read &uvexposure_par
-          CALL uvem_parin
-!
-!--       Read user-defined variables
-          CALL user_parin
-
-!
-!--       The restart file will be reopened when reading the subdomain data
-          IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
-             CALL close_file( 13 )
-          ENDIF
-
-!
 !--       Check in case of initial run, if the grid point numbers are well
 !--       defined and allocate some arrays which are already needed in
 !--       init_pegrid or check_parameters. During restart jobs, these arrays
-!--       will be allocated in read_var_list. All other arrays are allocated
+!--       will be allocated in rrd_global. All other arrays are allocated
 !--       in init_3d_model.
           IF ( TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
@@ -823,5 +825,5 @@
 !
 !--          ATTENTION: in case of changes to the following statement please
-!--                  also check the allocate statement in routine read_var_list
+!--                  also check the allocate statement in routine rrd_global
              ALLOCATE( pt_init(0:nz+1), q_init(0:nz+1), s_init(0:nz+1),        &
                        ref_state(0:nz+1), sa_init(0:nz+1), ug(0:nz+1),         &
