Index: palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 2967)
+++ palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3038)
@@ -25,41 +25,44 @@
 ! -----------------
 ! $Id$
+! updated variable descriptions
+!
+! 2967 2018-04-13 11:22:08Z raasch
 ! bugfix: missing parallel cpp-directives added
-! 
+!
 ! 2946 2018-04-04 17:01:23Z suehring
 ! Remove unused module load
-! 
+!
 ! 2945 2018-04-04 16:27:14Z suehring
-! - Bugfix in parallelization of synthetic turbulence generator in case the 
-!   z-dimension is not an integral divisor of the number of processors along  
+! - Bugfix in parallelization of synthetic turbulence generator in case the
+!   z-dimension is not an integral divisor of the number of processors along
 !   the x- and y-dimension
-! - Revision in control mimic in case of RAN-LES nesting 
-! 
+! - Revision in control mimic in case of RAN-LES nesting
+!
 ! 2938 2018-03-27 15:52:42Z suehring
-! Apply turbulence generator at all non-cyclic lateral boundaries in case of 
-! realistic Inifor large-scale forcing or RANS-LES nesting 
-! 
+! Apply turbulence generator at all non-cyclic lateral boundaries in case of
+! realistic Inifor large-scale forcing or RANS-LES nesting
+!
 ! 2936 2018-03-27 14:49:27Z suehring
-! variable named found has been introduced for checking if restart data was found, 
-! reading of restart strings has been moved completely to read_restart_data_mod, 
-! redundant skipping function has been removed, stg_read/write_restart_data 
-! have been renamed to stg_r/wrd_global, stg_rrd_global is called in 
+! variable named found has been introduced for checking if restart data was found,
+! reading of restart strings has been moved completely to read_restart_data_mod,
+! redundant skipping function has been removed, stg_read/write_restart_data
+! have been renamed to stg_r/wrd_global, stg_rrd_global is called in
 ! read_restart_data_mod now, flag syn_turb_gen_prerun and marker *** end stg
-! *** have been removed (Giersch), strings and their respective lengths are 
-! written out and read now in case of restart runs to get rid of prescribed 
-! character lengths (Giersch), CASE DEFAULT was added if restart data is read 
-! 
+! *** have been removed (Giersch), strings and their respective lengths are
+! written out and read now in case of restart runs to get rid of prescribed
+! character lengths (Giersch), CASE DEFAULT was added if restart data is read
+!
 ! 2841 2018-02-27 15:02:57Z suehring
 ! Bugfix: wrong placement of include 'mpif.h' corrected
-! 
+!
 ! 2836 2018-02-26 13:40:05Z Giersch
-! The variables synthetic_turbulence_generator and 
+! The variables synthetic_turbulence_generator and
 ! use_synthetic_turbulence_generator have been abbreviated + syn_turb_gen_prerun
 ! flag is used to define if module related parameters were outputted as restart
-! data 
-! 
+! data
+!
 ! 2716 2017-12-29 16:35:59Z kanani
 ! Corrected "Former revisions" section
-! 
+!
 ! 2696 2017-12-14 17:12:51Z kanani
 ! Change in file header (GPL part)
@@ -68,16 +71,16 @@
 ! unit number for file containing turbulence generator data changed to 90
 ! bugfix: preprocessor directives added for MPI specific code
-! 
+!
 ! 2576 2017-10-24 13:49:46Z Giersch
-! Definition of a new function called stg_skip_global to skip module 
+! Definition of a new function called stg_skip_global to skip module
 ! parameters during reading restart data
-! 
+!
 ! 2563 2017-10-19 15:36:10Z Giersch
 ! stg_read_restart_data is called in stg_parin in the case of a restart run
-! 
+!
 ! 2259 2017-06-08 09:09:11Z gronemeier
 ! Initial revision
 !
-! 
+!
 !
 ! Authors:
@@ -148,8 +151,8 @@
     LOGICAL :: use_syn_turb_gen = .FALSE.           !< switch to use synthetic turbulence generator
 
