Index: /palm/trunk/SCRIPTS/mbuild
===================================================================
--- /palm/trunk/SCRIPTS/mbuild	(revision 365)
+++ /palm/trunk/SCRIPTS/mbuild	(revision 366)
@@ -1092,5 +1092,5 @@
              then
 
-                print ". /usr/share/modules/init/bash; module load $mpilib; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
+                print ". /usr/share/modules/init/bash; module load ifort/11.0.069; module load $mpilib; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
 #                print ". /usr/share/modules/init/bash; module load mvapich2/1.2rc1-intel; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
 #                print ". /usr/share/modules/init/bash; module load mvapich2; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
Index: /palm/trunk/SCRIPTS/mrun
===================================================================
--- /palm/trunk/SCRIPTS/mrun	(revision 365)
+++ /palm/trunk/SCRIPTS/mrun	(revision 366)
@@ -2426,5 +2426,5 @@
        then
           printf "      compiler is called via ssh on \"hicegate2\" using module \"$mpilib\" \n"
-          ssh  130.75.4.103  -l $usern  ". /usr/share/modules/init/bash; module load $mpilib; cd $TEMPDIR; make -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
+          ssh  130.75.4.103  -l $usern  ". /usr/share/modules/init/bash; module load ifort/11.0.069; module load $mpilib; cd $TEMPDIR; make -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
           [[ ! -f a.out ]]  &&  compile_error=true
           continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
@@ -3163,4 +3163,11 @@
                    then
 #                      export MPI_LAUNCH_TIMEOUT=360
+                          # MPI_DSM_DISTRIBUTE not necessary when MPI_DSM_CPULIST is set
+                          # export MPI_DSM_DISTRIBUTE=1
+                          # MPI_DSM_CPULIST: pin MPI processes to cores
+                       export MPI_DSM_CPULIST="0,1,4,5,2,3,6,7:allhosts"
+                          # MPI_IB_RAILS: use both IB rails on ICE2
+                      export MPI_BUFS_PER_HOST=512
+                      export MPI_IB_RAILS=2
                       mpiexec_mpt -np $ii   ./a.out  $ROPTS  < runfile_atmos
                    elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]]
Index: /palm/trunk/SCRIPTS/subjob
===================================================================
--- /palm/trunk/SCRIPTS/subjob	(revision 365)
+++ /palm/trunk/SCRIPTS/subjob	(revision 366)
@@ -101,4 +101,6 @@
      # 24/06/09 - BjornM- adjustments for lcxt4 (loading modules manually)
      # 08/07/09 - Siggi - option -e added (email notification on lcsgih/b)
+     # 20/07/09 - Siggi - On lcsgi, jobs for returning the job protocol are
+     #                    now run on the data nodes (feature=data)
 
 
@@ -367,5 +369,5 @@
                  esac;;
         (lcsgib|lcsgih)   case  $ndq  in
-                     (testq|serialq|smallq|bigq)             error=false;;
+                     (testq|serialq|smallq|bigq|workq)       error=false;;
                      (*)                                     error=true;;
                  esac;;
@@ -706,5 +708,5 @@
  then
 
-    if [[ $queue = testq ]]
+    if [[ $queue = testq  ||  $queue = workq ]]
     then
        queue_directive="#PBS -q $queue"
@@ -735,9 +737,10 @@
 
 . /usr/share/modules/init/bash
+module load ifort/11.0.069
 module load $mpilib
 # module load mvapich2/1.2rc1-intel
 # module load mvapich2
 module load netcdf
-export LD_LIBRARY_PATH=/sw/intel/cce/10.1.015/lib:/sw/intel/fce/10.1.015/lib:/sw/dataformats/netcdf/3.6.2/lib:\$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=/sw/intel/cce/10.1.015/lib:/sw/intel/fce/10.1.015/lib:/sw/dataformats/netcdf/3.6.2/lib:\$LD_LIBRARY_PATH
 echo ld_library_path=\$LD_LIBRARY_PATH
 
@@ -1005,5 +1008,5 @@
           echo "#PBS -l walltime=00:30:00"               >>  $job_to_send
           echo "#PBS -l nodes=1:ppn=1"                   >>  $job_to_send
