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

Last change on this file since 4492 was 4360, checked in by suehring, 5 years ago

Bugfix in output of time-averaged plant-canopy quanities; Output of plant-canopy data only where tall canopy is defined; land-surface model: fix wrong location strings; tests: update urban test case; all source code files: copyright update

  • Property svn:keywords set to Id
File size: 3.6 KB
RevLine 
[1682]1!> @file user_spectra.f90
[2000]2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]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!
[4360]17! Copyright 1997-2020 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[258]20! Current revisions:
[211]21! -----------------
[1683]22!
[3049]23!
[1321]24! Former revisions:
25! -----------------
26! $Id: user_spectra.f90 4360 2020-01-07 11:25:50Z pavelkrc $
[4182]27! Corrected "Former revisions" section
28!
29! 3768 2019-02-27 14:35:58Z raasch
[3768]30! variables removed + statement added to avoid compiler warnings about unused variables
31!
32! 3655 2019-01-07 16:51:22Z knoop
[3421]33! Renamed output variables
[1321]34!
[4182]35! 211 2008-11-11 04:46:24Z raasch
36! Former file user_interface.f90 split into one file per subroutine
37!
[211]38! Description:
39! ------------
[1682]40!> Calculation of user-defined spectra.
41!> See section 3.5.4 on how to define, calculate, and output user defined
42!> quantities.
[211]43!------------------------------------------------------------------------------!
[1682]44 SUBROUTINE user_spectra( mode, m, pr )
45 
[211]46
47    USE arrays_3d
[1320]48   
[258]49    USE control_parameters
[1320]50   
[211]51    USE indices
[1320]52   
53    USE kinds
54   
[1833]55    USE spectra_mod
[1320]56   
[211]57    USE statistics
[1320]58   
[211]59    USE user
60
61    IMPLICIT NONE
62
63    CHARACTER (LEN=*) ::  mode
64
[1682]65    INTEGER(iwp) ::  m    !<
66    INTEGER(iwp) ::  pr   !<
[211]67
68
69!
[3768]70!-- Next line is to avoid compiler warning about unused variable. Please remove.
71    IF ( pr == 0 )  CONTINUE
72
73!
[211]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         
[3421]83          CASE ( 'u', 'v', 'w', 'theta', 'q', 's' )
[211]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
[1320]92             message_string = 'Spectra of ' //                                 &
[274]93                         TRIM( data_output_sp(m) ) // ' can not be calculated'
[3046]94             CALL message( 'user_spectra', 'UI0010', 0, 1, 0, 6, 0 )
[258]95           
[211]96       END SELECT
97
98    ELSEIF ( mode == 'data_output' )  THEN
99
100       SELECT CASE ( TRIM( data_output_sp(m) ) )
101
[3421]102          CASE ( 'u', 'v', 'w', 'theta', 'q', 's' )
[211]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
[1320]110             message_string = 'Spectra of ' //                                 &
[258]111                              TRIM( data_output_sp(m) ) // ' are not defined'
112             CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 )
113             
[211]114          END SELECT
115
116    ENDIF
117
118 END SUBROUTINE user_spectra
119
Note: See TracBrowser for help on using the repository browser.