Index: palm/trunk/SCRIPTS/mrun_new
===================================================================
--- palm/trunk/SCRIPTS/mrun_new	(revision 1)
+++ palm/trunk/SCRIPTS/mrun_new	(revision 5)
@@ -3,5 +3,5 @@
 ##!/home/DSRC/NC/tatuyama/pub/ksh   NEEDED ON NEC AT RIAM !!!!!!!!!!
 
-# mrun - Plot-Shellskript         Version:  @(#)MRUN 1.8   07/02/07
+# mrun - Plot-Shellskript         Version:  @(#)MRUN 1.8   10/02/07
 
      # Prozedur zum Starten von Modellaeufen
@@ -103,6 +103,8 @@
      #                     sampled in SOURCES_FOR_RUN_$fname which is a
      #                     subdirectory of the current working directory,
-     #                     -s TEST  changed to  -s CHANGED_FILES  or -s CF,
+     #                     -s TEST  changed to  -s WRITE_PERMIT  or -s WP,
      #                     adapted for RIAM (neck)
+     #                     bugfix for cycle number of output file (extout)
+     #                     all hpmuk-related code removed
 
 
@@ -125,5 +127,4 @@
  cond2="" 
  config_file=.mrun.config
- continuation_run=false
  cpp_opts=""
  cpumax=0
@@ -174,4 +175,5 @@
  queue=none
  read_from_config=""
+ restart_run=false
  return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
  if [[ $return_addres = 130.75.105.158 ]]
@@ -314,6 +316,4 @@
      (bora|breva|elephanta|gallego|gregale|hababai|irifi|levanto|maestro|orkan|ostria|poniente|quanero|scirocco|vorias)  mrun_path=/home/raasch/pub
                             localhost=lcmuk;;
-     (caurus|caver|gharra|samun|twister|viracao|yalka)  mrun_path=/home/raasch/pub/
-                                                         localhost=hpmuk;;
      (breg*-en0|berni*-en0) mrun_path=/home/b/niksiraa/pub
                             localhost=ibmb; archive_system=tivoli;;
@@ -357,5 +357,5 @@
        (B)   delete_temporary_catalog=false; mc="$mc -B";;
        (c)   config_file=$OPTARG; mc="$mc -c$OPTARG";;
-       (C)   continuation_run=true; mc="$mc -C";;
+       (C)   restart_run=true; mc="$mc -C";;
        (d)   fname=$OPTARG; mc="$mc -d$OPTARG";;
        (D)   cpp_opts="$cpp_opts $OPTARG"; mc="$mc -D$OPTARG";;
@@ -500,5 +500,5 @@
     do_remote=true
     case  $host  in
-        (hpmuk|ibm|ibmb|ibmh|ibms|ibmy|nech|neck|lctit|unics)  true;;
+        (ibm|ibmb|ibmh|ibms|ibmy|nech|neck|lctit|unics)  true;;
         (*)  printf "\n"
              printf "\n  +++ execution host \"$host\" not admitted for MRUN,"
@@ -843,5 +843,5 @@
     do_remote=true
     case  $host  in
-        (hpmuk|ibm|ibmb|ibmh|ibms|ibmy|lctit|nech|neck|unics)  true;;
+        (ibm|ibmb|ibmh|ibms|ibmy|lctit|nech|neck|unics)  true;;
         (*)  printf "\n"
              printf "\n  +++ execution host \"$host\" not admitted for MRUN,"
@@ -995,5 +995,4 @@
  then
     case  $host  in
-        (hpmuk)      queue=hpmuk;;
         (ibmb)       if [[ $node_usage = shared ]]
                      then
@@ -1297,7 +1296,8 @@
  then
 
-    [[ "$source_list" = CF ]]  &&  source_list=CHANGED_FILES
-
-    if [[ "$source_list" = CHANGED_FILES  ||  $continuation_run != true ]]
+    [[ "$source_list" = LM ]]  &&  source_list=LOCALLY_MODIFIED
+    [[ "$source_list" = WP ]]  &&  source_list=WRITE_PERMIT
+
+    if [[ $restart_run != true ]]
     then
        rm -rf  SOURCES_FOR_RUN_$fname
