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

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

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 3.8 KB
RevLine 
[1682]1!> @file user_spectra.f90
[1036]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!
[1310]16! Copyright 1997-2014 Leibniz Universitaet Hannover
[1036]17!--------------------------------------------------------------------------------!
18!
[258]19! Current revisions:
[211]20! -----------------
[1682]21! Code annotations made doxygen readable 
[1321]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
[1320]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
[211]34!
[1037]35! 1036 2012-10-22 13:43:42Z raasch
36! code put under GPL (PALM 3.9)
37!
[226]38! 211 2008-11-11 04:46:24Z raasch
39! Former file user_interface.f90 split into one file per subroutine
40!
[211]41! Description:
42! ------------
[1682]43!> Calculation of user-defined spectra.
44!> See section 3.5.4 on how to define, calculate, and output user defined
45!> quantities.
[211]46!------------------------------------------------------------------------------!
[1682]47 SUBROUTINE user_spectra( mode, m, pr )
48 
[211]49
50    USE arrays_3d
[1320]51   
[258]52    USE control_parameters
[1320]53   
[211]54    USE indices
[1320]55   
56    USE kinds
57   
[211]58    USE spectrum
[1320]59   
[211]60    USE statistics
[1320]61   
[211]62    USE user
63
64    IMPLICIT NONE
65
66    CHARACTER (LEN=*) ::  mode
67
[1682]68    INTEGER(iwp) ::  i    !<
69    INTEGER(iwp) ::  j    !<
70    INTEGER(iwp) ::  k    !<
71    INTEGER(iwp) ::  m    !<
72    INTEGER(iwp) ::  pr   !<
[211]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
[1320]94             message_string = 'Spectra of ' //                                 &
[274]95                         TRIM( data_output_sp(m) ) // ' can not be calculated'
[258]96             CALL message( 'user_spectra', 'UI0010', 0, 0, 0, 6, 0 )
97           
[211]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
[1320]112             message_string = 'Spectra of ' //                                 &
[258]113                              TRIM( data_output_sp(m) ) // ' are not defined'
114             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
115             
[211]116          END SELECT
117
118    ENDIF
119
120 END SUBROUTINE user_spectra
121
Note: See TracBrowser for help on using the repository browser.