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

Last change on this file since 4239 was 4182, checked in by scharf, 5 years ago
  • corrected "Former revisions" section
  • minor formatting in "Former revisions" section
  • added "Author" section
  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1!> @file user_spectra.f90
2!------------------------------------------------------------------------------!
3! This file is part of the PALM model system.
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-2019 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: user_spectra.f90 4182 2019-08-22 15:20:23Z suehring $
27! Corrected "Former revisions" section
28!
29! 3768 2019-02-27 14:35:58Z raasch
30! variables removed + statement added to avoid compiler warnings about unused variables
31!
32! 3655 2019-01-07 16:51:22Z knoop
33! Renamed output variables
34!
35! 211 2008-11-11 04:46:24Z raasch
36! Former file user_interface.f90 split into one file per subroutine
37!
38! Description:
39! ------------
40!> Calculation of user-defined spectra.
41!> See section 3.5.4 on how to define, calculate, and output user defined
42!> quantities.
43!------------------------------------------------------------------------------!
44 SUBROUTINE user_spectra( mode, m, pr )
45 
46
47    USE arrays_3d
48   
49    USE control_parameters
50   
51    USE indices
52   
53    USE kinds
54   
55    USE spectra_mod
56   
57    USE statistics
58   
59    USE user
60
61    IMPLICIT NONE
62
63    CHARACTER (LEN=*) ::  mode
64
65    INTEGER(iwp) ::  m    !<
66    INTEGER(iwp) ::  pr   !<
67
68
69!
70!-- Next line is to avoid compiler warning about unused variable. Please remove.
71    IF ( pr == 0 )  CONTINUE
72
73!
74!-- Sample on how to calculate spectra of user-defined quantities.
75!-- Each quantity is identified by the corresponding user profile index
76!-- "pr_palm+#" where "#" is an integer starting from 1. These
77!-- user-profile-numbers must also be assigned to the respective strings
78!-- given by data_output_pr_user in routine user_check_data_output_pr.
79    IF ( mode == 'preprocess' )  THEN
80
81       SELECT CASE ( TRIM( data_output_sp(m) ) )
82         
83          CASE ( 'u', 'v', 'w', 'theta', 'q', 's' )
84!--          Not allowed here since these are the standard quantities used in
85!--          preprocess_spectra.
86       
87!          CASE ( 'u*v*' )
88!             pr = pr_palm+1
89!             d(nzb+1:nzt,nys:nyn,nxl:nxr) = ustvst(nzb+1:nzt,nys:nyn,nxl:nxr)
90       
91          CASE DEFAULT
92             message_string = 'Spectra of ' //                                 &
93                         TRIM( data_output_sp(m) ) // ' can not be calculated'
94             CALL message( 'user_spectra', 'UI0010', 0, 1, 0, 6, 0 )
95           
96       END SELECT
97
98    ELSEIF ( mode == 'data_output' )  THEN
99
100       SELECT CASE ( TRIM( data_output_sp(m) ) )
101
102          CASE ( 'u', 'v', 'w', 'theta', 'q', 's' )
103!--          Not allowed here since these are the standard quantities used in
104!--          data_output_spectra.
105
106!          CASE ( 'u*v*' )
107!             pr = 6
108
109          CASE DEFAULT
110             message_string = 'Spectra of ' //                                 &
111                              TRIM( data_output_sp(m) ) // ' are not defined'
112             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
113             
114          END SELECT
115
116    ENDIF
117
118 END SUBROUTINE user_spectra
119
Note: See TracBrowser for help on using the repository browser.