-    INTEGER(iwp) ::  id_stg_left        !< left lateral boundary core id in case of turbulence generator  
-    INTEGER(iwp) ::  id_stg_north       !< north lateral boundary core id in case of turbulence generator  
-    INTEGER(iwp) ::  id_stg_right       !< right lateral boundary core id in case of turbulence generator  
-    INTEGER(iwp) ::  id_stg_south       !< south lateral boundary core id in case of turbulence generator  
+    INTEGER(iwp) ::  id_stg_left        !< left lateral boundary core id in case of turbulence generator
+    INTEGER(iwp) ::  id_stg_north       !< north lateral boundary core id in case of turbulence generator
+    INTEGER(iwp) ::  id_stg_right       !< right lateral boundary core id in case of turbulence generator
+    INTEGER(iwp) ::  id_stg_south       !< south lateral boundary core id in case of turbulence generator
     INTEGER(iwp) ::  stg_type_xz        !< MPI type for full z range
     INTEGER(iwp) ::  stg_type_xz_small  !< MPI type for small z range
@@ -158,8 +161,8 @@
     INTEGER(iwp) ::  merg               !< maximum length scale (in gp)
     INTEGER(iwp) ::  mergp              !< merg + nbgp
-    INTEGER(iwp) ::  nzb_x_stg          !< 
-    INTEGER(iwp) ::  nzt_x_stg          !< 
-    INTEGER(iwp) ::  nzb_y_stg          !< 
-    INTEGER(iwp) ::  nzt_y_stg          !< 
+    INTEGER(iwp) ::  nzb_x_stg          !< lower bound of z coordinate (required for transposing z on PEs along x)
+    INTEGER(iwp) ::  nzt_x_stg          !< upper bound of z coordinate (required for transposing z on PEs along x)
+    INTEGER(iwp) ::  nzb_y_stg          !< lower bound of z coordinate (required for transposing z on PEs along y)
+    INTEGER(iwp) ::  nzt_y_stg          !< upper bound of z coordinate (required for transposing z on PEs along y)
 
     REAL(wp) :: mc_factor    !< mass flux correction factor
@@ -325,5 +328,5 @@
     IF ( use_syn_turb_gen )  THEN
 