-          echo "#PBS -l feature=xe"                      >>  $job_to_send
+          echo "#PBS -l feature=data"                    >>  $job_to_send
           echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol"      >>  $job_to_send
           echo "#PBS -j oe"                        >>  $job_to_send
Index: /palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- /palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 365)
+++ /palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 366)
@@ -1,4 +1,8 @@
 New:
 ---
+bc_lr/bc_ns  in most subroutines replaced by LOGICAL variables bc_lr_cyc,
+bc_ns_cyc for speed optimization
+(check_parameters, diffusion_u, diffusion_v, diffusion_w, modules)
+
 Additional timestep criterion in case of simulations with plant canopy (timestep)
 
@@ -113,4 +117,7 @@
 Errors:
 ------
+Bugfix: Output on unit 14 only if requested by write_binary.
+(user_last_actions)
+
 Bugfix to avoid zero division by km_neutral (production_e)
 
@@ -165,3 +172,3 @@
 Bugfix: initial setting of time_coupling in coupled restart runs (time_integration)
 
-advec_particles, check_parameters, cpu_log, data_output_2d, data_output_3d, header, init_3d_model, init_particles, modules, netcdf, prandtl_fluxes, production_e, read_var_list, time_integration, write_var_list
+advec_particles, check_parameters, cpu_log, data_output_2d, data_output_3d, header, init_3d_model, init_particles, modules, netcdf, prandtl_fluxes, production_e, read_var_list, time_integration, user_last_actions, write_var_list
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 365)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 366)
@@ -4,4 +4,5 @@
 ! Actual revisions:
 ! -----------------
+! bc_lr_cyc and bc_ns_cyc are set,
 ! initializing_actions='read_data_for_recycling' renamed to 'cyclic_fill'
 ! Check for illegal entries in section_xy|xz|yz that exceed nz+1|ny+1|nx+1
@@ -1105,4 +1106,9 @@
 
 !
+!-- Internal variables used for speed optimization in if clauses
+    IF ( bc_lr /= 'cyclic' )  bc_lr_cyc = .FALSE.
+    IF ( bc_ns /= 'cyclic' )  bc_ns_cyc = .FALSE.
+
+!
 !-- Non-cyclic lateral boundaries require the multigrid method and Piascek-
 !-- Willimas advection scheme. Several schemes and tools do not work with
Index: /palm/trunk/SOURCE/diffusion_u.f90
===================================================================
--- /palm/trunk/SOURCE/diffusion_u.f90	(revision 365)
+++ /palm/trunk/SOURCE/diffusion_u.f90	(revision 366)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! bc_ns replaced by bc_ns_cyc
 !
 ! Former revisions:
@@ -101,5 +101,5 @@
 !--             velocity components parallel to the outflow boundary in
 !--             the direction normal to the outflow boundary.
-                IF ( bc_ns /= 'cyclic' )  THEN
+                IF ( .NOT. bc_ns_cyc )  THEN
                    kmyp_y = MAX( kmyp_y, km_damp_y(j) )
                    kmym_y = MAX( kmym_y, km_damp_y(j) )
@@ -134,5 +134,5 @@
 !--                velocity components parallel to the outflow boundary in
 !--                the direction normal to the outflow boundary.
-                   IF ( bc_ns /= 'cyclic' )  THEN
+                   IF ( .NOT. bc_ns_cyc )  THEN
                       kmyp_y = MAX( kmyp_y, km_damp_y(j) )
                       kmym_y = MAX( kmym_y, km_damp_y(j) )
@@ -266,5 +266,5 @@
 !--       parallel to the outflow boundary in the direction normal to the
 !--       outflow boundary.
-          IF ( bc_ns /= 'cyclic' )  THEN
+          IF ( .NOT. bc_ns_cyc )  THEN
              kmyp_y = MAX( kmyp_y, km_damp_y(j) )
              kmym_y = MAX( kmym_y, km_damp_y(j) )
@@ -302,5 +302,5 @@
 !--          velocity components parallel to the outflow boundary in
 !--          the direction normal to the outflow boundary.
