source: palm/trunk/SOURCE/data_log.f90 @ 1320

Last change on this file since 1320 was 1320, checked in by raasch, 7 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1 SUBROUTINE data_log( array, i1, i2, j1, j2, k1, k2 )
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later 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-2014 Leibniz Universitaet Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! ONLY-attribute added to USE-statements,
23! kind-parameters added to all INTEGER and REAL declaration statements,
24! kinds are defined in new module kinds,
25! old module precision_kind is removed,
26! revision history before 2012 removed,
27! comment fields (!:) to be used for variable explanations added to
28! all variable declaration statements
29!
30! Former revisions:
31! -----------------
32! $Id: data_log.f90 1320 2014-03-20 08:40:49Z raasch $
33!
34! 1036 2012-10-22 13:43:42Z raasch
35! code put under GPL (PALM 3.9)
36!
37! RCS Log replace by Id keyword, revision history cleaned up
38!
39! Revision 1.1  2006/02/23 10:09:29  raasch
40! Initial revision
41!
42!
43! Description:
44! ------------
45! Complete logging of data
46!------------------------------------------------------------------------------!
47#if defined( __logging )
48
49    USE control_parameters,                                                    &
50        ONLY:  log_message, simulated_time
51       
52    USE kinds
53       
54    USE pegrid
55
56    IMPLICIT NONE
57
58    INTEGER(iwp) ::  i1  !:
59    INTEGER(iwp) ::  i2  !:
60    INTEGER(iwp) ::  j1  !:
61    INTEGER(iwp) ::  j2  !:
62    INTEGER(iwp) ::  k1  !:
63    INTEGER(iwp) ::  k2  !:
64
65    REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) ::  array  !:
66
67
68!
69!-- Open the file for data logging
70    CALL check_open( 20 )
71
72!
73!-- Write the message string
74    WRITE ( 20 )  log_message
75
76!
77!-- Write the simulated time and the array indices
78    WRITE ( 20 )  simulated_time, i1, i2, j1, j2, k1, k2
79
80!
81!-- Write the array
82    WRITE ( 20 )  array
83
84#endif
85 END SUBROUTINE data_log
86
87
88
89 SUBROUTINE data_log_2d( array, i1, i2, j1, j2)
90
91!------------------------------------------------------------------------------!
92! Description:
93! ------------
94! Same as above, for 2d arrays
95!------------------------------------------------------------------------------!
96#if defined( __logging )
97
98    USE control_parameters,                                                    &
99        ONLY:  log_message, simulated_time
100
101    USE kinds
102           
103    USE pegrid
104
105    IMPLICIT NONE
106
107    INTEGER(iwp) ::  i1  !:
108    INTEGER(iwp) ::  i2  !:
109    INTEGER(iwp) ::  j1  !:
110    INTEGER(iwp) ::  j2  !:
111
112    REAL(wp), DIMENSION(i1:i2,j1:j2) ::  array  !:
113
114
115!
116!-- Open the file for data logging
117    CALL check_open( 20 )
118
119!
120!-- Write the message string
121    WRITE ( 20 )  log_message
122
123!
124!-- Write the simulated time and the array indices
125    WRITE ( 20 )  simulated_time, i1, i2, j1, j2
126
127!
128!-- Write the array
129    WRITE ( 20 )  array
130
131#endif
132 END SUBROUTINE data_log_2d
133
134
135
136 SUBROUTINE data_log_2d_int( array, i1, i2, j1, j2)
137
138!------------------------------------------------------------------------------!
139! Description:
140! ------------
141! Same as above, for 2d integer arrays
142!------------------------------------------------------------------------------!
143#if defined( __logging )
144
145    USE control_parameters,                                                    &
146        ONLY:  log_message, simulated_time
147
148    USE kinds
149           
150    USE pegrid
151
152    IMPLICIT NONE
153
154    INTEGER(iwp) ::  i1  !:
155    INTEGER(iwp) ::  i2  !:
156    INTEGER(iwp) ::  j1  !:
157    INTEGER(iwp) ::  j2  !:
158
159    INTEGER(iwp), DIMENSION(i1:i2,j1:j2) ::  array  !:
160
161
162!
163!-- Open the file for data logging
164    CALL check_open( 20 )
165
166!
167!-- Write the message string
168    WRITE ( 20 )  log_message
169
170!
171!-- Write the simulated time and the array indices
172    WRITE ( 20 )  simulated_time, i1, i2, j1, j2
173
174!
175!-- Write the array
176    WRITE ( 20 )  array
177
178#endif
179 END SUBROUTINE data_log_2d_int
Note: See TracBrowser for help on using the repository browser.