-       IF ( .NOT. forcing  .AND.  .NOT. nest_domain )  THEN 
+       IF ( .NOT. forcing  .AND.  .NOT. nest_domain )  THEN
 
           IF ( INDEX( initializing_actions, 'set_constant_profiles' ) == 0     &
@@ -446,5 +449,5 @@
     REAL(wp) :: lwy     !< length scale for w in y direction
     REAL(wp) :: lwz     !< length scale for w in z direction
-    REAL(wp) :: nnz     !< increment used to determine processor decomposition of z-axis along x and y direction  
+    REAL(wp) :: nnz     !< increment used to determine processor decomposition of z-axis along x and y direction
     REAL(wp) :: zz      !< height
 
@@ -482,5 +485,5 @@
     nzt_x_stg = ( myidx + 1 ) * INT( nnz )
 
-    IF ( MOD( nz , pdims(1) ) /= 0  .AND.  myidx == id_stg_right )             &  
+    IF ( MOD( nz , pdims(1) ) /= 0  .AND.  myidx == id_stg_right )             &
        nzt_x_stg = nzt_x_stg + myidx * ( nnz - INT( nnz ) )
 !        nzt_x_stg = myidx * nnz + MOD( nz , pdims(1) )
@@ -493,5 +496,5 @@
 
        IF ( MOD( nz , pdims(2) ) /= 0  .AND.  myidy == id_stg_north )          &
-          nzt_y_stg = nzt_y_stg + myidy * ( nnz - INT( nnz ) )  
+          nzt_y_stg = nzt_y_stg + myidy * ( nnz - INT( nnz ) )
 !           nzt_y_stg = myidy * nnz + MOD( nz , pdims(2) )
     ENDIF
@@ -503,6 +506,6 @@
     extent = 1 * realsize
 !
-!-- Set-up MPI datatyp to involve all cores for turbulence generation at yz 
-!-- layer 
+!-- Set-up MPI datatyp to involve all cores for turbulence generation at yz
+!-- layer
 !-- stg_type_yz: yz-slice with vertical bounds nzb:nzt+1
     CALL MPI_TYPE_CREATE_SUBARRAY( 2, [nzt-nzb+2,nyng-nysg+1],                 &
@@ -529,6 +532,6 @@
     ENDDO
 !
-!-- Set-up MPI datatyp to involve all cores for turbulence generation at xz 
-!-- layer 
+!-- Set-up MPI datatyp to involve all cores for turbulence generation at xz
+!-- layer
 !-- stg_type_xz: xz-slice with vertical bounds nzb:nzt+1
     IF ( forcing  .OR.  ( nest_domain .AND.  rans_mode_parent  .AND.           &
@@ -615,13 +618,13 @@
 
        CLOSE( 90 )
-   
+
     ELSE
 !
-!--    Set-up defaul length scales. Assume exponentially decreasing length 
-!--    scales and isotropic turbulence. 
-!--    Typical length (time) scales of 100 m (s) should be a good compromise 
-!--    between all stratrifications. Near-surface variances are fixed to 
+!--    Set-up defaul length scales. Assume exponentially decreasing length
+!--    scales and isotropic turbulence.
+!--    Typical length (time) scales of 100 m (s) should be a good compromise
+!--    between all stratrifications. Near-surface variances are fixed to
 !--    0.1 m2/s2, vertical fluxes are one order of magnitude smaller.
-!--    Vertical fluxes  
+!--    Vertical fluxes
        length_scale_surface = 100.0_wp
        r_ii_0               = 0.1_wp
@@ -683,5 +686,5 @@
 !
 !-- Assign initial profiles
-    IF ( .NOT. forcing  .AND.  .NOT.  nest_domain )  THEN 
+    IF ( .NOT. forcing  .AND.  .NOT.  nest_domain )  THEN
        u_init = mean_inflow_profiles(:,1)
        v_init = mean_inflow_profiles(:,2)
@@ -959,9 +962,9 @@
     IMPLICIT NONE
 
-    LOGICAL, INTENT(OUT)  ::  found 
+    LOGICAL, INTENT(OUT)  ::  found
 
 
     found = .TRUE.
- 
+
 
     SELECT CASE ( restart_string(1:length) )
@@ -974,5 +977,5 @@
        CASE DEFAULT
 
-          found = .FALSE.   
+          found = .FALSE.
 
     END SELECT
@@ -1166,5 +1169,5 @@
 !--    This correction factor insures that the mass flux is preserved at the
 !--    inflow boundary
-       IF ( .NOT. forcing  .AND.  .NOT. nest_domain )  THEN 
+       IF ( .NOT. forcing  .AND.  .NOT. nest_domain )  THEN
           mc_factor_l = 0.0_wp
           mc_factor   = 0.0_wp
@@ -1210,10 +1213,10 @@
              DO  k = nzb+1, nzt
                 volume_flow_l = volume_flow_l + u(k,j,i) * dzw(k) * dy         &
-                                     * MERGE( 1.0_wp, 0.0_wp,                  &   
+                                     * MERGE( 1.0_wp, 0.0_wp,                  &
                                               BTEST( wall_flags_0(k,j,i), 1 ) )
 
                 mc_factor_l = mc_factor_l     + ( u(k,j,i) + dist_yz(k,j,1) )  &
                                                          * dzw(k) * dy         &
-                                     * MERGE( 1.0_wp, 0.0_wp,                  &   
+                                     * MERGE( 1.0_wp, 0.0_wp,                  &
                                               BTEST( wall_flags_0(k,j,i), 1 ) )
              ENDDO
@@ -1329,10 +1332,10 @@
           DO  k = nzb+1, nzt
              volume_flow_l = volume_flow_l + v(k,j,i) * dzw(k) * dx            &
-                                  * MERGE( 1.0_wp, 0.0_wp,                     &   
+                                  * MERGE( 1.0_wp, 0.0_wp,                     &
                                            BTEST( wall_flags_0(k,j,i), 2 ) )
 
              mc_factor_l = mc_factor_l     + ( v(k,j,i) + dist_xz(k,i,2) )     &
                                                       * dzw(k) * dx            &
-                                  * MERGE( 1.0_wp, 0.0_wp,                     &   
+                                  * MERGE( 1.0_wp, 0.0_wp,                     &
                                            BTEST( wall_flags_0(k,j,i), 2 ) )
           ENDDO
