Changeset 4784 for palm/trunk/UTIL/surface_output_processing
- Timestamp:
- Nov 13, 2020 6:24:56 PM (4 years ago)
- Location:
- palm/trunk/UTIL/surface_output_processing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/surface_output_processing/surface_output_parin
r3494 r4784 6 6 ! 7 7 !-- Path to the output binary files. 8 path = '~/palm/current_version/JOBS/test_urban/OUTPUT/', 9 ! 10 !-- Name of the run. 11 run = 'test_urban', 12 ! 13 !-- Cycle number of the output data which should be processed. 14 cycle_number = 0, 8 path = <replace by your path to surface data>, 15 9 ! 16 10 !-- Convert instantaneous or average data. -
palm/trunk/UTIL/surface_output_processing/surface_output_to_vtk.f90
r4481 r4784 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - Give path to surface data directly 28 ! - Remove non-used input variables 29 ! - Output 5 relevant digits for the point data in order to account also for 30 ! small grid spacings 31 ! 32 ! 4481 2020-03-31 18:55:54Z maronga 27 33 ! Add suffix to VTK output to indicate average data 28 34 ! … … 164 170 165 171 CHARACTER(LEN=100) :: path !< path to the binary data 166 CHARACTER(LEN=100) :: run !< name of the run167 172 CHARACTER(LEN=100) :: variable_name !< name of the processed output variable 168 173 169 INTEGER(4) :: ftell !< intrinsic function, get current position in file170 INTEGER(4) :: ndum !< return parameter of intrinsic function fseek174 INTEGER(4) :: ftell !< intrinsic function, get current position in file 175 INTEGER(4) :: ndum !< return parameter of intrinsic function fseek 171 176 172 177 INTEGER, PARAMETER :: iwp = 4 !< integer precision … … 174 179 INTEGER, PARAMETER :: OFFSET_KIND = C_SIZE_T !< unsigned integer for the C-interface 175 180 176 INTEGER(iwp) :: cycle_number !< cycle number177 181 INTEGER(iwp) :: f !< running index over all binary files 178 182 INTEGER(iwp) :: file_id_in = 18 !< file unit for input binaray file … … 201 205 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: points !< point / vertex data 202 206 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: polygons !< polygon data 207 real(wp) :: dum 203 208 204 209 logical :: flag … … 240 245 ! 241 246 !-- Open file with surface output for processor f. 242 OPEN ( file_id_in, FILE = TRIM( path ) // TRIM( run ) //&247 OPEN ( file_id_in, FILE = TRIM( path ) // & 243 248 TRIM( myid_char ), FORM = 'UNFORMATTED' ) 244 249 ! … … 271 276 !-- Write the vertex data into header file. 272 277 DO n = 1, npoints(f) 273 WRITE( file_id_out_header, '(8F15. 1)' ) points(1:3,n)278 WRITE( file_id_out_header, '(8F15.4)' ) points(1:3,n) 274 279 ENDDO 275 280 ! … … 287 292 ! 288 293 !-- Open file with surface output for processor f. 289 OPEN ( file_id_in, FILE = TRIM( path ) // TRIM( run ) // & 290 TRIM( myid_char ), FORM = 'UNFORMATTED' ) 294 OPEN ( file_id_in, FILE = TRIM( path ) // TRIM( myid_char ), FORM = 'UNFORMATTED' ) 291 295 ! 292 296 !-- Move to last postion. … … 357 361 ! 358 362 !-- Open binary file with surface output for processor f. 359 OPEN ( file_id_in, FILE = TRIM( path ) // TRIM( run ) // & 360 TRIM( myid_char ), FORM = 'UNFORMATTED' ) 363 OPEN ( file_id_in, FILE = TRIM( path ) // TRIM( myid_char ), FORM = 'UNFORMATTED' ) 361 364 ! 362 365 !-- Move to last postion. … … 472 475 INTEGER(iwp) :: file_id_parin = 90 473 476 474 NAMELIST /surface_output/ convert_average_data, cycle_number, num_pe, & 475 path, run 477 NAMELIST /surface_output/ convert_average_data, num_pe, path 476 478 477 479 ! … … 494 496 !------------------------------------------------------------------------------! 495 497 SUBROUTINE surface_output_create_file_string 496 498 497 499 IMPLICIT NONE 498 500 499 501 CHARACTER(LEN=3) :: char_av = '' 500 CHARACTER(LEN=4) :: char_cycle = ''501 502 !503 !-- Create substring for the cycle number.504 IF ( cycle_number /= 0 ) THEN505 IF ( cycle_number < 10 ) THEN506 WRITE( char_cycle, '(I1)') cycle_number507 char_cycle = '.00' // TRIM( char_cycle )508 ELSEIF ( cycle_number < 100 ) THEN509 WRITE( char_cycle, '(I2)') cycle_number510 char_cycle = '.0' // TRIM( char_cycle )511 ELSEIF ( cycle_number < 1000 ) THEN512 WRITE( char_cycle, '(I3)') cycle_number513 char_cycle = '.' // TRIM( char_cycle )514 ENDIF515 ENDIF516 502 ! 517 503 !-- Create substring for averaged data. … … 521 507 IF ( f < 10 ) THEN 522 508 WRITE( char_dum, '(I1)') f 523 myid_char = TRIM( char_av ) // '_surf_00000' // TRIM( char_dum ) // & 524 TRIM( char_cycle ) // file_suffix 509 myid_char = TRIM( char_av ) // '_00000' // TRIM( char_dum ) 525 510 ELSEIF ( f < 100 ) THEN 526 511 WRITE( char_dum, '(I2)') f 527 myid_char = TRIM( char_av ) // '_surf_0000' // TRIM( char_dum ) // & 528 TRIM( char_cycle ) // file_suffix 512 myid_char = TRIM( char_av ) // '_0000' // TRIM( char_dum ) 529 513 ELSEIF ( f < 1000 ) THEN 530 514 WRITE( char_dum, '(I3)') f 531 myid_char = TRIM( char_av ) // '_surf_000' // TRIM( char_dum ) // & 532 TRIM( char_cycle ) // file_suffix 515 myid_char = TRIM( char_av ) // '_000' // TRIM( char_dum ) 533 516 ELSEIF ( f < 10000 ) THEN 534 517 WRITE( char_dum, '(I4)') f 535 myid_char = TRIM( char_av ) // '_surf_00' // TRIM( char_dum ) // & 536 TRIM( char_cycle ) // file_suffix 518 myid_char = TRIM( char_av ) // '_00' // TRIM( char_dum ) 537 519 ELSEIF ( f < 100000 ) THEN 538 520 WRITE( char_dum, '(I5)') f 539 myid_char = TRIM( char_av ) // '_surf_0' // TRIM( char_dum ) // & 540 TRIM( char_cycle ) // file_suffix 521 myid_char = TRIM( char_av ) // '_0' // TRIM( char_dum ) 541 522 ELSEIF ( f < 1000000 ) THEN 542 523 WRITE( char_dum, '(I6)') f 543 myid_char = TRIM( char_av ) // '_surf_' // TRIM( char_dum ) // & 544 TRIM( char_cycle ) // file_suffix 524 myid_char = TRIM( char_av ) // '_' // TRIM( char_dum ) 545 525 ENDIF 546 526
Note: See TracChangeset
for help on using the changeset viewer.