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

Last change on this file since 1036 was 1036, checked in by raasch, 9 years ago

code has been put under the GNU General Public License (v3)

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