Index: /palm/trunk/SCRIPTS/mrun
===================================================================
--- /palm/trunk/SCRIPTS/mrun	(revision 1100)
+++ /palm/trunk/SCRIPTS/mrun	(revision 1101)
@@ -1,3 +1,3 @@
-#!/bin/ksh
+#!/bin/bash 
 
 # mrun - script for running PALM jobs
@@ -22,5 +22,8 @@
 # Current revisions:
 # ------------------
-# 
+# script now running under bash instead of ksh, which required small adjustments
+# (output formatting with printf instead "typeset -L/-R", print replaced by echo,
+# read from stdin),
+# cross comilername on lckyuh compute nodes replaced by real compiler name
 #
 # Former revisions:
@@ -177,4 +180,5 @@
  usern=$LOGNAME
  use_openmp=false
+ version="MRUN  2.0 Rev$Rev$"
  working_directory=`pwd`
  TOPT=""
@@ -183,16 +187,6 @@
 
  typeset -i  iec=0 iic=0 iin=0 ioc=0 iout=0 memory=0 stagein_anz=0 stageout_anz=0
- typeset -i  cputime i ii iia iii iio icycle inode ival jobges jobsek maxcycle minuten nodes pes sekunden tp1
-
- typeset  -R30 calltime
- typeset  -L20 spalte1
- typeset  -L40 spalte2
- typeset  -L60 spalte3
- typeset  -L35 string1=`date`
- typeset  -L12 string2=$usern
- typeset  -L12 string3=$localhost_realname
- typeset  -L12 string4
- typeset  -L12 string5
- typeset  -L30 version="MRUN  2.0 Rev$Rev$"
+ typeset -i  cputime i ii iia iii iio icycle inode ival jobges jobsek last_char maxcycle minuten nodes pes sekunden tp1
+
 
 
@@ -225,6 +219,9 @@
 #
 #             # EINTRAG IN DIE STATISTIK-DATEI
-#          string4=$host
-#          string5=$locat
+#          string1=`date`                  #-L35
+#          string2=$usern                  #-L12
+#          string3=$localhost_realname     #-L12
+#          string4=$host                   #-L12
+#          string5=$locat                  #-L12
 #          if [[ "$job_on_file" = ""  &&  $locat != control_c  &&  $locat != user_abort ]]
 #          then
@@ -251,8 +248,10 @@
              eval  ${err_command[$i]}
           done
-          if [[ -n $interpreted_config_file ]]  then
+          if [[ -n $interpreted_config_file ]]
+          then
              rm -rf  $interpreted_config_file
           fi
-          if [[ -n .mrun_environment ]]  then
+          if [[ -n .mrun_environment ]]
+          then
              rm -rf  .mrun_environment
           fi
@@ -366,6 +365,6 @@
     # EVTL. POSITIONSPARAMETER EINLESEN
     # ZUR ZEIT GIBT ES NUR DEN PARAMETER ? (=KURZINFO)
- shift OPTIND-1
-
+ (( to_shift = $OPTIND - 1 ))
+ shift $to_shift
 
     # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
@@ -1199,5 +1198,5 @@
        while  read zeile
        do
-          cycle=$(print $zeile | cut -f2 -d".")
+          cycle=$(echo $zeile | cut -f2 -d".")
           if [[ "$cycle" = "$zeile" ]]
           then
@@ -1323,5 +1322,5 @@
           while  read zeile
           do
-             cycle=$(print $zeile | cut -f2 -d".")
+             cycle=$(echo $zeile | cut -f2 -d".")
              if [[ "$cycle" = "$zeile"  ||  "$cycle" = ${extout[$i]} ]]
              then
@@ -2000,9 +1999,9 @@
  printf "\n"
 # [[ $silent = false ]]  &&  clear
- printf "#--------------------------------------------------------------# \n"
- printf "| $version$calltime | \n"
- printf "|                                                              | \n"
+ printf "#------------------------------------------------------------------------# \n"
+ printf "| %-35s%35s | \n" "$version" "$calltime"
+ printf "|                                                                        | \n"
  spalte1="called on:"; spalte2=$localhost_realname
- printf "| $spalte1$spalte2 | \n"
+ printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  if [[ $local_compile = false ]]
  then
@@ -2016,126 +2015,126 @@
     spalte1="compiling test only!"; spalte2=""
  fi
