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

Last change on this file since 1682 was 1682, checked in by knoop, 9 years ago

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 3.8 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-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21! Code annotations made doxygen readable 
22!
23! Former revisions:
24! -----------------
25! $Id: user_spectra.f90 1682 2015-10-07 23:56:08Z knoop $
26!
27! 1320 2014-03-20 08:40:49Z raasch
28! kind-parameters added to all INTEGER and REAL declaration statements,
29! kinds are defined in new module kinds,
30! old module precision_kind is removed,
31! revision history before 2012 removed,
32! comment fields (!:) to be used for variable explanations added to
33! all variable declaration statements
34!
35! 1036 2012-10-22 13:43:42Z raasch
36! code put under GPL (PALM 3.9)
37!
38! 211 2008-11-11 04:46:24Z raasch
39! Former file user_interface.f90 split into one file per subroutine
40!
41! Description:
42! ------------
43!> Calculation of user-defined spectra.
44!> See section 3.5.4 on how to define, calculate, and output user defined
45!> quantities.
46!------------------------------------------------------------------------------!
47 SUBROUTINE user_spectra( mode, m, pr )
48 
49
50    USE arrays_3d
51   
52    USE control_parameters
53   
54    USE indices
55   
56    USE kinds
57   
58    USE spectrum
59   
60    USE statistics
61   
62    USE user
63
64    IMPLICIT NONE
65
66    CHARACTER (LEN=*) ::  mode
67
68    INTEGER(iwp) ::  i    !<
69    INTEGER(iwp) ::  j    !<
70    INTEGER(iwp) ::  k    !<
71    INTEGER(iwp) ::  m    !<
72    INTEGER(iwp) ::  pr   !<
73
74
75!
76!-- Sample on how to calculate spectra of user-defined quantities.
77!-- Each quantity is identified by the corresponding user profile index
78!-- "pr_palm+#" where "#" is an integer starting from 1. These
79!-- user-profile-numbers must also be assigned to the respective strings
80!-- given by data_output_pr_user in routine user_check_data_output_pr.
81    IF ( mode == 'preprocess' )  THEN
82
83       SELECT CASE ( TRIM( data_output_sp(m) ) )
84         
85          CASE ( 'u', 'v', 'w', 'pt', 'q' )
86!--          Not allowed here since these are the standard quantities used in
87!--          preprocess_spectra.
88       
89!          CASE ( 'u*v*' )
90!             pr = pr_palm+1
91!             d(nzb+1:nzt,nys:nyn,nxl:nxr) = ustvst(nzb+1:nzt,nys:nyn,nxl:nxr)
92       
93          CASE DEFAULT
94             message_string = 'Spectra of ' //                                 &
95                         TRIM( data_output_sp(m) ) // ' can not be calculated'
96             CALL message( 'user_spectra', 'UI0010', 0, 0, 0, 6, 0 )
97           
98       END SELECT
99
100    ELSEIF ( mode == 'data_output' )  THEN
101
102       SELECT CASE ( TRIM( data_output_sp(m) ) )
103
104          CASE ( 'u', 'v', 'w', 'pt', 'q' )
105!--          Not allowed here since these are the standard quantities used in
106!--          data_output_spectra.
107
108!          CASE ( 'u*v*' )
109!             pr = 6
110
111          CASE DEFAULT
112             message_string = 'Spectra of ' //                                 &
113                              TRIM( data_output_sp(m) ) // ' are not defined'
114             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
115             
116          END SELECT
117
118    ENDIF
119
120 END SUBROUTINE user_spectra
121
Note: See TracBrowser for help on using the repository browser.