-             IF ( bc_ns /= 'cyclic' )  THEN
+             IF ( .NOT. bc_ns_cyc )  THEN
                 kmyp_y = MAX( kmyp_y, km_damp_y(j) )
                 kmym_y = MAX( kmym_y, km_damp_y(j) )
Index: /palm/trunk/SOURCE/diffusion_v.f90
===================================================================
--- /palm/trunk/SOURCE/diffusion_v.f90	(revision 365)
+++ /palm/trunk/SOURCE/diffusion_v.f90	(revision 366)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! bc_lr replaced by bc_lr_cyc
 !
 ! Former revisions:
@@ -99,5 +99,5 @@
 !--             velocity components parallel to the outflow boundary in
 !--             the direction normal to the outflow boundary.
-                IF ( bc_lr /= 'cyclic' )  THEN
+                IF ( .NOT. bc_lr_cyc )  THEN
                    kmxp_x = MAX( kmxp_x, km_damp_x(i) )
                    kmxm_x = MAX( kmxm_x, km_damp_x(i) )
@@ -132,5 +132,5 @@
 !--                velocity components parallel to the outflow boundary in
 !--                the direction normal to the outflow boundary.
-                   IF ( bc_lr /= 'cyclic' )  THEN
+                   IF ( .NOT. bc_lr_cyc )  THEN
                       kmxp_x = MAX( kmxp_x, km_damp_x(i) )
                       kmxm_x = MAX( kmxm_x, km_damp_x(i) )
@@ -263,5 +263,5 @@
 !--       parallel to the outflow boundary in the direction normal to the
 !--       outflow boundary.
-          IF ( bc_lr /= 'cyclic' )  THEN
+          IF ( .NOT. bc_lr_cyc )  THEN
              kmxp_x = MAX( kmxp_x, km_damp_x(i) )
              kmxm_x = MAX( kmxm_x, km_damp_x(i) )
@@ -301,5 +301,5 @@
 !--          velocity components parallel to the outflow boundary in
 !--          the direction normal to the outflow boundary.
-             IF ( bc_lr /= 'cyclic' )  THEN
+             IF ( .NOT. bc_lr_cyc )  THEN
                 kmxp_x = MAX( kmxp_x, km_damp_x(i) )
                 kmxm_x = MAX( kmxm_x, km_damp_x(i) )
Index: /palm/trunk/SOURCE/diffusion_w.f90
===================================================================
--- /palm/trunk/SOURCE/diffusion_w.f90	(revision 365)
+++ /palm/trunk/SOURCE/diffusion_w.f90	(revision 366)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! bc_lr/bc_ns replaced by bc_lr_cyc/bc_ns_cyc
 !
 ! Former revisions:
@@ -100,9 +100,9 @@
 !--             velocity components parallel to the outflow boundary in
 !--             the direction normal to the outflow boundary.
-                IF ( bc_lr /= 'cyclic' )  THEN
+                IF ( .NOT. bc_lr_cyc )  THEN
                    kmxp_x = MAX( kmxp_x, km_damp_x(i) )
                    kmxm_x = MAX( kmxm_x, km_damp_x(i) )
                 ENDIF
-                IF ( bc_ns /= 'cyclic' )  THEN
+                IF ( .NOT. bc_ns_cyc )  THEN
                    kmyp_y = MAX( kmyp_y, km_damp_y(j) )
                    kmym_y = MAX( kmym_y, km_damp_y(j) )
@@ -150,9 +150,9 @@
 !--                velocity components parallel to the outflow boundary in
 !--                the direction normal to the outflow boundary.
-                   IF ( bc_lr /= 'cyclic' )  THEN
+                   IF ( .NOT. bc_lr_cyc )  THEN
                       kmxp_x = MAX( kmxp_x, km_damp_x(i) )
                       kmxm_x = MAX( kmxm_x, km_damp_x(i) )
                    ENDIF
-                   IF ( bc_ns /= 'cyclic' )  THEN
+                   IF ( .NOT. bc_ns_cyc )  THEN
                       kmyp_y = MAX( kmyp_y, km_damp_y(j) )
                       kmym_y = MAX( kmym_y, km_damp_y(j) )