- printf "| $spalte1$spalte2 | \n"
+ printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  if [[ -n $numprocs ]]
  then
     spalte1="number of PEs:"; spalte2=$numprocs
-    printf "| $spalte1$spalte2 | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  fi
  if [[ -n $tasks_per_node ]]
  then
     spalte1="tasks per node:"; spalte2="$tasks_per_node (number of nodes: $nodes)"
-    printf "| $spalte1$spalte2 | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  fi
  if [[ $maximum_parallel_io_streams != $numprocs ]]
  then
     spalte1="max par io streams:"; spalte2="$maximum_parallel_io_streams"
-    printf "| $spalte1$spalte2 | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  fi
  if [[ $use_openmp = true ]]
  then
     spalte1="threads per task:"; spalte2="$threads_per_task"
-    printf "| $spalte1$spalte2 | \n"
- fi
- printf "|                                                              | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+ fi
+ printf "|                                                                        | \n"
  if [[ $do_compile = true ]]
  then
     if [[ "$mopts" != "" ]]
     then
-       spalte1="make options:"; spalte2=$mopts
-       printf "| $spalte1$spalte2 | \n"
-       zeile=$(echo "$mopts" | cut -c41-)
+       spalte1="make options:"; spalte2=$(echo "$mopts" | cut -c-45)
+       printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+       zeile=$(echo "$mopts" | cut -c46-)
        while [[ "$zeile" != "" ]]
        do
           spalte1=""
-          spalte2=$zeile
-          printf "| $spalte1$spalte2 | \n"
-          zeile=$(echo "$zeile" | cut -c41-)
+          spalte2=$(echo "$zeile" | cut -c-45)
+          printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+          zeile=$(echo "$zeile" | cut -c46-)
        done
     fi
 
-    spalte1="cpp directives:"; spalte2=$cpp_options
-    printf "| $spalte1$spalte2 | \n"
-    zeile=$(echo "$cpp_options" | cut -c41-)
+    spalte1="cpp directives:"; spalte2=$(echo "$cpp_options" | cut -c-45)
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+    zeile=$(echo "$cpp_options" | cut -c46-)
     while [[ "$zeile" != "" ]]
     do
        spalte1=""
-       spalte2=$zeile
-       printf "| $spalte1$spalte2 | \n"
-       zeile=$(echo "$zeile" | cut -c41-)
+       spalte2=$(echo "$zeile" | cut -c-45)
+       printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+       zeile=$(echo "$zeile" | cut -c46-)
     done
 
-    spalte1="compiler options:"; spalte2="$fopts"
-    printf "| $spalte1$spalte2 | \n"
-    zeile=$(echo "$fopts" | cut -c41-)
+    spalte1="compiler options:"; spalte2=$(echo "$fopts" | cut -c-45)
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+    zeile=$(echo "$fopts" | cut -c46-)
     while [[ "$zeile" != "" ]]
     do
        spalte1=""
-       spalte2=$zeile
-       printf "| $spalte1$spalte2 | \n"
-       zeile=$(echo "$zeile" | cut -c41-)
+       spalte2=$(echo "$zeile" | cut -c-45)
+       printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+       zeile=$(echo "$zeile" | cut -c46-)
     done
 
-    spalte1="linker options:"; spalte2=$lopts
-    printf "| $spalte1$spalte2 | \n"
-    zeile=$(echo "$lopts" | cut -c41-)
+    spalte1="linker options:"; spalte2=$(echo "$lopts" | cut -c-45)
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+    zeile=$(echo "$lopts" | cut -c46-)
     while [[ "$zeile" != "" ]]
     do
        spalte1=""
-       spalte2=$zeile
-       printf "| $spalte1$spalte2 | \n"
-       zeile=$(echo "$zeile" | cut -c41-)
+       spalte2=$(echo "$zeile" | cut -c-45)
+       printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+       zeile=$(echo "$zeile" | cut -c46-)
     done
 
-    spalte1="modules to be load:"; spalte2=$modules
-    printf "| $spalte1$spalte2 | \n"
-    zeile=$(echo "$modules" | cut -c41-)
+    spalte1="modules to be load:"; spalte2=$(echo "$modules" | cut -c-45)
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+    zeile=$(echo "$modules" | cut -c46-)
     while [[ "$zeile" != "" ]]
     do
        spalte1=""
