Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 175)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 177)
@@ -77,4 +77,7 @@
 Errors:
 ------
+Bugfix: Construction of vertical profiles when 10 gradients have been 
+specified in the parameter list (ug, vg, pt, q, sa, lad). (check_parameters)
+
 Bugfix: Determination of the number of vertical levels for which spectra 
 shall be output - 100 replaced by 10. (netcdf)
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 175)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 177)
@@ -4,4 +4,7 @@
 ! Actual revisions:
 ! -----------------
+! Bug fix: Construction of vertical profiles when 10 gradients have been 
+! specified in the parameter list (ug, vg, pt, q, sa, lad)  
+!
 ! Leaf area density (LAD) explicitly set to its surface value at k=0
 ! Case of reading data for recycling included in initializing_actions,
@@ -632,17 +635,12 @@
           ug(0) = ug_surface
           DO  k = 1, nzt+1
-             IF ( ug_vertical_gradient_level(i) < zu(k)  .AND. &
-                  ug_vertical_gradient_level(i) >= 0.0 )  THEN
-                gradient = ug_vertical_gradient(i) / 100.0
-                ug_vertical_gradient_level_ind(i) = k - 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "ug_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
-                ENDIF
-             ENDIF
+             IF ( i < 11 ) THEN
+                IF ( ug_vertical_gradient_level(i) < zu(k)  .AND. &
+                     ug_vertical_gradient_level(i) >= 0.0 )  THEN
+                   gradient = ug_vertical_gradient(i) / 100.0
+                   ug_vertical_gradient_level_ind(i) = k - 1
+                   i = i + 1
+                ENDIF
+             ENDIF        
              IF ( gradient /= 0.0 )  THEN
                 IF ( k /= 1 )  THEN
@@ -661,15 +659,10 @@
           ug(nzt+1) = ug_surface
           DO  k = nzt, 0, -1
-             IF ( ug_vertical_gradient_level(i) > zu(k)  .AND. &
-                  ug_vertical_gradient_level(i) <= 0.0 )  THEN
-                gradient = ug_vertical_gradient(i) / 100.0
-                ug_vertical_gradient_level_ind(i) = k + 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "ug_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN
+                IF ( ug_vertical_gradient_level(i) > zu(k)  .AND. &
+                     ug_vertical_gradient_level(i) <= 0.0 )  THEN
+                   gradient = ug_vertical_gradient(i) / 100.0
+                   ug_vertical_gradient_level_ind(i) = k + 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -708,15 +701,10 @@
           vg(0) = vg_surface
           DO  k = 1, nzt+1
-             IF ( vg_vertical_gradient_level(i) < zu(k)  .AND. &
-                  vg_vertical_gradient_level(i) >= 0.0 )  THEN
-                gradient = vg_vertical_gradient(i) / 100.0
-                vg_vertical_gradient_level_ind(i) = k - 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "vg_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN 
+                IF ( vg_vertical_gradient_level(i) < zu(k)  .AND. &
+                     vg_vertical_gradient_level(i) >= 0.0 )  THEN
+                   gradient = vg_vertical_gradient(i) / 100.0
+                   vg_vertical_gradient_level_ind(i) = k - 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -737,15 +725,10 @@
           vg(nzt+1) = vg_surface
           DO  k = nzt, 0, -1
-             IF ( vg_vertical_gradient_level(i) > zu(k)  .AND. &
-                  vg_vertical_gradient_level(i) <= 0.0 )  THEN
-                gradient = vg_vertical_gradient(i) / 100.0
-                vg_vertical_gradient_level_ind(i) = k + 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "vg_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN
+                IF ( vg_vertical_gradient_level(i) > zu(k)  .AND. &
+                     vg_vertical_gradient_level(i) <= 0.0 )  THEN
+                   gradient = vg_vertical_gradient(i) / 100.0
+                   vg_vertical_gradient_level_ind(i) = k + 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -781,15 +764,10 @@
           pt_vertical_gradient_level_ind(1) = 0
           DO  k = 1, nzt+1