@@ -231,9 +231,9 @@
 !--       parallel to the outflow boundary in the direction normal to the
 !--       outflow boundary.
-          IF ( bc_lr /= 'cyclic' )  THEN
+          IF ( .NOT. bc_lr_cyc )  THEN
              kmxp_x = MAX( kmxp_x, km_damp_x(i) )
              kmxm_x = MAX( kmxm_x, km_damp_x(i) )
           ENDIF
-          IF ( bc_ns /= 'cyclic' )  THEN
+          IF ( .NOT. bc_ns_cyc )  THEN
              kmyp_y = MAX( kmyp_y, km_damp_y(j) )
              kmym_y = MAX( kmym_y, km_damp_y(j) )
@@ -293,9 +293,9 @@
 !--          velocity components parallel to the outflow boundary in
 !--          the direction normal to the outflow boundary.
-             IF ( bc_lr /= 'cyclic' )  THEN
+             IF ( .NOT. bc_lr_cyc )  THEN
                 kmxp_x = MAX( kmxp_x, km_damp_x(i) )
                 kmxm_x = MAX( kmxm_x, km_damp_x(i) )
              ENDIF
-             IF ( bc_ns /= 'cyclic' )  THEN
+             IF ( .NOT. bc_ns_cyc )  THEN
                 kmyp_y = MAX( kmyp_y, km_damp_y(j) )
                 kmym_y = MAX( kmym_y, km_damp_y(j) )
Index: /palm/trunk/SOURCE/init_ocean.f90
===================================================================
--- /palm/trunk/SOURCE/init_ocean.f90	(revision 365)
+++ /palm/trunk/SOURCE/init_ocean.f90	(revision 366)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix: First calculation of hyp(0) changed
 !
 ! Former revisions:
@@ -50,7 +50,8 @@
     rho_init(nzt) = rho_surface
 
-    DO  k = nzt-1, 0, -1
+    DO  k = nzt-1, 1, -1
        hyp(k) = hyp(k+1) + rho_surface * g * dzu(k)
     ENDDO
+    hyp(0) = hyp(1) + rho_surface * g * dzu(1)
 
     IF ( myid == 0 )  THEN
Index: /palm/trunk/SOURCE/modules.f90
===================================================================
--- /palm/trunk/SOURCE/modules.f90	(revision 365)
+++ /palm/trunk/SOURCE/modules.f90	(revision 366)
@@ -5,4 +5,5 @@
 ! Current revisions:
 ! -----------------
+! +bc_lr_cyc, bc_ns_cyc
 ! +output_for_t0 
 ! translation error of actual -> current revisions fixed
@@ -358,4 +359,5 @@
 
     LOGICAL ::  adjust_mixing_length = .FALSE., avs_output = .FALSE., &
+                bc_lr_cyc =.TRUE., bc_ns_cyc = .TRUE., &
                 call_psolver_at_all_substeps = .TRUE., &
                 cloud_droplets = .FALSE., cloud_physics = .FALSE., &
Index: /palm/trunk/SOURCE/user_last_actions.f90
===================================================================
--- /palm/trunk/SOURCE/user_last_actions.f90	(revision 365)
+++ /palm/trunk/SOURCE/user_last_actions.f90	(revision 366)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Output on unit 14 only if requested by write_binary
 !
 ! Former revisions:
@@ -18,4 +18,5 @@
 !------------------------------------------------------------------------------!
 
+    USE control_parameters
     USE user
 
@@ -25,9 +26,12 @@
 !-- Here the user-defined actions at the end of a job follow.
 !-- Sample for user-defined output:
-!    IF ( ALLOCATED( u2_av ) )  THEN
-!       WRITE ( 14 )  'u2_av               ';  WRITE ( 14 )  u2_av
-!    ENDIF
+    IF ( write_binary(1:4) == 'true' )  THEN
+!       IF ( ALLOCATED( u2_av ) )  THEN
+!          WRITE ( 14 )  'u2_av               ';  WRITE ( 14 )  u2_av
+!       ENDIF
 
-    WRITE ( 14 )  '*** end user ***    '
+       WRITE ( 14 )  '*** end user ***    '
+
+    ENDIF
 
  END SUBROUTINE user_last_actions
