1 | !> @file data_log.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-2020 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: data_log.f90 4360 2020-01-07 11:25:50Z forkel $ |
---|
27 | ! Corrected "Former revisions" section |
---|
28 | ! |
---|
29 | ! 3725 2019-02-07 10:11:02Z raasch |
---|
30 | ! preprocessor directives removed to avoid compiler warnings |
---|
31 | ! |
---|
32 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
33 | ! Corrected "Former revisions" section |
---|
34 | ! |
---|
35 | ! Revision 1.1 2006/02/23 10:09:29 raasch |
---|
36 | ! Initial revision |
---|
37 | ! |
---|
38 | ! |
---|
39 | ! Description: |
---|
40 | ! ------------ |
---|
41 | !> Complete logging of data |
---|
42 | !------------------------------------------------------------------------------! |
---|
43 | SUBROUTINE data_log( array, i1, i2, j1, j2, k1, k2 ) |
---|
44 | |
---|
45 | USE control_parameters, & |
---|
46 | ONLY: log_message, simulated_time |
---|
47 | |
---|
48 | USE kinds |
---|
49 | |
---|
50 | USE pegrid |
---|
51 | |
---|
52 | IMPLICIT NONE |
---|
53 | |
---|
54 | INTEGER(iwp) :: i1 !< |
---|
55 | INTEGER(iwp) :: i2 !< |
---|
56 | INTEGER(iwp) :: j1 !< |
---|
57 | INTEGER(iwp) :: j2 !< |
---|
58 | INTEGER(iwp) :: k1 !< |
---|
59 | INTEGER(iwp) :: k2 !< |
---|
60 | |
---|
61 | REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: array !< |
---|
62 | |
---|
63 | |
---|
64 | ! |
---|
65 | !-- Open the file for data logging |
---|
66 | CALL check_open( 20 ) |
---|
67 | |
---|
68 | ! |
---|
69 | !-- Write the message string |
---|
70 | WRITE ( 20 ) log_message |
---|
71 | |
---|
72 | ! |
---|
73 | !-- Write the simulated time and the array indices |
---|
74 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2, k1, k2 |
---|
75 | |
---|
76 | ! |
---|
77 | !-- Write the array |
---|
78 | WRITE ( 20 ) array |
---|
79 | |
---|
80 | END SUBROUTINE data_log |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | !------------------------------------------------------------------------------! |
---|
85 | ! Description: |
---|
86 | ! ------------ |
---|
87 | !> Complete logging of data for 2d arrays |
---|
88 | !------------------------------------------------------------------------------! |
---|
89 | |
---|
90 | SUBROUTINE data_log_2d( array, i1, i2, j1, j2) |
---|
91 | |
---|
92 | USE control_parameters, & |
---|
93 | ONLY: log_message, simulated_time |
---|
94 | |
---|
95 | USE kinds |
---|
96 | |
---|
97 | USE pegrid |
---|
98 | |
---|
99 | IMPLICIT NONE |
---|
100 | |
---|
101 | INTEGER(iwp) :: i1 !< |
---|
102 | INTEGER(iwp) :: i2 !< |
---|
103 | INTEGER(iwp) :: j1 !< |
---|
104 | INTEGER(iwp) :: j2 !< |
---|
105 | |
---|
106 | REAL(wp), DIMENSION(i1:i2,j1:j2) :: array !< |
---|
107 | |
---|
108 | |
---|
109 | ! |
---|
110 | !-- Open the file for data logging |
---|
111 | CALL check_open( 20 ) |
---|
112 | |
---|
113 | ! |
---|
114 | !-- Write the message string |
---|
115 | WRITE ( 20 ) log_message |
---|
116 | |
---|
117 | ! |
---|
118 | !-- Write the simulated time and the array indices |
---|
119 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2 |
---|
120 | |
---|
121 | ! |
---|
122 | !-- Write the array |
---|
123 | WRITE ( 20 ) array |
---|
124 | |
---|
125 | END SUBROUTINE data_log_2d |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | !------------------------------------------------------------------------------! |
---|
130 | ! Description: |
---|
131 | ! ------------ |
---|
132 | !> Complete logging of data for 2d integer arrays |
---|
133 | !------------------------------------------------------------------------------! |
---|
134 | |
---|
135 | SUBROUTINE data_log_2d_int( array, i1, i2, j1, j2) |
---|
136 | |
---|
137 | USE control_parameters, & |
---|
138 | ONLY: log_message, simulated_time |
---|
139 | |
---|
140 | USE kinds |
---|
141 | |
---|
142 | USE pegrid |
---|
143 | |
---|
144 | IMPLICIT NONE |
---|
145 | |
---|
146 | INTEGER(iwp) :: i1 !< |
---|
147 | INTEGER(iwp) :: i2 !< |
---|
148 | INTEGER(iwp) :: j1 !< |
---|
149 | INTEGER(iwp) :: j2 !< |
---|
150 | |
---|
151 | INTEGER(iwp), DIMENSION(i1:i2,j1:j2) :: array !< |
---|
152 | |
---|
153 | |
---|
154 | ! |
---|
155 | !-- Open the file for data logging |
---|
156 | CALL check_open( 20 ) |
---|
157 | |
---|
158 | ! |
---|
159 | !-- Write the message string |
---|
160 | WRITE ( 20 ) log_message |
---|
161 | |
---|
162 | ! |
---|
163 | !-- Write the simulated time and the array indices |
---|
164 | WRITE ( 20 ) simulated_time, i1, i2, j1, j2 |
---|
165 | |
---|
166 | ! |
---|
167 | !-- Write the array |
---|
168 | WRITE ( 20 ) array |
---|
169 | |
---|
170 | END SUBROUTINE data_log_2d_int |
---|