Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 1678)
+++ palm/trunk/SOURCE/modules.f90	(revision 1682)
@@ -1,4 +1,3 @@
- MODULE advection
-
+!> @file modules.f90
 !--------------------------------------------------------------------------------!
 ! This file is part of PALM.
@@ -20,5 +19,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Code annotations made doxygen readable 
 ! 
 ! Former revisions:
@@ -300,6 +299,8 @@
 ! Description:
 ! ------------
-! Definition of variables for special advection schemes
-!------------------------------------------------------------------------------!
+!> Definition of variables for special advection schemes.
+!------------------------------------------------------------------------------!
+ MODULE advection
+ 
     USE kinds
 
@@ -311,13 +312,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of all arrays defined on the computational grid.
+!------------------------------------------------------------------------------!
  MODULE arrays_3d
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of all arrays defined on the computational grid
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -380,13 +378,11 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of variables needed for time-averaging of 2d/3d data.
+!------------------------------------------------------------------------------!
  MODULE averaging
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables needed for time-averaging of 2d/3d data
-!------------------------------------------------------------------------------!
+ 
     USE kinds
 
@@ -403,12 +399,11 @@
 
 
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of variables and constants for cloud physics.
+!------------------------------------------------------------------------------!
  MODULE cloud_parameters
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables and constants for cloud physics
-!------------------------------------------------------------------------------!
+ 
     USE kinds
 
