Index: /palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 958)
+++ /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 959)
@@ -381,5 +381,6 @@
 
       ;************************************************************************
-      ; currently, more than 3 plots cannot be drawn together
+      ; currently, more than 3 plots cannot be drawn together. the profiles 
+      ; are split to a maximum of 3 plots per panel.
       ;***********************************************************************
 
@@ -387,7 +388,8 @@
          if(number_comb_all(com_i) .GT. 3) then
             print(" ")
-            print("Currently, it is not possible to plot more than three"+\
-                  "profiles together. Hence, they are split to a maximum"+\
-                  "of three profiles per coordinate plane.")
+            print("Currently, it is not possible to plot more than three "+\
+                  "profiles together ("+c_var_all(com_i)+"). Hence, they "+\
+                  "are split to a maximum of three profiles per "+\
+                  "coordinate plane.")
             print(" ") 
 	    c_var_all_temp = c_var_all
@@ -410,6 +412,8 @@
             end do
             number_comb_all(com_i+1) = max(dimsizes(c_var_long)) - 3 
-	    c_var_all(com_i+2:max_com_i) = c_var_all_temp(com_i+1:max_com_i-1)
-            number_comb_all(com_i+2:max_com_i) = number_comb_all_temp(com_i+1:max_com_i-1)
+            if (com_i+2 .le. max_com_i) then
+	       c_var_all(com_i+2:max_com_i) = c_var_all_temp(com_i+1:max_com_i-1)
+               number_comb_all(com_i+2:max_com_i) = number_comb_all_temp(com_i+1:max_com_i-1)
+            end if
 	    delete(c_var_all_temp)
             delete(number_comb_all_temp)
Index: /palm/trunk/SOURCE/netcdf.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf.f90	(revision 958)
+++ /palm/trunk/SOURCE/netcdf.f90	(revision 959)
@@ -7,5 +7,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Bugfix in cross_profiles. It is not possible to arrange more than 100 
+! profiles with cross_profiles. 
 !
 ! Former revisions:
@@ -117,6 +118,7 @@
     CHARACTER (LEN=10)             ::  netcdf_var_name, precision, var
     CHARACTER (LEN=80)             ::  time_average_text
-    CHARACTER (LEN=2000)           ::  char_cross_profiles, var_list, &
-                                       var_list_old
+    CHARACTER (LEN=2000)           ::  char_cross_profiles,     &
+                                       message_cross_profiles,  &
+                                       var_list, var_list_old
 
     CHARACTER (LEN=100), DIMENSION(1:crmax) :: cross_profiles_adj,   &
@@ -3169,10 +3171,10 @@
 	    IF ( TRIM( cross_profiles_adj(i) ) == ' ' )  EXIT
 	    delim_old = 0
-	    DO   j = 1, 100
+	    DO   j = 1, crmax
 	      delim = INDEX( cross_profiles_adj(i)(delim_old+1:), ' ' )
 	      IF (delim .EQ. 1)  EXIT
-	      cross_profiles_char(k) = cross_profiles_adj(i)(delim_old+1:    &
-                                       delim_old+delim-1)
-	      cross_profiles_numb(k) = i
+	      cross_profiles_char( MIN( crmax, k ) ) = cross_profiles_adj(i)  &
+                                       (delim_old+1:delim_old+delim-1)
+	      cross_profiles_numb( MIN( crmax, k ) ) = i
 	      k = k+1
 	      cross_profiles_maxi  = i
@@ -3181,5 +3183,5 @@
 	  ENDDO
 
-          cross_profiles_count = k-1
+          cross_profiles_count = MIN( crmax, k-1 )
           
 !
@@ -3192,5 +3194,5 @@
 	  DO  i = 1, cross_profiles_count
 	    DO  j = 1, dopr_n
-	      IF ( TRIM(cross_profiles_char(i)) == TRIM(data_output_pr(j)) ) &
+	      IF ( TRIM(cross_profiles_char(i) ) == TRIM(data_output_pr(j)) ) &
 		 EXIT
 	      IF ( j == dopr_n)  THEN
@@ -3223,10 +3225,11 @@
 		cross_profiles_count = cross_profiles_count + 1
 		cross_profiles_maxi  = cross_profiles_maxi  + 1
-		cross_profiles_char( cross_profiles_count ) =                  &
+		cross_profiles_char( MIN( crmax, cross_profiles_count ) ) =    &
                                                       TRIM( data_output_pr(i) )
-		cross_profiles_numb(cross_profiles_count) = cross_profiles_maxi
+		cross_profiles_numb( MIN( crmax, cross_profiles_count ) ) =    &
+                                                      cross_profiles_maxi
 		cross_profiles_log = .TRUE.
-                message_string = TRIM( message_string ) // ', ' //             &
-				 TRIM( data_output_pr(i) )
+                message_string = TRIM( message_string ) // ', '&
+				         // TRIM( data_output_pr(i) )
 	      ENDIF
 	    ENDDO
@@ -3234,7 +3237,13 @@
 
 	  IF ( cross_profiles_log )  THEN
-	    message_string = TRIM(message_string(2:)) // ' has/have been' //  & 
-			     ' added to cross_profiles.'
+	    message_string = TRIM(message_string(2:)) //               &
+                             ' has/have been added to cross_profiles.'
 	    CALL message( 'define_netcdf_header', 'PA0353', 0, 0, 0, 6, 0 )
+	  ENDIF
+
+          IF ( cross_profiles_count .ge. crmax )  THEN
+	    message_string = 'It is not possible to arrange more than '&
+                             // '100 profiles with cross_profiles.'
+	    CALL message( 'define_netcdf_header', 'PA0354', 0, 0, 0, 6, 0 )
 	  ENDIF
 