-       spalte2=$zeile
-       printf "| $spalte1$spalte2 | \n"
-       zeile=$(echo "$zeile" | cut -c41-)
+       spalte2=$(echo "$zeile" | cut -c-45)
+       printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+       zeile=$(echo "$zeile" | cut -c46-)
     done
 
-    spalte1="main program":; spalte2=$mainprog
-    printf "| $spalte1$spalte2 | \n"
+    spalte1="main program:"; spalte2=$mainprog
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  else
     spalte1=executable:; spalte2=$executable
-    printf "| $spalte1$spalte2 | \n"
- fi
- printf "|                                                              | \n"
- spalte1="base name of files":; spalte2=$fname
- printf "| $spalte1$spalte2 | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+ fi
+ printf "|                                                                        | \n"
+ spalte1="base name of files:"; spalte2=$fname
+ printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  if [[ $fname != $afname ]]
  then
-    spalte1="base name of input files":; spalte2=$afname
-    printf "| $spalte1$spalte2 | \n"
- fi
- spalte1="INPUT control list":; spalte2=$input_list
- printf "| $spalte1$spalte2 | \n"
- spalte1="OUTPUT control list":; spalte2=$output_list
- printf "| $spalte1$spalte2 | \n"
+    spalte1="base name of input files:"; spalte2=$afname
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+ fi
+ spalte1="INPUT control list:"; spalte2=$(echo $input_list)
+ printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
+ spalte1="OUTPUT control list:"; spalte2=$(echo $output_list)
+ printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
 
  if [[ $do_batch = true  ||  "$LOADLBATCH" = yes ]]
  then
     spalte1="memory demand / PE":; spalte2="$memory MB"
-    printf "| $spalte1$spalte2 | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
     spalte1=CPU-time:; spalte2="$minuten:$sekunden"
-    printf "| $spalte1$spalte2 | \n"
+    printf "| %-25s%-45s | \n" "$spalte1" "$spalte2"
  fi
 
  if [[ $do_compile = true ]]
  then
-    printf "|                                                              | \n"
-    printf "| Files to be compiled:                                        | \n"
+    printf "|                                                                        | \n"
+    printf "| Files to be compiled:                                                  | \n"
     zeile=$source_list
     while [[ "$zeile" != "" ]]
     do
-       spalte3=$zeile
-       printf "| $spalte3 | \n"
-       zeile=$(echo "$zeile" | cut -c61-)
+       linestart=$(echo $zeile | cut -c-70)
+       printf "| %-70s | \n" "$linestart"
+       zeile=$(echo "$zeile" | cut -c71-)
     done
  fi
- printf "#--------------------------------------------------------------#"
+ printf "#------------------------------------------------------------------------#"
 
 
@@ -2192,8 +2191,13 @@
     antwort=dummy
     printf "\n\n"
-    while [[ "$antwort" != y  &&  "$antwort" != Y  &&  "$antwort" != n  &&  "$antwort" != N ]]
+    printf " >>> everything o.k. (y/n) ?  "
+    while  read antwort
     do
-       printf " >>> everything o.k. (y/n) ?  "
-       read  antwort
+       if [[ "$antwort" != y  &&  "$antwort" != Y  &&  "$antwort" != n  &&  "$antwort" != N ]]
+       then
+          printf " >>> everything o.k. (y/n) ?  "
+       else
+          break
+       fi
     done
     if [[ $antwort = n  ||  $antwort = N ]]
@@ -2214,42 +2218,44 @@
  fi
 
-#### PERFORM PARAMETER FILE CHECK (COUPLED RUNS ARE NOT SUPPORTED YET)
-
-#DEFINE VARIABLES FOR FREQUENTLY USED DIRECTORIES
+
+    # PERFORM PARAMETER FILE CHECK (COUPLED RUNS ARE NOT SUPPORTED YET)
+    # DEFINE VARIABLES FOR FREQUENTLY USED DIRECTORIES
  check_depository="${working_directory}/trunk/UTIL"
  check_sources="${working_directory}/tmp_check_namelist_files"
  skip_check=false
 
-#CHECK IF NAMELIST_FILE_CHECK HAS BEEN COMPILED SUCCESSFULLY
+    # CHECK IF NAMELIST_FILE_CHECK HAS BEEN COMPILED SUCCESSFULLY
  if [[ ! -f $check_depository/check_namelist_files.tar ]]
  then
