source: palm/trunk/SOURCE/user_spectra.f90 @ 2000

Last change on this file since 2000 was 2000, checked in by knoop, 8 years ago

Forced header and separation lines into 80 columns

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1!> @file user_spectra.f90
2!------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2016 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! Forced header and separation lines into 80 columns
23!
24! Former revisions:
25! -----------------
26! $Id: user_spectra.f90 2000 2016-08-20 18:09:15Z knoop $
27!
28! 1960 2016-07-12 16:34:24Z suehring
29! Consider additional spectra for passive scalar
30!
31! 1833 2016-04-07 14:23:03Z raasch
32! spectrum renamed spectra_mod
33!
34! 1682 2015-10-07 23:56:08Z knoop
35! Code annotations made doxygen readable 
36!
37! 1320 2014-03-20 08:40:49Z raasch
38! kind-parameters added to all INTEGER and REAL declaration statements,
39! kinds are defined in new module kinds,
40! old module precision_kind is removed,
41! revision history before 2012 removed,
42! comment fields (!:) to be used for variable explanations added to
43! all variable declaration statements
44!
45! 1036 2012-10-22 13:43:42Z raasch
46! code put under GPL (PALM 3.9)
47!
48! 211 2008-11-11 04:46:24Z raasch
49! Former file user_interface.f90 split into one file per subroutine
50!
51! Description:
52! ------------
53!> Calculation of user-defined spectra.
54!> See section 3.5.4 on how to define, calculate, and output user defined
55!> quantities.
56!------------------------------------------------------------------------------!
57 SUBROUTINE user_spectra( mode, m, pr )
58 
59
60    USE arrays_3d
61   
62    USE control_parameters
63   
64    USE indices
65   
66    USE kinds
67   
68    USE spectra_mod
69   
70    USE statistics
71   
72    USE user
73
74    IMPLICIT NONE
75
76    CHARACTER (LEN=*) ::  mode
77
78    INTEGER(iwp) ::  i    !<
79    INTEGER(iwp) ::  j    !<
80    INTEGER(iwp) ::  k    !<
81    INTEGER(iwp) ::  m    !<
82    INTEGER(iwp) ::  pr   !<
83
84
85!
86!-- Sample on how to calculate spectra of user-defined quantities.
87!-- Each quantity is identified by the corresponding user profile index
88!-- "pr_palm+#" where "#" is an integer starting from 1. These
89!-- user-profile-numbers must also be assigned to the respective strings
90!-- given by data_output_pr_user in routine user_check_data_output_pr.
91    IF ( mode == 'preprocess' )  THEN
92
93       SELECT CASE ( TRIM( data_output_sp(m) ) )
94         
95          CASE ( 'u', 'v', 'w', 'pt', 'q', 's' )
96!--          Not allowed here since these are the standard quantities used in
97!--          preprocess_spectra.
98       
99!          CASE ( 'u*v*' )
100!             pr = pr_palm+1
101!             d(nzb+1:nzt,nys:nyn,nxl:nxr) = ustvst(nzb+1:nzt,nys:nyn,nxl:nxr)
102       
103          CASE DEFAULT
104             message_string = 'Spectra of ' //                                 &
105                         TRIM( data_output_sp(m) ) // ' can not be calculated'
106             CALL message( 'user_spectra', 'UI0010', 0, 0, 0, 6, 0 )
107           
108       END SELECT
109
110    ELSEIF ( mode == 'data_output' )  THEN
111
112       SELECT CASE ( TRIM( data_output_sp(m) ) )
113
114          CASE ( 'u', 'v', 'w', 'pt', 'q', 's' )
115!--          Not allowed here since these are the standard quantities used in
116!--          data_output_spectra.
117
118!          CASE ( 'u*v*' )
119!             pr = 6
120
121          CASE DEFAULT
122             message_string = 'Spectra of ' //                                 &
123                              TRIM( data_output_sp(m) ) // ' are not defined'
124             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
125             
126          END SELECT
127
128    ENDIF
129
130 END SUBROUTINE user_spectra
131
Note: See TracBrowser for help on using the repository browser.