Index: palm/trunk/SCRIPTS/batch_scp
===================================================================
--- palm/trunk/SCRIPTS/batch_scp	(revision 1091)
+++ palm/trunk/SCRIPTS/batch_scp	(revision 1094)
@@ -22,5 +22,5 @@
 # Current revisions:
 # ------------------
-# 
+# new option -P for explicit setting of ssh/scp port
 #
 # Former revisions:
@@ -104,5 +104,5 @@
 
     # SHELLSCRIPT-OPTIONEN EINLESEN
- while  getopts  :aAbcCdgmnoqsu:w:  option
+ while  getopts  :aAbcCdgmnoP:qsu:w:  option
  do
    case  $option  in
@@ -117,4 +117,5 @@
        (n)   print_local_filename=true;;  # Option ist nicht dokumentiert !
        (o)   overwrite=true;;
+       (P)   scp_port=$OPTARG;;
        (q)   quote_wait=true;;
        (s)   silent=true;;
@@ -243,4 +244,12 @@
 
 
+    # Set port number option for calls of ssh/scp, subjob and batch_scp scripts
+ if [[ "$scp_port" != "" ]]
+ then
+    PORTOPT="-P $scp_port"
+    SSH_PORTOPT="-p $scp_port"
+ fi
+
+
     # PRUEFEN, OB LOKALE DATEI/LOKALES VERZEICHNIS VORHANDEN BZW. NICHT VORHANDEN
  if [[ $get = false ]]
@@ -300,7 +309,7 @@
  if [[ $(echo $local_host | cut -c1-4) = gaia ]]
  then
-    ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3; ls -1; echo '*** list complete'\" "  > $filelist  2>&1
+    ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"cd $3; ls -1; echo '*** list complete'\" "  > $filelist  2>&1
  else
-    ssh -p 22 $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
+    ssh $SSH_PORTOPT $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
  fi
  ssh_status=$?
@@ -510,7 +519,7 @@
     if [[ $(echo $local_host | cut -c1-4) = gaia ]]
     then
-       ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist
+       ssh $SSH_PORTOPT $local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist
     else
-       ssh $1 -p 22 -l $remote_user "cd $3" > $filelist
+       ssh $SSH_PORTOPT $1 -l $remote_user "cd $3" > $filelist
     fi
     if [[ $? != 0 ]]
@@ -560,7 +569,7 @@
              if [[ $catalog_copy = false ]]
              then
-                scp -p -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
+                scp $PORTOPT -p -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
              else
-                scp -p -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
+                scp $PORTOPT -p -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
              fi
           elif [[ $(echo $local_host | cut -c1-4) = gaia ]]
@@ -568,14 +577,14 @@
              if [[ $catalog_copy = false ]]
              then
-                ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
+                ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
              else
-                ssh $local_user@gaiad "cd $local_wdir; scp -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
+                ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
              fi
           else
              if [[ $catalog_copy = false ]]
              then
-                scp -P 22 -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+                scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
              else
-                scp -P 22 -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+                scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
              fi
           fi
@@ -591,7 +600,7 @@
              if  [[ $(echo $local_host | cut -c1-4) = gaia ]]
              then
-                remote_size=`ssh $local_user@gaiad "ssh $1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "`
+                remote_size=`ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "`
              else
-                remote_size=`ssh $1 -p 22 -l $remote_user "ls -al $catalog_name$4$zyklusnr"`
+                remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"`
              fi
              remote_size=`echo $remote_size | cut -d" " -f5`
@@ -608,7 +617,7 @@
           if [[ $(echo $local_host | cut -c1-4) = gaia ]]
           then
-             ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random"  > /dev/null
+             ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random"  > /dev/null
           else
-             scp -P 22 -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
+             scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
           fi
           if [[ $? != 0 ]]
@@ -621,7 +630,7 @@
              if  [[ $(echo $local_host | cut -c1-4) = gaia ]]
              then
-                remote_size=`ssh $local_user@gaiad "ssh $1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "`
+                remote_size=`ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "`
              else
