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