Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 77)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 82)
@@ -5,5 +5,20 @@
 Changed:
 -------
+All system relevant compile and link options as well as the host identifier (local_host) are specified in the configuration file.
 
+Filetransfer by ftp removed (options -f removed from mrun and mbuild).
+
+Call of (system-)FLUSH routine moved to new routine local_flush.
+
+return_addres and return_username are read from ENVPAR-NAMELIST-file.
+
+Preprocessor strings for different linux clusters changed to "lc", some preprocessor directives renamed (new: __intel_openmp_bug), preprocessor directives for old systems removed
+
+advec_particles, check_open, cpu_log, cpu_statistics, data_output_dvrp, flow_statistics, header, init_dvrp, init_particles, init_1d_model, init_dvrp, init_pegrid, local_getenv, local_system, local_tremain, local_tremain_ini, modules, run_control
+
+new:
+local_flush
+
+mbuild, mrun
 
 Errors:
Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 77)
+++ palm/trunk/SOURCE/Makefile	(revision 82)
@@ -4,5 +4,5 @@
 # Actual revisions:
 # -----------------
-# 
+# +local_flush
 #
 # Former revisions:
@@ -51,5 +51,5 @@
 	init_particles.f90 init_pegrid.f90 init_pt_anomaly.f90 \
 	init_rankine.f90 init_slope.f90 interaction_droplets_ptq.f90 \
-	local_getenv.f90 local_stop.f90 local_system.f90 local_tremain.f90 \
+	local_flush.f90 local_getenv.f90 local_stop.f90 local_system.f90 local_tremain.f90 \
 	local_tremain_ini.f90 modules.f90 netcdf.f90 package_parin.f90 \
 	palm.f90 parin.f90 particle_boundary_conds.f90 poisfft.f90 \
@@ -81,5 +81,5 @@
 	init_dvrp.o init_grid.o init_particles.o init_pegrid.o \
 	init_pt_anomaly.o init_rankine.o init_slope.o \
-	interaction_droplets_ptq.o local_getenv.o local_stop.o \
+	interaction_droplets_ptq.o local_flush.o local_getenv.o local_stop.o \
 	local_system.o local_tremain.o local_tremain_ini.o modules.o netcdf.o \
 	package_parin.o palm.o parin.o particle_boundary_conds.o poisfft.o \
Index: palm/trunk/SOURCE/advec_particles.f90
===================================================================
--- palm/trunk/SOURCE/advec_particles.f90	(revision 77)
+++ palm/trunk/SOURCE/advec_particles.f90	(revision 82)
@@ -117,5 +117,5 @@
 !       WRITE (9,*) '--- advec_particles: #1'
 !       WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !    ENDIF
 !
@@ -165,5 +165,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##0.3'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -172,5 +172,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -1872,5 +1872,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##0.4'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -1879,5 +1879,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -1904,8 +1904,8 @@
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory dt_prel'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 CALL allocate_prt_memory( number_of_initial_particles )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_prt_memory dt_prel'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
              ENDIF
           ENDIF
@@ -1928,8 +1928,8 @@
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory dt_prel'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                    CALL allocate_tail_memory( number_of_initial_tails )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_tail_memory dt_prel'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 ENDIF
              ENDIF
@@ -2008,5 +2008,5 @@
              ENDIF
 !    WRITE ( 9, * ) '*** advec_particles: after setting the beginning of new tails'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 
              number_of_particles = number_of_particles + &
@@ -2017,5 +2017,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##0.5'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2024,5 +2024,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -2031,5 +2031,5 @@
 !       WRITE (9,*) '--- advec_particles: #2'
 !       WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !    ENDIF
 !    DO  n = 1, number_of_particles
