Index: /palm/trunk/SOURCE/boundary_conds.f90
===================================================================
--- /palm/trunk/SOURCE/boundary_conds.f90	(revision 995)
+++ /palm/trunk/SOURCE/boundary_conds.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! little reformatting
 !  
 ! Former revisions:
@@ -259,14 +259,13 @@
 
 !
-!--       Calculate the phase speeds for u,v, and w, first local and then 
-!--       average parallel along the outflow boundary.  
-          DO k = nzb+1, nzt+1
-             DO i = nxl, nxr
+!--       Calculate the phase speeds for u, v, and w, first local and then
+!--       average along the outflow boundary.
+          DO  k = nzb+1, nzt+1
+             DO  i = nxl, nxr
 
                 denom = u_m_s(k,0,i) - u_m_s(k,1,i)
 
                 IF ( denom /= 0.0 )  THEN
-                   c_u(k,i) = -c_max * ( u(k,0,i) - u_m_s(k,0,i) )             &
-                              / ( denom * tsc(2) )
+                   c_u(k,i) = -c_max * ( u(k,0,i) - u_m_s(k,0,i) ) / ( denom * tsc(2) )
                    IF ( c_u(k,i) < 0.0 )  THEN
                       c_u(k,i) = 0.0
@@ -281,6 +280,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_v(k,i) = -c_max * ( v(k,1,i) - v_m_s(k,1,i) )             &
-                              / ( denom * tsc(2) )
+                   c_v(k,i) = -c_max * ( v(k,1,i) - v_m_s(k,1,i) ) / ( denom * tsc(2) )
                    IF ( c_v(k,i) < 0.0 )  THEN
                       c_v(k,i) = 0.0
@@ -295,6 +293,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_w(k,i) = -c_max * ( w(k,0,i) - w_m_s(k,0,i) )             &
-                              / ( denom * tsc(2) )
+                   c_w(k,i) = -c_max * ( w(k,0,i) - w_m_s(k,0,i) ) / ( denom * tsc(2) )
                    IF ( c_w(k,i) < 0.0 )  THEN
                       c_w(k,i) = 0.0
@@ -343,6 +340,6 @@
 !
 !--       Calculate the new velocities
-          DO k = nzb+1, nzt+1 
-             DO i = nxlg, nxrg
+          DO  k = nzb+1, nzt+1
+             DO  i = nxlg, nxrg
                 u_p(k,-1,i) = u(k,-1,i) - dt_3d * tsc(2) * c_u_m(k) *          &
                                        ( u(k,-1,i) - u(k,0,i) ) * ddy
@@ -401,14 +398,13 @@
 
 !
-!--       Calculate the phase speeds for u,v, and w, first local and then 
-!--       average parallel along the outflow boundary.  
-          DO k = nzb+1, nzt+1
-             DO i = nxl, nxr
+!--       Calculate the phase speeds for u, v, and w, first local and then
+!--       average along the outflow boundary.
+          DO  k = nzb+1, nzt+1
+             DO  i = nxl, nxr
 
                 denom = u_m_n(k,ny,i) - u_m_n(k,ny-1,i)
 
                 IF ( denom /= 0.0 )  THEN
-                   c_u(k,i) = -c_max * ( u(k,ny,i) - u_m_n(k,ny,i) )           &
-                              / ( denom * tsc(2) )
+                   c_u(k,i) = -c_max * ( u(k,ny,i) - u_m_n(k,ny,i) ) / ( denom * tsc(2) )
                    IF ( c_u(k,i) < 0.0 )  THEN
                       c_u(k,i) = 0.0
@@ -423,6 +419,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_v(k,i) = -c_max * ( v(k,ny,i) - v_m_n(k,ny,i) )           &
-                              / ( denom * tsc(2) )
+                   c_v(k,i) = -c_max * ( v(k,ny,i) - v_m_n(k,ny,i) ) / ( denom * tsc(2) )
                    IF ( c_v(k,i) < 0.0 )  THEN
                       c_v(k,i) = 0.0
