[1682] | 1 | !> @file user_spectra.f90 |
---|
[1036] | 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 | ! |
---|
[1310] | 16 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 17 | !--------------------------------------------------------------------------------! |
---|
| 18 | ! |
---|
[258] | 19 | ! Current revisions: |
---|
[211] | 20 | ! ----------------- |
---|
[1683] | 21 | ! |
---|
| 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: user_spectra.f90 1683 2015-10-07 23:57:51Z maronga $ |
---|
| 26 | ! |
---|
[1683] | 27 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 28 | ! Code annotations made doxygen readable |
---|
| 29 | ! |
---|
[1321] | 30 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 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 |
---|
[211] | 37 | ! |
---|
[1037] | 38 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 39 | ! code put under GPL (PALM 3.9) |
---|
| 40 | ! |
---|
[226] | 41 | ! 211 2008-11-11 04:46:24Z raasch |
---|
| 42 | ! Former file user_interface.f90 split into one file per subroutine |
---|
| 43 | ! |
---|
[211] | 44 | ! Description: |
---|
| 45 | ! ------------ |
---|
[1682] | 46 | !> Calculation of user-defined spectra. |
---|
| 47 | !> See section 3.5.4 on how to define, calculate, and output user defined |
---|
| 48 | !> quantities. |
---|
[211] | 49 | !------------------------------------------------------------------------------! |
---|
[1682] | 50 | SUBROUTINE user_spectra( mode, m, pr ) |
---|
| 51 | |
---|
[211] | 52 | |
---|
| 53 | USE arrays_3d |
---|
[1320] | 54 | |
---|
[258] | 55 | USE control_parameters |
---|
[1320] | 56 | |
---|
[211] | 57 | USE indices |
---|
[1320] | 58 | |
---|
| 59 | USE kinds |
---|
| 60 | |
---|
[211] | 61 | USE spectrum |
---|
[1320] | 62 | |
---|
[211] | 63 | USE statistics |
---|
[1320] | 64 | |
---|
[211] | 65 | USE user |
---|
| 66 | |
---|
| 67 | IMPLICIT NONE |
---|
| 68 | |
---|
| 69 | CHARACTER (LEN=*) :: mode |
---|
| 70 | |
---|
[1682] | 71 | INTEGER(iwp) :: i !< |
---|
| 72 | INTEGER(iwp) :: j !< |
---|
| 73 | INTEGER(iwp) :: k !< |
---|
| 74 | INTEGER(iwp) :: m !< |
---|
| 75 | INTEGER(iwp) :: pr !< |
---|
[211] | 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 |
---|
[1320] | 97 | message_string = 'Spectra of ' // & |
---|
[274] | 98 | TRIM( data_output_sp(m) ) // ' can not be calculated' |
---|
[258] | 99 | CALL message( 'user_spectra', 'UI0010', 0, 0, 0, 6, 0 ) |
---|
| 100 | |
---|
[211] | 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 |
---|
[1320] | 115 | message_string = 'Spectra of ' // & |
---|
[258] | 116 | TRIM( data_output_sp(m) ) // ' are not defined' |
---|
| 117 | CALL message( 'user_spectra', 'UI0011', 0, 0, 0, 6, 0 ) |
---|
| 118 | |
---|
[211] | 119 | END SELECT |
---|
| 120 | |
---|
| 121 | ENDIF |
---|
| 122 | |
---|
| 123 | END SUBROUTINE user_spectra |
---|
| 124 | |
---|