Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 220)
+++ palm/trunk/SCRIPTS/mbuild	(revision 221)
@@ -798,4 +798,30 @@
 
 
+       # MPI LIBRARY ERMITTELN
+    line=""
+    found=false
+    grep  "$remote_host_string" $config_file | grep "%mpilib"  >  $tmp_mbuild
+    while read line1
+    do
+
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+
+       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+       then
+             # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN
+          mpilib=`echo $line | cut -d" " -s -f2`
+          found=true
+       fi
+
+    done < $tmp_mbuild
+
+    [[ $found = false ]]  &&  mpilib=mpt
+
+
+
+
        # LADER-OPTIONEN ERMITTELN
     line=""
@@ -887,4 +913,9 @@
        line=$(echo "$line" | cut -c51-)
     done
+    if [[ $( echo $remote_host | cut -c1-5 ) = lcsgi ]]
+    then
+       column1="mpi library:"; column2=$mpilib
+       printf "| $column1$column2 | \n"
+    fi
     column1="loader options:"; column2=$loader_options
     printf "| $column1$column2 | \n"
@@ -1082,5 +1113,5 @@
              then
 
-                print ". /usr/share/modules/init/bash; module load mpt/1.21; 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 $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 220)
+++ palm/trunk/SCRIPTS/mrun	(revision 221)
@@ -164,4 +164,6 @@
      #                     default source-code filenames are allowed
      # 14/11/08 - Siggi  - cond1 and cond2 are part of the depository name
+     # 08/01/09 - Siggi  - mpi module on sgi machines to be used can be set
+     #                     with environment variable mpilib
 
 
@@ -2015,4 +2017,13 @@
  fi
 
+
+    # SET DEFAULT VALUE FOR MPI MODULE TO BE USED ON SGI-ALTIX
+ if [[ $host = lcsgib  ||  $host = lcsgih ]]
+ then
+    [[ "$mpilib" = "" ]]  &&  export mpilib=mpt
+ fi
+
+
+
 ###########################################################################
 # HEADER-AUSGABE
@@ -2369,14 +2380,12 @@
        elif [[ $localhost = lcsgib ]]
        then
-          printf "      compiler is called via ssh on \"bicegate\" \n"
-          ssh  130.73.232.102  -l $usern  ". /usr/share/modules/init/bash; module load mpt; cd $TEMPDIR; make -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
+          printf "      compiler is called via ssh on \"bicegate\" using module \"$mpilib\" \n"
+          ssh  130.73.232.102  -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\" "
           [[ ! -f a.out ]]  &&  compile_error=true
           continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
        elif [[ $localhost = lcsgih ]]
        then
-          printf "      compiler is called via ssh on \"hicegate2\" \n"
-          ssh  130.75.4.103  -l $usern  ". /usr/share/modules/init/bash; module load mpt; cd $TEMPDIR; make -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
-#          ssh  130.75.4.102  -l $usern  ". /usr/share/modules/init/bash; module load mvapich2; cd $TEMPDIR; make -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
-#          print  ". /usr/share/modules/init/bash; module load mpt; cd $TEMPDIR; make -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" " | ssh  ${usern}@130.75.4.102  2>&1
+          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 "
           [[ ! -f a.out ]]  &&  compile_error=true
           continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
@@ -2830,11 +2839,16 @@
           fi
           printf "\n\n"
-#          ulimit -s 300000   # A too large stack size causes problems
-#          export MV2_NUM_PORTS=2
-#          export MV2_CPU_MAPPING=0:1:2:3
-#          mpiexec    ./a.out  $ROPTS
-#          export MPI_LAUNCH_TIMEOUT=360
            echo "no_coupling"  >  runfile_atmos
-           mpiexec_mpt -np $ii   ./a.out  $ROPTS
+           if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]]
+           then
+#              export MPI_LAUNCH_TIMEOUT=360
+              mpiexec_mpt -np $ii   ./a.out  $ROPTS
+           elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]]
+           then
+#              ulimit -s 300000   # A too large stack size causes problems
+#              export MV2_NUM_PORTS=2
+#              export MV2_CPU_MAPPING=0:1:2:3
+              mpiexec    ./a.out  $ROPTS
+           fi
        else 
           printf "\n  +++ no debug available on \"$localhost\" "
@@ -2998,10 +3012,15 @@
                 if [[ $host = lcsgih  ||  $host = lcsgib ]]
                 then
