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

Last change on this file since 1120 was 1037, checked in by raasch, 12 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1 SUBROUTINE user_spectra( mode, m, pr )
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later 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-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22
23!
24! Former revisions:
25! -----------------
26! $Id: user_spectra.f90 1037 2012-10-22 14:10:22Z raasch $
27!
28! 1036 2012-10-22 13:43:42Z raasch
29! code put under GPL (PALM 3.9)
30!
31! 274 2009-03-26 15:11:21Z heinze
32! Output of messages replaced by message handling routine.
33!
34! 211 2008-11-11 04:46:24Z raasch
35! Former file user_interface.f90 split into one file per subroutine
36!
37! Description:
38! ------------
39! Calculation of user-defined spectra.
40! See section 3.5.4 on how to define, calculate, and output user defined
41! quantities.
42!------------------------------------------------------------------------------!
43
44    USE arrays_3d
45    USE control_parameters
46    USE indices
47    USE spectrum
48    USE statistics
49    USE user
50
51    IMPLICIT NONE
52
53    CHARACTER (LEN=*) ::  mode
54
55    INTEGER ::  i, j, k, m, pr
56
57
58!
59!-- Sample on how to calculate spectra of user-defined quantities.
60!-- Each quantity is identified by the corresponding user profile index
61!-- "pr_palm+#" where "#" is an integer starting from 1. These
62!-- user-profile-numbers must also be assigned to the respective strings
63!-- given by data_output_pr_user in routine user_check_data_output_pr.
64    IF ( mode == 'preprocess' )  THEN
65
66       SELECT CASE ( TRIM( data_output_sp(m) ) )
67         
68          CASE ( 'u', 'v', 'w', 'pt', 'q' )
69!--          Not allowed here since these are the standard quantities used in
70!--          preprocess_spectra.
71       
72!          CASE ( 'u*v*' )
73!             pr = pr_palm+1
74!             d(nzb+1:nzt,nys:nyn,nxl:nxr) = ustvst(nzb+1:nzt,nys:nyn,nxl:nxr)
75       
76          CASE DEFAULT
77             message_string = 'Spectra of ' // &
78                         TRIM( data_output_sp(m) ) // ' can not be calculated'
79             CALL message( 'user_spectra', 'UI0010', 0, 0, 0, 6, 0 )
80           
81       END SELECT
82
83    ELSEIF ( mode == 'data_output' )  THEN
84
85       SELECT CASE ( TRIM( data_output_sp(m) ) )
86
87          CASE ( 'u', 'v', 'w', 'pt', 'q' )
88!--          Not allowed here since these are the standard quantities used in
89!--          data_output_spectra.
90
91!          CASE ( 'u*v*' )
92!             pr = 6
93
94          CASE DEFAULT
95             message_string = 'Spectra of ' //  &
96                              TRIM( data_output_sp(m) ) // ' are not defined'
97             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
98             
99          END SELECT
100
101    ENDIF
102
103 END SUBROUTINE user_spectra
104
Note: See TracBrowser for help on using the repository browser.