-      skip_check=true 
-      reason="run on remote host or parameter file check has not been compiled."
+    skip_check=true 
+    reason="run on remote host or parameter file check has not been compiled."
  fi
  if [[ ! -f $PALM_BIN/check_namelist_files.x ]]
  then
-      skip_check=true 
-      reason="parameter file check has not been compiled."
- fi
-
-#CHECK FOR PARALLEL RUN; OTHERWISE SKIP CHECK
+    skip_check=true 
+    reason="parameter file check has not been compiled."
+ fi
+
+    # CHECK FOR PARALLEL RUN; OTHERWISE SKIP CHECK
  if [[ "$cond1" != "parallel"  &&  "$cond2" != "parallel" ]]
  then
-     skip_check=true 
-     reason="serial run."
- fi
-
-#ONLY PERFORM CHECK IF -z OPTION IS NOT SET, NO RESTART RUN IS CARRIED OUT AND IF THE EXECUTION HOST IS THE LOCAL HOST
-# ATTENTION: THIS ROUTINE DOES NOT WORK IF THE COMPILER ON THE LOCAL HOST DIFFERS FROM THE COMPILER ON THE REMOTE HOST
+    skip_check=true 
+    reason="serial run."
+ fi
+
+    # ONLY PERFORM CHECK IF -z OPTION IS NOT SET, NO RESTART RUN IS CARRIED OUT
+    # AND IF THE EXECUTION HOST IS THE LOCAL HOST
+    # ATTENTION: THIS ROUTINE DOES NOT WORK IF THE COMPILER ON THE LOCAL HOST
+    # DIFFERS FROM THE COMPILER ON THE REMOTE HOST
  if [[ $check_namelist_files == false ]]
  then
-     skip_check=true
-     reason="-z option set."
+    skip_check=true
+    reason="-z option set."
  fi
 
  if [[ $fromhost != $localhost ]]
  then
-     skip_check=true
-     reason="submitting host is local host."  
+    skip_check=true
+    reason="submitting host is local host."  
  fi  
 
@@ -2264,10 +2270,9 @@
     skip_check=true
     reason="restart run."     
-
- fi
-
-#SKIP CHECK IN CASE OF RESTART RUN: CHECK WHETHER THE LAST CHAR IS "f" IN PARIN
- ((last_char = `echo $filename_input | wc -c` - 1))
- last_char=`echo $filename_input |cut -c$last_char`
+ fi
+
+    # SKIP CHECK IN CASE OF RESTART RUN: CHECK WHETHER THE LAST CHAR IS "f" IN PARIN
+ (( last_char = `echo $filename_input | wc -c` - 1 ))
+ last_char=`echo $filename_input | cut -c $last_char`
  if [[ "$last_char" == "f" ]]
  then
@@ -2278,9 +2283,8 @@
  if [[ $skip_check == false ]]
  then
-
     tmp_check=${working_directory}/tmp_check
 
-#   GET TOPOGRAPHY PARAMETER FILE SUFFIX (USUALLY "_P3DF"). THIS FILE MIGHT IS
-#   NOT NECESSARILY REQUIRED
+       # GET TOPOGRAPHY PARAMETER FILE SUFFIX (USUALLY "_P3DF"). THIS FILE MIGHT IS
+       # NOT NECESSARILY REQUIRED
     line=""
     found=false
@@ -2303,5 +2307,5 @@
     rm -rf ${working_directory}/tmp_check
 
-#   CHECK IF THE A P3DF FILE MUST BE CHECKED
+       # CHECK IF THE A P3DF FILE MUST BE CHECKED
     for  item  in  $input_list
     do
@@ -2314,6 +2318,6 @@
     done
 
-#   ERROR IF NO PARAMETER FILE WAS FOUND, OTHERWISE PROCEED
-    if [[ (! -f $filename_input) && ( "$filename_input" != "") ]]
+      # ERROR IF NO PARAMETER FILE WAS FOUND, OTHERWISE PROCEED
+    if [[ (! -f $filename_input) && ( "$filename_input" != "" ) ]]
     then
        printf "\n\n  +++ ERROR: parameter file ($filename_input) not found." 
@@ -2321,9 +2325,7 @@
     fi
    
