Index: palm/trunk/SOURCE/init_masks.f90
===================================================================
--- palm/trunk/SOURCE/init_masks.f90	(revision 558)
+++ palm/trunk/SOURCE/init_masks.f90	(revision 564)
@@ -4,5 +4,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! assignment of mask_xyz_loop added, palm message identifiers of masked output
+! changed 
 !
 ! Former revisions:
@@ -64,5 +65,5 @@
                         '3 (NetCDF 4) and 4 (NetCDF 4 Classic model)'//  &
                         '&are currently not supported (not yet tested).'
-       CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+       CALL message( 'init_masks', 'PA0328', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -70,4 +71,5 @@
 !-- Store data output parameters for masked data output in few shared arrays
     DO mid = 1, masks
+    
        do_mask     (mid,:) = data_output_masks(mid,:)
        do_mask_user(mid,:) = data_output_masks_user(mid,:)
@@ -75,7 +77,27 @@
        mask      (mid,2,:) = mask_y(mid,:)
        mask      (mid,3,:) = mask_z(mid,:) 
-       mask_loop (mid,1,:) = mask_x_loop(mid,:) 
-       mask_loop (mid,2,:) = mask_y_loop(mid,:) 
-       mask_loop (mid,3,:) = mask_z_loop(mid,:) 
+       
+       IF ( mask_x_loop(mid,1) == -1.0 .AND. mask_x_loop(mid,2) == -1.0  &
+            .AND. mask_x_loop(mid,3) == -1.0 ) THEN
+	  mask_loop(mid,1,1:2) = -1.0
+          mask_loop(mid,1,3) = 0.0
+       ELSE
+          mask_loop(mid,1,:) = mask_x_loop(mid,:)
+       ENDIF
+       IF ( mask_y_loop(mid,1) == -1.0 .AND. mask_y_loop(mid,2) == -1.0  &
+            .AND. mask_y_loop(mid,3) == -1.0 ) THEN
+	  mask_loop(mid,2,1:2) = -1.0
+          mask_loop(mid,2,3) = 0.0
+       ELSE
+          mask_loop(mid,2,:) = mask_y_loop(mid,:)
+       ENDIF
+       IF ( mask_z_loop(mid,1) == -1.0 .AND. mask_z_loop(mid,2) == -1.0  &
+            .AND. mask_z_loop(mid,3) == -1.0 ) THEN
+	  mask_loop(mid,3,1:2) = -1.0
+          mask_loop(mid,3,3) = 0.0
+       ELSE
+          mask_loop(mid,3,:) = mask_z_loop(mid,:)
+       ENDIF
+       
     ENDDO
     
@@ -107,5 +129,5 @@
                      'given by data_output_mask and data_output_mask_user ', &
                      'exceeds the limit of 100'
-                CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                CALL message( 'init_masks', 'PA0329', 1, 2, 0, 6, 0 )
              ENDIF
              do_mask(mid,i) = do_mask_user(mid,j)
@@ -138,5 +160,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires constant_diffusion = .FALSE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0103', 1, 2, 0, 6, 0 )
                 ENDIF
                 unit = 'm2/s2'
@@ -147,5 +169,5 @@
                         '" requires a "particles_par"-NAMELIST in the ', &
                         'parameter file (PARIN)'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0104', 1, 2, 0, 6, 0 )
                 ENDIF
                 IF ( TRIM( var ) == 'pc' )  unit = 'number'
@@ -156,5 +178,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires humidity = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0105', 1, 2, 0, 6, 0 )
                 ENDIF
                 IF ( TRIM( var ) == 'q'   )  unit = 'kg/kg'
@@ -166,5 +188,5 @@
                         '" requires cloud_physics = .TRUE. or cloud_droplets', &
                         ' = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 )
                 ENDIF
                 unit = 'kg/kg'
@@ -174,5 +196,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires cloud_droplets = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0107', 1, 2, 0, 6, 0 )
                 ENDIF
                 IF ( TRIM( var ) == 'ql_c'  )  unit = 'kg/kg'
@@ -184,5 +206,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires cloud_physics = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 )
                 ENDIF
                 unit = 'kg/kg'
@@ -192,5 +214,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires ocean = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0109', 1, 2, 0, 6, 0 )
                 ENDIF
                 unit = 'kg/m3'
