Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 68)
+++ palm/trunk/SCRIPTS/mrun	(revision 69)
@@ -1,3 +1,3 @@
-#!/bin/ksh
+#!/bin/pdksh
 
 ##!/home/DSRC/NC/tatuyama/pub/ksh   NEEDED ON NEC AT RIAM !!!!!!!!!!
@@ -114,4 +114,5 @@
      # 14/03/07 - Siggi  - fimm admitted, revision number added to terminal
      #                     output
+     # 16/03/07 - Siggi  - adjustments for lctit
 
 
@@ -184,5 +185,6 @@
  read_from_config=""
  restart_run=false
- return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
+# return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
+ return_addres=1.2.3.4
  if [[ $return_addres = 130.75.105.158 ]]
  then
@@ -246,5 +248,6 @@
     # FEHLERBEHANDLUNG
     # BEI EXIT:
- trap 'if [[ $locat != localhost ]]
+ trap 'rm -rf  tmp_mrun
+       if [[ $locat != localhost ]]
        then
 #          if [[ ! -f ${mrun_path}/statistik/mrun_statistik ]]
@@ -271,5 +274,5 @@
 #             fi
 #          fi
-          continue
+          echo " " > /dev/null
        fi
 
@@ -308,5 +311,6 @@
 
     # BEI TERMINAL-BREAK:
- trap '[[ $tmpcreate = true ]]  &&  (cd; rm -rf $TEMPDIR)
+ trap 'rm -rf  tmp_mrun
+       [[ $tmpcreate = true ]]  &&  (cd; rm -rf $TEMPDIR)
        if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]]
        then
@@ -520,8 +524,8 @@
  if [[ -n $additional_conditions ]]
  then
-    echo $additional_conditions | cut -d" " -f1-3 | read  cond1  cond2  dummy
-#    cond1=`echo $additional_conditions | cut -d" " -f1`
-#    cond2=`echo $additional_conditions | cut -d" " -s -f2`
-#    dummy=`echo $additional_conditions | cut -d" " -s -f3`
+#    echo $additional_conditions | cut -d" " -f1-3 | read  cond1  cond2  dummy
+    cond1=`echo $additional_conditions | cut -d" " -f1`
+    cond2=`echo $additional_conditions | cut -d" " -s -f2`
+    dummy=`echo $additional_conditions | cut -d" " -s -f3`
     if [[ -n $dummy ]]
     then
@@ -592,10 +596,10 @@
              # ZEILE DEFINIERT ENVIRONMENT-VARIABLE
           zeile=$(echo $zeile | cut -c2-)
-          echo $zeile | cut -d" " -f1-5 | read  var  value  for_host  for_cond1  for_cond2
-#          var=`echo $zeile | cut -d" " -f1`
-#          value=`echo $zeile | cut -d" " -s -f2`
-#          for_host=`echo $zeile | cut -d" " -s -f3`
-#          for_cond1=`echo $zeile | cut -d" " -s -f4`
-#          for_cond2=`echo $zeile | cut -d" " -s -f5`
+#          echo $zeile | cut -d" " -f1-5 | read  var  value  for_host  for_cond1  for_cond2
+          var=`echo $zeile | cut -d" " -f1`
+          value=`echo $zeile | cut -d" " -s -f2`
+          for_host=`echo $zeile | cut -d" " -s -f3`
+          for_cond1=`echo $zeile | cut -d" " -s -f4`
+          for_cond2=`echo $zeile | cut -d" " -s -f5`
 
           if [[ "$for_host" = ""  ||  ( "$for_host" = $host  &&  "$for_cond1" = "$cond1"  &&  "$for_cond2" = "$cond2" )  ||  $(echo "$input_list$output_list"|grep -c "$for_host") != 0 ]]
@@ -683,7 +687,7 @@
              # s2b: loc    - Feld (optional)
              # s2c: tr/ar  - Feld (optional)
-          echo $zeile | cut -d" " -f1-2 | read  s1  s2
-#          s1=`echo $zeile | cut -d" " -f1`
-#          s2=`echo $zeile | cut -d" " -s -f2`
+#          echo $zeile | cut -d" " -f1-2 | read  s1  s2
+          s1=`echo $zeile | cut -d" " -f1`
+          s2=`echo $zeile | cut -d" " -s -f2`
           s2a=$(echo $s2 | cut -d":" -f1)
           if [[ $(echo $s2 | grep -c ":") = 0 ]]
@@ -692,13 +696,13 @@
              s2c=""
           else
-             echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read  s2b  s2c
-#             s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'`
-#             s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'`
-          fi
-          echo $zeile | cut -d" " -f3-6 | read  s3  s4  s5  s6
-#          s3=`echo $zeile | cut -d" " -f3`
-#          s4=`echo $zeile | cut -d" " -s -f4`
-#          s5=`echo $zeile | cut -d" " -s -f5`
-#          s6=`echo $zeile | cut -d" " -s -f6`
+#             echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read  s2b  s2c
+             s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'`
+             s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'`
+          fi
+#          echo $zeile | cut -d" " -f3-6 | read  s3  s4  s5  s6
+          s3=`echo $zeile | cut -d" " -f3`
+          s4=`echo $zeile | cut -d" " -s -f4`
+          s5=`echo $zeile | cut -d" " -s -f5`
+          s6=`echo $zeile | cut -d" " -s -f6`
 
        
@@ -768,4 +772,22 @@
 #    esac
 
