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