-                remote_size=`ssh $1 -p 22 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
+                remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
              fi
              remote_size=`echo $remote_size | cut -d" " -f5`
@@ -640,7 +649,7 @@
           if  [[ $(echo $local_host | cut -c1-4) = gaia ]]
           then
-             ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'\" " > $filelist
+             ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'\" " > $filelist
           else
-             ssh $1 -p 22 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist
+             ssh $SSH_PORTOPT $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist
           fi
           if [[ $? != 0 ]]
@@ -660,7 +669,7 @@
        if  [[ $(echo $local_host | cut -c1-4) = gaia ]]
        then
-          ssh $local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" "
-       else
-          ssh $1 -p 22 -l $remote_user "mkdir -p $3"
+          ssh $SSH_PORTOPT $local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" "
+       else
+          ssh $SSH_PORTOPT $1 -l $remote_user "mkdir -p $3"
        fi
        if [[ $? != 0 ]]
@@ -670,7 +679,7 @@
        if  [[ $(echo $local_host | cut -c1-4) = gaia ]]
        then
-          ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
-       else
-          scp -P 22 -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+          ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
+       else
+          scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
        fi
        if [[ $? != 0 ]]
@@ -694,7 +703,7 @@
           if  [[ $(echo $local_host | cut -c1-4) = gaia ]]
           then
-             ssh $local_user@gaiad "cd $local_wdir; scp -p $remote_user@$1:$catalog_name$4$zyklusnr $2"  > /dev/null
+             ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $remote_user@$1:$catalog_name$4$zyklusnr $2"  > /dev/null
           else
-             scp -P 22 -p $remote_user@$1:$catalog_name$4$zyklusnr $2  > /dev/null
+             scp $PORTOPT -p $remote_user@$1:$catalog_name$4$zyklusnr $2  > /dev/null
           fi
           if [[ $? != 0 ]]
Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 1091)
+++ palm/trunk/SCRIPTS/mrun	(revision 1094)
@@ -22,5 +22,6 @@
 # Current revisions:
 # ------------------
-# 
+# explicit ssh/scp port can be set in config file with environment variable
+# scp_port.  This port is handled to all ssh/scp/batch_scp calls.
 #
 # Former revisions:
@@ -1100,4 +1101,12 @@
 
 
+    # Set port number option for calls of ssh/scp, subjob and batch_scp scripts
+ if [[ "$scp_port" != "" ]]
+ then
+    PORTOPT="-P $scp_port"
+    SSH_PORTOPT="-p $scp_port"
+ fi
+
+
     # FALLS NICHT VORGEGEBEN, DEFAULT-QUEUE AUF DER ZIELMASCHINE FESTLEGEN
  if [[ $queue = none ]]
@@ -2741,5 +2750,5 @@
        then
 #         init_cmds was ". /SX/opt/etc/initsx.sh;" 
-          ssh  136.172.44.192 -l $usern "$init_cmds $module_calls cd \$HOME/work/${usern}.$kennung; sxmake $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
+          ssh  $SSH_PORTOPT  136.172.44.192 -l $usern "$init_cmds $module_calls cd \$HOME/work/${usern}.$kennung; sxmake $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
           cp  $TEMPDIR_COMPILE/a.out  .
           [[ $? != 0 ]]  &&  compile_error=true
@@ -2748,5 +2757,5 @@
        then
           printf "      compiler is called via ssh on \"plogin1\" \n"
-          ssh  plogin1  -l $usern  "$init_cmds export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
+          ssh  $SSH_PORTOPT  plogin1  -l $usern  "$init_cmds export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -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
@@ -2754,5 +2763,5 @@
        then
           printf "      compiler is called via ssh on \"bicegate0\" \n"
-          ssh  bicegate0  -l $usern  "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
+          ssh  $SSH_PORTOPT  bicegate0  -l $usern  "$init_cmds $module_calls cd $TEMPDIR; make $mopts -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
@@ -2760,5 +2769,5 @@
        then
           printf "      compiler is called via ssh on \"hicegate0\" \n"
-          ssh  hicegate0  -l $usern  "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
+          ssh  $SSH_PORTOPT  hicegate0  -l $usern  "$init_cmds $module_calls cd $TEMPDIR; make $mopts -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
@@ -2766,5 +2775,5 @@
        then 
           printf "      compiler is called via ssh on \"flow\" \n"
-          ssh  flow02.hpc.uni-oldenburg.de -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" "
+          ssh  $SSH_PORTOPT  flow02.hpc.uni-oldenburg.de -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -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
@@ -2971,7 +2980,7 @@
                 if [[ $localhost = lcsgih ]]
                 then
-                   ssh  $usern@hicedata.hlrn.de  "cp  $PERM/${frelin[$i]}  $PWD"
+                   ssh  $SSH_PORTOPT  $usern@hicedata.hlrn.de  "cp  $PERM/${frelin[$i]}  $PWD"
                 else
-                   ssh  $usern@bicedata.hlrn.de  "cp  $PERM/${frelin[$i]}  $PWD"
+                   ssh  $SSH_PORTOPT  $usern@bicedata.hlrn.de  "cp  $PERM/${frelin[$i]}  $PWD"
                 fi
              else
@@ -2981,7 +2990,7 @@
                    if [[ $localhost = lcsgih ]]
                    then
-                      ssh  $usern@hicedata.hlrn.de  "cd $PWD; tar  xf  $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar"
+                      ssh  $SSH_PORTOPT  $usern@hicedata.hlrn.de  "cd $PWD; tar  xf  $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar"
                    else
-                      ssh  $usern@bicedata.hlrn.de  "cd $PWD; tar  xf  $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar"
+                      ssh  $SSH_PORTOPT  $usern@bicedata.hlrn.de  "cd $PWD; tar  xf  $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar"
                    fi
                    (( inode = inode + 1 ))
@@ -3940,5 +3949,5 @@
                    printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst"
                    printf "\n              or higher cycle\n"
-                   echo "batch_scp $cps -b -m -u $return_username $return_addres  $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
+                   echo "batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres  $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
 
                    echo "[[ \$? = 0 ]]  &&  rm  $file_to_transfer"  >>  transfer_${localout[$i]}
@@ -3946,11 +3955,11 @@
                    if [[ $localhost = nech ]]
                    then
-                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 900  transfer_${localout[$i]}
+                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 900  $PORTOPT  transfer_${localout[$i]}
                    else
                       if [[ "$LOGNAME" = b323013 ]]
                       then
-                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
+                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  $PORTOPT  transfer_${localout[$i]}
                       else
-                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
+                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  $PORTOPT  transfer_${localout[$i]}
                       fi
                    fi
@@ -3962,5 +3971,5 @@
                    printf "\n  >>> OUTPUT: ${localout[$i]}$cst  by SCP to"
                    printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n"
-                   batch_scp $cps -b -m -u $return_username $return_addres  ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
+                   batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres  ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
                    [[ $? != 0 ]]  &&  transfer_failed=true
 
@@ -4015,5 +4024,5 @@
                    printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}"
                    printf "\n              or higher cycle\n"
-                   echo "batch_scp -A -b -m -u $return_username $return_addres  $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
+                   echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_addres  $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
 
                    echo "[[ \$? = 0 ]]  &&  rm  $file_to_transfer"  >>  transfer_${localout[$i]}
@@ -4021,11 +4030,11 @@
                    if [[ $localhost = nech ]]
                    then
-                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 900  transfer_${localout[$i]}
+                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 900  $PORTOPT  transfer_${localout[$i]}
                    else
                       if [[ $LOGNAME = b323013 ]]
                       then
-                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
+                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  $PORTOPT  transfer_${localout[$i]}
                       else
-                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
+                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  $PORTOPT  transfer_${localout[$i]}
                       fi
                    fi
@@ -4037,5 +4046,5 @@
                    printf "\n  >>> OUTPUT: ${localout[$i]}  append by SCP to"
                    printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n"
-                   batch_scp -A -b -m -u $return_username  $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
+                   batch_scp $PORTOPT -A -b -m -u $return_username  $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
                    [[ $? != 0 ]]  &&  transfer_failed=true
 
@@ -4215,9 +4224,9 @@
                    if [[ $localhost = lcsgih  ||  $localhost = lcsgib ]]
                    then
-#                      subjob  -d  -v  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  archive_${frelout[$i]}
-                      subjob   -v  -q permq  -X 1 -T 1  -m 1000  -t 172800  -c $job_catalog  archive_${frelout[$i]}
+#                      subjob  -d  -v  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  $PORTOPT  archive_${frelout[$i]}
+                      subjob   -v  -q permq  -X 1 -T 1  -m 1000  -t 172800  -c $job_catalog  $PORTOPT  archive_${frelout[$i]}
                    elif [[ $localhost = nech ]]
                    then
-                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 7200  archive_${frelout[$i]}
+                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 7200  $PORTOPT  archive_${frelout[$i]}
                    fi
                    printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
@@ -4340,5 +4349,5 @@
                 fi
 
-                subjob  -v  -d  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  archive_${frelout[$i]}
+                subjob  -v  -d  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  $PORTOPT  archive_${frelout[$i]}
                 printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
                 file_saved=true
@@ -4374,5 +4383,5 @@
                 fi
 
-                subjob  -v  -c /pf/b/$usern/job_queue  -d  -q pp  -X 0  -m 1000  -t 7200  archive_${frelout[$i]}
+                subjob  -v  -c /pf/b/$usern/job_queue  -d  -q pp  -X 0  -m 1000  -t 7200  $PORTOPT  archive_${frelout[$i]}
                 printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
                 file_saved=true
@@ -4527,11 +4536,11 @@
                 if [[ $(echo $return_addres | grep -c "130.75.105") = 1 ]]
                 then
-                   ssh $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;. /muksoft/packages/intel/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
+                   ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;. /muksoft/packages/intel/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
                 else
                    if [[ $localhost = ibmkisti ]]
                    then
-                      ssh $usern@gaiad "ssh $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "
+                      ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "
                    else
-                      ssh $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
+                      ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
                    fi
                 fi
@@ -4557,5 +4566,5 @@
              if [[ $localhost = lcfimm ]]
              then
-                ssh $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 
+                ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 
              else
                 eval  $mc                # ' MUESSEN AUSGEWERTET WERDEN
@@ -4708,9 +4717,9 @@
           if [[ $host != ibmkisti ]]
           then
-             echo  "scp  -r  $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname ."  >>  $jobfile
+             echo  "scp $PORTOPT -r $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname ."  >>  $jobfile
           else
                 # on KISTI's IBM firewall is only opened on interactive node
              echo  "localdir=\`pwd\`"                            >>  $jobfile
-             echo  "ssh $remote_username@gaiad \"cd \$localdir; scp  -r  $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname .\" "  >>  $jobfile
+             echo  "ssh $SSH_PORTOPT $remote_username@gaiad \"cd \$localdir; scp $PORTOPT -r  $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname .\" "  >>  $jobfile
           fi
        fi
@@ -4800,5 +4809,5 @@
              echo  "%END%"                                    >>  $jobfile
           else
-             echo  "batch_scp -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >>  $jobfile
+             echo  "batch_scp $PORTOPT -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >>  $jobfile
           fi
 
@@ -4850,5 +4859,5 @@
     fi
 
-    subjob  $job_on_file  -h $host  -u $remote_username -g $group_number -q $queue  -m $memory  -N $node_usage -t $cpumax  $XOPT  $TOPT  $OOPT  -n $fname  -v  -c $job_catalog  -e $email_notification  $jobfile
+    subjob  $job_on_file  -h $host  -u $remote_username -g $group_number -q $queue  -m $memory  -N $node_usage -t $cpumax  $XOPT  $TOPT  $OOPT  -n $fname  -v  -c $job_catalog  -e $email_notification  $PORTOPT  $jobfile
     rm -rf  $jobfile
 
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1091)
+++ palm/trunk/SCRIPTS/subjob	(revision 1094)
@@ -23,5 +23,5 @@
 # Current revisions:
 # ------------------
-# 
+# new option -P for explicit setting of ssh/scp port
 #
 # Former revisions:
@@ -181,5 +181,5 @@
 
     # PROZEDUROPTIONEN EINLESEN
- while  getopts  :c:dDe:g:h:m:n:N:O:q:t:T:u:vX:  option
+ while  getopts  :c:dDe:g:h:m:n:N:O:P:q:t:T:u:vX:  option
  do
    case  $option  in
@@ -194,4 +194,5 @@
        (N)   node_usage=$OPTARG;;
        (O)   threads_per_task=$OPTARG;;
+       (P)   scp_port=$OPTARG;;
        (q)   no_default_queue=$OPTARG;;
        (t)   cputime=$OPTARG;;
@@ -226,4 +227,5 @@
     printf "\n        -n    jobname                             <jobdatei>"
     printf "\n        -O    threads per task (for OpenMP usage) 1"
+    printf "\n        -P    ssh/scp port                        default port"
     printf "\n        -q    job-queue to be used                default"
     printf "\n        -t    allowed cpu-time in seconds         ---"
@@ -478,9 +480,19 @@
  fi
 
+
     # Calculate number of processes per node
  (( processes_per_node = tasks_per_node * threads_per_task ))
 
+
     # Calculate number of MPI tasks
  (( mpi_tasks = numprocs / threads_per_task ))
+
+
+    # Set port number option for calls of ssh/scp, subjob and batch_scp scripts
+ if [[ "$scp_port" != "" ]]
+ then
+    PORTOPT="-P $scp_port"
+    SSH_PORTOPT="-p $scp_port"
+ fi
 
 
@@ -1207,5 +1219,5 @@
 
           echo "echo \"set -x\" >> scpjob.$kennung"                   >>  $job_to_send
-          echo "echo \"batch_scp  -d  -w 10  -u $local_user  $local_addres  ${job_catalog}/$remote_dayfile  \\\"$job_catalog\\\"  $local_dayfile\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"batch_scp  $PORTOPT  -d  -w 10  -u $local_user  $local_addres  ${job_catalog}/$remote_dayfile  \\\"$job_catalog\\\"  $local_dayfile\" >> scpjob.$kennung"  >>  $job_to_send
           if [[ $remote_host = ibmku ]]
           then
@@ -1224,5 +1236,5 @@
           echo "set -x"                            >>  $job_to_send
           echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
@@ -1236,5 +1248,5 @@
           echo " "                                 >>  $job_to_send
           echo "set -x"                            >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
@@ -1253,5 +1265,5 @@
           echo "export LANG=en_US.UTF-8"           >>  $job_to_send
           echo "set -x"                            >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
@@ -1270,5 +1282,5 @@
           echo ". /usr/share/modules/init/bash"    >>  $job_to_send
           echo "set -x"                            >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
@@ -1295,5 +1307,5 @@
           fi
           echo "set -x"                            >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
@@ -1317,10 +1329,10 @@
        then
           echo "mv  scpjob.$kennung  $job_catalog"           >>  $job_to_send
-          echo "ssh ${remote_username}@${remote_addres}  \"$submcom ${job_catalog}/scpjob.$kennung\" "  >>  $job_to_send
+          echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres}  \"$submcom ${job_catalog}/scpjob.$kennung\" "  >>  $job_to_send
           echo "rm  ${job_catalog}/scpjob.$kennung"          >>  $job_to_send
        elif [[ $remote_host = lckyut ]]
        then
-          echo "scp -P 22 scpjob.$kennung  ${remote_username}@${remote_addres}:job_queue"           >>  $job_to_send
-          echo "ssh -p 22 ${remote_username}@${remote_addres}  \"cd job_queue; $submcom scpjob.$kennung; rm scpjob.$kennung\" "  >>  $job_to_send
+          echo "scp $PORTOPT scpjob.$kennung  ${remote_username}@${remote_addres}:job_queue"           >>  $job_to_send
+          echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres}  \"cd job_queue; $submcom scpjob.$kennung; rm scpjob.$kennung\" "  >>  $job_to_send
        else
           echo "$submcom  scpjob.$kennung"      >>  $job_to_send
@@ -1393,12 +1405,12 @@
              # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE
              # PASSWORT AB
-          /bin/scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
+          /bin/scp  $PORTOPT  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
        elif [[ $remote_host = nech ]]
        then
              # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ
              # TRANSFERIERT WERDEN
-          scp  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
+          scp  $PORTOPT  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
        else
-          scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
+          scp  $PORTOPT  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
        fi
        if [[ $? = 1 ]]
@@ -1426,10 +1438,10 @@
        then
           printf "\n >>> submit with HLRN qos-feature hiprio...\n"
-          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost"
+          ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost"
        elif [[ $remote_host = ibmku ]]
        then
-          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
+          ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
        else
-          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
+          ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
        fi
 
