Index: palm/trunk/SOURCE/data_output_spectra.f90
===================================================================
--- palm/trunk/SOURCE/data_output_spectra.f90	(revision 1319)
+++ palm/trunk/SOURCE/data_output_spectra.f90	(revision 1320)
@@ -20,5 +20,10 @@
 ! 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,
+! revision history before 2012 removed,
+! comment fields (!:) to be used for variable explanations added to
+! all variable declaration statements
 !
 ! Former revisions:
@@ -34,19 +39,4 @@
 ! 964 2012-07-26 09:14:24Z raasch
 ! code for profil-output removed
-!
-! 291 2009-04-16 12:07:26Z raasch
-! simulated_time in NetCDF output replaced by time_since_reference_point.
-! Output of NetCDF messages with aid of message handling routine.
-! Output of messages replaced by message handling routine.
-!
-! 189 2008-08-13 17:09:26Z letzel
-! allow 100 spectra levels instead of 10 for consistency with
-! define_netcdf_header, +user-defined spectra
-!
-! February 2007
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.7  2006/04/11 14:56:38  raasch
-! pl_spectra renamed data_output_sp
 !
 ! Revision 1.1  2001/01/05 15:14:20  raasch
@@ -61,17 +51,32 @@
 #if defined( __spectra )
 
-    USE arrays_3d
-    USE control_parameters
-    USE cpulog
+    USE control_parameters,                                                    &
+        ONLY:  average_count_sp, averaging_interval_sp, dosp_time_count
+
+    USE cpulog,                                                                &
+        ONLY:  cpu_log, log_point
+
+    USE kinds
+
     USE netcdf_control
+
     USE pegrid
-    USE spectrum
-    USE statistics
+
+    USE spectrum,                                                              &
+        ONLY:  data_output_sp
+
+    USE statistics,                                                            &
+        ONLY:  spectrum_x, spectrum_y
 
 
     IMPLICIT NONE
 
-    INTEGER :: m, pr, cranz_x, cranz_y
-    LOGICAL :: frame_x, frame_y
+    INTEGER(iwp) ::  cranz_x !:
+    INTEGER(iwp) ::  cranz_y !:
+    INTEGER(iwp) ::  m       !:
+    INTEGER(iwp) ::  pr      !:
+    
+    LOGICAL      ::  frame_x !: 
+    LOGICAL      ::  frame_y !:
 
     CALL cpu_log( log_point(31), 'data_output_spectra', 'start' )
@@ -183,24 +188,39 @@
 #if defined( __netcdf )
 
-    USE constants
-    USE control_parameters
-    USE grid_variables
-    USE indices
+    USE constants,                                                             &
+        ONLY:  pi
+
+    USE control_parameters,                                                    &
+        ONLY:  dosp_time_count
+
+    USE grid_variables,                                                        &
+        ONLY:  dx, dy
+
+    USE indices,                                                               &
+        ONLY:  nx, ny
+
+    USE kinds
+
     USE netcdf_control
-    USE spectrum
-    USE statistics
+
+    USE spectrum,                                                              &
+        ONLY:  n_sp_x, n_sp_y
+
+    USE statistics,                                                            &
+        ONLY:  spectrum_x, spectrum_y
 
     IMPLICIT NONE
 
-    CHARACTER (LEN=1), INTENT(IN) ::  direction
-
-    INTEGER, INTENT(IN) ::  nsp
-
-    INTEGER ::  i, k
-
-    REAL ::  frequency
-
-    REAL, DIMENSION(nx/2) ::  netcdf_data_x
-    REAL, DIMENSION(ny/2) ::  netcdf_data_y
+    CHARACTER (LEN=1), INTENT(IN) ::  direction     !:
+
+    INTEGER(iwp), INTENT(IN)      ::  nsp           !:
+
+    INTEGER(iwp)                  ::  i             !:
+    INTEGER(iwp)                  ::  k             !:
+
+    REAL(wp)                      ::  frequency     !:
+
+    REAL(wp), DIMENSION(nx/2)     ::  netcdf_data_x !:
+    REAL(wp), DIMENSION(ny/2)     ::  netcdf_data_y !:
 
 
@@ -248,36 +268,72 @@
  SUBROUTINE data_output_spectra_x( m, cranz, pr, frame_written )
 
