[1682] | 1 | !> @file user_data_output_mask.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1036] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 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. |
---|
[1036] | 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 | ! |
---|
[2101] | 17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[300] | 20 | ! Current revisions: |
---|
| 21 | ! ------------------ |
---|
[1683] | 22 | ! |
---|
[2001] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: user_data_output_mask.f90 2101 2017-01-05 16:42:31Z schwenkel $ |
---|
| 27 | ! |
---|
[2001] | 28 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 29 | ! Forced header and separation lines into 80 columns |
---|
| 30 | ! |
---|
[1683] | 31 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 32 | ! Code annotations made doxygen readable |
---|
| 33 | ! |
---|
[1321] | 34 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 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 |
---|
[300] | 40 | ! |
---|
[1037] | 41 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 42 | ! code put under GPL (PALM 3.9) |
---|
| 43 | ! |
---|
[300] | 44 | ! Description: |
---|
| 45 | ! ------------ |
---|
[1682] | 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. |
---|
[300] | 48 | !------------------------------------------------------------------------------! |
---|
[1682] | 49 | SUBROUTINE user_data_output_mask( av, variable, found, local_pf ) |
---|
| 50 | |
---|
[300] | 51 | |
---|
| 52 | USE control_parameters |
---|
[1320] | 53 | |
---|
[300] | 54 | USE indices |
---|
[1320] | 55 | |
---|
| 56 | USE kinds |
---|
| 57 | |
---|
[300] | 58 | USE user |
---|
| 59 | |
---|
| 60 | IMPLICIT NONE |
---|
| 61 | |
---|
[1682] | 62 | CHARACTER (LEN=*) :: variable !< |
---|
[300] | 63 | |
---|
[1682] | 64 | INTEGER(iwp) :: av !< |
---|
| 65 | INTEGER(iwp) :: i !< |
---|
| 66 | INTEGER(iwp) :: j !< |
---|
| 67 | INTEGER(iwp) :: k !< |
---|
[300] | 68 | |
---|
[1682] | 69 | LOGICAL :: found !< |
---|
[300] | 70 | |
---|
[1320] | 71 | REAL(wp), & |
---|
| 72 | DIMENSION(mask_size_l(mid,1),mask_size_l(mid,2),mask_size_l(mid,3)) :: & |
---|
[1682] | 73 | local_pf !< |
---|
[300] | 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) |
---|
[1320] | 89 | ! local_pf(i,j,k) = u2(mask_k(mid,k), & |
---|
[300] | 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) |
---|
[1320] | 98 | ! local_pf(i,j,k) = u2_av(mask_k(mid,k), & |
---|
[300] | 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 |
---|