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