1 | !> @file user_spectra.f90 |
---|
2 | !--------------------------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
4 | ! |
---|
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. |
---|
8 | ! |
---|
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. |
---|
12 | ! |
---|
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/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2020 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: user_spectra.f90 4497 2020-04-15 10:20:51Z suehring $ |
---|
27 | ! file re-formatted to follow the PALM coding standard |
---|
28 | ! |
---|
29 | ! 4360 2020-01-07 11:25:50Z suehring |
---|
30 | ! Corrected "Former revisions" section |
---|
31 | ! |
---|
32 | ! 3768 2019-02-27 14:35:58Z raasch |
---|
33 | ! variables removed + statement added to avoid compiler warnings about unused variables |
---|
34 | ! |
---|
35 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
36 | ! Renamed output variables |
---|
37 | ! |
---|
38 | ! 211 2008-11-11 04:46:24Z raasch |
---|
39 | ! Former file user_interface.f90 split into one file per subroutine |
---|
40 | ! |
---|
41 | ! Description: |
---|
42 | ! ------------ |
---|
43 | !> Calculation of user-defined spectra. |
---|
44 | !> See section 3.5.4 on how to define, calculate, and output user defined quantities. |
---|
45 | !--------------------------------------------------------------------------------------------------! |
---|
46 | SUBROUTINE user_spectra( mode, m, pr ) |
---|
47 | |
---|
48 | |
---|
49 | USE arrays_3d |
---|
50 | |
---|
51 | USE control_parameters |
---|
52 | |
---|
53 | USE indices |
---|
54 | |
---|
55 | USE kinds |
---|
56 | |
---|
57 | USE spectra_mod |
---|
58 | |
---|
59 | USE statistics |
---|
60 | |
---|
61 | USE user |
---|
62 | |
---|
63 | IMPLICIT NONE |
---|
64 | |
---|
65 | CHARACTER(LEN=*) :: mode !< |
---|
66 | |
---|
67 | INTEGER(iwp) :: m !< |
---|
68 | INTEGER(iwp) :: pr !< |
---|
69 | |
---|
70 | |
---|
71 | ! |
---|
72 | !-- Next line is to avoid compiler warning about unused variable. Please remove. |
---|
73 | IF ( pr == 0 ) CONTINUE |
---|
74 | |
---|
75 | ! |
---|
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. |
---|
80 | IF ( mode == 'preprocess' ) THEN |
---|
81 | |
---|
82 | SELECT CASE ( TRIM( data_output_sp(m) ) ) |
---|
83 | |
---|
84 | CASE ( 'u', 'v', 'w', 'theta', 'q', 's' ) |
---|
85 | !-- Not allowed here since these are the standard quantities used in 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 |
---|
92 | message_string = 'Spectra of ' // TRIM( data_output_sp(m) ) // ' can not be calculated' |
---|
93 | CALL message( 'user_spectra', 'UI0010', 0, 1, 0, 6, 0 ) |
---|
94 | |
---|
95 | END SELECT |
---|
96 | |
---|
97 | ELSEIF ( mode == 'data_output' ) THEN |
---|
98 | |
---|
99 | SELECT CASE ( TRIM( data_output_sp(m) ) ) |
---|
100 | |
---|
101 | CASE ( 'u', 'v', 'w', 'theta', 'q', 's' ) |
---|
102 | !-- Not allowed here since these are the standard quantities used in data_output_spectra. |
---|
103 | |
---|
104 | ! CASE ( 'u*v*' ) |
---|
105 | ! pr = 6 |
---|
106 | |
---|
107 | CASE DEFAULT |
---|
108 | message_string = 'Spectra of ' // TRIM( data_output_sp(m) ) // ' are not defined' |
---|
109 | CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 ) |
---|
110 | |
---|
111 | END SELECT |
---|
112 | |
---|
113 | ENDIF |
---|
114 | |
---|
115 | END SUBROUTINE user_spectra |
---|
116 | |
---|