-             IF ( pt_vertical_gradient_level(i) < zu(k)  .AND. &
-                  pt_vertical_gradient_level(i) >= 0.0 )  THEN
-                gradient = pt_vertical_gradient(i) / 100.0
-                pt_vertical_gradient_level_ind(i) = k - 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "pt_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN
+                IF ( pt_vertical_gradient_level(i) < zu(k)  .AND. &
+                     pt_vertical_gradient_level(i) >= 0.0 )  THEN
+                   gradient = pt_vertical_gradient(i) / 100.0
+                   pt_vertical_gradient_level_ind(i) = k - 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -809,15 +787,10 @@
           pt_vertical_gradient_level_ind(1) = nzt+1
           DO  k = nzt, 0, -1
-             IF ( pt_vertical_gradient_level(i) > zu(k)  .AND. &
-                  pt_vertical_gradient_level(i) <= 0.0 )  THEN
-                gradient = pt_vertical_gradient(i) / 100.0
-                pt_vertical_gradient_level_ind(i) = k + 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "pt_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN
+                IF ( pt_vertical_gradient_level(i) > zu(k)  .AND. &
+                     pt_vertical_gradient_level(i) <= 0.0 )  THEN
+                   gradient = pt_vertical_gradient(i) / 100.0
+                   pt_vertical_gradient_level_ind(i) = k + 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -868,15 +841,10 @@
           q_vertical_gradient_level_ind(1) = 0
           DO  k = 1, nzt+1
-             IF ( q_vertical_gradient_level(i) < zu(k)  .AND. &
-                  q_vertical_gradient_level(i) >= 0.0 )  THEN
-                gradient = q_vertical_gradient(i) / 100.0
-                q_vertical_gradient_level_ind(i) = k - 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of arr', &
-                              'ay "q_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN
+                IF ( q_vertical_gradient_level(i) < zu(k)  .AND. &
+                     q_vertical_gradient_level(i) >= 0.0 )  THEN
+                   gradient = q_vertical_gradient(i) / 100.0
+                   q_vertical_gradient_level_ind(i) = k - 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -921,15 +889,10 @@
           sa_vertical_gradient_level_ind(1) = nzt+1
           DO  k = nzt, 0, -1
-             IF ( sa_vertical_gradient_level(i) > zu(k)  .AND. &
-                  sa_vertical_gradient_level(i) <= 0.0 )  THEN
-                gradient = sa_vertical_gradient(i) / 100.0
-                sa_vertical_gradient_level_ind(i) = k + 1
-                i = i + 1
-                IF ( i > 10 )  THEN
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ check_parameters: upper bound 10 of array', &
-                              ' "sa_vertical_gradient_level_ind" exceeded'
-                   ENDIF
-                   CALL local_stop
+             IF ( i < 11 ) THEN
+                IF ( sa_vertical_gradient_level(i) > zu(k)  .AND. &
+                     sa_vertical_gradient_level(i) <= 0.0 )  THEN
+                   gradient = sa_vertical_gradient(i) / 100.0
+                   sa_vertical_gradient_level_ind(i) = k + 1
+                   i = i + 1
                 ENDIF
              ENDIF
@@ -961,15 +924,10 @@
              lad_vertical_gradient_level_ind(1) = 0
              DO k = 1, pch_index
-                IF ( lad_vertical_gradient_level(i) < zu(k) .AND.  &
-                     lad_vertical_gradient_level(i) >= 0.0 ) THEN
-                   gradient = lad_vertical_gradient(i)
-                   lad_vertical_gradient_level_ind(i) = k - 1
-                   i = i + 1
-                   IF ( i > 10 ) THEN
-                      IF ( myid == 0 ) THEN
-                         PRINT*, '+++ user_init_3d_model: upper bound 10 of array',  &
-                                 ' "lad_vertical_gradient_level" exceeded'
-                      ENDIF
-                      CALL local_stop
+                IF ( i < 11 ) THEN
+                   IF ( lad_vertical_gradient_level(i) < zu(k) .AND.  &
+                        lad_vertical_gradient_level(i) >= 0.0 ) THEN
+                      gradient = lad_vertical_gradient(i)
+                      lad_vertical_gradient_level_ind(i) = k - 1
+                      i = i + 1
                    ENDIF
                 ENDIF