-#   CHECK IF THE RESTART PARAMETER FILE EXISTS (IF NECESSARY)
+       # CHECK IF THE RESTART PARAMETER FILE EXISTS (IF NECESSARY)
     if  [[ $check_restart == 1 ]]
     then
-
-
 
        filenamef="${filename_input}f"
@@ -2353,10 +2355,10 @@
     fi
 
-#   CREATE TEMPORARY SOURCES_FOR_CHECK PATH
+       # CREATE TEMPORARY SOURCES_FOR_CHECK PATH
     mkdir $check_sources
     cd $check_sources
 
 
-#   CHECK FOR USER CODE, OTHERWISE USE THE PRECOMPILED CHECK_NAMELIST_FILES.X
+       # CHECK FOR USER CODE, OTHERWISE USE THE PRECOMPILED CHECK_NAMELIST_FILES.X
     if [[ -d $add_source_path ]]
     then
@@ -2371,8 +2373,8 @@
        touch check_namelist_files.f90
 
-#      GET COMPILER OPTIONS AND PERFORM MAKE
+          # GET COMPILER OPTIONS AND PERFORM MAKE
        printf "\n\n  *** compiling code if necessary...\n"
 
-#      workaround for batch jobs on local machine (lcxe6)
+          # workaround for batch jobs on local machine (lcxe6)
        if [[ $do_batch == true && $do_remote == false ]]
        then
@@ -2380,5 +2382,5 @@
        fi
 
-       # GET CHECK OPTIONS
+          # GET CHECK OPTIONS
        line=""
        found=false
@@ -2396,6 +2398,6 @@
           if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
           then
-          # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING UND ALLE -D ENTFERNEN
-          line="$line "
+                # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING UND ALLE -D ENTFERNEN
+             line="$line "
              copts_check=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g' | sed 's/-D[^ ]* //g' | sed 's/ -D.*//g'`
              found=true
@@ -2407,5 +2409,5 @@
        make -f Makefile_check F90=$compiler_name_ser  COPT="$copts_check"
 
-#      GET MAKE OUTPUT
+          # GET MAKE OUTPUT
        if [[ $? != 0 ]]
        then
@@ -2447,11 +2449,11 @@
        cp ${pathname}/${fname}${topo_suffix} ./TOPOGRAPHY_DATA
 
-#      IN CASE OF TOPOGRAPHY AND HIGH GRID POINT NUMBERS, THE STACK SIZE 
-#      MUST BE INCREASED. THIS IS DUE TO THE ARRAY nzb_local AND topo_height, 
-#      WHICH REQUIRE SUFFICIENT MEMORY
+          # IN CASE OF TOPOGRAPHY AND HIGH GRID POINT NUMBERS, THE STACK SIZE 
+          # MUST BE INCREASED. THIS IS DUE TO THE ARRAY nzb_local AND topo_height, 
+          # WHICH REQUIRE SUFFICIENT MEMORY
        ulimit -s unlimited          
     fi
 
-#   CREATE ENVPAR FILE, WHICH IS NEEDED BY CHECK_NAMELIST_FILES.X
+       # CREATE ENVPAR FILE, WHICH IS NEEDED BY CHECK_NAMELIST_FILES.X
     cat  >  ENVPAR  <<  %%END%%
  &envpar  run_identifier = '$fname', host = '$host',
@@ -2464,6 +2466,7 @@
 %%END%%
 
-#   SAFETY CHECK: ONLY PROCEED IF THE PARAMETER CHECK PROGRAM WAS PROPERLY COMPILED
-    if [[ ! -f check_namelist_files.x && $skip_check == false ]] then
+       # SAFETY CHECK: ONLY PROCEED IF THE PARAMETER CHECK PROGRAM WAS PROPERLY COMPILED
+    if [[ ! -f check_namelist_files.x  &&  $skip_check == false ]]
+    then
        printf "\n  +++ WARNING: check_namelist_files.x not found."
        answer=dummy
@@ -2483,6 +2486,5 @@
              locat=normal; exit
           else
-             printf "\n  *** skipping parameter file check."
-         
+             printf "\n  *** skipping parameter file check."         
           fi
       fi
@@ -2490,8 +2492,8 @@
     elif [[ $skip_check == false ]]
     then
-#      STARTING THE PARAMETER FILE CHECK
+          # STARTING THE PARAMETER FILE CHECK
        printf "\n\n  *** starting parameter file check..."
 