@@ -418,65 +413,65 @@
                 
 
-    REAL(wp) ::  a_1 = 8.69E-4_wp,     & !: coef. in turb. parametrization (cm-2 s3)
-                 a_2 = -7.38E-5_wp,    & !: coef. in turb. parametrization (cm-2 s3)
-                 a_3 = -1.40E-2_wp,    & !: coef. in turb. parametrization
-                 a_term = 9.65_wp,     & !: coef. for terminal velocity (m s-1)
-                 a_vent = 0.78_wp,     & !: coef. for ventilation effect
-                 b_1 = 11.45E-6_wp,    & !: coef. in turb. parametrization (m)
-                 b_2 = 9.68E-6_wp,     & !: coef. in turb. parametrization (m)
-                 b_3 = 0.62_wp,        & !: coef. in turb. parametrization
-                 b_term = 9.8_wp,      & !: coef. for terminal velocity (m s-1)
-                 b_vent = 0.308_wp,    & !: coef. for ventilation effect
-                 beta_cc = 3.09E-4_wp, & !: coef. in turb. parametrization (cm-2 s3)
-                 bfactor,              & !: solution effect on diffusional growth
-                 c_1 = 4.82E-6_wp,     & !: coef. in turb. parametrization (m)
-                 c_2 = 4.8E-6_wp,      & !: coef. in turb. parametrization (m)
-                 c_3 = 0.76_wp,        & !: coef. in turb. parametrization
-                 c_const = 0.93_wp,    & !: const. in Taylor-microscale Reynolds number
-                 c_evap = 0.7_wp,      & !: constant in evaporation
-                 c_sedimentation = 2.0_wp, & !: Courant number of sedimentation process
-                 c_term = 600.0_wp,    & !: coef. for terminal velocity (m-1)
-                 cof(6) = (/ 76.18009172947146_wp,      & !: coefficients in the 
-                             -86.50532032941677_wp,     & !: numerical
-                             24.01409824083091_wp,      & !: calculation of the
-                             -1.231739572450155_wp,     & !: gamma function
+    REAL(wp) ::  a_1 = 8.69E-4_wp,     & !< coef. in turb. parametrization (cm-2 s3)
+                 a_2 = -7.38E-5_wp,    & !< coef. in turb. parametrization (cm-2 s3)
+                 a_3 = -1.40E-2_wp,    & !< coef. in turb. parametrization
+                 a_term = 9.65_wp,     & !< coef. for terminal velocity (m s-1)
+                 a_vent = 0.78_wp,     & !< coef. for ventilation effect
+                 b_1 = 11.45E-6_wp,    & !< coef. in turb. parametrization (m)
+                 b_2 = 9.68E-6_wp,     & !< coef. in turb. parametrization (m)
+                 b_3 = 0.62_wp,        & !< coef. in turb. parametrization
+                 b_term = 9.8_wp,      & !< coef. for terminal velocity (m s-1)
+                 b_vent = 0.308_wp,    & !< coef. for ventilation effect
+                 beta_cc = 3.09E-4_wp, & !< coef. in turb. parametrization (cm-2 s3)
+                 bfactor,              & !< solution effect on diffusional growth
+                 c_1 = 4.82E-6_wp,     & !< coef. in turb. parametrization (m)
+                 c_2 = 4.8E-6_wp,      & !< coef. in turb. parametrization (m)
+                 c_3 = 0.76_wp,        & !< coef. in turb. parametrization
+                 c_const = 0.93_wp,    & !< const. in Taylor-microscale Reynolds number
+                 c_evap = 0.7_wp,      & !< constant in evaporation
+                 c_sedimentation = 2.0_wp, & !< Courant number of sedimentation process
+                 c_term = 600.0_wp,    & !< coef. for terminal velocity (m-1)
+                 cof(6) = (/ 76.18009172947146_wp,      & !< coefficients in the 
+                             -86.50532032941677_wp,     & !< numerical
+                             24.01409824083091_wp,      & !< calculation of the
+                             -1.231739572450155_wp,     & !< gamma function
                              0.1208650973866179E-2_wp,  &
                              -0.5395239384953E-5_wp /), &
-                cp = 1005.0_wp,       & !: heat capacity of dry air (J kg-1 K-1) 
-                diff_coeff_l = 0.23E-4_wp, & !: diffusivity of water vapor (m2 s-1)
-                effective_coll_efficiency, & !: effective collision efficiency
-                eps_ros = 1.0E-4_wp,  & !: accuracy of Rosenbrock method
-                eps_sb = 1.0E-20_wp,  & !: threshold in two-moments scheme
-                k_cc = 9.44E09_wp,    & !: const. cloud-cloud kernel (m3 kg-2 s-1) 
-                k_cr0 = 4.33_wp,      & !: const. cloud-rain kernel (m3 kg-1 s-1) 
-                k_rr = 7.12_wp,       & !: const. rain-rain kernel (m3 kg-1 s-1) 
-                k_br = 1000._wp,      & !: const. in breakup parametrization (m-1)
-                k_st = 1.2E8_wp,      & !: const. in drizzle parametrization (m-1 s-1)
-                kappa_rr = 60.7_wp,   & !: const. in collision kernel (kg-1/3)
-                kin_vis_air = 1.4086E-5_wp, & !: kin. viscosity of air (m2 s-1)
-                l_v = 2.5E+06_wp,     & !: latent heat of vaporization (J kg-1)
-                l_d_cp, l_d_r, l_d_rv, & !: l_v / cp, l_v / r_d, l_v / r_v
-                mass_of_solute = 1.0E-17_wp, & !: soluted NaCl (kg)
-                molecular_weight_of_solute = 0.05844_wp, & !: mol. m. NaCl (kg mol-1)
-                molecular_weight_of_water = 0.01801528_wp, & !: mol. m. H2O (kg mol-1)
-                nc_const = 70.0E6_wp, & !: cloud droplet concentration
-                prec_time_const = 0.001_wp, & !: coef. in Kessler scheme
-                pirho_l, dpirho_l, & !: pi * rho_l / 6.0; 6.0 / ( pi * rho_l )
-                rho_l = 1.0E3_wp,     & !: density of water (kg m-3)
-                ql_crit = 0.0005_wp,  & !: coef. in Kessler scheme
-                r_d = 287.0_wp,       & !: sp. gas const. dry air (J kg-1 K-1)
-                r_v = 461.51_wp,      & !: sp. gas const. water vapor (J kg-1 K-1)
-                schmidt = 0.71_wp,    & !: Schmidt number
-                schmidt_p_1d3,        & !: schmidt**( 1.0 / 3.0 )
-                sed_qc_const,         & !: const. for sedimentation of cloud water
-                sigma_gc = 1.3_wp,    & !: log-normal geometric standard deviation
-                stp = 2.5066282746310005_wp, & !: parameter in gamma function
-                thermal_conductivity_l = 2.43E-2_wp, & !: therm. cond. air (J m-1 s-1 K-1)
-                vanthoff = 2.0_wp,    & !: van't Hoff factor for NaCl
-                x0 = 2.6E-10_wp,      & !: separating drop mass (kg)
-                xrmin = 2.6E-10_wp,   & !: minimum rain drop size (kg)
-                xrmax = 5.0E-6_wp,    & !: maximum rain drop site (kg)
-                dt_precipitation = 100.0_wp, & !: timestep precipitation (s)
-                w_precipitation = 9.65_wp      !: maximum terminal velocity (m s-1)
+                cp = 1005.0_wp,       & !< heat capacity of dry air (J kg-1 K-1) 
+                diff_coeff_l = 0.23E-4_wp, & !< diffusivity of water vapor (m2 s-1)
+                effective_coll_efficiency, & !< effective collision efficiency
+                eps_ros = 1.0E-4_wp,  & !< accuracy of Rosenbrock method
+                eps_sb = 1.0E-20_wp,  & !< threshold in two-moments scheme
+                k_cc = 9.44E09_wp,    & !< const. cloud-cloud kernel (m3 kg-2 s-1) 
+                k_cr0 = 4.33_wp,      & !< const. cloud-rain kernel (m3 kg-1 s-1) 
+                k_rr = 7.12_wp,       & !< const. rain-rain kernel (m3 kg-1 s-1) 
+                k_br = 1000._wp,      & !< const. in breakup parametrization (m-1)
+                k_st = 1.2E8_wp,      & !< const. in drizzle parametrization (m-1 s-1)
+                kappa_rr = 60.7_wp,   & !< const. in collision kernel (kg-1/3)
+                kin_vis_air = 1.4086E-5_wp, & !< kin. viscosity of air (m2 s-1)
+                l_v = 2.5E+06_wp,     & !< latent heat of vaporization (J kg-1)
+                l_d_cp, l_d_r, l_d_rv, & !< l_v / cp, l_v / r_d, l_v / r_v
+                mass_of_solute = 1.0E-17_wp, & !< soluted NaCl (kg)
+                molecular_weight_of_solute = 0.05844_wp, & !< mol. m. NaCl (kg mol-1)
+                molecular_weight_of_water = 0.01801528_wp, & !< mol. m. H2O (kg mol-1)
+                nc_const = 70.0E6_wp, & !< cloud droplet concentration
+                prec_time_const = 0.001_wp, & !< coef. in Kessler scheme
+                pirho_l, dpirho_l, & !< pi * rho_l / 6.0; 6.0 / ( pi * rho_l )
+                rho_l = 1.0E3_wp,     & !< density of water (kg m-3)
+                ql_crit = 0.0005_wp,  & !< coef. in Kessler scheme
+                r_d = 287.0_wp,       & !< sp. gas const. dry air (J kg-1 K-1)
+                r_v = 461.51_wp,      & !< sp. gas const. water vapor (J kg-1 K-1)
+                schmidt = 0.71_wp,    & !< Schmidt number
+                schmidt_p_1d3,        & !< schmidt**( 1.0 / 3.0 )
+                sed_qc_const,         & !< const. for sedimentation of cloud water
+                sigma_gc = 1.3_wp,    & !< log-normal geometric standard deviation
+                stp = 2.5066282746310005_wp, & !< parameter in gamma function
+                thermal_conductivity_l = 2.43E-2_wp, & !< therm. cond. air (J m-1 s-1 K-1)
+                vanthoff = 2.0_wp,    & !< van't Hoff factor for NaCl
+                x0 = 2.6E-10_wp,      & !< separating drop mass (kg)
+                xrmin = 2.6E-10_wp,   & !< minimum rain drop size (kg)
+                xrmax = 5.0E-6_wp,    & !< maximum rain drop site (kg)
+                dt_precipitation = 100.0_wp, & !< timestep precipitation (s)
+                w_precipitation = 9.65_wp      !< maximum terminal velocity (m s-1)
 
     REAL(wp), DIMENSION(:), ALLOCATABLE     ::  hyrho, pt_d_t, t_d_pt  
@@ -493,13 +488,11 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of general constants.
+!------------------------------------------------------------------------------!
  MODULE constants
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of general constants
-!------------------------------------------------------------------------------!
+ 
     USE kinds
 
@@ -512,14 +505,12 @@
  END MODULE constants
 
-
-
-
+ 
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of parameters for program control
+!------------------------------------------------------------------------------!
  MODULE control_parameters
 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of parameters for program control
-!------------------------------------------------------------------------------!
     USE kinds
 
@@ -821,12 +812,10 @@
 
 
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of variables used with dvrp-software.
+!------------------------------------------------------------------------------!
  MODULE dvrp_variables
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables used with dvrp-software
-!------------------------------------------------------------------------------!
 
      USE kinds
@@ -941,13 +930,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of grid spacings.
+!------------------------------------------------------------------------------!
  MODULE grid_variables
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of grid spacings
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -967,13 +953,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of array bounds, number of gridpoints, and wall flag arrays.
+!------------------------------------------------------------------------------!
  MODULE indices
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of array bounds, number of gridpoints, and wall flag arrays
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -1015,16 +998,18 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Interfaces for special subroutines which use optional parameters.
+!------------------------------------------------------------------------------!
  MODULE interfaces
 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Interfaces for special subroutines which use optional parameters
-!------------------------------------------------------------------------------!
-
     INTERFACE
 
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> @todo Missing subroutine description.
+!------------------------------------------------------------------------------!
        SUBROUTINE global_min_max ( i1, i2, j1, j2, k1, k2, feld, mode, offset, &
                                    wert, wert_ijk, wert1, wert1_ijk )
@@ -1049,16 +1034,19 @@
 
 
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Interfaces for subroutines with pointer arguments called in
+!> prognostic_equations.
+!------------------------------------------------------------------------------!
  MODULE pointer_interfaces
 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Interfaces for subroutines with pointer arguments called in
-! prognostic_equations
-!------------------------------------------------------------------------------!
-
     INTERFACE
 
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> @todo Missing subroutine description.
+!------------------------------------------------------------------------------!
        SUBROUTINE advec_s_bc( sk, sk_char )
 
@@ -1081,13 +1069,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of variables for the 1D-model.
+!------------------------------------------------------------------------------!
  MODULE model_1d
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables for the 1D-model
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -1114,13 +1099,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of parameters and variables for netcdf control.
+!------------------------------------------------------------------------------!
  MODULE netcdf_control
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of parameters and variables for netcdf control.
-!------------------------------------------------------------------------------!
 
     USE control_parameters, ONLY: max_masks
@@ -1263,15 +1245,12 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of variables which define processor topology and the exchange of
+!> ghost point layers. This modules must be placed in all routines which contain
+!> MPI-calls.
+!------------------------------------------------------------------------------!
  MODULE pegrid
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables which define processor topology and the exchange of
-! ghost point layers. This modules must be placed in all routines which contain
-! MPI-calls.
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -1334,13 +1313,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of variables which control PROFIL-output.
+!------------------------------------------------------------------------------!
  MODULE profil_parameter
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables which control PROFIL-output
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -1392,13 +1368,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of quantities used for computing spectra.
+!------------------------------------------------------------------------------!
  MODULE spectrum
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of quantities used for computing spectra
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -1443,13 +1416,10 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of statistical quantities, e.g. global sums.
+!------------------------------------------------------------------------------!
  MODULE statistics
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of statistical quantities, e.g. global sums
-!------------------------------------------------------------------------------!
 
     USE kinds
@@ -1474,6 +1444,6 @@
                                                   sums_ls_l
                                               
-    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE   ::  hom_sum, rmask, spectrum_x, &
-                                                  spectrum_y, sums_l, sums_l_l, &
+    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE   ::  hom_sum, rmask, spectrum_x,     &
+                                                  spectrum_y, sums_l, sums_l_l,   &
                                                   sums_up_fraction_l
     REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  hom
@@ -1484,20 +1454,16 @@
 
 
-
-
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Definition of indices for transposed arrays.
+!------------------------------------------------------------------------------!
  MODULE transpose_indices
 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of indices for transposed arrays
-!------------------------------------------------------------------------------!
-
     USE kinds
 
-    INTEGER(iwp) ::  nxl_y, nxl_yd, nxl_z, nxr_y, nxr_yd, nxr_z, nyn_x, nyn_z,      &
+    INTEGER(iwp) ::  nxl_y, nxl_yd, nxl_z, nxr_y, nxr_yd, nxr_z, nyn_x, nyn_z, &
                      nys_x, nys_z, nzb_x, nzb_y, nzb_yd, nzt_x, nzt_y, nzt_yd
                 
-
     SAVE
 
