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

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

last commit documented

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