-#      CHECKING THE P3D FILE
+          # CHECKING THE P3D FILE
        printf "\n\n      (1) checking $filename_input"  
        echo "$numprocs 0 0" > VARIN
@@ -2508,12 +2510,13 @@
        fi
 
-#      CHECKING THE PD3F FILE IF NECESSARY
+          # CHECKING THE PD3F FILE IF NECESSARY
        if [[ $check_restart == 1 && $check_error == false ]]
        then
           printf "\n\n      (2) checking $filenamef"  
 
-#         FIRST CHECK IF INITIALIZING_ACTIONS="READ_RESTART_DATA" IS SET IN &INIPAR LIST
+             # FIRST CHECK IF INITIALIZING_ACTIONS="READ_RESTART_DATA" IS SET
+             # IN &INIPAR LIST
           found=false
-          cat PARINF|while read line
+          cat PARINF | while read line
           do
              line=$(echo $line|sed 's/ //g')
@@ -2547,5 +2550,5 @@
           fi
 
-#         READ max_user_pr FROM FILES
+             # READ max_user_pr FROM FILES
           if [[ -f parin_for_check ]]
           then
@@ -2568,5 +2571,5 @@
        fi
     
-#      REPORT ERRORS AND CONTINUE/EXIT
+          # REPORT ERRORS AND CONTINUE/EXIT
        if [[ $check_error == true ]]
        then
@@ -2577,6 +2580,6 @@
           while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
           do
-          printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
-          read  answer
+             printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
+             read  answer
           done
 
@@ -2689,5 +2692,5 @@
 
 
-       basename=`print $mainprog | cut -f1 -d"."`
+       basename=`echo $mainprog | cut -f1 -d"."`
        eval make_depository=${local_depository_path}/${basename}_current_version.tar
        if [[ ! -f $make_depository ]]
@@ -4781,5 +4784,11 @@
           # with the SGE batch system
        echo  "cat > $config_file << \"%END%\""      >>  $jobfile
-       sed 's/#$.*//g'   $config_file               >>  $jobfile
+       if [[ $host = lckyuh ]]
+       then
+             # no cross compiler on compute node
+          sed  's/frtpx/frt/g'  $config_file        >>  $jobfile
+       else
+          sed 's/#$.*//g'   $config_file            >>  $jobfile
+       fi
        echo  "%END%"                                >>  $jobfile
        echo  " "                                    >>  $jobfile
@@ -4788,7 +4797,7 @@
           # ABSPEICHERN DER AKTUELLEN MRUN-VERSION
           # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
-       echo  "cat > $mrun_script_name <<\"%END%\""    >>  $jobfile
-       cat   ${PALM_BIN}/$mrun_script_name            >>  $jobfile
-       echo  "%END%"                                  >>  $jobfile
+       echo  "cat > $mrun_script_name <<\"%END%\""  >>  $jobfile
+       cat   ${PALM_BIN}/$mrun_script_name          >>  $jobfile
+       echo  "%END%"                                >>  $jobfile
        echo  "chmod u+x $mrun_script_name"          >>  $jobfile
        echo  "execute_mrun=true"                    >>  $jobfile
@@ -4851,14 +4860,10 @@
 
        # MRUN AUF ZIELRECHNER AUFRUFEN (queue is workaround for ibmkisti)
-    echo  "set -x"                                      >>  $jobfile
-    echo  "queue=$queue"                                >>  $jobfile
-#    echo  "echo \"*** shell test\" "                    >>  $jobfile
-#    echo  "which ksh"                                   >>  $jobfile
-#    echo  "ls -al /bin"                                 >>  $jobfile
+    echo  "set -x"                                        >>  $jobfile
+    echo  "queue=$queue"                                  >>  $jobfile
     echo  "[[ \$execute_mrun = true ]]  &&  ./$mrun_com"  >>  $jobfile
-
-    echo  'ls -al; echo `pwd`'                          >>  $jobfile
-    echo  "cd \$HOME"                                   >>  $jobfile
-    echo  "rm -rf  $TEMPDIR"                            >>  $jobfile
+    echo  'ls -al; echo `pwd`'                            >>  $jobfile
+    echo  "cd \$HOME"                                     >>  $jobfile
+    echo  "rm -rf  $TEMPDIR"                              >>  $jobfile
 
 