@@ -2038,5 +2038,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2103,5 +2103,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##1'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2111,5 +2111,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2117,5 +2117,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -2274,5 +2274,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##2'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2282,5 +2282,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2288,5 +2288,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -2313,8 +2313,8 @@
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trrp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 CALL allocate_prt_memory( trrp_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_prt_memory trrp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
              ENDIF
           ENDIF
@@ -2341,8 +2341,8 @@
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trrpt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                    CALL allocate_tail_memory( trrpt_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_tail_memory trrpt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 ENDIF
              ENDIF
@@ -2370,5 +2370,5 @@
 !          WRITE (9,*) '--- advec_particles: #3'
 !          WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !       ENDIF
 
@@ -2390,8 +2390,8 @@
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trlp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 CALL allocate_prt_memory( trlp_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_prt_memory trlp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
              ENDIF
           ENDIF
@@ -2418,8 +2418,8 @@
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trlpt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                    CALL allocate_tail_memory( trlpt_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_tail_memory trlpt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 ENDIF
              ENDIF
@@ -2447,5 +2447,5 @@
 !          WRITE (9,*) '--- advec_particles: #4'
 !          WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !       ENDIF
 
@@ -2460,5 +2460,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##3'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2468,5 +2468,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2474,5 +2474,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -2538,5 +2538,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##4'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2546,5 +2546,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2552,5 +2552,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -2715,5 +2715,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##5'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2723,5 +2723,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2729,5 +2729,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -2754,8 +2754,8 @@
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trnp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 CALL allocate_prt_memory( trnp_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_prt_memory trnp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
              ENDIF
           ENDIF
@@ -2782,8 +2782,8 @@
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trnpt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                    CALL allocate_tail_memory( trnpt_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_tail_memory trnpt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 ENDIF
              ENDIF
@@ -2811,5 +2811,5 @@
 !          WRITE (9,*) '--- advec_particles: #5'
 !          WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !       ENDIF
 
@@ -2831,8 +2831,8 @@
              ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_prt_memory trsp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 CALL allocate_prt_memory( trsp_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_prt_memory trsp'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
              ENDIF
           ENDIF
@@ -2859,8 +2859,8 @@
                 ELSE
 !    WRITE ( 9, * ) '*** advec_particles: before allocate_tail_memory trspt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                    CALL allocate_tail_memory( trspt_count_recv )
 !    WRITE ( 9, * ) '*** advec_particles: after allocate_tail_memory trspt'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
                 ENDIF
              ENDIF
@@ -2888,5 +2888,5 @@
 !          WRITE (9,*) '--- advec_particles: #6'
 !          WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !       ENDIF
 
@@ -2901,5 +2901,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##6'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -2909,5 +2909,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -2915,5 +2915,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -3133,5 +3133,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##7'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    nd = 0
 !    DO  n = 1, number_of_particles
@@ -3141,5 +3141,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -3147,5 +3147,5 @@
 !    IF ( nd /= deleted_particles ) THEN
 !       WRITE (9,*) '*** nd=',nd,' deleted_particles=',deleted_particles
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !       CALL MPI_ABORT( comm2d, 9999, ierr )
 !    ENDIF
@@ -3167,5 +3167,5 @@
 !       IF ( nd /= deleted_particles ) THEN
 !          WRITE (9,*) '*** advec_part nd=',nd,' deleted_particles=',deleted_particles
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -3189,5 +3189,5 @@
 !                WRITE (9,*) '+++ n=',n,' (of ',number_of_tails,' #oftails)'
 !                WRITE (9,*) '    id=',new_tail_id(n)
-!                CALL FLUSH_( 9 )
+!                CALL local_flush( 9 )
                 ENDIF
              ENDDO
@@ -3196,5 +3196,5 @@
 !       IF ( nd /= deleted_tails  .AND.  use_particle_tails ) THEN
 !          WRITE (9,*) '*** advec_part nd=',nd,' deleted_tails=',deleted_tails
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -3211,5 +3211,5 @@
 !        WRITE (9,*) '    new_tail_id=', new_tail_id(particles(n)%tail_id), &
 !                         ' of (',number_of_tails,')'
-!        CALL FLUSH_( 9 )
+!        CALL local_flush( 9 )
 !     ENDIF
                 particles(n)%tail_id = new_tail_id(particles(n)%tail_id)
@@ -3219,5 +3219,5 @@
 !     IF ( nn /= number_of_tails  .AND.  use_particle_tails ) THEN
 !        WRITE (9,*) '*** advec_part #of_tails=',number_of_tails,' nn=',nn
-!        CALL FLUSH_( 9 )
+!        CALL local_flush( 9 )
 !        DO  n = 1, number_of_particles
 !           WRITE (9,*) 'prt# ',n,' tail_id=',particles(n)%tail_id, &
@@ -3233,8 +3233,8 @@
 !       WRITE (9,*) '--- advec_particles: #7'
 !       WRITE (9,*) '    #of p=',number_of_particles,' #of t=',number_of_tails
-!       CALL FLUSH_( 9 )
+!       CALL local_flush( 9 )
 !    ENDIF
 !    WRITE ( 9, * ) '*** advec_particles: ##8'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    DO  n = 1, number_of_particles
 !       IF ( particles(n)%tail_id<0 .OR. particles(n)%tail_id>number_of_tails ) &
@@ -3242,5 +3242,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -3252,5 +3252,5 @@
 
 !    WRITE ( 9, * ) '*** advec_particles: ##9'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    DO  n = 1, number_of_particles
 !       IF ( particles(n)%tail_id<0 .OR. particles(n)%tail_id>number_of_tails ) &
@@ -3258,5 +3258,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -3341,5 +3341,5 @@
     CALL user_particle_attributes
 !    WRITE ( 9, * ) '*** advec_particles: ##10'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 !    DO  n = 1, number_of_particles
 !       IF ( particles(n)%tail_id<0 .OR. particles(n)%tail_id>number_of_tails ) &
@@ -3347,5 +3347,5 @@
 !          WRITE (9,*) '+++ n=',n,' (of ',number_of_particles,')'
 !          WRITE (9,*) '    id=',particles(n)%tail_id,' of (',number_of_tails,')'
-!          CALL FLUSH_( 9 )
+!          CALL local_flush( 9 )
 !          CALL MPI_ABORT( comm2d, 9999, ierr )
 !       ENDIF
@@ -3366,5 +3366,5 @@
 !--          next tailpoint
 !             WRITE ( 9, * ) '*** advec_particles: ##10.1  nn=',nn
-!             CALL FLUSH_( 9 )
+!             CALL local_flush( 9 )
              IF ( minimum_tailpoint_distance /= 0.0 )  THEN
                 distance = ( particle_tail_coordinates(1,1,nn) -      &
@@ -3376,5 +3376,5 @@
              ENDIF
 !             WRITE ( 9, * ) '*** advec_particles: ##10.2'
-!             CALL FLUSH_( 9 )
+!             CALL local_flush( 9 )
 !
 !--          First, increase the index of all existings tailpoints by one
@@ -3395,5 +3395,5 @@
              ENDIF
 !             WRITE ( 9, * ) '*** advec_particles: ##10.3'
-!             CALL FLUSH_( 9 )
+!             CALL local_flush( 9 )
 !
 !--          In any case, store the new point at the beginning of the tail
@@ -3403,5 +3403,5 @@
              particle_tail_coordinates(1,4,nn) = particles(n)%color
 !             WRITE ( 9, * ) '*** advec_particles: ##10.4'
-!             CALL FLUSH_( 9 )
+!             CALL local_flush( 9 )
 !
 !--          Increase the age of the tailpoints
@@ -3418,5 +3418,5 @@
              ENDIF
 !             WRITE ( 9, * ) '*** advec_particles: ##10.5'
-!             CALL FLUSH_( 9 )
+!             CALL local_flush( 9 )
 
           ENDIF
@@ -3426,5 +3426,5 @@
     ENDIF
 !    WRITE ( 9, * ) '*** advec_particles: ##11'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 
 !
@@ -3533,5 +3533,5 @@
     ENDIF
     WRITE (9,*) '*** Request: ',new_maximum_number,' new_maximum_number(tails)'
-!    CALL FLUSH_( 9 )
+!    CALL local_flush( 9 )
 
     tmp_tail(:,:,1:number_of_tails)  = &
Index: palm/trunk/SOURCE/check_open.f90
===================================================================
--- palm/trunk/SOURCE/check_open.f90	(revision 77)
+++ palm/trunk/SOURCE/check_open.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Call of local_getenv removed, preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -42,5 +42,5 @@
 
     CHARACTER (LEN=2)   ::  suffix
-    CHARACTER (LEN=20)  ::  return_addres, return_usern, xtext = 'time in s'
+    CHARACTER (LEN=20)  ::  xtext = 'time in s'
     CHARACTER (LEN=30)  ::  filename
     CHARACTER (LEN=40)  ::  avs_coor_file, avs_coor_file_localname, &
@@ -151,9 +151,4 @@
                         STATUS='OLD' )
           ELSE
-#if defined( __t3eh ) || defined( __t3eb ) || defined( __t3ej5 )
-!
-!--          Declare a cache layer for faster I/O
-             CALL ASNUNIT ( 13, '-F cachea:512:1:1', ierr1 )
-#endif
              OPEN ( 13, FILE='BININ/'//myid_char, FORM='UNFORMATTED', &
                         STATUS='OLD' )
@@ -174,9 +169,4 @@
 !--          directory created by PE0 can open their file
              CALL MPI_BARRIER( comm2d, ierr )
-#endif
-#if defined( __t3eh ) || defined( __t3eb ) || defined( __t3ej5 )
-!
-!--          Declare a cache layer for faster I/O
-             CALL ASNUNIT ( 14, '-F cachea:512:1:1', ierr1 )
 #endif
              OPEN ( 14, FILE='BINOUT/'//myid_char_14, FORM='UNFORMATTED', &
@@ -342,13 +332,4 @@
        CASE ( 30 )
 
-
-#if defined( __t3eb ) || defined( __t3eh ) || defined( __t3ej5 )
-!
-!--       In case of active data compression 32Bit integer output
-          IF ( do3d_compress )  THEN
-             CALL ASNUNIT( 30, '-F f77 -N ieee_32', ierr1 )
-          ENDIF
-#endif
-
           OPEN ( 30, FILE='PLOT3D_DATA'//myid_char, FORM='UNFORMATTED' )
 !
@@ -369,6 +350,6 @@
 !--          Therefore path information has to be obtained first.
              IF ( avs_output )  THEN
-                CALL local_getenv( 'return_addres', 13, return_addres, iaddres )
-                CALL local_getenv( 'return_username', 15, return_usern, iusern )
+                iaddres = LEN_TRIM( return_addres )
+                iusern  = LEN_TRIM( return_username )
 
                 OPEN ( 3, FILE='OUTPUT_FILE_CONNECTIONS', FORM='FORMATTED' )
@@ -433,5 +414,5 @@
 !--                   really transferred.
                       command = TRIM( batch_scp ) // ' -n -u ' // &
-                         return_usern(1:iusern) // ' ' // &
+                         return_username(1:iusern) // ' ' // &
                          return_addres(1:iaddres) // ' /etc/passwd "' // &
                          TRIM( avs_coor_file_catalog ) // '" ' // &
@@ -445,5 +426,5 @@
 !--                   Determine the data file name
                       command = TRIM( batch_scp ) // ' -n -u ' // &
-                         return_usern(1:iusern) // ' ' // &
+                         return_username(1:iusern) // ' ' // &
                          return_addres(1:iaddres) // ' /etc/passwd "' // &
                          TRIM( avs_data_file_catalog ) // '" ' // &
Index: palm/trunk/SOURCE/cpu_log.f90
===================================================================
--- palm/trunk/SOURCE/cpu_log.f90	(revision 77)
+++ palm/trunk/SOURCE/cpu_log.f90	(revision 82)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor strings for different linux clusters changed to "lc",
+! preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -34,10 +35,8 @@
     TYPE(logpoint)              ::  log_event
 
-#if defined( __lcmuk ) || defined( __lctit ) || defined( __hpmuk ) || defined( __decalpha ) || defined( __nec )
+#if defined( __lc ) || defined( __decalpha ) || defined( __nec )
     INTEGER                     ::  count, count_rate
 #elif defined( __ibm )
     INTEGER(8)                  ::  IRTC
-#elif defined( __t3eb )
-    REAL                        ::  TIMEF
 #endif
 
@@ -57,20 +56,9 @@
 !
 !-- Take current time
-#if defined( __lcmuk ) || defined( __lctit ) || defined( __hpmuk ) || defined( __decalpha ) || defined( __nec )
+#if defined( __lc ) || defined( __decalpha ) || defined( __nec )
     CALL SYSTEM_CLOCK( count, count_rate )
     mtime = REAL( count ) / REAL( count_rate )
 #elif defined( __ibm )
     mtime = IRTC( ) * 1E-9
-!#elif defined( __vpp )
-!    CALL CLOCKV ( mtimevec, mtime, 0, 2 )
-#elif defined( __t3eb ) || defined( __t3eh ) || defined( __t3ej2 ) || defined( __t3ej5 )
-#if defined( __parallel )
-    IF ( .NOT. PRESENT( barrierwait ) )  THEN
-       CALL MPI_BARRIER( comm2d, ierr )
-       CONTINUE
-    ENDIF
-#endif
-    mtime = TIMEF( )
-    mtime = mtime * 0.001
 #else
     IF ( myid == 0 )  THEN
Index: palm/trunk/SOURCE/cpu_statistics.f90
===================================================================
--- palm/trunk/SOURCE/cpu_statistics.f90	(revision 77)
+++ palm/trunk/SOURCE/cpu_statistics.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -37,8 +37,4 @@
     REAL, DIMENSION(:,:), ALLOCATABLE ::  pe_log_points
 
-
-!#if defined( __hpmuk )  &&  ! defined( __chinook )
-!    norm = clock_ticks_per_second()
-!#endif
 
 !
Index: palm/trunk/SOURCE/data_output_dvrp.f90
===================================================================
--- palm/trunk/SOURCE/data_output_dvrp.f90	(revision 77)
+++ palm/trunk/SOURCE/data_output_dvrp.f90	(revision 82)
@@ -32,4 +32,6 @@
 ! Actual revisions:
 ! -----------------
+! Preprocessor strings for different linux clusters changed to "lc",
+! routine local_flush is used for buffer flushing
 ! TEST: write statements
 !
@@ -84,9 +86,5 @@
 
     WRITE ( 9, * ) '*** myid=', myid, ' Anfang data_output_dvrp'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
     CALL cpu_log( log_point(27), 'data_output_dvrp', 'start' )
 
@@ -104,16 +102,8 @@
           lock_steering_update = .TRUE.
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: vor steering_update'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           CALL DVRP_STEERING_UPDATE( m-1, data_output_dvrp )
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: nach steering_update'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           lock_steering_update = .FALSE.
        ENDIF
@@ -150,9 +140,5 @@
 
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: anfang particles'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 !
 !--       DVRP-Calls for plotting particles:
@@ -183,9 +169,5 @@
              WRITE (9,*) '--- before ALLOCATE  simtime=',simulated_time,' #of_tails=', number_of_tails, &
                            ' max#of_tp=', maximum_number_of_tailpoints
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
              ALLOCATE( psize(number_of_tails), p_t(number_of_tails),      &
                        p_c(number_of_tails*maximum_number_of_tailpoints), &
@@ -194,9 +176,5 @@
                        p_z(number_of_tails*maximum_number_of_tailpoints) )
              WRITE (9,*) '--- after ALLOCATE'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
              psize = 0.0;  p_t = 0;  p_c = 0.0;  p_x = 0.0;  p_y = 0.0
              p_z   = 0.0;
@@ -209,9 +187,5 @@
                    IF ( simulated_time > 1338.0 )  THEN
                       WRITE (9,*) '--- particle ',n,' tail_id=',nn,' #of_tp=',particles(n)%tailpoints
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
                    ENDIF
                    DO  j = 1, particles(n)%tailpoints
@@ -227,9 +201,5 @@
                          WRITE (9,*) '--- tp= ',i,' x=',p_x(i),' y=',p_y(i), &
                                                  ' z=',p_z(i),' c=',p_c(i)
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
                       ENDIF
                    ENDDO
@@ -238,18 +208,10 @@
                    IF ( simulated_time > 1338.0 )  THEN
                       WRITE (9,*) '--- t= ',k,' psize=',psize(k),' p_t=',p_t(k)
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
                    ENDIF
                 ENDIF                
              ENDDO
              WRITE (9,*) '--- after locally storing the particle attributes'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           ENDIF
 
@@ -275,9 +237,5 @@
              ELSE
                 WRITE (9,*) '--- before DVRP_PARTICLES'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
                 CALL DVRP_PARTICLES( m-1, number_of_tails, p_x, p_y, p_z, 15, &
                                      psize, p_c, p_t )
@@ -292,9 +250,5 @@
                 WRITE (9,*) 'p_t =', p_t
 
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
              ENDIF
           ENDIF
@@ -302,9 +256,5 @@
           CALL DVRP_VISUALIZE( m-1, 3, dvrp_filecount )
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: ende particles'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
           DEALLOCATE( psize, p_c, p_t, p_x, p_y, p_z )
@@ -456,9 +406,5 @@
 
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: anfang isosurface'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 !
 !--          DVRP-Calls for plotting isosurfaces:
@@ -481,9 +427,5 @@
              CALL DVRP_VISUALIZE( m-1, 1, dvrp_filecount )
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: ende isosurface'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
              CALL cpu_log( log_point_s(26), 'dvrp_isosurface', 'stop' )
@@ -492,9 +434,5 @@
 
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: anfang slicer'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 !
 !--          DVRP-Calls for plotting slicers:
@@ -526,9 +464,5 @@
 
     WRITE ( 9, * ) '*** myid=', myid, ' data_output_dvrp: ende slicer'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           ENDIF
 
@@ -545,9 +479,5 @@
     CALL cpu_log( log_point(27), 'data_output_dvrp', 'stop' )
     WRITE ( 9, * ) '*** myid=', myid, ' Ende data_output_dvrp'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 #endif
Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 77)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Cpp-directive lcmuk changed to intel_openmp_bug
 !
 ! Former revisions:
@@ -98,5 +98,5 @@
        tn = 0
        !$OMP PARALLEL PRIVATE( i, j, k, tn )
-#if defined( __lcmuk )
+#if defined( __intel_openmp_bug )
        tn = omp_get_thread_num()
 #else
@@ -260,5 +260,5 @@
 !--          rearranged according to the staggered grid.
        tn = 0
-#if defined( __lcmuk )
+#if defined( __intel_openmp_bug )
        !$OMP PARALLEL PRIVATE( i, j, k, pts, sums_ll, sums_l_eper, sums_l_etot, &
        !$OMP                    tn, ust, ust2, u2, vst, vst2, v2, w2 )
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 77)
+++ palm/trunk/SOURCE/header.f90	(revision 82)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor strings for different linux clusters changed to "lc",
+! routine local_flush is used for buffer flushing
 !
 ! Former revisions:
@@ -1109,11 +1110,7 @@
     WRITE ( io, 99 )
 
-#if defined( __ibm )
 !
 !-- Write buffer contents to disc immediately
-    CALL FLUSH_( io )
-#elif defined( __lcmuk )  ||  defined( __nec )
-    CALL FLUSH( io )
-#endif
+    CALL local_flush( io )
 
 !
Index: palm/trunk/SOURCE/init_1d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_1d_model.f90	(revision 77)
+++ palm/trunk/SOURCE/init_1d_model.f90	(revision 82)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor strings for different linux clusters changed to "lc",
+! routine local_flush is used for buffer flushing
 !
 ! Former revisions:
@@ -770,11 +771,7 @@
        WRITE ( 15, 101 )  current_timestep_number_1d, simulated_time_chr, &
                           dt_1d, umax, vmax, us1d, alpha, energy
-#if defined( __ibm )
 !
 !--    Write buffer contents to disc immediately
-       CALL FLUSH_( 15 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-       CALL FLUSH( 15 )
-#endif
+       CALL local_flush( 15 )
 
     ENDIF
@@ -955,11 +952,7 @@
        WRITE ( 17, 101 )
 
-#if defined( __ibm )
 !
 !--    Write buffer contents to disc immediately
-       CALL FLUSH_( 17 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-       CALL FLUSH( 17 )
-#endif
+       CALL local_flush( 17 )
 
     ENDIF
Index: palm/trunk/SOURCE/init_dvrp.f90
===================================================================
--- palm/trunk/SOURCE/init_dvrp.f90	(revision 77)
+++ palm/trunk/SOURCE/init_dvrp.f90	(revision 82)
@@ -3,5 +3,7 @@
 !------------------------------------------------------------------------------!
 ! Actual revisions:
-! ----------------- 
+! -----------------
+! Preprocessor strings for different linux clusters changed to "lc",
+! routine local_flush is used for buffer flushing
 ! Test output of isosurface on camera file
 ! TEST: print* statements
@@ -145,9 +147,5 @@
 
     WRITE ( 9, * ) '***  vor dvrp_output_rtsp'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
              dvrp_file   = TRIM( mode_dvrp(m) ) // '/camera.dvr'
@@ -157,9 +155,5 @@
                                     dvrp_file_c )
     WRITE ( 9, * ) '***  nach dvrp_output_rtsp'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
           ELSEIF ( dvrp_output == 'ftp' )  THEN
@@ -185,9 +179,5 @@
           CALL DVRP_CAMERA( m-1, center, distance )
     WRITE ( 9, * ) '***  #1'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 !
@@ -202,9 +192,5 @@
           CALL DVRP_EXIT( m-1 )
     WRITE ( 9, * ) '***  #2'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 
@@ -223,9 +209,5 @@
                                     dvrp_file_c )
     WRITE ( 9, * ) '***  #3'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
           ELSEIF ( dvrp_output == 'ftp' )  THEN
@@ -274,9 +256,5 @@
           CALL DVRP_MATERIAL_RGB( m-1, 1, 0.8, 0.7, 0.6, 0.0 )
     WRITE ( 9, * ) '***  #4'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 !
@@ -292,31 +270,15 @@
           ENDDO
     WRITE ( 9, * ) '***  #4.1'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, &
                           cyclic_dvrp, cyclic_dvrp, cyclic_dvrp )
     WRITE ( 9, * ) '***  #4.2'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           CALL DVRP_THRESHOLD( m-1, 1.0 )
     WRITE ( 9, * ) '***  #4.3'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
           CALL DVRP_VISUALIZE( m-1, 1, 0 )
     WRITE ( 9, * ) '***  #4.4'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
           DEALLOCATE( local_pf )
@@ -324,9 +286,5 @@
           CALL DVRP_EXIT( m-1 )
     WRITE ( 9, * ) '***  #5'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 !
@@ -344,9 +302,5 @@
                                     dvrp_file_c )
     WRITE ( 9, * ) '***  #6'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
           ELSEIF ( dvrp_output == 'ftp' )  THEN
@@ -395,9 +349,5 @@
           CALL DVRP_MATERIAL_RGB( m-1, 1, 0.0, 0.6, 0.0, 0.0 )
     WRITE ( 9, * ) '***  #7'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 !
@@ -416,9 +366,5 @@
           CALL DVRP_EXIT( m-1 )
     WRITE ( 9, * ) '***  #8'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
     
@@ -461,17 +407,9 @@
                 name_c = TRIM( do3d(0,vn) )
     WRITE ( 9, * ) '***  #9'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
                 CALL DVRP_STEERING_INIT( m-1, name_c, steering_dvrp(pn)%min, &
                                          steering_dvrp(pn)%max, threshold(tv) )
     WRITE ( 9, * ) '***  #10'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
              ELSEIF ( mode_dvrp(pn)(1:6) == 'slicer' )  THEN
@@ -517,9 +455,5 @@
 
     WRITE ( 9, * ) '***  #11'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
           dvrp_file = TRIM( mode_dvrp(m) ) // '/*****.dvr'
@@ -529,9 +463,5 @@
                                  dvrp_file_c )
     WRITE ( 9, * ) '***  #12'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
        ELSEIF ( dvrp_output == 'ftp' )  THEN
@@ -585,18 +515,10 @@
 !--    Define the grid used by dvrp
     WRITE ( 9, * ) '***  #13'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
        CALL DVRP_GRID( m-1, nx_dvrp, ny_dvrp, nz_dvrp, xcoor_dvrp, ycoor_dvrp, &
                        zcoor_dvrp )
     WRITE ( 9, * ) '***  #14'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 
@@ -631,46 +553,22 @@
 !-- Initialize logging of calls by DVRP graphic software
     WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_LOG_INIT'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
     CALL DVRP_LOG_INIT( 'DVRP_LOG' // CHAR( 0 ), 0 )
     WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_LOG_INIT'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 !
 !-- User-defined logging events: #1 (total time needed by PALM)
     WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_LOG_SYMBOL'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
     CALL DVRP_LOG_SYMBOL( 1, 'PALM_total' // CHAR( 0 ) )
     WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_LOG_SYMBOL'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
     CALL DVRP_LOG_SYMBOL( 2, 'PALM_timestep' // CHAR( 0 ) )
     WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_LOG_EVENT'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
     CALL DVRP_LOG_EVENT( 1, 1 )
     WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_LOG_EVENT'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
 
 #if defined( __parallel )
@@ -681,16 +579,8 @@
        use_seperate_pe_for_dvrp_output = .TRUE.
     WRITE ( 9, * ) '*** myid=', myid, ' vor DVRP_SPLIT'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
        CALL DVRP_SPLIT( MPI_COMM_WORLD, comm_palm )
     WRITE ( 9, * ) '*** myid=', myid, ' nach DVRP_SPLIT'
-#if defined( __ibm )
-    CALL FLUSH_( 9 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-    CALL FLUSH( 9 )
-#endif
+    CALL local_flush( 9 )
        CALL MPI_COMM_SIZE( comm_palm, numprocs, ierr )
     ENDIF
Index: palm/trunk/SOURCE/init_particles.f90
===================================================================
--- palm/trunk/SOURCE/init_particles.f90	(revision 77)
+++ palm/trunk/SOURCE/init_particles.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -59,13 +59,8 @@
 !
 !-- Define MPI derived datatype for FORTRAN datatype particle_type (see module
-!-- particle_attributes). Integer length is 4 byte, Real is 8 byte (=> total
-!-- length 100, nevertheless, 120 bytes are needed on T3E since integer seems
-!-- to be 8 bytes long there)
-    blocklengths(1)  = 19; blocklengths(2)  = 4; blocklengths(3)  =  1
-#if defined( __t3eb )
-    displacements(1) = 0; displacements(2) = 152; displacements(3) = 184
-#else
-    displacements(1) = 0; displacements(2) = 152; displacements(3) = 168
-#endif
+!-- particle_attributes). Integer length is 4 byte, Real is 8 byte
+    blocklengths(1)  = 19;  blocklengths(2)  =   4;  blocklengths(3)  =   1
+    displacements(1) =  0;  displacements(2) = 152;  displacements(3) = 168
+
     types(1) = MPI_REAL
     types(2) = MPI_INTEGER
Index: palm/trunk/SOURCE/init_pegrid.f90
===================================================================
--- palm/trunk/SOURCE/init_pegrid.f90	(revision 77)
+++ palm/trunk/SOURCE/init_pegrid.f90	(revision 82)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Cpp-directive lcmuk changed to intel_openmp_bug, setting of host on lcmuk by
+! cpp-directive removed
 !
 ! Former revisions:
@@ -56,5 +57,5 @@
 !-- Get the number of OpenMP threads
     !$OMP PARALLEL
-#if defined( __lcmuk )
+#if defined( __intel_openmp_bug )
     threads_per_task = omp_get_num_threads()
 #else
@@ -72,7 +73,4 @@
 !--    Automatic determination of the topology
 !--    The default on SMP- and cluster-hosts is a 1d-decomposition along x
-#if defined( __lcmuk )
-       host = 'lcmuk'
-#endif
        IF ( host(1:3) == 'ibm'  .OR.  host(1:3) == 'nec'  .OR. &
             host(1:2) == 'lc'   .OR.  host(1:3) == 'dec' )  THEN
Index: palm/trunk/SOURCE/local_flush.f90
===================================================================
--- palm/trunk/SOURCE/local_flush.f90	(revision 82)
+++ palm/trunk/SOURCE/local_flush.f90	(revision 82)
@@ -0,0 +1,27 @@
+ SUBROUTINE local_flush( file_id )
+
+!------------------------------------------------------------------------------!
+! Actual revisions:
+! -----------------
+! 
+!
+! Former revisions:
+! -----------------
+! $Id$
+! Initial revision (raasch 12/04/07)
+!
+!
+! Description:
+! ------------
+! Flush calls for different operating systems
+!------------------------------------------------------------------------------!
+
+    INTEGER ::  file_id
+
+#if defined( __ibm )
+    CALL FLUSH_( file_id )
+#elif defined( __lc )  ||  defined( __nec )
+    CALL FLUSH( file_id )
+#endif
+
+ END SUBROUTINE local_flush    
Index: palm/trunk/SOURCE/local_getenv.f90
===================================================================
--- palm/trunk/SOURCE/local_getenv.f90	(revision 77)
+++ palm/trunk/SOURCE/local_getenv.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -29,18 +29,10 @@
     CHARACTER (LEN=*) ::  var, value
     INTEGER           ::  ivalue, ivar
-#if defined( __t3eb ) || defined( __t3eh ) || defined( __t3ej2 ) || defined( __t3ej5 )
-    INTEGER           ::  dummy
-#endif
 #if defined( __lcmuk )
     INTEGER            ::  i, ia(20)
 #endif
 
-#if defined( __t3eb ) || defined( __t3eh ) || defined( __t3ej2 ) || defined( __t3ej5 )
-    CALL PXFGETENV( var(1:ivar), ivar, value, ivalue, dummy )
-    IF ( ivalue == 0 )  value = ''
-#else
     CALL GETENV( var(1:ivar), value )
     ivalue = LEN_TRIM( value )
-#endif
 
 #if defined( __lcmuk )  &&  defined( __parallel )
Index: palm/trunk/SOURCE/local_system.f90
===================================================================
--- palm/trunk/SOURCE/local_system.f90	(revision 77)
+++ palm/trunk/SOURCE/local_system.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -25,9 +25,5 @@
     CHARACTER (LEN=*) ::  command
 
-#if defined( __t3eb ) || defined( __t3eh ) || defined( __t3ej2 ) || defined( __t3ej5 )
-    CALL ISHELL( command )
-#else
     CALL SYSTEM( command )
-#endif
 
  END SUBROUTINE local_system    
Index: palm/trunk/SOURCE/local_tremain.f90
===================================================================
--- palm/trunk/SOURCE/local_tremain.f90	(revision 77)
+++ palm/trunk/SOURCE/local_tremain.f90	(revision 82)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor strings for different linux clusters changed to "lc",
+! preprocessor directives for old systems removed
 !
 ! Former revisions:
@@ -30,33 +31,19 @@
 
     REAL ::  remaining_time
-!#if defined( __vpp )
-!    REAL ::  cpu_time_used, rdum
-!#endif
 #if defined( __ibm )
     INTEGER(8) ::  IRTC
     REAL       ::  actual_wallclock_time
-#elif defined( __lctit )
+#elif defined( __lc )
     INTEGER    ::  count, count_rate
     REAL       ::  actual_wallclock_time
 #endif
 
-#if defined( __t3eh ) || defined( __t3eb ) || defined( __t3ej2 ) || defined( __t3ej5 )
+#if defined( __ibm )
 
-    CALL MPP_TREMAIN( remaining_time )
-
-!#elif defined( __vpp )
-!
-!    CALL CLOCKV( rdum, cpu_time_used, 0, 2 )
-!    remaining_time = maximum_cpu_time_allowed - cpu_time_used
-
-#elif defined( __ibm )
-
-!    CALL SYSTEM_CLOCK( count, count_rate )
-!    actual_wallclock_time = REAL( count ) / REAL( count_rate )
     actual_wallclock_time = IRTC( ) * 1E-9
     remaining_time = maximum_cpu_time_allowed - &
                      ( actual_wallclock_time - initial_wallclock_time )
 
-#elif defined( __lctit )
+#elif defined( __lc )
 
     CALL SYSTEM_CLOCK( count, count_rate )
Index: palm/trunk/SOURCE/local_tremain_ini.f90
===================================================================
--- palm/trunk/SOURCE/local_tremain_ini.f90	(revision 77)
+++ palm/trunk/SOURCE/local_tremain_ini.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Cpp-directive lctit renamed lc
 !
 ! Former revisions:
@@ -33,5 +33,5 @@
     INTEGER            ::  idum
     INTEGER(8)         ::  IRTC
-#elif defined( __lctit )
+#elif defined( __lc )
     CHARACTER (LEN=10) ::  value_chr
     INTEGER            ::  idum
@@ -46,5 +46,5 @@
     initial_wallclock_time = IRTC( ) * 1E-9
 
-#elif defined( __lctit )
+#elif defined( __lc )
 
     CALL SYSTEM_CLOCK( count, count_rate )
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 77)
+++ palm/trunk/SOURCE/modules.f90	(revision 82)
@@ -5,5 +5,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! +return_addres, return_username
+! Cpp-directive lcmuk renamed lc
 !
 ! Former revisions:
@@ -236,4 +237,5 @@
                             mixing_length_1d = 'as_in_3d_model', &
                             random_generator = 'numerical-recipes', &
+                            return_addres, return_username, &
                             timestep_scheme = 'runge-kutta-3'
     CHARACTER (LEN=40)  ::  avs_data_file, topography = 'flat'
@@ -879,7 +881,6 @@
 
 #if defined( __parallel )
-#if defined( __lcmuk )
+#if defined( __lc )
     USE MPI
-!    INCLUDE "mpif.h"
 #else
     INCLUDE "mpif.h"
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 77)
+++ palm/trunk/SOURCE/parin.f90	(revision 82)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! +return_addres, return_username, use_seperate_pe_for_dvrp_output in envpar
 !
 ! Former revisions:
@@ -121,6 +121,6 @@
 
 
-    NAMELIST /envpar/  host, maximum_cpu_time_allowed, revision, &
-                       run_identifier, tasks_per_node, write_binary
+    NAMELIST /envpar/  host, maximum_cpu_time_allowed, revision, return_addres, &
+                       return_username, run_identifier, tasks_per_node, write_binary
 
 
Index: palm/trunk/SOURCE/poisfft.f90
===================================================================
--- palm/trunk/SOURCE/poisfft.f90	(revision 77)
+++ palm/trunk/SOURCE/poisfft.f90	(revision 82)
@@ -1345,5 +1345,5 @@
 !       tn = omp_get_thread_num()
 !       WRITE( 120+tn, * ) '+++ id=',myid,' nx=',nx,' thread=', omp_get_thread_num()
-!       CALL FLUSH_( 120+tn )
+!       CALL local_flush( 120+tn )
 !CDIR NOLOOPCHG
        DO  k = 0, nz-1
@@ -1354,5 +1354,5 @@
        ENDDO
 !       WRITE( 120+tn, * ) '+++ id=',myid,' end of first tridia loop   thread=', omp_get_thread_num()
-!       CALL FLUSH_( 120+tn )
+!       CALL local_flush( 120+tn )
 
        IF ( j <= nnyh )  THEN
Index: palm/trunk/SOURCE/run_control.f90
===================================================================
--- palm/trunk/SOURCE/run_control.f90	(revision 77)
+++ palm/trunk/SOURCE/run_control.f90	(revision 82)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Preprocessor strings for different linux clusters changed to "lc",
+! routine local_flush is used for buffer flushing
 !
 ! Former revisions:
@@ -89,11 +90,8 @@
                           advected_distance_x/1000.0,                          &
                           advected_distance_y/1000.0, mgcycles
-#if defined( __ibm )
 !
 !--    Write buffer contents to disc immediately
-       CALL FLUSH_( 15 )
-#elif defined( __lcmuk )  ||  defined( __lctit )  ||  defined( __nec )
-       CALL FLUSH( 15 )
-#endif
+       CALL local_flush( 15 )
+
     ENDIF
 !
