Index: palm/trunk/SCRIPTS/palmrun
===================================================================
--- palm/trunk/SCRIPTS/palmrun	(revision 4481)
+++ palm/trunk/SCRIPTS/palmrun	(revision 4536)
@@ -27,4 +27,7 @@
 # -----------------
 # $Id$
+# handling of single restart files (created with MPI-I/O) added
+# 
+# 4481 2020-03-31 18:55:54Z maronga
 # add cycle number to initial files too (000),
 # remove compatibility for cycle numbers which are less than three digits wide
@@ -2045,4 +2048,9 @@
           files_for_cores=true; filetype=files
           actionin[$i]="ln"
+             # FILE HAS BEEN FOUND INSTEAD OF DIRECTORY
+          if [[ -f "${absnamein[$i]}" ]]
+          then
+             files_for_cores=false; filetype=file
+          fi
        elif [[ "${actionin[$i]}" = lnpe  &&  ! -n $cores ]]
        then
@@ -2572,7 +2580,12 @@
           link_local_output=true
           actionout[$i]=""
+             # FILE HAS BEEN FOUND INSTEAD OF DIRECTORY
+          if [[ -f ${localout[$i]} ]]
+          then
+             files_for_cores=false; filetype=file
+          fi
        elif [[ "${actionout[$i]}" = lnpe  &&  ! -n $cores ]]
        then
-          link_local_output
+          link_local_output=true
           actionout[$i]=""
        elif [[ "${actionout[$i]}" = trpe  &&  -n $cores ]]
@@ -2697,38 +2710,34 @@
                 printf "\n  >>> OUTPUT: ${localout[$i]}  to"
                 printf "\n              ${pathout[$i]}.${extout[$i]}\n"
-		              if [[ $link_local_output = true ]]
-		              then
-		                 printf "      file will be linked\n"
-		                 ln -f  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
-		              fi
-		                 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
-		              if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]]
+                if [[ $link_local_output = true ]]
                 then
-		                 if [[ $link_local_output = true ]]
-	                  then
+                   printf "      file will be linked\n"
+                   ln -f  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
+                fi
+                   # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
+                if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]]
+                then
+                   if [[ $link_local_output = true ]]
+                   then
                       printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-		                 fi
-		                 cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
-		              else
-                   printf "+++ no copy because file ${pathout[$i]}.${extout[$i]} exists\n"
+                   fi
+                   cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
                 fi
              else
                 printf "\n  >>> OUTPUT: ${localout[$i]}  to"
                 printf "\n              ${pathout[$i]}\n"
-		              if [[ $link_local_output = true ]]
-		              then
-		                 printf "      file will be linked\n"
-		                 ln -f  ${localout[$i]}  ${pathout[$i]}
-		              fi
-		                 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
-	              	if [[ ! -f "${pathout[$i]}" ]]
+                if [[ $link_local_output = true ]]
                 then
-		                 if [[ $link_local_output = true ]]
-	                  then
+                   printf "      file will be linked\n"
+                   ln -f  ${localout[$i]}  ${pathout[$i]}
+                fi
+                   # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
+             	if [[ ! -f "${pathout[$i]}" ]]
+                then
+                   if [[ $link_local_output = true ]]
+                   then
                       printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-		                 fi
-		                 cp  ${localout[$i]}  ${pathout[$i]}
-		              else
-		                 printf "+++ no copy because file ${pathout[$i]} exists\n"
+                   fi
+                   cp  ${localout[$i]}  ${pathout[$i]}
                 fi
              fi
@@ -2741,25 +2750,25 @@
              printf "\n  >>> OUTPUT: ${localout[$i]}/_....  to"
              printf "\n              ${pathout[$i]}\n"
-	            if [[ $link_local_output = true ]]
-	            then
-		              printf "      files will be linked\n"
-		              mkdir -p ${pathout[$i]}
-		              cd ${localout[$i]}
-		              for file in $(ls *)
-		              do
-		                 ln -f $file  ${pathout[$i]}
-		              done >|/dev/null 2>&1
-		              cd $tempdir
-	            fi
+             if [[ $link_local_output = true ]]
+             then
+                printf "      files will be linked\n"
+                mkdir -p ${pathout[$i]}
+                cd ${localout[$i]}
+                for file in $(ls *)
+                do
+                   ln -f $file  ${pathout[$i]}
+                done >|/dev/null 2>&1
+                cd $tempdir
+             fi
 
                 # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r"
-	            if [[ ! -f "${pathout[$i]}/_000000" ]]
+             if [[ ! -f "${pathout[$i]}/_000000" ]]
              then
-		              if [[ $link_local_output = true ]]
-		              then
+                if [[ $link_local_output = true ]]
+                then
                    printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-		              fi
-		              [[ ! -d "${pathout[$i]}" ]]  &&  mkdir  ${pathout[$i]}
-		              cp -r  ${localout[$i]}/*  ${pathout[$i]}
+                fi
+                [[ ! -d "${pathout[$i]}" ]]  &&  mkdir  ${pathout[$i]}
+                cp -r  ${localout[$i]}/*  ${pathout[$i]}
        	     fi
 
