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

Last change on this file since 4814 was 4497, checked in by raasch, 5 years ago

last bugfix deactivated because of compile problems, files re-formatted to follow the PALM coding standard

  • Property svn:keywords set to Id
File size: 3.5 KB
RevLine 
[1682]1!> @file user_spectra.f90
[4497]2!--------------------------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]4!
[4497]5! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General
6! Public License as published by the Free Software Foundation, either version 3 of the License, or
7! (at your option) any later version.
[1036]8!
[4497]9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11! Public License for more details.
[1036]12!
[4497]13! You should have received a copy of the GNU General Public License along with PALM. If not, see
14! <http://www.gnu.org/licenses/>.
[1036]15!
[4360]16! Copyright 1997-2020 Leibniz Universitaet Hannover
[4497]17!--------------------------------------------------------------------------------------------------!
[1036]18!
[4497]19!
[258]20! Current revisions:
[211]21! -----------------
[1683]22!
[3049]23!
[1321]24! Former revisions:
25! -----------------
26! $Id: user_spectra.f90 4497 2020-04-15 10:20:51Z gronemeier $
[4497]27! file re-formatted to follow the PALM coding standard
28!
29! 4360 2020-01-07 11:25:50Z suehring
[4182]30! Corrected "Former revisions" section
[4497]31!
[4182]32! 3768 2019-02-27 14:35:58Z raasch
[3768]33! variables removed + statement added to avoid compiler warnings about unused variables
[4497]34!
[3768]35! 3655 2019-01-07 16:51:22Z knoop
[3421]36! Renamed output variables
[1321]37!
[4182]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.
[4497]44!> See section 3.5.4 on how to define, calculate, and output user defined quantities.
45!--------------------------------------------------------------------------------------------------!
[1682]46 SUBROUTINE user_spectra( mode, m, pr )
[211]47
[4497]48
[211]49    USE arrays_3d
[4497]50
[258]51    USE control_parameters
[4497]52
[211]53    USE indices
[4497]54
[1320]55    USE kinds
[4497]56
[1833]57    USE spectra_mod
[4497]58
[211]59    USE statistics
[4497]60
[211]61    USE user
62
63    IMPLICIT NONE
64
[4497]65    CHARACTER(LEN=*) ::  mode  !<
[211]66
[4497]67    INTEGER(iwp) ::  m   !<
68    INTEGER(iwp) ::  pr  !<
[211]69
70
71!
[3768]72!-- Next line is to avoid compiler warning about unused variable. Please remove.
73    IF ( pr == 0 )  CONTINUE
74
75!
[4497]76!-- Sample on how to calculate spectra of user-defined quantities. Each quantity is identified by
77!-- the corresponding user profile index "pr_palm+#" where "#" is an integer starting from 1. These
78!-- user-profile-numbers must also be assigned to the respective strings given by
79!-- data_output_pr_user in routine user_check_data_output_pr.
[211]80    IF ( mode == 'preprocess' )  THEN
81
82       SELECT CASE ( TRIM( data_output_sp(m) ) )
[4497]83
[3421]84          CASE ( 'u', 'v', 'w', 'theta', 'q', 's' )
[4497]85!--          Not allowed here since these are the standard quantities used in preprocess_spectra.
86
[211]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)
[4497]90
[211]91          CASE DEFAULT
[4497]92             message_string = 'Spectra of ' // TRIM( data_output_sp(m) ) // ' can not be calculated'
[3046]93             CALL message( 'user_spectra', 'UI0010', 0, 1, 0, 6, 0 )
[4497]94
[211]95       END SELECT
96
97    ELSEIF ( mode == 'data_output' )  THEN
98
99       SELECT CASE ( TRIM( data_output_sp(m) ) )
100
[3421]101          CASE ( 'u', 'v', 'w', 'theta', 'q', 's' )
[4497]102!--          Not allowed here since these are the standard quantities used in data_output_spectra.
[211]103
104!          CASE ( 'u*v*' )
105!             pr = 6
106
107          CASE DEFAULT
[4497]108             message_string = 'Spectra of ' // TRIM( data_output_sp(m) ) // ' are not defined'
[258]109             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
[4497]110
[211]111          END SELECT
112
113    ENDIF
114
115 END SUBROUTINE user_spectra
116
Note: See TracBrowser for help on using the repository browser.