@@ -200,5 +222,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires passive_scalar = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0110', 1, 2, 0, 6, 0 )
                 ENDIF
                 unit = 'conc'
@@ -208,5 +230,5 @@
                    WRITE ( message_string, * ) 'output of "', TRIM( var ), &
                         '" requires ocean = .TRUE.'
-                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                   CALL message( 'init_masks', 'PA0109', 1, 2, 0, 6, 0 )
                 ENDIF
                 unit = 'psu'
@@ -216,14 +238,14 @@
                      'output: "', TRIM( var ), '" is only allowed', &
                      'for horizontal cross section'
-                CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                CALL message( 'init_masks', 'PA0111', 1, 2, 0, 6, 0 )
 !                IF ( TRIM( var ) == 'lwp*'  .AND.  .NOT. cloud_physics )  THEN
 !                   WRITE ( message_string, * ) 'output of "', TRIM( var ), &
 !                         '" requires cloud_physics = .TRUE.'
-!                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+!                   CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 )
 !                ENDIF
 !                IF ( TRIM( var ) == 'pra*'  .AND.  .NOT. precipitation )  THEN
 !                   WRITE ( message_string, * ) 'output of "', TRIM( var ), &
 !                         '" requires precipitation = .TRUE.'
-!                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+!                   CALL message( 'init_masks', 'PA0112', 1, 2, 0, 6, 0 )
 !                ENDIF
 !                IF ( TRIM( var ) == 'pra*'  .AND.  j == 1 )  THEN
@@ -231,10 +253,10 @@
 !                         ' precipitation amount "', TRIM( var ),         &
 !                         '" not possible' 
-!                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+!                   CALL message( 'init_masks', 'PA0113', 1, 2, 0, 6, 0 )
 !                ENDIF
 !                IF ( TRIM( var ) == 'prr*'  .AND.  .NOT. precipitation )  THEN
 !                   WRITE ( message_string, * ) 'output of "', TRIM( var ), &
 !                         '" requires precipitation = .TRUE.'
-!                   CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+!                   CALL message( 'init_masks', 'PA0112', 1, 2, 0, 6, 0 )
 !                ENDIF
 !
@@ -262,9 +284,9 @@
                            'output or data_output_user: "', &
                            TRIM( do_mask(mid,i) ), '"'
-                      CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                      CALL message( 'init_masks', 'PA0114', 1, 2, 0, 6, 0 )
                    ELSE
                       WRITE ( message_string, * ) 'illegal value for data_',&
                            'output: "', TRIM( do_mask(mid,i) ), '"'
-                      CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                      CALL message( 'init_masks', 'PA0330', 1, 2, 0, 6, 0 )
                    ENDIF
                 ENDIF
@@ -451,5 +473,5 @@
                      m,' in mask ',mid,' along dimension ',dim,  &
                      ' exceeds ',nxyz_string,' = ',nxyz
-                CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                CALL message( 'init_masks', 'PA0331', 1, 2, 0, 6, 0 )
              ENDIF
              IF ( m >= lb .AND. m <= ub )  THEN
@@ -490,5 +512,5 @@
                      nxyz_string,'*',dxyz_string,'/mask_scale(',dim,')=', &
                      nxyz*dxyz/mask_scale(dim)
-                CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                CALL message( 'init_masks', 'PA0332', 1, 2, 0, 6, 0 )
              ENDIF
              loop_begin  = NINT( mask_loop(mid,dim,1) * mask_scale(dim) * ddxyz )
@@ -507,5 +529,5 @@
                      mask_loop(mid,dim,2),'&exceed zw(nz)/mask_scale(',dim, &
                      ')=',zw(nz)/mask_scale(dim)
-                CALL message( 'init_masks', 'PA9998', 1, 2, 0, 6, 0 )
+                CALL message( 'init_masks', 'PA0333', 1, 2, 0, 6, 0 )
              ENDIF
              ind_array =  &
@@ -530,5 +552,5 @@
                      'match the desired heights&within the stretching ', &
                      'region. Recommendation: use mask instead of mask_loop.'
-                CALL message( 'init_masks', 'PA9998', 0, 1, 0, 6, 0 )
+                CALL message( 'init_masks', 'PA0334', 0, 1, 0, 6, 0 )
              ENDIF
 