-#                   ulimit -s 300000   # A too large stack size causes problems
-#                   export MV2_NUM_PORTS=2
-#                   export MV2_CPU_MAPPING=0:1:2:3
-#                   mpiexec    ./a.out  $ROPTS
-#                   export MPI_LAUNCH_TIMEOUT=360
-                   mpiexec_mpt -np $ii   ./a.out  $ROPTS
+                   if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]]
+                   then
+#                      export MPI_LAUNCH_TIMEOUT=360
+                      mpiexec_mpt -np $ii   ./a.out  $ROPTS
+                   elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]]
+                   then
+#                      ulimit -s 300000   # A too large stack size causes problems
+#                      export MV2_NUM_PORTS=2
+#                      export MV2_CPU_MAPPING=0:1:2:3
+                      mpiexec    ./a.out  $ROPTS
+                   fi
                 elif [[ $host = lcxt4 ]]
                 then
@@ -3027,6 +3046,17 @@
                    then
 
-                      mpiexec_mpt -np $iia  ./palm  $ROPTS < runfile_atmos &
-                      mpiexec_mpt -np $iio  ./palm  $ROPTS < runfile_ocean &
+                      if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]]
+                      then
+#                         export MPI_LAUNCH_TIMEOUT=360
+                         mpiexec_mpt -np $iia  ./a.out  $ROPTS < runfile_atmos &
+                         mpiexec_mpt -np $iio  ./a.out  $ROPTS < runfile_ocean &
+                      elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]]
+                      then
+#                         ulimit -s 300000   # A too large stack size causes problems
+#                         export MV2_NUM_PORTS=2
+#                         export MV2_CPU_MAPPING=0:1:2:3
+                         mpiexec -n $iia  ./a.out  $ROPTS < runfile_atmos &
+                         mpiexec -n $iio  ./a.out  $ROPTS < runfile_ocean &
+                      fi
 
                    elif [[ $host = lcxt4 ]]
@@ -3051,5 +3081,15 @@
                    then
 
-                      mpiexec_mpt  -np $ii  a.out  $ROPTS  <  runfile_atmos
+                      if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]]
+                      then
+#                         export MPI_LAUNCH_TIMEOUT=360
+                         mpiexec_mpt -np $ii  ./a.out  $ROPTS < runfile_atmos
+                      elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]]
+                      then
+#                         ulimit -s 300000   # A too large stack size causes problems
+#                         export MV2_NUM_PORTS=2
+#                         export MV2_CPU_MAPPING=0:1:2:3
+                         mpiexec  ./a.out  $ROPTS < runfile_atmos
+                      fi
 
                    elif [[ $host = lcxt4 ]]
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 220)
+++ palm/trunk/SCRIPTS/subjob	(revision 221)
@@ -703,5 +703,5 @@
 
 . /usr/share/modules/init/bash
-module load mpt/1.21
+module load $mpilib
 # module load mvapich2/1.2rc1-intel
 # module load mvapich2
Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 220)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 221)
@@ -9,5 +9,5 @@
 DVRP arguments changed to single precision, mode pathlines added.
 
-User can add additional routines in files user_additional_routines.f90
+User can add additional routines in files user_additional_routines
 
 User can check user parameters and deduce further quantities in user_check_parameters
@@ -76,3 +76,5 @@
 of grid points do not match (read_3d_binary)
 
-advec_particles, combine_plot_fields, data_output_2d, header, production_e, read_3d_binary
+Bugfix: abort in case that absolute temperature is below zero (init_cloud_physics)
+
+advec_particles, combine_plot_fields, data_output_2d, header, init_cloud_physics, production_e, read_3d_binary
Index: palm/trunk/SOURCE/init_cloud_physics.f90
===================================================================
--- palm/trunk/SOURCE/init_cloud_physics.f90	(revision 220)
+++ palm/trunk/SOURCE/init_cloud_physics.f90	(revision 221)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix: abort in case that absolute temperature is below zero
 !
 ! Former revisions:
@@ -62,4 +62,12 @@
     t_surface = pt_surface * ( surface_pressure / 1000.0 )**0.286
     DO  k = nzb, nzt+1
+!
+!--    Check temperature in case of too large domain height
+       IF ( ( t_surface - g/cp * zu(k) ) < 0.0 )  THEN
+          WRITE( message_string, * )  'absolute temperature < 0.0 at zu(', k, &
+                                      ') = ', zu(k)
+          CALL handle_palm_message( 'init_cloud_physics', 'PA0142', 1, 2, 0, 6, &
+                                    0 )
+       ENDIF
        hyp(k)    = surface_pressure * 100.0 * &
                    ( (t_surface - g/cp * zu(k)) / t_surface )**(1.0/0.286)