@@ -437,6 +432,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_w(k,i) = -c_max * ( w(k,ny,i) - w_m_n(k,ny,i) )           &
-                              / ( denom * tsc(2) )
+                   c_w(k,i) = -c_max * ( w(k,ny,i) - w_m_n(k,ny,i) ) / ( denom * tsc(2) )
                    IF ( c_w(k,i) < 0.0 )  THEN
                       c_w(k,i) = 0.0
@@ -485,6 +479,6 @@
 !
 !--       Calculate the new velocities
-          DO k = nzb+1, nzt+1 
-             DO i = nxlg, nxrg
+          DO  k = nzb+1, nzt+1
+             DO  i = nxlg, nxrg
                 u_p(k,ny+1,i) = u(k,ny+1,i) - dt_3d * tsc(2) * c_u_m(k) *      &
                                        ( u(k,ny+1,i) - u(k,ny,i) ) * ddy
@@ -543,14 +537,13 @@
 
 !
-!--       Calculate the phase speeds for u,v, and w, first local and then 
-!--       average parallel along the outflow boundary.  
-          DO k = nzb+1, nzt+1
-             DO j = nys, nyn
+!--       Calculate the phase speeds for u, v, and w, first local and then
+!--       average along the outflow boundary.
+          DO  k = nzb+1, nzt+1
+             DO  j = nys, nyn
 
                 denom = u_m_l(k,j,1) - u_m_l(k,j,2)
 
                 IF ( denom /= 0.0 )  THEN
-                   c_u(k,j) = -c_max * ( u(k,j,1) - u_m_l(k,j,1) )             &
-                              / ( denom * tsc(2) )
+                   c_u(k,j) = -c_max * ( u(k,j,1) - u_m_l(k,j,1) ) / ( denom * tsc(2) )
                    IF ( c_u(k,j) < 0.0 )  THEN
                       c_u(k,j) = 0.0
@@ -565,6 +558,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_v(k,j) = -c_max * ( v(k,j,0) - v_m_l(k,j,0) )             &
-                              / ( denom * tsc(2) )
+                   c_v(k,j) = -c_max * ( v(k,j,0) - v_m_l(k,j,0) ) / ( denom * tsc(2) )
                    IF ( c_v(k,j) < 0.0 )  THEN
                       c_v(k,j) = 0.0
@@ -579,6 +571,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_w(k,j) = -c_max * ( w(k,j,0) - w_m_l(k,j,0) )             &
-                              / ( denom * tsc(2) )
+                   c_w(k,j) = -c_max * ( w(k,j,0) - w_m_l(k,j,0) ) / ( denom * tsc(2) )
                    IF ( c_w(k,j) < 0.0 )  THEN
                       c_w(k,j) = 0.0
@@ -627,6 +618,6 @@
 !
 !--       Calculate the new velocities
-          DO k = nzb+1, nzt+1 
-             DO i = nxlg, nxrg
+          DO  k = nzb+1, nzt+1
+             DO  i = nxlg, nxrg
                 u_p(k,j,0) = u(k,j,0) - dt_3d * tsc(2) * c_u_m(k) *            &
                                        ( u(k,j,0) - u(k,j,1) ) * ddx
@@ -685,14 +676,13 @@
 
 !
-!--       Calculate the phase speeds for u,v, and w, first local and then 
-!--       average parallel along the outflow boundary.  
-          DO k = nzb+1, nzt+1
-             DO j = nys, nyn
+!--       Calculate the phase speeds for u, v, and w, first local and then
+!--       average along the outflow boundary.
+          DO  k = nzb+1, nzt+1
+             DO  j = nys, nyn
 
                 denom = u_m_r(k,j,nx) - u_m_r(k,j,nx-1)
 
                 IF ( denom /= 0.0 )  THEN
-                   c_u(k,j) = -c_max * ( u(k,j,nx) - u_m_r(k,j,nx) )           &
-                              / ( denom * tsc(2) )
+                   c_u(k,j) = -c_max * ( u(k,j,nx) - u_m_r(k,j,nx) ) / ( denom * tsc(2) )
                    IF ( c_u(k,j) < 0.0 )  THEN
                       c_u(k,j) = 0.0
