1 | SUBROUTINE init_dvrp |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! Test output of isosurface on camera file |
---|
8 | ! TEST: print* statements |
---|
9 | ! ToDo: checking of mode_dvrp for legal values is not correct |
---|
10 | ! |
---|
11 | ! Former revisions: |
---|
12 | ! ----------------- |
---|
13 | ! $Log: init_dvrp.f90,v $ |
---|
14 | ! Revision 1.12 2006/02/23 12:30:22 raasch |
---|
15 | ! ebene renamed section, pl.. replaced by do.., |
---|
16 | ! |
---|
17 | ! Revision 1.11 2005/03/31 07:01:20 raasch |
---|
18 | ! Test version with print statements checked in |
---|
19 | ! |
---|
20 | ! Revision 1.10 2003/08/01 08:36:28 raasch |
---|
21 | ! Module dvrp added to routine close_dvrp, set the maximum time the program |
---|
22 | ! can be suspended on user request, every steering variable is defined for |
---|
23 | ! every stream |
---|
24 | ! |
---|
25 | ! Revision 1.9 2003/03/16 09:39:44 raasch |
---|
26 | ! Two underscores (_) are placed in front of all define-strings |
---|
27 | ! |
---|
28 | ! Revision 1.8 2003/03/04 11:28:53 raasch |
---|
29 | ! Update for new version of dvrp software (e.g. using module dvrp is now |
---|
30 | ! mandatory). Initialization of dvrp steering variables included. |
---|
31 | ! |
---|
32 | ! Revision 1.7 2002/12/19 15:37:57 raasch |
---|
33 | ! STOP statement replaced by call of subroutine local_stop |
---|
34 | ! |
---|
35 | ! Revision 1.6 2001/08/21 09:45:54 raasch |
---|
36 | ! Superelevation implemented, additional PE can be used for handling the |
---|
37 | ! dvrp output (see init_dvrp_logging and close_dvrp) |
---|
38 | ! |
---|
39 | ! Revision 1.5 2001/07/12 12:10:16 raasch |
---|
40 | ! Adjustment of camera position, output of boundingbox moved from the scene |
---|
41 | ! files to camera.dvr, destination for dvrp_output is now controlled via |
---|
42 | ! parameters given in the parameter file. |
---|
43 | ! |
---|
44 | ! Revision 1.4 2001/03/30 07:31:03 raasch |
---|
45 | ! Translation of remaining German identifiers (variables, subroutines, etc.) |
---|
46 | ! |
---|
47 | ! Revision 1.3 2001/01/25 07:04:23 raasch |
---|
48 | ! Subroutines init_dvrp_logging and close_dvrp attached. |
---|
49 | ! |
---|
50 | ! Revision 1.2 2000/12/28 13:11:43 raasch |
---|
51 | ! Complete revision due to new features of dvrp-software |
---|
52 | ! |
---|
53 | ! Revision 1.1 2000/04/27 06:24:39 raasch |
---|
54 | ! Initial revision |
---|
55 | ! |
---|
56 | ! |
---|
57 | ! Description: |
---|
58 | ! ------------ |
---|
59 | ! Initializing actions needed when using dvrp-software |
---|
60 | !------------------------------------------------------------------------------! |
---|
61 | #if defined( __dvrp_graphics ) |
---|
62 | |
---|
63 | USE arrays_3d |
---|
64 | USE DVRP |
---|
65 | USE dvrp_variables |
---|
66 | USE grid_variables |
---|
67 | USE indices |
---|
68 | USE pegrid |
---|
69 | USE control_parameters |
---|
70 | |
---|
71 | IMPLICIT NONE |
---|
72 | |
---|
73 | CHARACTER (LEN=2) :: section_chr |
---|
74 | CHARACTER (LEN=80) :: dvrp_file_local |
---|
75 | INTEGER :: i, j, k, l, m, pn, tv, vn |
---|
76 | LOGICAL :: allocated |
---|
77 | REAL :: center(3), distance |
---|
78 | |
---|
79 | REAL, DIMENSION(:,:,:), ALLOCATABLE :: local_pf |
---|
80 | |
---|
81 | TYPE(CSTRING), SAVE :: dvrp_directory_c, dvrp_file_c, & |
---|
82 | dvrp_file_local_c,dvrp_host_c, & |
---|
83 | dvrp_password_c, dvrp_username_c, name_c |
---|
84 | |
---|
85 | ! |
---|
86 | !-- Set the maximum time the program can be suspended on user request (by |
---|
87 | !-- dvrp steering). This variable is defined in module DVRP. |
---|
88 | DVRP_MAX_SUSPEND_TIME = 7200 |
---|
89 | |
---|
90 | ! |
---|
91 | !-- Allocate array holding the names and limits of the steering variables |
---|
92 | !-- (must have the same number of elements as array mode_dvrp!) |
---|
93 | ALLOCATE( steering_dvrp(10) ) |
---|
94 | |
---|
95 | ! |
---|
96 | !-- Check, if output parameters are given and/or allowed |
---|
97 | !-- and set default-values, where necessary |
---|
98 | IF ( dvrp_username == ' ' ) THEN |
---|
99 | IF ( myid == 0 ) THEN |
---|
100 | PRINT*, '+++ init_dvrp: dvrp_username is undefined' |
---|
101 | CALL local_stop |
---|
102 | ENDIF |
---|
103 | ENDIF |
---|
104 | |
---|
105 | IF ( dvrp_output /= 'ftp' .AND. dvrp_output /= 'rtsp' .AND. & |
---|
106 | dvrp_output /= 'local' ) THEN |
---|
107 | IF ( myid == 0 ) THEN |
---|
108 | PRINT*, '+++ init_dvrp: dvrp_output="', dvrp_output, '" not allowed' |
---|
109 | CALL local_stop |
---|
110 | ENDIF |
---|
111 | ENDIF |
---|
112 | |
---|
113 | IF ( dvrp_directory == 'default' ) THEN |
---|
114 | dvrp_directory = TRIM( dvrp_username ) // '/' // TRIM( run_identifier ) |
---|
115 | ENDIF |
---|
116 | |
---|
117 | IF ( dvrp_file /= 'default' .AND. dvrp_file /= '/dev/null' ) THEN |
---|
118 | IF ( myid == 0 ) THEN |
---|
119 | PRINT*, '+++ init_dvrp: dvrp_file="', dvrp_file, '" not allowed' |
---|
120 | CALL local_stop |
---|
121 | ENDIF |
---|
122 | ENDIF |
---|
123 | |
---|
124 | ! |
---|
125 | !-- Strings are assigned to strings of special type which have a CHAR( 0 ) |
---|
126 | !-- (C end-of-character symbol) at their end. This is needed when strings are |
---|
127 | !-- passed to C routines. |
---|
128 | dvrp_directory_c = dvrp_directory |
---|
129 | dvrp_file_c = dvrp_file |
---|
130 | dvrp_host_c = dvrp_host |
---|
131 | dvrp_password_c = dvrp_password |
---|
132 | dvrp_username_c = dvrp_username |
---|
133 | |
---|
134 | ! |
---|
135 | !-- Loop over all output modes choosed |
---|
136 | m = 1 |
---|
137 | allocated = .FALSE. |
---|
138 | DO WHILE ( mode_dvrp(m) /= ' ' ) |
---|
139 | |
---|
140 | ! |
---|
141 | !-- Check, if mode is allowed |
---|
142 | IF ( mode_dvrp(m)(1:10) /= 'isosurface' .AND. & |
---|
143 | mode_dvrp(m)(1:6) /= 'slicer' .AND. & |
---|
144 | mode_dvrp(m)(1:9) /= 'particles' ) THEN |
---|
145 | |
---|
146 | IF ( myid == 0 ) THEN |
---|
147 | PRINT*, '+++ init_dvrp: mode_dvrp="', mode_dvrp, '" not allowed' |
---|
148 | ENDIF |
---|
149 | CALL local_stop |
---|
150 | |
---|
151 | ENDIF |
---|
152 | |
---|
153 | ! |
---|
154 | !-- Camera position must be computed and written on file when no dvrp-output |
---|
155 | !-- has been generated so far (in former runs) |
---|
156 | ! IF ( dvrp_filecount == 0 ) THEN |
---|
157 | ! |
---|
158 | !-- Compute center of domain and distance of camera from center |
---|
159 | center(1) = ( nx + 1.0 ) * dx * 0.5 * superelevation_x |
---|
160 | center(2) = ( ny + 1.0 ) * dy * 0.5 * superelevation_y |
---|
161 | center(3) = ( zu(nz_do3d) - zu(nzb) ) * 0.5 * superelevation |
---|
162 | distance = 1.5 * MAX( ( nx + 1.0 ) * dx * superelevation_x, & |
---|
163 | ( ny + 1.0 ) * dy * superelevation_y, & |
---|
164 | ( zu(nz_do3d) - zu(nzb) ) * superelevation ) |
---|
165 | |
---|
166 | ! |
---|
167 | !-- Write camera position on file |
---|
168 | CALL DVRP_INIT( m-1, 0 ) |
---|
169 | |
---|
170 | ! |
---|
171 | !-- Create filename for camera |
---|
172 | IF ( dvrp_output == 'rtsp' ) THEN |
---|
173 | |
---|
174 | WRITE ( 9, * ) '*** vor dvrp_output_rtsp' |
---|
175 | CALL FLUSH_( 9 ) |
---|
176 | dvrp_file = TRIM( mode_dvrp(m) ) // '/camera.dvr' |
---|
177 | dvrp_file_c = dvrp_file |
---|
178 | CALL DVRP_OUTPUT_RTSP( m-1, dvrp_host_c, dvrp_username_c, & |
---|
179 | dvrp_password_c, dvrp_directory_c, & |
---|
180 | dvrp_file_c ) |
---|
181 | WRITE ( 9, * ) '*** nach dvrp_output_rtsp' |
---|
182 | CALL FLUSH_( 9 ) |
---|
183 | |
---|
184 | ELSEIF ( dvrp_output == 'ftp' ) THEN |
---|
185 | |
---|
186 | dvrp_file = TRIM( mode_dvrp(m) ) // '.camera.dvr' |
---|
187 | dvrp_file_c = dvrp_file |
---|
188 | ! CALL DVRP_OUTPUT_FTP( m-1, 0, dvrp_host_c, dvrp_username_c, & |
---|
189 | ! dvrp_password_c, dvrp_directory_c, & |
---|
190 | ! dvrp_file_c ) |
---|
191 | |
---|
192 | ELSE |
---|
193 | |
---|
194 | IF ( dvrp_file(1:9) /= '/dev/null' ) THEN |
---|
195 | dvrp_file_local = TRIM( mode_dvrp(m) ) // '.camera.dvr' |
---|
196 | dvrp_file_local_c = dvrp_file_local |
---|
197 | ELSE |
---|
198 | dvrp_file_local_c = dvrp_file_c |
---|
199 | ENDIF |
---|
200 | ! CALL DVRP_OUTPUT_LOCAL( m-1, 0, dvrp_file_local_c ) |
---|
201 | |
---|
202 | ENDIF |
---|
203 | |
---|
204 | CALL DVRP_CAMERA( m-1, center, distance ) |
---|
205 | WRITE ( 9, * ) '*** #1' |
---|
206 | CALL FLUSH_( 9 ) |
---|
207 | |
---|
208 | ! |
---|
209 | !-- Define bounding box material and create a bounding box |
---|
210 | CALL DVRP_MATERIAL_RGB( m-1, 1, 0.5, 0.5, 0.5, 0.0 ) |
---|
211 | CALL DVRP_BOUNDINGBOX( m-1, 1, 0.01, 0.0, 0.0, 0.0, & |
---|
212 | (nx+1) * dx * superelevation_x, & |
---|
213 | (ny+1) * dy * superelevation_y, & |
---|
214 | zu(nz_do3d) * superelevation ) |
---|
215 | |
---|
216 | CALL DVRP_VISUALIZE( m-1, 0, 0 ) |
---|
217 | CALL DVRP_EXIT( m-1 ) |
---|
218 | WRITE ( 9, * ) '*** #2' |
---|
219 | CALL FLUSH_( 9 ) |
---|
220 | |
---|
221 | |
---|
222 | ! |
---|
223 | !-- Write topography isosurface on file |
---|
224 | CALL DVRP_INIT( m-1, 0 ) |
---|
225 | |
---|
226 | ! |
---|
227 | !-- Create filename for buildings |
---|
228 | IF ( dvrp_output == 'rtsp' ) THEN |
---|
229 | |
---|
230 | dvrp_file = TRIM( mode_dvrp(m) ) // '/buildings.dvr' |
---|
231 | dvrp_file_c = dvrp_file |
---|
232 | CALL DVRP_OUTPUT_RTSP( m-1, dvrp_host_c, dvrp_username_c, & |
---|
233 | dvrp_password_c, dvrp_directory_c, & |
---|
234 | dvrp_file_c ) |
---|
235 | WRITE ( 9, * ) '*** #3' |
---|
236 | CALL FLUSH_( 9 ) |
---|
237 | |
---|
238 | ENDIF |
---|
239 | |
---|
240 | ! |
---|
241 | !-- Determine local gridpoint coordinates |
---|
242 | IF ( .NOT. allocated ) THEN |
---|
243 | ALLOCATE( xcoor_dvrp(nxl:nxr+1), ycoor_dvrp(nys:nyn+1), & |
---|
244 | zcoor_dvrp(nzb:nz_do3d) ) |
---|
245 | allocated = .TRUE. |
---|
246 | |
---|
247 | DO i = nxl, nxr+1 |
---|
248 | xcoor_dvrp(i) = i * dx * superelevation_x |
---|
249 | ENDDO |
---|
250 | DO j = nys, nyn+1 |
---|
251 | ycoor_dvrp(j) = j * dy * superelevation_y |
---|
252 | ENDDO |
---|
253 | zcoor_dvrp = zu(nzb:nz_do3d) * superelevation |
---|
254 | nx_dvrp = nxr+1 - nxl + 1 |
---|
255 | ny_dvrp = nyn+1 - nys + 1 |
---|
256 | nz_dvrp = nz_do3d - nzb + 1 |
---|
257 | ENDIF |
---|
258 | |
---|
259 | ! |
---|
260 | !-- Define the grid used by dvrp |
---|
261 | CALL DVRP_GRID( m-1, nx_dvrp, ny_dvrp, nz_dvrp, xcoor_dvrp, & |
---|
262 | ycoor_dvrp, zcoor_dvrp ) |
---|
263 | CALL DVRP_MATERIAL_RGB( m-1, 1, 0.8, 0.7, 0.6, 0.0 ) |
---|
264 | WRITE ( 9, * ) '*** #4' |
---|
265 | CALL FLUSH_( 9 ) |
---|
266 | |
---|
267 | ! |
---|
268 | !-- Compute and plot isosurface in dvr-format |
---|
269 | ALLOCATE( local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d) ) |
---|
270 | local_pf = 0.0 |
---|
271 | DO i = nxl, nxr+1 |
---|
272 | DO j = nys, nyn+1 |
---|
273 | IF ( nzb_s_inner(j,i) > 0 ) THEN |
---|
274 | local_pf(i,j,nzb:nzb_s_inner(j,i)) = 1.0 |
---|
275 | ENDIF |
---|
276 | ENDDO |
---|
277 | ENDDO |
---|
278 | WRITE ( 9, * ) '*** #4.1' |
---|
279 | CALL FLUSH_( 9 ) |
---|
280 | CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
281 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
282 | WRITE ( 9, * ) '*** #4.2' |
---|
283 | CALL FLUSH_( 9 ) |
---|
284 | CALL DVRP_THRESHOLD( m-1, 1.0 ) |
---|
285 | WRITE ( 9, * ) '*** #4.3' |
---|
286 | CALL FLUSH_( 9 ) |
---|
287 | CALL DVRP_VISUALIZE( m-1, 1, 0 ) |
---|
288 | WRITE ( 9, * ) '*** #4.4' |
---|
289 | CALL FLUSH_( 9 ) |
---|
290 | |
---|
291 | DEALLOCATE( local_pf ) |
---|
292 | |
---|
293 | CALL DVRP_EXIT( m-1 ) |
---|
294 | WRITE ( 9, * ) '*** #5' |
---|
295 | CALL FLUSH_( 9 ) |
---|
296 | |
---|
297 | ! |
---|
298 | !-- Write the surface isosurface on file |
---|
299 | CALL DVRP_INIT( m-1, 0 ) |
---|
300 | |
---|
301 | ! |
---|
302 | !-- Create filename for surface |
---|
303 | IF ( dvrp_output == 'rtsp' ) THEN |
---|
304 | |
---|
305 | dvrp_file = TRIM( mode_dvrp(m) ) // '/surface.dvr' |
---|
306 | dvrp_file_c = dvrp_file |
---|
307 | CALL DVRP_OUTPUT_RTSP( m-1, dvrp_host_c, dvrp_username_c, & |
---|
308 | dvrp_password_c, dvrp_directory_c, & |
---|
309 | dvrp_file_c ) |
---|
310 | WRITE ( 9, * ) '*** #6' |
---|
311 | CALL FLUSH_( 9 ) |
---|
312 | |
---|
313 | ENDIF |
---|
314 | |
---|
315 | ! |
---|
316 | !-- Determine local gridpoint coordinates |
---|
317 | IF ( .NOT. allocated ) THEN |
---|
318 | ALLOCATE( xcoor_dvrp(nxl:nxr+1), ycoor_dvrp(nys:nyn+1), & |
---|
319 | zcoor_dvrp(nzb:nz_do3d) ) |
---|
320 | allocated = .TRUE. |
---|
321 | |
---|
322 | DO i = nxl, nxr+1 |
---|
323 | xcoor_dvrp(i) = i * dx * superelevation_x |
---|
324 | ENDDO |
---|
325 | DO j = nys, nyn+1 |
---|
326 | ycoor_dvrp(j) = j * dy * superelevation_y |
---|
327 | ENDDO |
---|
328 | zcoor_dvrp = zu(nzb:nz_do3d) * superelevation |
---|
329 | nx_dvrp = nxr+1 - nxl + 1 |
---|
330 | ny_dvrp = nyn+1 - nys + 1 |
---|
331 | nz_dvrp = nz_do3d - nzb + 1 |
---|
332 | ENDIF |
---|
333 | |
---|
334 | ! |
---|
335 | !-- Define the grid used by dvrp |
---|
336 | CALL DVRP_GRID( m-1, nx_dvrp, ny_dvrp, nz_dvrp, xcoor_dvrp, & |
---|
337 | ycoor_dvrp, zcoor_dvrp ) |
---|
338 | CALL DVRP_MATERIAL_RGB( m-1, 1, 0.0, 0.6, 0.0, 0.0 ) |
---|
339 | WRITE ( 9, * ) '*** #7' |
---|
340 | CALL FLUSH_( 9 ) |
---|
341 | |
---|
342 | ! |
---|
343 | !-- Compute and plot isosurface in dvr-format |
---|
344 | ALLOCATE( local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d) ) |
---|
345 | local_pf = 0.0 |
---|
346 | local_pf(:,:,0) = 1.0 |
---|
347 | |
---|
348 | CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
349 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
350 | CALL DVRP_THRESHOLD( m-1, 1.0 ) |
---|
351 | CALL DVRP_VISUALIZE( m-1, 1, 0 ) |
---|
352 | |
---|
353 | DEALLOCATE( local_pf ) |
---|
354 | |
---|
355 | CALL DVRP_EXIT( m-1 ) |
---|
356 | WRITE ( 9, * ) '*** #8' |
---|
357 | CALL FLUSH_( 9 ) |
---|
358 | |
---|
359 | |
---|
360 | ! ENDIF |
---|
361 | |
---|
362 | |
---|
363 | ! |
---|
364 | !-- Initialize dvrp for all dvrp-calls during the run |
---|
365 | CALL DVRP_INIT( m-1, 0 ) |
---|
366 | |
---|
367 | ! |
---|
368 | !-- Preliminary definition of filename for dvrp-output |
---|
369 | IF ( dvrp_output == 'rtsp' ) THEN |
---|
370 | |
---|
371 | ! |
---|
372 | !-- First initialize parameters for possible interactive steering. |
---|
373 | !-- Every parameter has to be passed to the respective stream. |
---|
374 | pn = 1 |
---|
375 | ! |
---|
376 | !-- Initialize threshold counter needed for initialization of the |
---|
377 | !-- isosurface steering variables |
---|
378 | tv = 0 |
---|
379 | |
---|
380 | DO WHILE ( mode_dvrp(pn) /= ' ' ) |
---|
381 | |
---|
382 | IF ( mode_dvrp(pn)(1:10) == 'isosurface' ) THEN |
---|
383 | |
---|
384 | READ ( mode_dvrp(pn), '(10X,I1)' ) vn |
---|
385 | steering_dvrp(pn)%name = do3d(0,vn) |
---|
386 | tv = tv + 1 |
---|
387 | |
---|
388 | IF ( do3d(0,vn)(1:1) == 'w' ) THEN |
---|
389 | steering_dvrp(pn)%min = -4.0 |
---|
390 | steering_dvrp(pn)%max = 5.0 |
---|
391 | ELSE |
---|
392 | steering_dvrp(pn)%min = 288.0 |
---|
393 | steering_dvrp(pn)%max = 292.0 |
---|
394 | ENDIF |
---|
395 | |
---|
396 | name_c = TRIM( do3d(0,vn) ) |
---|
397 | WRITE ( 9, * ) '*** #9' |
---|
398 | CALL FLUSH_( 9 ) |
---|
399 | CALL DVRP_STEERING_INIT( m-1, name_c, steering_dvrp(pn)%min, & |
---|
400 | steering_dvrp(pn)%max, threshold(tv) ) |
---|
401 | WRITE ( 9, * ) '*** #10' |
---|
402 | CALL FLUSH_( 9 ) |
---|
403 | |
---|
404 | ELSEIF ( mode_dvrp(pn)(1:6) == 'slicer' ) THEN |
---|
405 | |
---|
406 | READ ( mode_dvrp(pn), '(6X,I1)' ) vn |
---|
407 | steering_dvrp(pn)%name = do2d(0,vn) |
---|
408 | name_c = TRIM( do2d(0,vn) ) |
---|
409 | |
---|
410 | l = MAX( 2, LEN_TRIM( do2d(0,vn) ) ) |
---|
411 | section_chr = do2d(0,vn)(l-1:l) |
---|
412 | SELECT CASE ( section_chr ) |
---|
413 | CASE ( 'xy' ) |
---|
414 | steering_dvrp(pn)%imin = 0 |
---|
415 | steering_dvrp(pn)%imax = nz_do3d |
---|
416 | slicer_position_dvrp(pn) = section(1,1) |
---|
417 | CALL DVRP_STEERING_INIT( m-1, name_c, & |
---|
418 | steering_dvrp(pn)%imin, & |
---|
419 | steering_dvrp(pn)%imax, & |
---|
420 | slicer_position_dvrp(pn) ) |
---|
421 | CASE ( 'xz' ) |
---|
422 | steering_dvrp(pn)%imin = 0 |
---|
423 | steering_dvrp(pn)%imax = ny |
---|
424 | slicer_position_dvrp(pn) = section(1,2) |
---|
425 | CALL DVRP_STEERING_INIT( m-1, name_c, & |
---|
426 | steering_dvrp(pn)%imin, & |
---|
427 | steering_dvrp(pn)%imax, & |
---|
428 | slicer_position_dvrp(pn) ) |
---|
429 | CASE ( 'yz' ) |
---|
430 | steering_dvrp(pn)%imin = 0 |
---|
431 | steering_dvrp(pn)%imax = nx |
---|
432 | slicer_position_dvrp(pn) = section(1,3) |
---|
433 | CALL DVRP_STEERING_INIT( m-1, name_c, & |
---|
434 | steering_dvrp(pn)%imin, & |
---|
435 | steering_dvrp(pn)%imax, & |
---|
436 | slicer_position_dvrp(pn) ) |
---|
437 | END SELECT |
---|
438 | |
---|
439 | ENDIF |
---|
440 | |
---|
441 | pn = pn + 1 |
---|
442 | |
---|
443 | ENDDO |
---|
444 | |
---|
445 | WRITE ( 9, * ) '*** #11' |
---|
446 | CALL FLUSH_( 9 ) |
---|
447 | |
---|
448 | dvrp_file = TRIM( mode_dvrp(m) ) // '/*****.dvr' |
---|
449 | dvrp_file_c = dvrp_file |
---|
450 | CALL DVRP_OUTPUT_RTSP( m-1, dvrp_host_c, dvrp_username_c, & |
---|
451 | dvrp_password_c, dvrp_directory_c, & |
---|
452 | dvrp_file_c ) |
---|
453 | WRITE ( 9, * ) '*** #12' |
---|
454 | CALL FLUSH_( 9 ) |
---|
455 | |
---|
456 | ELSEIF ( dvrp_output == 'ftp' ) THEN |
---|
457 | |
---|
458 | dvrp_file = TRIM( mode_dvrp(m) ) // '.%05d.dvr' |
---|
459 | dvrp_file_c = dvrp_file |
---|
460 | ! CALL DVRP_OUTPUT_FTP( m-1, 0, dvrp_host_c, dvrp_username_c, & |
---|
461 | ! dvrp_password_c, dvrp_directory_c, dvrp_file_c ) |
---|
462 | |
---|
463 | ELSE |
---|
464 | |
---|
465 | IF ( dvrp_file(1:9) /= '/dev/null' ) THEN |
---|
466 | dvrp_file_local = TRIM( mode_dvrp(m) ) // '.camera.dvr' |
---|
467 | dvrp_file_local_c = dvrp_file_local |
---|
468 | ELSE |
---|
469 | dvrp_file_local_c = dvrp_file_c |
---|
470 | ENDIF |
---|
471 | ! CALL DVRP_OUTPUT_LOCAL( m-1, 0, dvrp_file_local_c ) |
---|
472 | |
---|
473 | ENDIF |
---|
474 | |
---|
475 | ! dvrp_file = TRIM( mode_dvrp(m) ) // '.%05d.dvr' // CHAR( 0 ) |
---|
476 | ! dvrp_file = TRIM( mode_dvrp(m) ) // '/*****.dvr' // CHAR( 0 ) |
---|
477 | ! dvrp_file = '/dev/null' // CHAR( 0 ) |
---|
478 | ! CALL DVRP_OUTPUT_FTP( m-1, 0, dvrp_host, dvrp_username, dvrp_password, & |
---|
479 | ! dvrp_directory, dvrp_file ) |
---|
480 | ! CALL DVRP_OUTPUT_RTSP( m-1, dvrp_host, dvrp_username, dvrp_password, & |
---|
481 | ! dvrp_directory, dvrp_file ) |
---|
482 | ! CALL DVRP_OUTPUT_LOCAL( m-1, 0, dvrp_file ) |
---|
483 | |
---|
484 | ! |
---|
485 | !-- Determine local gridpoint coordinates |
---|
486 | IF ( .NOT. allocated ) THEN |
---|
487 | ALLOCATE( xcoor_dvrp(nxl:nxr+1), ycoor_dvrp(nys:nyn+1), & |
---|
488 | zcoor_dvrp(nzb:nz_do3d) ) |
---|
489 | allocated = .TRUE. |
---|
490 | |
---|
491 | DO i = nxl, nxr+1 |
---|
492 | xcoor_dvrp(i) = i * dx * superelevation_x |
---|
493 | ENDDO |
---|
494 | DO j = nys, nyn+1 |
---|
495 | ycoor_dvrp(j) = j * dy * superelevation_y |
---|
496 | ENDDO |
---|
497 | zcoor_dvrp = zu(nzb:nz_do3d) * superelevation |
---|
498 | nx_dvrp = nxr+1 - nxl + 1 |
---|
499 | ny_dvrp = nyn+1 - nys + 1 |
---|
500 | nz_dvrp = nz_do3d - nzb + 1 |
---|
501 | ENDIF |
---|
502 | |
---|
503 | ! |
---|
504 | !-- Define the grid used by dvrp |
---|
505 | WRITE ( 9, * ) '*** #13' |
---|
506 | CALL FLUSH_( 9 ) |
---|
507 | |
---|
508 | CALL DVRP_GRID( m-1, nx_dvrp, ny_dvrp, nz_dvrp, xcoor_dvrp, ycoor_dvrp, & |
---|
509 | zcoor_dvrp ) |
---|
510 | WRITE ( 9, * ) '*** #14' |
---|
511 | CALL FLUSH_( 9 ) |
---|
512 | |
---|
513 | |
---|
514 | m = m + 1 |
---|
515 | |
---|
516 | ENDDO |
---|
517 | |
---|
518 | #endif |
---|
519 | END SUBROUTINE init_dvrp |
---|
520 | |
---|
521 | |
---|
522 | SUBROUTINE init_dvrp_logging |
---|
523 | |
---|
524 | !------------------------------------------------------------------------------! |
---|
525 | ! Description: |
---|
526 | ! ------------ |
---|
527 | ! Initializes logging events for time measurement with dvrp software |
---|
528 | ! and splits one PE from the global communicator in case that dvrp output |
---|
529 | ! shall be done by one single PE. |
---|
530 | !------------------------------------------------------------------------------! |
---|
531 | #if defined( __dvrp_graphics ) |
---|
532 | |
---|
533 | USE dvrp_variables |
---|
534 | USE pegrid |
---|
535 | |
---|
536 | IMPLICIT NONE |
---|
537 | |
---|
538 | CHARACTER (LEN=4) :: chr |
---|
539 | INTEGER :: idummy |
---|
540 | |
---|
541 | ! |
---|
542 | !-- Initialize logging of calls by DVRP graphic software |
---|
543 | WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_LOG_INIT' |
---|
544 | CALL FLUSH_( 9 ) |
---|
545 | CALL DVRP_LOG_INIT( 'DVRP_LOG' // CHAR( 0 ), 0 ) |
---|
546 | WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_LOG_INIT' |
---|
547 | CALL FLUSH_( 9 ) |
---|
548 | |
---|
549 | ! |
---|
550 | !-- User-defined logging events: #1 (total time needed by PALM) |
---|
551 | WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_LOG_SYMBOL' |
---|
552 | CALL FLUSH_( 9 ) |
---|
553 | CALL DVRP_LOG_SYMBOL( 1, 'PALM_total' // CHAR( 0 ) ) |
---|
554 | WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_LOG_SYMBOL' |
---|
555 | CALL FLUSH_( 9 ) |
---|
556 | CALL DVRP_LOG_SYMBOL( 2, 'PALM_timestep' // CHAR( 0 ) ) |
---|
557 | WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_LOG_EVENT' |
---|
558 | CALL FLUSH_( 9 ) |
---|
559 | CALL DVRP_LOG_EVENT( 1, 1 ) |
---|
560 | WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_LOG_EVENT' |
---|
561 | CALL FLUSH_( 9 ) |
---|
562 | |
---|
563 | #if defined( __parallel ) |
---|
564 | ! |
---|
565 | !-- Find out, if dvrp output shall be done by a dedicated PE |
---|
566 | CALL local_getenv( 'use_seperate_pe_for_dvrp_output', 31, chr, idummy ) |
---|
567 | IF ( chr == 'true' ) THEN |
---|
568 | use_seperate_pe_for_dvrp_output = .TRUE. |
---|
569 | WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_SPLIT' |
---|
570 | CALL FLUSH_( 9 ) |
---|
571 | CALL DVRP_SPLIT( MPI_COMM_WORLD, comm_palm ) |
---|
572 | WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_SPLIT' |
---|
573 | CALL FLUSH_( 9 ) |
---|
574 | CALL MPI_COMM_SIZE( comm_palm, numprocs, ierr ) |
---|
575 | ENDIF |
---|
576 | #endif |
---|
577 | |
---|
578 | #endif |
---|
579 | END SUBROUTINE init_dvrp_logging |
---|
580 | |
---|
581 | |
---|
582 | SUBROUTINE close_dvrp |
---|
583 | |
---|
584 | !------------------------------------------------------------------------------! |
---|
585 | ! Description: |
---|
586 | ! ------------ |
---|
587 | ! Exit of dvrp software and finish dvrp logging |
---|
588 | !------------------------------------------------------------------------------! |
---|
589 | #if defined( __dvrp_graphics ) |
---|
590 | |
---|
591 | USE control_parameters |
---|
592 | USE dvrp |
---|
593 | USE dvrp_variables |
---|
594 | |
---|
595 | INTEGER :: m |
---|
596 | |
---|
597 | ! |
---|
598 | !-- If required, close dvrp-software and logging of dvrp-calls |
---|
599 | IF ( dt_dvrp /= 9999999.9 ) THEN |
---|
600 | m = 1 |
---|
601 | DO WHILE ( mode_dvrp(m) /= ' ' ) |
---|
602 | CALL DVRP_EXIT( m-1 ) |
---|
603 | m = m + 1 |
---|
604 | ENDDO |
---|
605 | CALL DVRP_LOG_EVENT( -1, 1 ) ! Logging of total cpu-time used by PALM |
---|
606 | IF ( use_seperate_pe_for_dvrp_output ) THEN |
---|
607 | CALL DVRP_SPLIT_EXIT( 1 ) ! Argument 0: reduced output |
---|
608 | ELSE |
---|
609 | CALL DVRP_LOG_EXIT( 1 ) ! Argument 0: reduced output |
---|
610 | ENDIF |
---|
611 | ENDIF |
---|
612 | |
---|
613 | #endif |
---|
614 | END SUBROUTINE close_dvrp |
---|