-    USE arrays_3d
-    USE constants
-    USE control_parameters
-    USE grid_variables
-    USE indices
+    USE constants,                                                             &
+        ONLY:  pi
+
+    USE control_parameters,                                                    &
+        ONLY:  averaging_interval_sp
+
+    USE grid_variables,                                                        &
+        ONLY:  dx
+
+    USE indices,                                                               &
+        ONLY:  nx
+
+    USE kinds
+
     USE pegrid
-    USE singleton
-    USE spectrum
-    USE statistics
-    USE transpose_indices
+
+    USE spectrum,                                                              &
+        ONLY:  comp_spectra_level, n_sp_x, plot_spectra_level
 
     IMPLICIT NONE
 
-    CHARACTER (LEN=30) ::  atext
-    INTEGER            ::  i, j, k, m, pr
-    LOGICAL            ::  frame_written
-    REAL               ::  frequency = 0.0
-
+    CHARACTER (LEN=30) ::  atext !:
+    
+    INTEGER(iwp)       ::  i     !:
+    INTEGER(iwp)       ::  j     !:
+    INTEGER(iwp)       ::  k     !:
+    INTEGER(iwp)       ::  m     !:
+    INTEGER(iwp)       ::  pr    !:
+    
+    LOGICAL            ::  frame_written   !:
+    
+    REAL(wp)           ::  frequency = 0.0 !:
 !
 !-- Variables needed for PROFIL-namelist
-    INTEGER                  :: cranz, labforx = 3, labfory = 3, legpos = 3, &
-                                timodex = 1
-    INTEGER, DIMENSION(1:100):: cucol = 1, klist = 999999, lstyle = 0
-    LOGICAL                  :: datleg = .TRUE., grid = .TRUE., &
-                                lclose = .TRUE., rand = .TRUE., &
-                                swap = .TRUE., twoxa = .TRUE.,  &
-                                xlog = .TRUE., ylog = .TRUE.
-    CHARACTER (LEN=80)       :: rtext, utext, xtext = 'k in m>->1', ytext
-    REAL                     :: gwid = 0.1, rlegfak = 0.7, uxmin, uxmax, &
-                                uymin, uymax
-    REAL, DIMENSION(1:100)   :: lwid = 0.6
-    REAL, DIMENSION(100)     :: uyma, uymi
+    CHARACTER (LEN=80) ::  rtext                !:
+    CHARACTER (LEN=80) ::  utext                !:
+    CHARACTER (LEN=80) ::  xtext = 'k in m>->1' !:
+    CHARACTER (LEN=80) ::  ytext                !:
+
+    INTEGER(iwp)       ::  cranz       !:
+    INTEGER(iwp)       ::  labforx = 3 !:
+    INTEGER(iwp)       ::  labfory = 3 !:
+    INTEGER(iwp)       ::  legpos  = 3 !:
+    INTEGER(iwp)       ::  timodex = 1 !:
+    
+    INTEGER(iwp), DIMENSION(1:100) ::  cucol  = 1      !:
+    INTEGER(iwp), DIMENSION(1:100) ::  klist  = 999999 !:
+    INTEGER(iwp), DIMENSION(1:100) ::  lstyle = 0      !:
+    
+    LOGICAL ::  datleg = .TRUE. !:
+    LOGICAL ::  grid = .TRUE.   !:
+    LOGICAL ::  lclose = .TRUE. !:
+    LOGICAL ::  rand = .TRUE.   !:
+    LOGICAL ::  swap = .TRUE.   !:
+    LOGICAL ::  twoxa = .TRUE.  !:
+    LOGICAL ::  xlog = .TRUE.   !:
+    LOGICAL ::  ylog = .TRUE.   !:
+    
+    REAL(wp) ::  gwid = 0.1    !:
+    REAL(wp) ::  rlegfak = 0.7 !:
+    REAL(wp) ::  uxmin         !:
+    REAL(wp) ::  uxmax         !:
+    REAL(wp) ::  uymin         !:
+    REAL(wp) ::  uymax         !:
+     
+    REAL(wp), DIMENSION(1:100) ::  lwid = 0.6 !:
+    REAL(wp), DIMENSION(100)   ::  uyma       !:
+    REAL(wp), DIMENSION(100)   ::  uymi       !:
 
     NAMELIST /RAHMEN/  cranz, datleg, rtext, swap
@@ -407,36 +463,74 @@
  SUBROUTINE data_output_spectra_y( m, cranz, pr, frame_written )
 
