[1682] | 1 | !> @file data_log.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 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1682] | 21 | ! Code annotations made doxygen readable |
---|
[1321] | 22 | ! |
---|
| 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: data_log.f90 1682 2015-10-07 23:56:08Z knoop $ |
---|
| 26 | ! |
---|
| 27 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 28 | ! ONLY-attribute added to USE-statements, |
---|
| 29 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 30 | ! kinds are defined in new module kinds, |
---|
| 31 | ! revision history before 2012 removed, |
---|
| 32 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 33 | ! all variable declaration statements |
---|
[1] | 34 | ! |
---|
[1037] | 35 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 36 | ! code put under GPL (PALM 3.9) |
---|
| 37 | ! |
---|
[3] | 38 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 39 | ! |
---|
[1] | 40 | ! Revision 1.1 2006/02/23 10:09:29 raasch |
---|
| 41 | ! Initial revision |
---|
| 42 | ! |
---|
| 43 | ! |
---|
| 44 | ! Description: |
---|
| 45 | ! ------------ |
---|
[1682] | 46 | !> Complete logging of data |
---|
[1] | 47 | !------------------------------------------------------------------------------! |
---|
[1682] | 48 | SUBROUTINE data_log( array, i1, i2, j1, j2, k1, k2 ) |
---|
| 49 | |
---|
[1] | 50 | #if defined( __logging ) |
---|
| 51 | |
---|
[1320] | 52 | USE control_parameters, & |
---|
| 53 | ONLY: log_message, simulated_time |
---|
| 54 | |
---|
| 55 | USE kinds |
---|
| 56 | |
---|
[1] | 57 | USE pegrid |
---|
| 58 | |
---|
| 59 | IMPLICIT NONE |
---|
| 60 | |
---|
[1682] | 61 | INTEGER(iwp) :: i1 !< |
---|
| 62 | INTEGER(iwp) :: i2 !< |
---|
| 63 | INTEGER(iwp) :: j1 !< |
---|
| 64 | INTEGER(iwp) :: j2 !< |
---|
| 65 | INTEGER(iwp) :: k1 !< |
---|
| 66 | INTEGER(iwp) :: k2 !< |
---|
[1] | 67 | |
---|
[1682] | 68 | REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: array !< |
---|
[1] | 69 | |
---|
| 70 | |
---|
| 71 | ! |
---|
| 72 | !-- Open the file for data logging |
---|
| 73 | CALL check_open( 20 ) |
---|
| 74 | |
---|
| 75 | ! |
---|
| 76 | !-- Write the message string |
---|
| 77 | WRITE ( 20 ) log_message |
---|
| 78 | |
---|
| 79 | ! |
---|
| 80 | !-- Write the simulated time and the array indices |
---|
| 81 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2, k1, k2 |
---|
| 82 | |
---|
| 83 | ! |
---|
| 84 | !-- Write the array |
---|
| 85 | WRITE ( 20 ) array |
---|
| 86 | |
---|
| 87 | #endif |
---|
| 88 | END SUBROUTINE data_log |
---|
| 89 | |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | !------------------------------------------------------------------------------! |
---|
| 93 | ! Description: |
---|
| 94 | ! ------------ |
---|
[1682] | 95 | !> Complete logging of data for 2d arrays |
---|
[1] | 96 | !------------------------------------------------------------------------------! |
---|
[1682] | 97 | |
---|
| 98 | SUBROUTINE data_log_2d( array, i1, i2, j1, j2) |
---|
| 99 | |
---|
[1] | 100 | #if defined( __logging ) |
---|
| 101 | |
---|
[1320] | 102 | USE control_parameters, & |
---|
| 103 | ONLY: log_message, simulated_time |
---|
| 104 | |
---|
| 105 | USE kinds |
---|
| 106 | |
---|
[1] | 107 | USE pegrid |
---|
| 108 | |
---|
| 109 | IMPLICIT NONE |
---|
| 110 | |
---|
[1682] | 111 | INTEGER(iwp) :: i1 !< |
---|
| 112 | INTEGER(iwp) :: i2 !< |
---|
| 113 | INTEGER(iwp) :: j1 !< |
---|
| 114 | INTEGER(iwp) :: j2 !< |
---|
[1] | 115 | |
---|
[1682] | 116 | REAL(wp), DIMENSION(i1:i2,j1:j2) :: array !< |
---|
[1] | 117 | |
---|
| 118 | |
---|
| 119 | ! |
---|
| 120 | !-- Open the file for data logging |
---|
| 121 | CALL check_open( 20 ) |
---|
| 122 | |
---|
| 123 | ! |
---|
| 124 | !-- Write the message string |
---|
| 125 | WRITE ( 20 ) log_message |
---|
| 126 | |
---|
| 127 | ! |
---|
| 128 | !-- Write the simulated time and the array indices |
---|
| 129 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2 |
---|
| 130 | |
---|
| 131 | ! |
---|
| 132 | !-- Write the array |
---|
| 133 | WRITE ( 20 ) array |
---|
| 134 | |
---|
| 135 | #endif |
---|
| 136 | END SUBROUTINE data_log_2d |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | !------------------------------------------------------------------------------! |
---|
| 141 | ! Description: |
---|
| 142 | ! ------------ |
---|
[1682] | 143 | !> Complete logging of data for 2d integer arrays |
---|
[1] | 144 | !------------------------------------------------------------------------------! |
---|
[1682] | 145 | |
---|
| 146 | SUBROUTINE data_log_2d_int( array, i1, i2, j1, j2) |
---|
| 147 | |
---|
[1] | 148 | #if defined( __logging ) |
---|
| 149 | |
---|
[1320] | 150 | USE control_parameters, & |
---|
| 151 | ONLY: log_message, simulated_time |
---|
| 152 | |
---|
| 153 | USE kinds |
---|
| 154 | |
---|
[1] | 155 | USE pegrid |
---|
| 156 | |
---|
| 157 | IMPLICIT NONE |
---|
| 158 | |
---|
[1682] | 159 | INTEGER(iwp) :: i1 !< |
---|
| 160 | INTEGER(iwp) :: i2 !< |
---|
| 161 | INTEGER(iwp) :: j1 !< |
---|
| 162 | INTEGER(iwp) :: j2 !< |
---|
[1] | 163 | |
---|
[1682] | 164 | INTEGER(iwp), DIMENSION(i1:i2,j1:j2) :: array !< |
---|
[1] | 165 | |
---|
| 166 | |
---|
| 167 | ! |
---|
| 168 | !-- Open the file for data logging |
---|
| 169 | CALL check_open( 20 ) |
---|
| 170 | |
---|
| 171 | ! |
---|
| 172 | !-- Write the message string |
---|
| 173 | WRITE ( 20 ) log_message |
---|
| 174 | |
---|
| 175 | ! |
---|
| 176 | !-- Write the simulated time and the array indices |
---|
| 177 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2 |
---|
| 178 | |
---|
| 179 | ! |
---|
| 180 | !-- Write the array |
---|
| 181 | WRITE ( 20 ) array |
---|
| 182 | |
---|
| 183 | #endif |
---|
| 184 | END SUBROUTINE data_log_2d_int |
---|