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

Last change on this file since 1998 was 1961, checked in by suehring, 8 years ago

last commit documented

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