Changeset 3755 for palm/trunk/UTIL/surface_output_processing
- Timestamp:
- Feb 19, 2019 5:03:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/surface_output_processing/surface_output_to_vtk.f90
r3523 r3755 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - Change format description to avoid *** for larger domains 28 ! - switch back from to non-standard Fortran ftell and fseek since posix 29 ! interface do not work any more for some unknown reason 30 ! 31 ! 3523 2018-11-13 16:09:31Z suehring 27 32 ! Implement interface for posix conform C-systemcalls in order to replace 28 33 ! non-standard FORTRAN functions ftell and fseek. … … 151 156 CHARACTER(LEN=30) :: myid_char !< combined string indicating binary file 152 157 158 153 159 CHARACTER(LEN=100) :: path !< path to the binary data 154 160 CHARACTER(LEN=100) :: run !< name of the run 155 161 CHARACTER(LEN=100) :: variable_name !< name of the processed output variable 162 163 INTEGER(4) :: ftell !< intrinsic function, get current position in file 164 INTEGER(4) :: ndum !< return parameter of intrinsic function fseek 156 165 157 166 INTEGER, PARAMETER :: iwp = 4 !< integer precision 158 167 INTEGER, PARAMETER :: wp = 8 !< float precision 159 168 INTEGER, PARAMETER :: OFFSET_KIND = C_SIZE_T !< unsigned integer for the C-interface 160 169 161 170 INTEGER(iwp) :: cycle_number !< cycle number 162 171 INTEGER(iwp) :: f !< running index over all binary files … … 169 178 INTEGER(iwp) :: ns_total !< total number of polygons 170 179 INTEGER(iwp) :: num_pe !< number of processors of the run 171 172 INTEGER(OFFSET_KIND),DIMENSION(:), ALLOCATABLE :: filepos !< current fileposition in binary file 180 181 ! INTEGER(OFFSET_KIND),DIMENSION(:), ALLOCATABLE :: filepos !< current fileposition in binary file 182 INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: filepos !< current fileposition in binary file 173 183 174 184 INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: npoints !< number of points/vertices in a binaray file … … 193 203 !-- Allocate array which contains the file position in each output file, 194 204 !-- in order to skip some reading. 195 ALLOCATE( eof( 0:num_pe-1) )196 ALLOCATE( filepos( 0:num_pe-1) )197 ALLOCATE( npoints( 0:num_pe-1) )198 ALLOCATE( ns( 0:num_pe-1) )205 ALLOCATE( eof(0:num_pe-1) ) 206 ALLOCATE( filepos(0:num_pe-1) ) 207 ALLOCATE( npoints(0:num_pe-1) ) 208 ALLOCATE( ns(0:num_pe-1) ) 199 209 ! 200 210 !-- Initialize file position. … … 242 252 ! 243 253 !-- Obtain current file position. Will be stored for next file opening. 244 CALL posix_ftell( file_id_in, filepos(f) ) 254 ! CALL posix_ftell( file_id_in, filepos(f) ) 255 filepos(f) = ftell( file_id_in ) 245 256 ! 246 257 !-- Write header information. Only one time required. … … 256 267 !-- Write the vertex data into header file. 257 268 DO n = 1, npoints(f) 258 WRITE( file_id_out_header, '(8F1 0.1)' ) points(1:3,n)269 WRITE( file_id_out_header, '(8F15.1)' ) points(1:3,n) 259 270 ENDDO 260 271 ! … … 276 287 ! 277 288 !-- Move to last postion. 278 CALL posix_lseek( file_id_in, filepos(f) ) 289 ! CALL posix_lseek( file_id_in, filepos(f) ) 290 CALL FSEEK( file_id_in, filepos(f), 0, ndum ) 279 291 ! 280 292 !-- Allocate array for polygon data … … 286 298 !-- Obtain current file position after reading the local polygon data. 287 299 !-- Will be used for next file opening. 288 CALL posix_ftell( file_id_in, filepos(f) ) 300 ! CALL posix_ftell( file_id_in, filepos(f) ) 301 filepos(f) = ftell( file_id_in ) 289 302 ! 290 303 !-- Write further header information. Only one time required. 291 304 IF ( f == 0 ) & 292 WRITE ( file_id_out_header, '(A, 8I10)') "POLYGONS ", &305 WRITE ( file_id_out_header, '(A,2I10)') "POLYGONS ", & 293 306 ns_total, 5 * ns_total 294 307 ! … … 297 310 !-- surface element. 298 311 DO n = 1, ns(f) 299 WRITE ( file_id_out_header, '( 8I10)' ) INT( polygons(1:5,n) )312 WRITE ( file_id_out_header, '(5I18)' ) INT( polygons(1:5,n) ) 300 313 ENDDO 301 314 ! … … 344 357 ! 345 358 !-- Move to last postion. 346 ! ndum = fseek( file_id_in, filepos(f), 0 ) 347 CALL posix_lseek( file_id_in, filepos(f) ) 348 ! CALL FSEEK( file_id_in, filepos(f), 0, ndum ) 359 ! CALL posix_lseek( file_id_in, filepos(f) ) 360 CALL FSEEK( file_id_in, filepos(f), 0, ndum ) 349 361 ! 350 362 !-- Read string length and string indicating the output time step. … … 409 421 ! 410 422 !-- Remember file position in binary file and close it. 411 CALL posix_ftell( file_id_in, filepos(f) ) 423 ! CALL posix_ftell( file_id_in, filepos(f) ) 424 filepos(f) = ftell( file_id_in ) 412 425 413 426 CLOSE ( file_id_in )
Note: See TracChangeset
for help on using the changeset viewer.