Index: palm/trunk/UTIL/surface_output_processing/surface_output_to_vtk.f90
===================================================================
--- palm/trunk/UTIL/surface_output_processing/surface_output_to_vtk.f90	(revision 3754)
+++ palm/trunk/UTIL/surface_output_processing/surface_output_to_vtk.f90	(revision 3755)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! - Change format description to avoid *** for larger domains
+! - switch back from to non-standard Fortran ftell and fseek since posix
+!   interface do not work any more for some unknown reason
+! 
+! 3523 2018-11-13 16:09:31Z suehring
 ! Implement interface for posix conform C-systemcalls in order to replace
 ! non-standard FORTRAN functions ftell and fseek. 
@@ -151,12 +156,16 @@
     CHARACTER(LEN=30)  ::  myid_char              !< combined string indicating binary file
     
+
     CHARACTER(LEN=100) ::  path                   !< path to the binary data 
     CHARACTER(LEN=100) ::  run                    !< name of the run
     CHARACTER(LEN=100) ::  variable_name          !< name of the processed output variable    
+
+    INTEGER(4)   ::  ftell                      !< intrinsic function, get current position in file
+    INTEGER(4)   ::  ndum                       !< return parameter of intrinsic function fseek   
        
     INTEGER, PARAMETER ::  iwp = 4                !< integer precision
     INTEGER, PARAMETER ::  wp  = 8                !< float precision
     INTEGER, PARAMETER ::  OFFSET_KIND = C_SIZE_T !< unsigned integer for the C-interface
-    
+
     INTEGER(iwp) ::  cycle_number                 !< cycle number
     INTEGER(iwp) ::  f                            !< running index over all binary files
@@ -169,6 +178,7 @@
     INTEGER(iwp) ::  ns_total                     !< total number of polygons
     INTEGER(iwp) ::  num_pe                       !< number of processors of the run
-    
-    INTEGER(OFFSET_KIND),DIMENSION(:), ALLOCATABLE ::  filepos !< current fileposition in binary file
+
+!     INTEGER(OFFSET_KIND),DIMENSION(:), ALLOCATABLE ::  filepos !< current fileposition in binary file
+    INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  filepos !< current fileposition in binary file
     
     INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  npoints !< number of points/vertices in a binaray file
@@ -193,8 +203,8 @@
 !-- Allocate array which contains the file position in each output file,
 !-- in order to skip some reading.
-    ALLOCATE( eof( 0:num_pe-1 )     )
-    ALLOCATE( filepos( 0:num_pe-1 ) )
-    ALLOCATE( npoints( 0:num_pe-1 ) )
-    ALLOCATE( ns( 0:num_pe-1 )      )
+    ALLOCATE( eof(0:num_pe-1)     )
+    ALLOCATE( filepos(0:num_pe-1) )
+    ALLOCATE( npoints(0:num_pe-1) )
+    ALLOCATE( ns(0:num_pe-1)      )
 !
 !-- Initialize file position.
@@ -242,5 +252,6 @@
 !
 !--    Obtain current file position. Will be stored for next file opening.
-       CALL posix_ftell( file_id_in, filepos(f) )
+!        CALL posix_ftell( file_id_in, filepos(f) )
+       filepos(f) = ftell( file_id_in )
 !
 !--    Write header information. Only one time required.
@@ -256,5 +267,5 @@
 !--    Write the vertex data into header file.
        DO  n = 1, npoints(f)
-          WRITE( file_id_out_header, '(8F10.1)' )  points(1:3,n)
+          WRITE( file_id_out_header, '(8F15.1)' )  points(1:3,n)
        ENDDO
 !
@@ -276,5 +287,6 @@
 !
 !--    Move to last postion. 
-       CALL posix_lseek( file_id_in, filepos(f) )
+!        CALL posix_lseek( file_id_in, filepos(f) )
+       CALL FSEEK( file_id_in, filepos(f), 0, ndum )
 !
 !--    Allocate array for polygon data
@@ -286,9 +298,10 @@
 !--    Obtain current file position after reading the local polygon data. 
 !--    Will be used for next file opening.
-       CALL posix_ftell( file_id_in, filepos(f) )
+!        CALL posix_ftell( file_id_in, filepos(f) )
+       filepos(f) = ftell( file_id_in )
 !
 !--    Write further header information. Only one time required.
        IF ( f == 0 )                                                           &
-          WRITE ( file_id_out_header, '(A,8I10)') "POLYGONS ",                 &
+          WRITE ( file_id_out_header, '(A,2I10)') "POLYGONS ",                 &
                                                   ns_total, 5 * ns_total
 !
@@ -297,5 +310,5 @@
 !--    surface element.
        DO n = 1, ns(f)
-          WRITE ( file_id_out_header, '(8I10)' )  INT( polygons(1:5,n) )
+          WRITE ( file_id_out_header, '(5I18)' )  INT( polygons(1:5,n) )
        ENDDO
 !
@@ -344,7 +357,6 @@
 !
 !--       Move to last postion. 
-!           ndum = fseek( file_id_in, filepos(f), 0 )
-          CALL posix_lseek( file_id_in, filepos(f) )
-!           CALL FSEEK( file_id_in, filepos(f), 0, ndum )
+!           CALL posix_lseek( file_id_in, filepos(f) )
+          CALL FSEEK( file_id_in, filepos(f), 0, ndum )
 !
 !--       Read string length and string indicating the output time step. 
@@ -409,5 +421,6 @@
 !
 !--       Remember file position in binary file and close it.
-          CALL posix_ftell( file_id_in, filepos(f) )
+!           CALL posix_ftell( file_id_in, filepos(f) )
+          filepos(f) = ftell( file_id_in )
        
           CLOSE ( file_id_in )