-    USE arrays_3d
-    USE constants
-    USE control_parameters
-    USE grid_variables
-    USE indices
+    USE constants,                                                             &
+        ONLY:  pi
+
+    USE control_parameters,                                                    &
+        ONLY:  averaging_interval_sp
+
+    USE grid_variables,                                                        &
+        ONLY:  dy
+
+    USE indices,                                                               &
+        ONLY:  ny
+
+    USE kinds
+
     USE pegrid
-    USE singleton
-    USE spectrum
-    USE statistics
-    USE transpose_indices
+
+    USE spectrum  comp_spectra_level, plot_spectra_level
 
     IMPLICIT NONE
 
-    CHARACTER (LEN=30) ::  atext
-    INTEGER            :: i, j, k, m, pr
-    LOGICAL            :: frame_written
-    REAL               :: frequency = 0.0
+    
+    CHARACTER (LEN=30) ::  atext !:
+    
+    INTEGER(iwp)       ::  i     !:
+    INTEGER(iwp)       ::  j     !:
+    INTEGER(iwp)       ::  k     !:
+    INTEGER(iwp)       ::  m     !:
+    INTEGER(iwp)       ::  pr    !:
+    
+    LOGICAL            :: frame_written   !:
+    
+    REAL(wp)           :: frequency = 0.0 !:
 
 !
 !-- Variables needed for PROFIL-namelist
-    INTEGER                  :: cranz, labforx = 3, labfory = 3, legpos = 3, &
-                                timodex = 1
-    INTEGER, DIMENSION(1:100):: cucol = 1, klist = 999999, lstyle = 0
-    LOGICAL                  :: datleg = .TRUE., grid = .TRUE., &
-                                lclose = .TRUE., rand = .TRUE., &
-                                swap = .TRUE., twoxa = .TRUE.,  &
-                                xlog = .TRUE., ylog = .TRUE.
-    CHARACTER (LEN=80)       :: rtext, utext, xtext = 'k in m>->1', ytext
-    REAL                     :: gwid = 0.1, rlegfak = 0.7, uxmin, uxmax, &
-                                uymin, uymax
-    REAL, DIMENSION(1:100)   :: lwid = 0.6
-    REAL, DIMENSION(100)     :: uyma, uymi
+    CHARACTER (LEN=80) ::  rtext                !:
+    CHARACTER (LEN=80) ::  utext                !:
+    CHARACTER (LEN=80) ::  xtext = 'k in m>->1' !:
+    CHARACTER (LEN=80) ::  ytext                !:
+
+    INTEGER(iwp) ::  cranz       !:
+    INTEGER(iwp) ::  labforx = 3 !:
+    INTEGER(iwp) ::  labfory = 3 !:
+    INTEGER(iwp) ::  legpos  = 3 !:
+    INTEGER(iwp) ::  timodex = 1 !:
+    
+    INTEGER(iwp), DIMENSION(1:100) ::  cucol  = 1      !:
+    INTEGER(iwp), DIMENSION(1:100) ::  klist  = 999999 !:
+    INTEGER(iwp), DIMENSION(1:100) ::  lstyle = 0      !:
+    
+    LOGICAL ::  datleg = .TRUE. !:
+    LOGICAL ::  grid = .TRUE.   !:
+    LOGICAL ::  lclose = .TRUE. !:
+    LOGICAL ::  rand = .TRUE.   !:
+    LOGICAL ::  swap = .TRUE.   !:
+    LOGICAL ::  twoxa = .TRUE.  !:
+    LOGICAL ::  xlog = .TRUE.   !:
+    LOGICAL ::  ylog = .TRUE.   !:
+    
+    REAL(wp) ::  gwid = 0.1     !:
+    REAL(wp) ::  rlegfak = 0.7  !:
+    REAL(wp) ::  uxmin          !:
+    REAL(wp) ::  uxmax          !:
+    REAL(wp) ::  uymin          !:
+    REAL(wp) ::  uymax          !:
+    
+    REAL(wp), DIMENSION(1:100) ::  lwid = 0.6 !:
+    
+    REAL(wp), DIMENSION(100)   ::  uyma       !:
+    REAL(wp), DIMENSION(100)   ::  uymi       !:
 
     NAMELIST /RAHMEN/  cranz, datleg, rtext, swap