@@ -707,6 +697,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_v(k,j) = -c_max * ( v(k,j,nx) - v_m_r(k,j,nx) )           &
-                              / ( denom * tsc(2) )
+                   c_v(k,j) = -c_max * ( v(k,j,nx) - v_m_r(k,j,nx) ) / ( denom * tsc(2) )
                    IF ( c_v(k,j) < 0.0 )  THEN
                       c_v(k,j) = 0.0
@@ -721,6 +710,5 @@
 
                 IF ( denom /= 0.0 )  THEN
-                   c_w(k,j) = -c_max * ( w(k,j,nx) - w_m_r(k,j,nx) )           &
-                              / ( denom * tsc(2) )
+                   c_w(k,j) = -c_max * ( w(k,j,nx) - w_m_r(k,j,nx) ) / ( denom * tsc(2) )
                    IF ( c_w(k,j) < 0.0 )  THEN
                       c_w(k,j) = 0.0
@@ -769,6 +757,6 @@
 !
 !--       Calculate the new velocities
-          DO k = nzb+1, nzt+1 
-             DO i = nxlg, nxrg
+          DO  k = nzb+1, nzt+1
+             DO  i = nxlg, nxrg
                 u_p(k,j,nx+1) = u(k,j,nx+1) - dt_3d * tsc(2) * c_u_m(k) *      &
                                        ( u(k,j,nx+1) - u(k,j,nx) ) * ddx
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 995)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! little reformatting
 !
 ! Former revisions:
@@ -2712,5 +2712,5 @@
              IF ( TRIM( var ) == 'u*'     )  unit = 'm/s'
              IF ( TRIM( var ) == 'z0*'    )  unit = 'm'
-             IF ( TRIM( var ) == 'z0h*'    )  unit = 'm'
+             IF ( TRIM( var ) == 'z0h*'   )  unit = 'm'
 
 
@@ -2980,5 +2980,5 @@
 !-- potential temperature, check the width of the damping layer
     IF ( bc_lr /= 'cyclic' ) THEN
-       IF ( pt_damping_width < 0.0 .OR. pt_damping_width > REAL( nx * dx ) )  THEN
+       IF ( pt_damping_width < 0.0  .OR.  pt_damping_width > REAL( nx * dx ) )  THEN
           message_string = 'pt_damping_width out of range'
           CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 )
@@ -2987,5 +2987,5 @@
 
     IF ( bc_ns /= 'cyclic' )  THEN
-       IF ( pt_damping_width < 0.0 .OR. pt_damping_width > REAL( ny * dy ) )  THEN
+       IF ( pt_damping_width < 0.0  .OR.  pt_damping_width > REAL( ny * dy ) )  THEN
           message_string = 'pt_damping_width out of range'
           CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 )
Index: /palm/trunk/SOURCE/init_1d_model.f90
===================================================================
--- /palm/trunk/SOURCE/init_1d_model.f90	(revision 995)
+++ /palm/trunk/SOURCE/init_1d_model.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! little reformatting
 !
 ! Former revisions:
@@ -151,5 +151,5 @@
     usws1d = 0.0; usws1d_m = 0.0
     vsws1d = 0.0; vsws1d_m = 0.0
-    z01d = roughness_length
+    z01d  = roughness_length
     z0h1d = z0h_factor * z01d 
     IF ( humidity .OR. passive_scalar )  qs1d = 0.0
@@ -448,5 +448,5 @@
 !
 !--                Stable stratification
