Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 1310)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 1320)
@@ -20,5 +20,11 @@
 ! Current revisions:
 ! -----------------
-!
+! ONLY-attribute added to USE-statements,
+! kind-parameters added to all INTEGER and REAL declaration statements, 
+! kinds are defined in new module kinds, 
+! old module precision_kind is removed,
+! revision history before 2012 removed,
+! comment fields (!:) to be used for variable explanations added to
+! all variable declaration statements 
 !
 ! Former revisions:
@@ -81,59 +87,4 @@
 ! New cpp directive "__check" implemented which is used by check_namelist_files
 !
-! 759 2011-09-15 13:58:31Z raasch
-! Splitting of parallel I/O in blocks of PEs
-!
-! 722 2011-04-11 06:21:09Z raasch
-! Bugfix: bc_lr/ns_cyc replaced by bc_lr/ns, because variables are not yet set
-!         here
-!
-! 709 2011-03-30 09:31:40Z raasch
-! formatting adjustments
-!
-! 707 2011-03-29 11:39:40Z raasch
-! bc_lr/ns replaced by bc_lr/ns_cyc
-!
-! 667 2010-12-23 12:06:00Z suehring/gryschka
-! Definition of new array bounds nxlg, nxrg, nysg, nyng on each PE. 
-! Furthermore the allocation of arrays and steering of loops is done with these
-! parameters. Call of exchange_horiz are modified.
-! In case of dirichlet bounday condition at the bottom zu(0)=0.0
-! dzu_mg has to be set explicitly for a equally spaced grid near bottom.
-! ddzu_pres added to use a equally spaced grid near bottom.
-!
-! 555 2010-09-07 07:32:53Z raasch
-! Bugfix: default setting of nzb_local for flat topography
-!
-! 274 2009-03-26 15:11:21Z heinze
-! Output of messages replaced by message handling routine.
-! new topography case 'single_street_canyon'
-!
-! 217 2008-12-09 18:00:48Z letzel
-! +topography_grid_convention
-!
-! 134 2007-11-21 07:28:38Z letzel
-! Redefine initial nzb_local as the actual total size of topography (later the 
-! extent of topography in nzb_local is reduced by 1dx at the E topography walls 
-! and by 1dy at the N topography walls to form the basis for nzb_s_inner); 
-! for consistency redefine 'single_building' case.
-! Calculation of wall flag arrays
-!
-! 94 2007-06-01 15:25:22Z raasch
-! Grid definition for ocean version
-!
-! 75 2007-03-22 09:54:05Z raasch
-! storage of topography height arrays zu_s_inner and zw_s_inner,
-! 2nd+3rd argument removed from exchange horiz
-!
-! 19 2007-02-23 04:53:48Z raasch
-! Setting of nzt_diff
-!
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.17  2006/08/22 14:00:05  raasch
-! +dz_max to limit vertical stretching,
-! bugfix in index array initialization for line- or point-like topography
-! structures
-!
 ! Revision 1.1  1997/08/11 06:17:45  raasch
 ! Initial revision (Testversion)
@@ -145,27 +96,93 @@
 !------------------------------------------------------------------------------!
 