@@ -1315,11 +1315,8 @@
        # ALLE ERMITTELTEN DATEIEN WERDEN IM VERZEICHNIS SOURCES_FOR_RUN_...
        # GESAMMELT
-    if [[ "$source_list" = CHANGED_FILES ]]
+    if [[ "$source_list" = WRITE_PERMIT ]]
     then
 
        source_list=""
-
-          # ZUERST DAS DURCH DIE KONFIGURATIONSDATEI FESTGELEGTE
-          # QUELLTEXTVERZEICHNIS DURCHSUCHEN
        cd  $source_path
 
@@ -1354,8 +1351,53 @@
 
 
+    elif [[ "$source_list" = LOCALLY_MODIFIED ]]
+    then
+
+          # MODIFIZIERTE DATEIEN DER SVN-ARBEITSKOPIE BESTIMMEN
+       source_list=""
+       cd  $source_path
+
+
+          # PRUEFEN, OB VERZEICHNIS UEBERHAUPT UNTER SVN-KONTROLLE STEHT
+       if [[ ! -d .svn ]]
+       then
+          printf "\n\n  +++ source directory"
+          printf "\n         \"$source_path\" "
+          printf "\n         is not under control of \"subversion\"."
+          printf "\n         Please do not use mrun-option \"-s LOCALLY MODIFIED\"\n"
+       fi
+
+
+          # ALLE MODIFIZIERTEN QUELLCODEDATEIEN AUFLISTEN
+       Filenames=""
+       svn status  |  while  read line
+       do
+          firstc=`echo $line | cut -c1`
+          if [[ $firstc = M  ||  $firstc = "?" ]]
+          then
+             Name=`echo "$line" | cut -c8-`
+             extension=`echo $Name | cut -d. -f2`
+             if [[ "$extension" = f90 || "$extension" = F90 || "$extension" = f || "$extension" = F || "$extension" = c ]]
+             then
+                Filenames="$Filenames "$Name
+             fi
+          fi
+       done
+
+
+          # DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN
+       for  dateiname  in  $Filenames
+       do
+          cp  $dateiname  $working_directory/SOURCES_FOR_RUN_$fname
+          source_list=$source_list"$dateiname "
+       done
+
+       cd -  > /dev/null
+
+
        # MITTELS OPTION -s ANGEGEBENE DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN
        # BEI AUTOMATISCHEN FORTSETZUNGSLAEUFEN SIND DORT SCHON ALLE DATEIEN
        # VORHANDEN
-    elif [[ "$source_list" != ""  &&  $continuation_run != true ]]
+    elif [[ "$source_list" != ""  &&  $restart_run != true ]]
     then
 
@@ -1392,5 +1434,5 @@
        # LISTE DER ZU UEBERSETZENDEN PROGRAMMTEILE MIT ENTHALTEN IST (WENN
        # NICHT, WIRD ES DIESER LISTE HINZUGEFUEGT)
-    if [[ $continuation_run != true ]]
+    if [[ $restart_run != true ]]
     then
 
@@ -1412,5 +1454,5 @@
 
        # DATEIEN AUS ZUSAETZLICHEM QUELLVERZEICHNIS HINZUFUEGEN
-    if [[ $continuation_run != true  &&  "$add_source_path" != "" ]]
+    if [[ $restart_run != true  &&  "$add_source_path" != "" ]]
     then
 
@@ -1482,5 +1524,5 @@
        # ALLE UNTERPROGRAMME, DIE ZU VEREINBARTEN SOFTWAREPAKETEN GEHOEREN,
        # DER LISTE DER ZU UEBERSETZENDEN DATEIEN HINZUFUEGEN
-    if [[ $continuation_run != true  &&  -n $package_list ]]
+    if [[ $restart_run != true  &&  -n $package_list ]]
     then
 
@@ -1522,5 +1564,5 @@
        # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN
        # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN...
