Changeset 4498 for palm/trunk/SOURCE/user_data_output_mask.f90
- Timestamp:
- Apr 15, 2020 2:26:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/user_data_output_mask.f90
r4360 r4498 1 1 !> @file user_data_output_mask.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 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. 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. 9 8 ! 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 FOR12 ! A PARTICULAR PURPOSE. See the GNU GeneralPublic License for more details.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. 13 12 ! 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/>.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/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------! 17 !--------------------------------------------------------------------------------------------------! 18 ! 19 19 ! 20 20 ! Current revisions: 21 ! ----------------- -21 ! ----------------- 22 22 ! 23 23 ! … … 25 25 ! ----------------- 26 26 ! $Id$ 27 ! file re-formatted to follow the PALM coding standard 28 ! 29 ! 30 ! 4360 2020-01-07 11:25:50Z suehring 27 31 ! Corrected "Former revisions" section 28 ! 32 ! 29 33 ! 4168 2019-08-16 13:50:17Z suehring 30 ! Remove dependency on surface_mod + example for terrain-following output 34 ! Remove dependency on surface_mod + example for terrain-following output 31 35 ! adjusted 32 ! 36 ! 33 37 ! 4069 2019-07-01 14:05:51Z Giersch 34 ! Masked output running index mid has been introduced as a local variable to 38 ! Masked output running index mid has been introduced as a local variable to 35 39 ! avoid runtime error (Loop variable has been modified) in time_integration 36 ! 40 ! 37 41 ! 3768 2019-02-27 14:35:58Z raasch 38 42 ! variables commented + statement added to avoid compiler warnings about unused variables 39 ! 43 ! 40 44 ! 3655 2019-01-07 16:51:22Z knoop 41 45 ! Add terrain-following output … … 45 49 ! Description: 46 50 ! ------------ 47 !> Resorts the user-defined output quantity with indices (k,j,i) to a 48 !> temporary array withindices (i,j,k) for masked data output.49 !------------------------------------------------------------------------------ !51 !> Resorts the user-defined output quantity with indices (k,j,i) to a temporary array with 52 !> indices (i,j,k) for masked data output. 53 !--------------------------------------------------------------------------------------------------! 50 54 SUBROUTINE user_data_output_mask( av, variable, found, local_pf, mid ) 51 55 52 56 53 57 USE control_parameters 54 58 55 59 USE indices 56 60 57 61 USE kinds 58 62 59 63 USE user 60 64 61 65 IMPLICIT NONE 62 66 63 CHARACTER (LEN=*) :: variable !<67 CHARACTER(LEN=*) :: variable !< 64 68 65 INTEGER(iwp) :: av !<66 INTEGER(iwp) :: mid !< masked output running index67 ! INTEGER(iwp) :: i !<68 ! INTEGER(iwp) :: j !<69 ! INTEGER(iwp) :: k !<70 ! INTEGER(iwp) :: topo_top_index !< k index of highest horizontal surface69 INTEGER(iwp) :: av !< 70 INTEGER(iwp) :: mid !< masked output running index 71 ! INTEGER(iwp) :: i !< 72 ! INTEGER(iwp) :: j !< 73 ! INTEGER(iwp) :: k !< 74 ! INTEGER(iwp) :: topo_top_index !< k index of highest horizontal surface 71 75 72 LOGICAL :: found !<76 LOGICAL :: found !< 73 77 74 REAL(wp), & 75 DIMENSION(mask_size_l(mid,1),mask_size_l(mid,2),mask_size_l(mid,3)) :: & 76 local_pf !< 78 REAL(wp), DIMENSION(mask_size_l(mid,1),mask_size_l(mid,2),mask_size_l(mid,3)) :: local_pf !< 77 79 78 80 ! … … 87 89 88 90 !-- Uncomment and extend the following lines, if necessary. 89 !-- The arrays for storing the user defined quantities (here u2 and u2_av) 90 !-- have to be declaredand defined by the user!91 !-- The arrays for storing the user defined quantities (here u2 and u2_av) have to be declared 92 !-- and defined by the user! 91 93 !-- Sample for user-defined output: 92 94 ! CASE ( 'u2' ) … … 98 100 ! DO j = 1, mask_size_l(mid,2) 99 101 ! DO k = 1, mask_size_l(mid,3) 100 ! local_pf(i,j,k) = u2(mask_k(mid,k), &101 ! mask_j(mid,j), &102 ! local_pf(i,j,k) = u2(mask_k(mid,k), & 103 ! mask_j(mid,j), & 102 104 ! mask_i(mid,i)) 103 105 ! ENDDO … … 111 113 !! 112 114 !!-- Get k index of highest horizontal surface 113 ! topo_top_index = topo_top_ind( & 114 ! mask_j(mid,j), & 115 ! mask_i(mid,i), & 116 ! 1 ) 115 ! topo_top_index = topo_top_ind( mask_j(mid,j), mask_i(mid,i), 1 ) 117 116 !! 118 117 !!-- Save output array 119 118 ! DO k = 1, mask_size_l(mid,3) 120 ! local_pf(i,j,k) = u2(MIN( topo_top_index+mask_k(mid,k),& 121 ! nzt+1 ), & 122 ! mask_j(mid,j), & 123 ! mask_i(mid,i) ) 119 ! local_pf(i,j,k) = u2(MIN( topo_top_index + mask_k(mid,k), nzt+1 ), & 120 ! mask_j(mid,j), mask_i(mid,i) ) 124 121 ! ENDDO 125 122 ! ENDDO … … 133 130 ! DO j = 1, mask_size_l(mid,2) 134 131 ! DO k = 1, mask_size_l(mid,3) 135 ! local_pf(i,j,k) = u2_av(mask_k(mid,k), & 136 ! mask_j(mid,j), & 137 ! mask_i(mid,i) ) 132 ! local_pf(i,j,k) = u2_av(mask_k(mid,k), mask_j(mid,j), mask_i(mid,i) ) 138 133 ! ENDDO 139 134 ! ENDDO … … 146 141 !! 147 142 !!-- Get k index of highest horizontal surface 148 ! topo_top_index = topo_top_ind( & 149 ! mask_j(mid,j), & 150 ! mask_i(mid,i), & 151 ! 1 ) 143 ! topo_top_index = topo_top_ind( mask_j(mid,j), mask_i(mid,i), 1 ) 152 144 !! 153 145 !!-- Save output array 154 146 ! DO k = 1, mask_size_l(mid,3) 155 ! local_pf(i,j,k) = u2_av( & 156 ! MIN( topo_top_index+mask_k(mid,k),& 157 ! nzt+1 ), & 158 ! mask_j(mid,j), & 159 ! mask_i(mid,i) ) 147 ! local_pf(i,j,k) = u2_av( MIN( topo_top_index+mask_k(mid,k), nzt+1 ), & 148 ! mask_j(mid,j), mask_i(mid,i) ) 160 149 ! ENDDO 161 150 ! ENDDO
Note: See TracChangeset
for help on using the changeset viewer.