-                   ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /      &
+                   ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /       &
                           ( LOG( zu(nzb+1) / z0h1d ) + 5.0 * rif1d(nzb+1) * &
                                           ( zu(nzb+1) - z0h1d ) / zu(nzb+1) &
@@ -462,5 +462,5 @@
 !--                occur in the argument of the logarithm.
                    IF ( a == 0.0  .OR.  b == 0.0 )  THEN
-                      ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /      &
+                      ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /       &
                              ( LOG( zu(nzb+1) / z0h1d ) + 5.0 * rif1d(nzb+1) * &
                                              ( zu(nzb+1) - z0h1d ) / zu(nzb+1) &
@@ -581,5 +581,5 @@
 !
 !--                Stable stratification
-                   qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /        &
+                   qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /         &
                           ( LOG( zu(nzb+1) / z0h1d ) + 5.0 * rif1d(nzb+1) * &
                                           ( zu(nzb+1) - z0h1d ) / zu(nzb+1) &
@@ -595,5 +595,5 @@
 !--                occur in the argument of the logarithm.
                    IF ( a == 1.0  .OR.  b == 1.0 )  THEN
-                      qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /        &
+                      qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /         &
                              ( LOG( zu(nzb+1) / z0h1d ) + 5.0 * rif1d(nzb+1) * &
                                              ( zu(nzb+1) - z0h1d ) / zu(nzb+1) &
Index: /palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- /palm/trunk/SOURCE/init_3d_model.f90	(revision 995)
+++ /palm/trunk/SOURCE/init_3d_model.f90	(revision 996)
@@ -7,5 +7,5 @@
 ! Current revisions:
 ! ------------------
-!
+! little reformatting
 !
 ! Former revisions:
@@ -190,5 +190,5 @@
 
     INTEGER, DIMENSION(:,:), ALLOCATABLE ::  ngp_2dh_outer_l,  &
-         ngp_2dh_s_inner_l
+                                             ngp_2dh_s_inner_l
 
     REAL ::  a, b
@@ -213,5 +213,5 @@
               ngp_2dh_s_inner(nzb:nzt+1,0:statistic_regions),               &
               ngp_2dh_s_inner_l(nzb:nzt+1,0:statistic_regions),             &
-              rmask(nysg:nyng,nxlg:nxrg,0:statistic_regions),           &
+              rmask(nysg:nyng,nxlg:nxrg,0:statistic_regions),               &
               sums(nzb:nzt+1,pr_palm+max_pr_user),                          &
               sums_l(nzb:nzt+1,pr_palm+max_pr_user,0:threads_per_task-1),   &
@@ -225,7 +225,7 @@
               ts(nysg:nyng,nxlg:nxrg), tswst_1(nysg:nyng,nxlg:nxrg),  &
               us(nysg:nyng,nxlg:nxrg), usws_1(nysg:nyng,nxlg:nxrg),   &
-              uswst_1(nysg:nyng,nxlg:nxrg),                               &
-              vsws_1(nysg:nyng,nxlg:nxrg),                                &
-              vswst_1(nysg:nyng,nxlg:nxrg), z0(nysg:nyng,nxlg:nxrg),      &
+              uswst_1(nysg:nyng,nxlg:nxrg),                           &
+              vsws_1(nysg:nyng,nxlg:nxrg),                            &
+              vswst_1(nysg:nyng,nxlg:nxrg), z0(nysg:nyng,nxlg:nxrg),  &
               z0h(nysg:nyng,nxlg:nxrg) )
 
@@ -242,5 +242,5 @@
     ENDIF
 
-    ALLOCATE( d(nzb+1:nzta,nys:nyna,nxl:nxra),         &
+    ALLOCATE( d(nzb+1:nzta,nys:nyna,nxl:nxra),     &
               e_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
               e_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
@@ -256,7 +256,7 @@
               u_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
               u_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
-              v_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
-              v_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
-              v_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
+              v_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
+              v_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
+              v_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
               w_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
               w_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
@@ -374,10 +374,10 @@
 
        IF ( passive_scalar ) THEN
-          ALLOCATE ( sls(nzb:nzt+1,nysg:nyng,nxlg:nxrg),   &
+          ALLOCATE ( sls(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
                      sec(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 
        ENDIF
 
        IF ( cthf /= 0.0 ) THEN
-          ALLOCATE ( lai(nzb:nzt+1,nysg:nyng,nxlg:nxrg),   &
+          ALLOCATE ( lai(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
                      canopy_heat_flux(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
        ENDIF
@@ -423,5 +423,5 @@
                  c_w(nzb:nzt+1,nxlg:nxrg) )
     ENDIF
-    IF ( outflow_l  .OR.  outflow_r .OR. outflow_s .OR. outflow_n )  THEN
+    IF ( outflow_l  .OR.  outflow_r  .OR.  outflow_s  .OR.  outflow_n )  THEN
        ALLOCATE( c_u_m_l(nzb:nzt+1), c_v_m_l(nzb:nzt+1), c_w_m_l(nzb:nzt+1) )                   
        ALLOCATE( c_u_m(nzb:nzt+1), c_v_m(nzb:nzt+1), c_w_m(nzb:nzt+1) )
@@ -601,20 +601,4 @@
 !--          ---------  advection scheme: keep u and v zero one layer below
 !--                     the topography.
-!
-!--           Following was removed, because mirror boundary condition are
-!--           replaced by dirichlet boundary conditions 
-!
-!             IF ( ibc_uv_b == 0 )  THEN
-!!
-!!--             Satisfying the Dirichlet condition with an extra layer below
-!!--             the surface where the u and v component change their sign.
-!                DO  i = nxl-1, nxr+1
-!                   DO  j = nys-1, nyn+1
-!                      IF ( nzb_u_inner(j,i) == 0 ) u(0,j,i) = -u(1,j,i)
-!                      IF ( nzb_v_inner(j,i) == 0 ) v(0,j,i) = -v(1,j,i)
-!                   ENDDO
-!                ENDDO
-!
-!             ELSE
              IF ( ibc_uv_b == 1 )  THEN
 !
@@ -1073,9 +1057,8 @@
              IF ( zu(k) <= inflow_damping_height )  THEN
                 inflow_damping_factor(k) = 1.0
-             ELSEIF ( zu(k) <= inflow_damping_height +  &
-                               inflow_damping_width )  THEN
-                inflow_damping_factor(k) = 1.0 -                            &
-                                        ( zu(k) - inflow_damping_height ) / &
-                                        inflow_damping_width
+             ELSEIF ( zu(k) <= ( inflow_damping_height + inflow_damping_width ) )  THEN
+                inflow_damping_factor(k) = 1.0 -                               &
+                                           ( zu(k) - inflow_damping_height ) / &
+                                           inflow_damping_width
              ELSE
                 inflow_damping_factor(k) = 0.0
@@ -1097,16 +1080,16 @@
              DO  i = nxlg, nxrg
                 DO  j = nysg, nyng
-                   u  (nzb:nzb_u_inner(j,i),j,i) = 0.0
-                   v  (nzb:nzb_v_inner(j,i),j,i) = 0.0
-                   w  (nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   e  (nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   u_m(nzb:nzb_u_inner(j,i),j,i) = 0.0
-                   v_m(nzb:nzb_v_inner(j,i),j,i) = 0.0
-                   w_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   e_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   tu_m(nzb:nzb_u_inner(j,i),j,i) = 0.0
-                   tv_m(nzb:nzb_v_inner(j,i),j,i) = 0.0
-                   tw_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   te_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
+                   u  (nzb:nzb_u_inner(j,i),j,i)   = 0.0
+                   v  (nzb:nzb_v_inner(j,i),j,i)   = 0.0
+                   w  (nzb:nzb_w_inner(j,i),j,i)   = 0.0
+                   e  (nzb:nzb_w_inner(j,i),j,i)   = 0.0
+                   u_m(nzb:nzb_u_inner(j,i),j,i)   = 0.0
+                   v_m(nzb:nzb_v_inner(j,i),j,i)   = 0.0
+                   w_m(nzb:nzb_w_inner(j,i),j,i)   = 0.0
+                   e_m(nzb:nzb_w_inner(j,i),j,i)   = 0.0
+                   tu_m(nzb:nzb_u_inner(j,i),j,i)  = 0.0
+                   tv_m(nzb:nzb_v_inner(j,i),j,i)  = 0.0
+                   tw_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0
+                   te_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0
                    tpt_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
                 ENDDO
@@ -1554,6 +1537,6 @@
     ptdf_x = 0.0
     ptdf_y = 0.0
-    IF ( bc_lr_dirrad .OR. bc_lr_dirneu )  THEN
-       DO i = nxl, nxr
+    IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
+       DO  i = nxl, nxr
           IF ( ( i * dx ) < pt_damping_width )  THEN
              ptdf_x(i) = pt_damping_factor * ( SIN( pi * 0.5 *        &
@@ -1562,26 +1545,26 @@
           ENDIF
        ENDDO
-    ELSEIF ( bc_lr_raddir .OR. bc_lr_neudir )  THEN
-       DO i = nxl, nxr
+    ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
+       DO  i = nxl, nxr
           IF ( ( i * dx ) > ( nx * dx - pt_damping_width ) )  THEN
-             ptdf_x(i) = pt_damping_factor * ( SIN( pi * 0.5 *                 &
-                         REAL( ( i - nx ) * dx + pt_damping_width ) / (        &
-                         REAL( pt_damping_width )                     ) ) )**2       
+             ptdf_x(i) = pt_damping_factor *                                      &
+                         SIN( pi * 0.5 * ( ( i - nx ) * dx + pt_damping_width ) / &
+                                         REAL( pt_damping_width ) )**2
           ENDIF
        ENDDO 
-    ELSEIF ( bc_ns_dirrad .OR. bc_ns_dirneu )  THEN
-       DO j = nys, nyn
+    ELSEIF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
+       DO  j = nys, nyn
           IF ( ( j * dy ) > ( ny * dy - pt_damping_width ) )  THEN
-             ptdf_y(j) = pt_damping_factor * ( SIN( pi * 0.5 *                 &
-                         REAL( ( j - ny ) * dy + pt_damping_width ) / (        &
-                         REAL( pt_damping_width )                     ) ) )**2       
+             ptdf_y(j) = pt_damping_factor *                                      &
+                         SIN( pi * 0.5 * ( ( j - ny ) * dy + pt_damping_width ) / &
+                                         REAL( pt_damping_width ) )**2
           ENDIF
        ENDDO 
-    ELSEIF ( bc_ns_raddir .OR. bc_ns_neudir )  THEN
-       DO j = nys, nyn
+    ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
+       DO  j = nys, nyn
           IF ( ( j * dy ) < pt_damping_width )  THEN
-             ptdf_y(j) = pt_damping_factor * ( SIN( pi * 0.5 *        &
-                         REAL( pt_damping_width - j * dy ) / (        &
-                         REAL( pt_damping_width )            ) ) )**2       
+             ptdf_y(j) = pt_damping_factor *                             &
+                         SIN( pi * 0.5 * ( pt_damping_width - j * dy ) / &
+                                         REAL( pt_damping_width ) )**2
           ENDIF
        ENDDO
Index: /palm/trunk/SOURCE/init_grid.f90
===================================================================
--- /palm/trunk/SOURCE/init_grid.f90	(revision 995)
+++ /palm/trunk/SOURCE/init_grid.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! little reformatting
 !
 ! Former revisions:
@@ -613,5 +613,5 @@
 !-- steering the degradation of order of the applied advection scheme.
 !-- In case of non-cyclic lateral boundaries, the order of the advection
-!-- scheme is reduced at the lateral boundaries up to nzt.
+!-- scheme have to be reduced up to nzt (required at the lateral boundaries).
     nzb_max = MAXVAL( nzb_local )
     IF ( inflow_l .OR. outflow_l .OR. inflow_r .OR. outflow_r .OR.    &
Index: /palm/trunk/SOURCE/init_masks.f90
===================================================================
--- /palm/trunk/SOURCE/init_masks.f90	(revision 995)
+++ /palm/trunk/SOURCE/init_masks.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! little reformatting
 !
 ! Former revisions:
@@ -80,6 +80,6 @@
 !-- Parallel mask output not yet tested
     IF ( netcdf_data_format > 2 )  THEN
-       message_string = 'NetCDF file formats '//                         &
-                        '3 (NetCDF 4) and 4 (NetCDF 4 Classic model)'//  &
+       message_string = 'netCDF file formats '//                         &
+                        '3 (netCDF 4) and 4 (netCDF 4 Classic model)'//  &
                         '&are currently not supported (not yet tested).'
        CALL message( 'init_masks', 'PA0328', 1, 2, 0, 6, 0 )
@@ -88,5 +88,5 @@
 !
 !-- Store data output parameters for masked data output in few shared arrays
-    DO mid = 1, masks
+    DO  mid = 1, masks
     
        do_mask     (mid,:) = data_output_masks(mid,:)
@@ -96,21 +96,21 @@
        mask      (mid,3,:) = mask_z(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
+       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
+       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
+       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
@@ -158,5 +158,5 @@
 !--    Check and set steering parameters for mask data output and averaging
        i   = 1
-       DO  WHILE ( do_mask(mid,i) /= ' '  .AND.  i <= 100 )
+       DO WHILE ( do_mask(mid,i) /= ' '  .AND.  i <= 100 )
 !
 !--       Check for data averaging
@@ -265,32 +265,4 @@
                      'for horizontal cross section'
                 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', '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', 'PA0112', 1, 2, 0, 6, 0 )
-!                ENDIF
-!                IF ( TRIM( var ) == 'pra*'  .AND.  j == 1 )  THEN
-!                   WRITE ( message_string, * ) 'temporal averaging of ', &
-!                         ' precipitation amount "', TRIM( var ),         &
-!                         '" not possible' 
-!                   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', 'PA0112', 1, 2, 0, 6, 0 )
-!                ENDIF
-!
-!                IF ( TRIM( var ) == 'u*'   )  unit = 'm/s'
-!                IF ( TRIM( var ) == 't*'   )  unit = 'K'
-!                IF ( TRIM( var ) == 'lwp*' )  unit = 'kg/kg*m'
-!                IF ( TRIM( var ) == 'pra*' )  unit = 'mm'
-!                IF ( TRIM( var ) == 'prr*' )  unit = 'mm/s'
-!                IF ( TRIM( var ) == 'z0*'  )  unit = 'm'
 
              CASE ( 'p', 'pt', 'u', 'v', 'w' )
@@ -404,7 +376,6 @@
 !--       If at least part of the mask resides on the PE, send the index limits
 !--       for the target array, otherwise send -9999 to PE0.
-          IF ( mask_size_l(mid,1) > 0 .AND.  mask_size_l(mid,2) > 0 .AND. &
-               mask_size_l(mid,3) > 0  ) &
-               THEN
+          IF ( mask_size_l(mid,1) > 0  .AND.  mask_size_l(mid,2) > 0  .AND.  &
+               mask_size_l(mid,3) > 0  )  THEN
              ind(1) = mask_start_l(mid,1)
              ind(2) = mask_start_l(mid,1) + mask_size_l(mid,1) - 1
@@ -599,5 +570,5 @@
           DO  m = loop_begin, loop_end, loop_stride
              count = count + 1
-             IF ( m >= lb .AND. m <= ub )  THEN
+             IF ( m >= lb  .AND.  m <= ub )  THEN
                 IF ( count_l == 0 )  mask_start_l(mid,dim) = count
                 count_l = count_l + 1
Index: /palm/trunk/SOURCE/modules.f90
===================================================================
--- /palm/trunk/SOURCE/modules.f90	(revision 995)
+++ /palm/trunk/SOURCE/modules.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! -use_prior_plot1d_parameters
 !
 ! Former revisions:
@@ -627,6 +627,5 @@
                 stop_dt = .FALSE., synchronous_exchange = .FALSE., &
                 terminate_run = .FALSE., turbulent_inflow = .FALSE., &
-                use_prescribed_profile_data = .FALSE., &
-                use_prior_plot1d_parameters = .FALSE., use_reference = .FALSE.,&
+                use_prescribed_profile_data = .FALSE., use_reference = .FALSE.,&
                 use_surface_fluxes = .FALSE., use_top_fluxes = .FALSE., &
                 use_ug_for_galilei_tr = .TRUE., use_upstream_for_tke = .FALSE.,&
Index: /palm/trunk/SOURCE/parin.f90
===================================================================
--- /palm/trunk/SOURCE/parin.f90	(revision 995)
+++ /palm/trunk/SOURCE/parin.f90	(revision 996)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! -use_prior_plot1d_parameters
 !
 ! Former revisions:
@@ -229,5 +229,5 @@
              skip_time_do2d_xz, skip_time_do2d_yz, skip_time_do3d, &
              skip_time_domask, synchronous_exchange, termination_time_needed, &
-             use_prior_plot1d_parameters, z_max_do2d
+             z_max_do2d
 
 
@@ -276,11 +276,6 @@
 !
 !--       Read the control parameters for initialization.
-!--       The namelist "inipar" must be provided in the NAMELIST-file. If this
-!--       is not the case and the file contains - instead of "inipar" - any
-!--       other namelist, a read error is created on t3e and control is
-!--       transferred to the statement with label 10. Therefore, on t3e
-!--       machines one can not distinguish between errors produced by a wrong
-!--       "inipar" namelist or because this namelist is totally missing.
-           READ ( 11, inipar, ERR=10, END=11 )
+!--       The namelist "inipar" must be provided in the NAMELIST-file.
+          READ ( 11, inipar, ERR=10, END=11 )
 
 #if defined ( __check )
@@ -289,12 +284,12 @@
 !--       used. The p3d file here must be closed and the p3df file for reading 
 !--       3dpar is opened.
-          IF ( check_restart == 1 ) THEN
+          IF ( check_restart == 1 )  THEN
              CALL close_file( 11 )
              check_restart = 2
              CALL check_open( 11 )             
              initializing_actions = 'read_restart_data'
-          END IF
+          ENDIF
 #endif
-           GOTO 12
+          GOTO 12
 
  10       message_string = 'errors in \$inipar &or no \$inipar-namelist ' // &
@@ -309,6 +304,4 @@
 !--       a prior run). All PEs are reading from file created by PE0 (see
 !--       check_open)
-
-
  12       IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
 #if ! defined ( __check )
Index: /palm/trunk/SOURCE/poismg.f90
===================================================================
--- /palm/trunk/SOURCE/poismg.f90	(revision 995)
+++ /palm/trunk/SOURCE/poismg.f90	(revision 996)
@@ -7,5 +7,5 @@
 ! Current revisions:
 ! -----------------
-!
+! little reformatting
 !
 ! Former revisions:
@@ -1232,10 +1232,10 @@
 !--       outflow conditions have to be used on all PEs after the switch,
 !--       because then they have the total domain.
-          IF ( bc_lr_dirrad .OR. bc_lr_dirneu )  THEN
+          IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
              inflow_l  = .TRUE.
              inflow_r  = .FALSE.
              outflow_l = .FALSE.
              outflow_r = .TRUE.
-          ELSEIF ( bc_lr_raddir .OR. bc_lr_neudir )  THEN
+          ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
              inflow_l  = .FALSE.
              inflow_r  = .TRUE.
@@ -1244,10 +1244,10 @@
           ENDIF
 
-          IF ( bc_ns_dirrad .OR. bc_ns_dirneu )  THEN
+          IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
              inflow_n  = .TRUE.
              inflow_s  = .FALSE.
              outflow_n = .FALSE.
              outflow_s = .TRUE.
-          ELSEIF ( bc_ns_raddir .OR. bc_ns_neudir )  THEN
+          ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
              inflow_n  = .FALSE.
              inflow_s  = .TRUE.
@@ -1319,7 +1319,7 @@
 
           IF ( pleft == MPI_PROC_NULL )  THEN
-             IF ( bc_lr_dirrad .OR. bc_lr_dirneu )  THEN
+             IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
                 inflow_l  = .TRUE.
-             ELSEIF ( bc_lr_raddir .OR. bc_lr_neudir )  THEN
+             ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
                 outflow_l = .TRUE.
              ENDIF
@@ -1327,7 +1327,7 @@
 
           IF ( pright == MPI_PROC_NULL )  THEN
-             IF ( bc_lr_dirrad .OR. bc_lr_dirneu )  THEN
+             IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
                 outflow_r = .TRUE.
-             ELSEIF ( bc_lr_raddir .OR. bc_lr_neudir )  THEN
+             ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
                 inflow_r  = .TRUE.
              ENDIF
@@ -1335,7 +1335,7 @@
 
           IF ( psouth == MPI_PROC_NULL )  THEN
-             IF ( bc_ns_dirrad .OR. bc_ns_dirneu )  THEN
+             IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
                 outflow_s = .TRUE.
-             ELSEIF ( bc_ns_raddir .OR. bc_ns_neudir )  THEN
+             ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
                 inflow_s  = .TRUE.
              ENDIF
@@ -1343,7 +1343,7 @@
 
           IF ( pnorth == MPI_PROC_NULL )  THEN
-             IF ( bc_ns_dirrad .OR. bc_ns_dirneu )  THEN
+             IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
                 inflow_n  = .TRUE.
-             ELSEIF ( bc_ns_raddir .OR. bc_ns_neudir )  THEN
+             ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
                 outflow_n = .TRUE.
              ENDIF