+
+       # ENVIRONMENT-VARIABLEN FUER INTERPRET_CONFIG UEBER NAMELIST_DATEI ZUR
+       # VERFUEGUNG STELLEN
+    cat  >  .mrun_environment  <<  %%END%%
+ &mrun_environment  cond1 = '$cond1', cond2 = '$cond2', 
+                    config_file = '$config_file', do_remote = '$do_remote',
+                    do_trace = '$do_trace', host = '$host',
+                    input_list = '$input_list', icf = '$interpreted_config_file',
+                    localhost = '$localhost', output_list = '$output_list' /
+
+%%END%%
+
+       # WERTE VON MRUN-OPTIONEN SICHERN UND DAMIT GEGEBENENFALLS SPAETER DIE
+       # IN DER KONFIGURAIONSDATEI ANGEGEBENEN WERTE UEBERSTEUERN
+    mrun_memory=$memory
+    mrun_cpumax=$cpumax
+    mrun_numprocs=$numprocs
+
     if [[ $localhost_realname = "gate" ]]
     then
@@ -779,5 +801,10 @@
     export PATH=$PATH:.
     . $interpreted_config_file
-    rm  $interpreted_config_file
+#    rm  $interpreted_config_file
+
+       # OPTIONSWERTE UEBERSTEUERN KONFIGURATIONSDATEI
+    [[ "mrun_memory"   != "" ]]  &&  memory=$mrun_memory
+    [[ "mrun_cpumax"   != "" ]]  &&  cpumax=$mrun_cpumax
+    [[ "mrun_numprocs" != "" ]]  &&  numprocs=$mrun_numprocs
 
  fi
@@ -1054,5 +1081,5 @@
                   fi;;
      (lctit)      netcdf_support=true
-                  netcdf_path=/home2/usr5/mkanda/netcdf-3.6.1;;
+                  netcdf_path=/home2/usr5/mkanda/netcdf-3.6.2;;
      (nech)       netcdf_support=true
                   netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;;
@@ -1391,5 +1418,6 @@
           # ALLE MODIFIZIERTEN QUELLCODEDATEIEN AUFLISTEN
        Filenames=""
-       svn status  |  while  read line
+       svn status  >  tmp_mrun
+       while  read line
        do
           firstc=`echo $line | cut -c1`
@@ -1403,5 +1431,5 @@
              fi
           fi
-       done
+       done < tmp_mrun
 
 
@@ -1869,6 +1897,6 @@
        (lcmuk|nech|neck)  FOPTS="-I ${netcdf_path}/include  $FOPTS"
                           LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
-       (lctit)            FOPTS="-I ${netcdf_path}/src/f90  $FOPTS"
-                          LOPTS="$LOPTS -L${netcdf_path}/src/libsrc -lnetcdf";;
+       (lctit)            FOPTS="-I ${netcdf_path}/include  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
 
     esac
@@ -2175,5 +2203,6 @@
              # PFADNAMEN FUER DAS MAKE-DEPOSITORY ERMITTELN
           line=""
-          grep "%depository_path" $config_file  |  while read line
+          grep "%depository_path" $config_file  >  tmp_mrun
+          while read line
           do
              if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -2184,8 +2213,9 @@
                 fi
              fi
-          done
+          done < tmp_mrun
 
           line=""
-          grep  " $localhost" $config_file | grep "%depository_path"  |  while read line
+          grep  " $localhost" $config_file | grep "%depository_path"  >  tmp_mrun
+          while read line
           do
              if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -2193,5 +2223,5 @@
                 local_depository_path=`echo $line | cut -d" " -s -f2`
              fi
-          done
+          done < tmp_mrun
 
           if [[ "$local_depository_path" = "" ]]
@@ -2915,7 +2945,7 @@
              if [[ "$QUEUE" = interactive ]]
              then
-                mpirun  -np $numprocs  $runfile  $ROPTS  >  aout_output  2>&1
+                mpirun  -np $numprocs  a.out  $ROPTS  >  aout_output  2>&1
              else
-                n1ge  -fore  -mpi $numprocs  -q $queue  $runfile  $ROPTS  >  aout_output  2>&1
+                n1ge  -fore  -mpi $numprocs  -q $queue  a.out  $ROPTS  >  aout_output  2>&1
              fi
 
@@ -3866,5 +3896,5 @@
 
        # WORKAROUND FUER RIAM-NEC-JOBS WEGEN PROFILE-SCHWIERIGKEITEN
-    if [[ $localhost_realname = "gate" ]]
+    if [[ $localhost_realname = "gate"  ||  $localhost = lctit ]]
     then
        echo  "export PALM_BIN=$PALM_BIN"                >>  $jobfile
