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

Last change on this file since 2000 was 2000, checked in by knoop, 5 years ago

Forced header and separation lines into 80 columns

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