1 | !> @file user_data_output_mask.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 |
---|
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. |
---|
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 | ! |
---|
17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ------------------ |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: user_data_output_mask.f90 2696 2017-12-14 17:12:51Z raasch $ |
---|
27 | ! |
---|
28 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
29 | ! Forced header and separation lines into 80 columns |
---|
30 | ! |
---|
31 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
32 | ! Code annotations made doxygen readable |
---|
33 | ! |
---|
34 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
35 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
36 | ! kinds are defined in new module kinds, |
---|
37 | ! old module precision_kind is removed, |
---|
38 | ! comment fields (!:) to be used for variable explanations added to |
---|
39 | ! all variable declaration statements |
---|
40 | ! |
---|
41 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
42 | ! code put under GPL (PALM 3.9) |
---|
43 | ! |
---|
44 | ! Description: |
---|
45 | ! ------------ |
---|
46 | !> Resorts the user-defined output quantity with indices (k,j,i) to a |
---|
47 | !> temporary array with indices (i,j,k) for masked data output. |
---|
48 | !------------------------------------------------------------------------------! |
---|
49 | SUBROUTINE user_data_output_mask( av, variable, found, local_pf ) |
---|
50 | |
---|
51 | |
---|
52 | USE control_parameters |
---|
53 | |
---|
54 | USE indices |
---|
55 | |
---|
56 | USE kinds |
---|
57 | |
---|
58 | USE user |
---|
59 | |
---|
60 | IMPLICIT NONE |
---|
61 | |
---|
62 | CHARACTER (LEN=*) :: variable !< |
---|
63 | |
---|
64 | INTEGER(iwp) :: av !< |
---|
65 | INTEGER(iwp) :: i !< |
---|
66 | INTEGER(iwp) :: j !< |
---|
67 | INTEGER(iwp) :: k !< |
---|
68 | |
---|
69 | LOGICAL :: found !< |
---|
70 | |
---|
71 | REAL(wp), & |
---|
72 | DIMENSION(mask_size_l(mid,1),mask_size_l(mid,2),mask_size_l(mid,3)) :: & |
---|
73 | local_pf !< |
---|
74 | |
---|
75 | |
---|
76 | found = .TRUE. |
---|
77 | |
---|
78 | SELECT CASE ( TRIM( variable ) ) |
---|
79 | |
---|
80 | !-- Uncomment and extend the following lines, if necessary. |
---|
81 | !-- The arrays for storing the user defined quantities (here u2 and u2_av) |
---|
82 | !-- have to be declared and defined by the user! |
---|
83 | !-- Sample for user-defined output: |
---|
84 | ! CASE ( 'u2' ) |
---|
85 | ! IF ( av == 0 ) THEN |
---|
86 | ! DO i = 1, mask_size_l(mid,1) |
---|
87 | ! DO j = 1, mask_size_l(mid,2) |
---|
88 | ! DO k = 1, mask_size_l(mid,3) |
---|
89 | ! local_pf(i,j,k) = u2(mask_k(mid,k), & |
---|
90 | ! mask_j(mid,j),mask_i(mid,i)) |
---|
91 | ! ENDDO |
---|
92 | ! ENDDO |
---|
93 | ! ENDDO |
---|
94 | ! ELSE |
---|
95 | ! DO i = 1, mask_size_l(mid,1) |
---|
96 | ! DO j = 1, mask_size_l(mid,2) |
---|
97 | ! DO k = 1, mask_size_l(mid,3) |
---|
98 | ! local_pf(i,j,k) = u2_av(mask_k(mid,k), & |
---|
99 | ! mask_j(mid,j),mask_i(mid,i)) |
---|
100 | ! ENDDO |
---|
101 | ! ENDDO |
---|
102 | ! ENDDO |
---|
103 | ! ENDIF |
---|
104 | |
---|
105 | CASE DEFAULT |
---|
106 | found = .FALSE. |
---|
107 | |
---|
108 | END SELECT |
---|
109 | |
---|
110 | |
---|
111 | END SUBROUTINE user_data_output_mask |
---|