-    if [[ "$use_makefile" = true  &&  "$continuation_run" != true ]]
+    if [[ "$use_makefile" = true  &&  "$restart_run" != true ]]
     then
        [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
@@ -1663,5 +1705,5 @@
  then
     case  $localhost  in
-        (hpmuk|unics)                           compiler_name=f77;;
+        (unics)                                 compiler_name=f77;;
         (lcmuk)                                 if [[ "$cond1" = parallel  ||  "$cond2" = parallel ]]
                                                 then
@@ -1695,5 +1737,4 @@
  case  $localhost  in
      (decalpha|ibm|ibmb|ibmh|ibms|ibmy|unics)  praeproc=cpp;;
-     (hpmuk)                                   praeproc=/usr/ccs/lbin/cpp;;
  esac
 
@@ -2154,5 +2195,5 @@
              cp  $make_depository  $TEMPDIR_COMPILE
              cd  $TEMPDIR_COMPILE
-             tar -xf  $make_depository  >  /dev/null
+             tar -xf  $make_depository  >  /dev/null  2>&1
              cd -  > /dev/null
           fi
@@ -2229,46 +2270,4 @@
        else
 
-             # HPMUK EVTL. PRAEPROZESSOR LAUFEN LASSEN
-          if [[ $localhost = hpmuk ]]
-          then
-             (( i = 0 ))
-             new_source_list=""
-             for  filename  in  $source_list
-             do
-                basename=`print $filename | cut -f1 -d"."`
-                extension=`print $filename | cut -f2 -d"."`
-                if [[ $extension = F  &&  $localhost != hpmuk ]]
-                then
-                   (( i = i + 1 ))
-                   if (( i == 1 ))
-                   then
-                      printf "\n\n  *** preprocessor-calls:\n$striche"
-                   fi
-                   printf "\n      $praeproc  $PPOPTS  -P  $filename  >  ${basename}.f  2> /dev/null"
-                   $praeproc  $PPOPTS  -P  $filename  >  ${basename}.f  2> /dev/null
-                   new_source_list="$new_source_list "${basename}.f
-                   elif [[ $extension = f90 ]]
-                then
-                   (( i = i + 1 ))
-                   if (( i == 1 ))
-                   then
-                      printf "\n\n  *** preprocessor-calls:\n$striche"
-                   fi
-                   mv  $filename  ${basename}.F90
-                   printf "\n      $praeproc  $PPOPTS  -C  -P  ${basename}.F90  >  $filename  2> /dev/null"
-                   $praeproc  $PPOPTS  -C  -P  ${basename}.F90  >  $filename  2> /dev/null
-                   new_source_list="$new_source_list "$filename
-                   rm -f  ${basename}.F90
-                else
-                   new_source_list="$new_source_list "$filename
-                fi
-             done
-             source_list="$new_source_list"
-             if (( i != 0 ))
-             then
-                printf "\n$striche\n  *** preprocessor-calls finished\n"
-             fi
-          fi
-
 
              # UEBERSETZUNG DER QUELLTEXT-DATEIEN UND DES HAUPTPROGRAMMS
@@ -2328,15 +2327,7 @@
           printf "      linker-options:                    $LOPTS \n"
           printf "      source code files:                 $source_list \n"
-          if [[ $localhost = hpmuk ]]
-          then
-             if [[ $localhost_realname = caurus ]]
-             then
-                $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $source_list  $LOPTS
-             else
-                remsh  caurus  "export PATH=/opt/fortran90/bin:$PATH; cd `pwd`; $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $source_list  $LOPTS" 
-             fi
-          else
-             $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $LOPTS  $source_list  
-          fi
+
+          $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $LOPTS  $source_list  
+
        fi
        if [[ $? != 0  ||  "$compile_error" = true  ||  "$module_compile_error" = true ]]
@@ -2683,9 +2674,5 @@
           exit
        fi
-       if [[ $localhost = hpmuk ]]
-       then
-          echo  "property sdir .,${source_path}, ${add_source_path}"  >  .dderc
-          dde  a.out
-       elif [[ $localhost = decalpha ]]
+       if [[ $localhost = decalpha ]]
        then
           dxladebug  a.out
@@ -3546,5 +3533,5 @@
 
                 # KOPIEREN AUF EINPROZESSORMASCHINE
-             if [[ "${extout[$i]}" != " " ]]
+             if [[ "${extout[$i]}" != " "  &&  "${extout[$i]}" != "" ]]
              then
                 printf "\n  >>> OUTPUT: ${localout[$i]}  to  ${pathout[$i]}.${extout[$i]}\n"
