Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 3239)
+++ palm/trunk/SOURCE/modules.f90	(revision 3240)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! max_pr_user_tmp has been defined as a control variable because it is not 
+! local anymore
+! 
+! 3235 2018-09-07 14:06:15Z sward
 ! Added global variable dim_size_agtnum to own module. Necessary to avoid
 ! circular dependency in agent output.
@@ -1238,4 +1242,5 @@
     INTEGER(iwp) ::  maximum_parallel_io_streams = -1  !< maximum number of parallel io streams that the underlying parallel file system allows, set with palmrun option -w, ENVPAR namelist parameter, provided by palmrun
     INTEGER(iwp) ::  max_pr_user = 0                   !< number of user-defined profiles (must not change within a job chain)
+    INTEGER(iwp) ::  max_pr_user_tmp = 0               !< number of user-defined profiles that is temporary stored to check it against max_pr_user in case of restarts
     INTEGER(iwp) ::  mgcycles = 0                      !< number of multigrid cycles that the multigrid solver has actually carried out
     INTEGER(iwp) ::  mg_cycles = 4                     !< namelist parameter
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 3239)
+++ palm/trunk/SOURCE/parin.f90	(revision 3240)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! A check that controls the number of user-defined profiles on the restart file
+! with the one given for the current run has been added.
+! 
+! 3204 2018-08-23 10:49:05Z raasch
 ! additional check for nz
 ! 
@@ -906,4 +910,18 @@
 !--          Increment the run count
              runnr = runnr + 1
+!
+!--          In case of a restart run, the number of user-defined profiles on
+!--          the restart file (already stored in max_pr_user) has to match the
+!--          one given for the current run. max_pr_user_tmp is calculated in 
+!--          user_parin and max_pr_user is read in via rrd_global.
+             IF ( max_pr_user /= max_pr_user_tmp )  THEN
+                WRITE( message_string, * ) 'the number of user-defined ',      &
+                      'profiles given in data_output_pr (', max_pr_user_tmp,   &
+                      ') does not match the one ',                             &
+                      'found in the restart file (', max_pr_user, ')'
+                CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 )
+             ENDIF
+          ELSE
+             max_pr_user = max_pr_user_tmp
           ENDIF
 
Index: palm/trunk/SOURCE/user_parin.f90
===================================================================
--- palm/trunk/SOURCE/user_parin.f90	(revision 3239)
+++ palm/trunk/SOURCE/user_parin.f90	(revision 3240)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! The check that controls the number of user-defined profiles on the restart file
+! with the one given for the current run has been removed.
+! 
+! 3189 2018-08-06 13:18:55Z Giersch
 ! Indent revised
 ! 
@@ -112,5 +116,4 @@
     INTEGER(iwp) ::  i                 !< 
     INTEGER(iwp) ::  j                 !< 
-    INTEGER(iwp) ::  max_pr_user_tmp   !< 
 
 
@@ -177,5 +180,4 @@
 !-- standard data output (data_output_pr)
     IF ( user_defined_namelist_found )  THEN
-       max_pr_user_tmp = 0
        IF ( data_output_pr_user(1) /= ' ' )  THEN
           i = 1
@@ -191,23 +193,4 @@
           ENDDO
        ENDIF
-
-
-!
-!--    In case of a restart run, the number of user-defined profiles on the
-!--    restart file (already stored in max_pr_user) has to match the one given
-!--    for the current run
-       IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
-          IF ( max_pr_user /= max_pr_user_tmp )  THEN
-             WRITE( message_string, * ) 'the number of user-defined profiles ',&
-                     'given in data_output_pr (', max_pr_user_tmp, ') doe',    &
-                     'snot match the one ',                                    &
-                     'found in the restart file (', max_pr_user,               &
-                                     ')'
-             CALL message( 'user_parin', 'UI0009', 1, 2, 0, 6, 0 )
-          ENDIF
-       ELSE
-          max_pr_user = max_pr_user_tmp
-       ENDIF
-
     ENDIF
  