-    USE arrays_3d
-    USE control_parameters
-    USE grid_variables
-    USE indices
+    USE arrays_3d,                                                             &
+        ONLY:  dd2zu, ddzu, ddzu_pres, ddzw, dzu, dzu_mg, dzw, dzw_mg, f1_mg,  &
+               f2_mg, f3_mg, l_grid, l_wall, zu, zw
+        
+    USE control_parameters,                                                             &
+        ONLY:  bc_lr, bc_ns, building_height, building_length_x,               &
+               building_length_y, building_wall_left, building_wall_south,     &
+               canyon_height, canyon_wall_left, canyon_wall_south,             &
+               canyon_width_x, canyon_width_y, coupling_char, dp_level_ind_b,  &
+               dz, dz_max, dz_stretch_factor, dz_stretch_level,                &
+               dz_stretch_level_index, ibc_uv_b, io_blocks, io_group,          &
+               inflow_l, inflow_n, inflow_r, inflow_s, masking_method,         &
+               maximum_grid_level, message_string, momentum_advec, ocean,      &
+               outflow_l, outflow_n, outflow_r, outflow_s, prandtl_layer,      &
+               psolver, scalar_advec, topography, topography_grid_convention,  &
+               use_surface_fluxes, use_top_fluxes, wall_adjustment_factor 
+        
+    USE grid_variables,                                                        &
+        ONLY:  ddx, ddx2, ddx2_mg, ddy, ddy2, ddy2_mg, dx, dx2, dy, dy2, fwxm, &
+               fwxp, fwym, fwyp, fxm, fxp, fym, fyp, wall_e_x, wall_e_y,       &
+               wall_u, wall_v, wall_w_x, wall_w_y, zu_s_inner, zw_w_inner
+        
+    USE indices,                                                               &
+        ONLY:  flags, nbgp, nx, nxl, nxlg, nxlu, nxl_mg, nxr, nxrg, nxr_mg,    &
+               ny, nyn, nyng, nyn_mg, nys, nysv, nys_mg, nysg, nz, nzb,        &
+               nzb_2d, nzb_diff, nzb_diff_s_inner, nzb_diff_s_outer,           &
+               nzb_diff_u, nzb_diff_v, nzb_max, nzb_s_inner, nzb_s_outer,      &
+               nzb_u_inner, nzb_u_outer, nzb_v_inner, nzb_v_outer,             &
+               nzb_w_inner, nzb_w_outer, nzt, nzt_diff, nzt_mg, rflags_invers, &
+               rflags_s_inner, wall_flags_0, wall_flags_00, wall_flags_1,      &
+               wall_flags_10, wall_flags_2, wall_flags_3,  wall_flags_4,       &
+               wall_flags_5, wall_flags_6, wall_flags_7, wall_flags_8,         &
+               wall_flags_9
+    
+    USE kinds
+    
     USE pegrid
 
     IMPLICIT NONE
 
-    INTEGER ::  bh, blx, bly, bxl, bxr, byn, bys, ch, cwx, cwy, cxl, cxr, cyn, &
-                cys, gls, i, ii, inc, j, k, l, nxl_l, nxr_l, nyn_l, nys_l,     &
-                nzb_si, nzt_l, vi
-
-    INTEGER, DIMENSION(:), ALLOCATABLE   ::  vertical_influence
-
-    INTEGER, DIMENSION(:,:), ALLOCATABLE ::  corner_nl, corner_nr, corner_sl,  &
-                                             corner_sr, wall_l, wall_n, wall_r,&
-                                             wall_s, nzb_local, nzb_tmp
-
-    LOGICAL :: flag_set = .FALSE.
-
-    REAL    ::  dx_l, dy_l, dz_stretched
-
-    REAL, DIMENSION(:,:), ALLOCATABLE   ::  topo_height
+    INTEGER(iwp) ::  bh      !:
+    INTEGER(iwp) ::  blx     !:
+    INTEGER(iwp) ::  bly     !:
+    INTEGER(iwp) ::  bxl     !:
+    INTEGER(iwp) ::  bxr     !:
+    INTEGER(iwp) ::  byn     !:
+    INTEGER(iwp) ::  bys     !:
+    INTEGER(iwp) ::  ch      !:
+    INTEGER(iwp) ::  cwx     !:
+    INTEGER(iwp) ::  cwy     !:
+    INTEGER(iwp) ::  cxl     !:
+    INTEGER(iwp) ::  cxr     !:
+    INTEGER(iwp) ::  cyn     !:
+    INTEGER(iwp) ::  cys     !:
+    INTEGER(iwp) ::  gls     !:
+    INTEGER(iwp) ::  i       !:
+    INTEGER(iwp) ::  ii      !:
+    INTEGER(iwp) ::  inc     !:
+    INTEGER(iwp) ::  j       !:
+    INTEGER(iwp) ::  k       !:
+    INTEGER(iwp) ::  l       !:
+    INTEGER(iwp) ::  nxl_l   !:
+    INTEGER(iwp) ::  nxr_l   !:
+    INTEGER(iwp) ::  nyn_l   !:
+    INTEGER(iwp) ::  nys_l   !:
+    INTEGER(iwp) ::  nzb_si  !:
+    INTEGER(iwp) ::  nzt_l   !:
+    INTEGER(iwp) ::  vi      !:
+
+    INTEGER(iwp), DIMENSION(:), ALLOCATABLE   ::  vertical_influence  !:
+
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  corner_nl  !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  corner_nr  !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  corner_sl  !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  corner_sr  !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  wall_l     !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  wall_n     !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  wall_r     !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  wall_s     !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  nzb_local  !:
+    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  nzb_tmp    !:
+
+    LOGICAL :: flag_set = .FALSE.  !:
+
+    REAL(wp) ::  dx_l          !:
+    REAL(wp) ::  dy_l          !:
+    REAL(wp) ::  dz_stretched  !:
+
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  topo_height  !:
 
     
