Changeset 4784 for palm


Ignore:
Timestamp:
Nov 13, 2020 6:24:56 PM (4 years ago)
Author:
suehring
Message:

surface data output processing to vtk format: Output of 5 relevant digits rather than 1 for the point data in order to account also for small grid spacings; Give path to surface data directly; Remove non-used input variables

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  
    66!
    77!-- 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>,
    159!
    1610!-- Convert instantaneous or average data.
  • palm/trunk/UTIL/surface_output_processing/surface_output_to_vtk.f90

    r4481 r4784  
    2020! Current revisions:
    2121! -----------------
    22 ! 
    23 ! 
     22!
     23!
    2424! Former revisions:
    2525! -----------------
    2626! $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
    2733! Add suffix to VTK output to indicate average data
    2834!
     
    164170
    165171    CHARACTER(LEN=100) ::  path                   !< path to the binary data
    166     CHARACTER(LEN=100) ::  run                    !< name of the run
    167172    CHARACTER(LEN=100) ::  variable_name          !< name of the processed output variable   
    168173
    169     INTEGER(4)   ::  ftell                      !< intrinsic function, get current position in file
    170     INTEGER(4)   ::  ndum                       !< return parameter of intrinsic function fseek   
     174    INTEGER(4)   ::  ftell                        !< intrinsic function, get current position in file
     175    INTEGER(4)   ::  ndum                         !< return parameter of intrinsic function fseek   
    171176       
    172177    INTEGER, PARAMETER ::  iwp = 4                !< integer precision
     
    174179    INTEGER, PARAMETER ::  OFFSET_KIND = C_SIZE_T !< unsigned integer for the C-interface
    175180
    176     INTEGER(iwp) ::  cycle_number                 !< cycle number
    177181    INTEGER(iwp) ::  f                            !< running index over all binary files
    178182    INTEGER(iwp) ::  file_id_in = 18              !< file unit for input binaray file   
     
    201205    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  points         !< point / vertex data
    202206    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  polygons       !< polygon data
     207    real(wp) :: dum
    203208   
    204209    logical :: flag
     
    240245!
    241246!--    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 ) //                               &
    243248              TRIM( myid_char ), FORM = 'UNFORMATTED' )
    244249!
     
    271276!--    Write the vertex data into header file.
    272277       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)
    274279       ENDDO
    275280!
     
    287292!
    288293!--    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' )
    291295!
    292296!--    Move to last postion.
     
    357361!
    358362!--       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' )
    361364!
    362365!--       Move to last postion.
     
    472475       INTEGER(iwp) ::  file_id_parin = 90
    473476       
    474        NAMELIST /surface_output/  convert_average_data, cycle_number, num_pe,  &
    475                                   path, run
     477       NAMELIST /surface_output/  convert_average_data, num_pe, path
    476478
    477479!
     
    494496!------------------------------------------------------------------------------!
    495497    SUBROUTINE surface_output_create_file_string
    496        
     498
    497499       IMPLICIT NONE
    498        
     500
    499501       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 )  THEN
    505           IF ( cycle_number < 10 )  THEN
    506              WRITE( char_cycle, '(I1)')  cycle_number
    507              char_cycle = '.00' // TRIM( char_cycle )
    508           ELSEIF ( cycle_number < 100 )  THEN
    509              WRITE( char_cycle, '(I2)')  cycle_number
    510              char_cycle = '.0' // TRIM( char_cycle )
    511           ELSEIF ( cycle_number < 1000 )  THEN
    512              WRITE( char_cycle, '(I3)')  cycle_number
    513              char_cycle = '.' // TRIM( char_cycle )
    514           ENDIF
    515        ENDIF
    516502!
    517503!--    Create substring for averaged data.
     
    521507       IF ( f < 10 )  THEN
    522508          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 )
    525510       ELSEIF ( f < 100     )  THEN
    526511          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 )
    529513       ELSEIF ( f < 1000    )  THEN
    530514          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 )
    533516       ELSEIF ( f < 10000   )  THEN
    534517          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 )
    537519       ELSEIF ( f < 100000  )  THEN
    538520          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 )
    541522       ELSEIF ( f < 1000000 )  THEN
    542523          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 )
    545525       ENDIF
    546526       
Note: See TracChangeset for help on using the changeset viewer.