Index: palm/trunk/SCRIPTS/batch_scp
===================================================================
--- palm/trunk/SCRIPTS/batch_scp	(revision 1086)
+++ palm/trunk/SCRIPTS/batch_scp	(revision 1090)
@@ -1,52 +1,54 @@
 #! /bin/ksh
-# batch_scp - Shellskript         Version:  @(#)batch_scp 1.0a     25/10/05
+
+# batch_scp - script for automatic file/directory transfer using scp
+
+#--------------------------------------------------------------------------------#
+# This file is part of PALM.
+#
+# PALM is free software: you can redistribute it and/or modify it under the terms
+# of the GNU General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later version.
+#
+# PALM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# PALM. If not, see <http://www.gnu.org/licenses/>.
+#
+# Copyright 1997-2012  Leibniz University Hannover
+#--------------------------------------------------------------------------------#
+#
+# Current revisions:
+# ------------------
+# code put under GPL (PALM 3.9) 
+# adjustments for Kyushu-University computing center (lckyut)
+# old changelog messages removed
+#
+# Former revisions:
+# -----------------
 # $Id$
-
-     # Prozedur zum automatischen Transfer von Dateien mittels scp
-     #
-     # batch_scp hat 4 Argumente:
-     #         $1 = IP-Adresse des Zielrechners
-     #         $2 = zu uebertragende Datei
-     #         $3 = Verzeichnis, in das kopiert werden soll
-     #         $4 = Dateiname der Zieldatei
-
-
-     #                 ACHTUNG!!!!!!!!
-     #
-     # batch_scp hat noch folgenden grossen Mangel: wenn die Verzeichnisse
-     # auf den jeweiligen Remote-Rechnern aeltere Dateien beinhalten,
-     # die beim "ls -al" eine Jahreszahl und keine Uhrzeit (aa:bb) liefern,
-     # dann kann batch_scp die Dateinamen nicht ueberpruefen und findet
-     # z.B. bei -g die entsprechende Datei nicht!
-     #
-     #
-
-
-     # letzte Aenderung:
-     # 29/11/01 - Siggi - Entwicklungsbeginn
-     # 04/01/02 - Siggi - Version 1.0 funktionsfaehig
-     # 15/02/02 - Siggi - Verzeichnis-Listing umgestellt von "ls -al" auf "ls -1"
-     # 30/05/02 - Siggi - Abbruch mit exit 1 bei scp- oder ssh-Fehler
-     # 12/06/02 - Siggi - Version 1.0a, parent directories are also created, if
-     #                    directory on remote host does not exist
-     # 18/09/02 - Siggi - Fehlerabfragen korrigiert (waren wegen Klammerung
-     #                    unwirksam)
-     # 12/03/03 - Siggi - errfile and filelist are not stored in /tmp any more
-     #                    errors in execution of ssh does not lead
-     #                    to an abort on the NEC-system at DKRZ
-     # 01/04/03 - Siggi - small error concerning creation of catalogs removed
-     # 23/01/04 - Siggi - additional test output for scp on hurrikan
-     # 02/12/04 - Siggi - additional check of file size on remote host after scp.
-     #                    If the file sizes on local and remote host are equal,
-     #                    the scp exit status is ignored
-     # 03/12/04 - Siggi - additional checks of ssh actions independent of the
-     #                    ssh exit status
-     # 11/03/05 - Siggi - arguments are output in case of error exit
-     # 25/10/05 - Siggi - put of catalogs realized
-     # 27/04/09 - Marcus- use option -p for all scp calls
-     # 08/03/11 - Siggi - adjustments for ibmkisti: this machine allows
-     #                    outgoing ssh/scp connections only from the
-     #                    interactive nodes (gaiad). All ssh/scp traffic is
-     #                    done via this interactive node.
+#
+# 08/03/11 - Siggi - adjustments for ibmkisti: this machine allows
+#                    outgoing ssh/scp connections only from the
+#                    interactive nodes (gaiad). All ssh/scp traffic is
+#                    done via this interactive node.
+# 04/01/02 - Siggi - first version finished
+# 29/11/01 - Siggi - script development started
+#
+#--------------------------------------------------------------------------------#
+# batch_scp - script for automatic file/directory transfers using scp
+#
+# batch_scp has 4 arguments:
+#               $1 = IP-addres of remote (target) machine
+#               $2 = file to be transferred
+#               $3 = directory of remote machine, where file should be copied to
+#               $4 = filename that file should be given on remote machine
+#
+# ATTENTION: problems might occur if directories on remote machine include very
+#            old files for which "ls -al" does give "year" as modification
+#            time instead of "hh:mm". In such a case, batch_scp cannot check the
+#            filename and may not find the file (e.g. if option -g is used).
+#--------------------------------------------------------------------------------#
 
 
@@ -60,5 +62,5 @@
  check=false
  delete=false
- errfile=ftpcopy.errfile.$random
+ errfile=batch_scp.errfile.$random
  filelist=filelist.$random
  get=false
@@ -81,5 +83,6 @@
  trap 'if [[ $locat != normal ]]
        then
-          cat $filelist $errfile
+          [[ -f "$filelist" ]]  &&  cat $filelist
+          [[ -f "$errfile"  ]]  &&  cat $errfile
           rm -rf $filelist $errfile
           printf " +++ BATCH_SCP terminated \n"
@@ -296,5 +299,5 @@
     ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3; ls -1; echo '*** list complete'\" "  > $filelist  2>&1
  else
-    ssh $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
+    ssh -p 22 $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
  fi
  ssh_status=$?
@@ -506,5 +509,5 @@
        ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist
     else
-       ssh $1 -l $remote_user "cd $3" > $filelist
+       ssh $1 -p 22 -l $remote_user "cd $3" > $filelist
     fi
     if [[ $? != 0 ]]
@@ -569,7 +572,7 @@
              if [[ $catalog_copy = false ]]
              then
-                scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+                scp -P 22 -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
              else
-                scp -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+                scp -P 22 -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
              fi
           fi
@@ -587,5 +590,5 @@
                 remote_size=`ssh $local_user@gaiad "ssh $1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "`
              else
-                remote_size=`ssh $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"`
+                remote_size=`ssh $1 -p 22 -l $remote_user "ls -al $catalog_name$4$zyklusnr"`
              fi
              remote_size=`echo $remote_size | cut -d" " -f5`
@@ -604,5 +607,5 @@
              ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random"  > /dev/null
           else
-             scp -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
+             scp -P 22 -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
           fi
           if [[ $? != 0 ]]
@@ -617,5 +620,5 @@
                 remote_size=`ssh $local_user@gaiad "ssh $1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "`
              else
-                remote_size=`ssh $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
+                remote_size=`ssh $1 -p 22 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
              fi
              remote_size=`echo $remote_size | cut -d" " -f5`
@@ -636,5 +639,5 @@
              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
           else
-             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 $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
           fi
           if [[ $? != 0 ]]
@@ -656,5 +659,5 @@
           ssh $local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" "
        else
-          ssh $1 -l $remote_user "mkdir -p $3"
+          ssh $1 -p 22 -l $remote_user "mkdir -p $3"
        fi
        if [[ $? != 0 ]]
@@ -666,5 +669,5 @@
           ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr"  > /dev/null
        else
-          scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+          scp -P 22 -p $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
        fi
        if [[ $? != 0 ]]
@@ -690,5 +693,5 @@
              ssh $local_user@gaiad "cd $local_wdir; scp -p $remote_user@$1:$catalog_name$4$zyklusnr $2"  > /dev/null
           else
-             scp -p $remote_user@$1:$catalog_name$4$zyklusnr $2  > /dev/null
+             scp -P 22 -p $remote_user@$1:$catalog_name$4$zyklusnr $2  > /dev/null
           fi
           if [[ $? != 0 ]]
Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 1086)
+++ palm/trunk/SCRIPTS/mbuild	(revision 1090)
@@ -1,3 +1,5 @@
 #!/bin/ksh
+
+# mbuild - script for compiling the PALM code and its utility programs
 
 #--------------------------------------------------------------------------------#
@@ -19,5 +21,7 @@
 #
 # Current revisions:
-# -----------------
+# ------------------
+# adjustments for Kyushu-University computing center (lckyut)
+# old changelog messages removed
 #
 # Former revisions:
@@ -38,142 +42,13 @@
 # code put under GPL (PALM 3.9) 
 # 
+# 12/06/02 - Siggi - first version finished
+# 06/05/02 - Siggi - script development started
+#
+#--------------------------------------------------------------------------------#
 # mbuild - script for compiling the PALM code and its utility programs
-
-     # Procedure to compile code on local and remote hosts using the
-     # make-mechanism. The source code must be provided on the local host.
-
-     # Last changes:
-     # 06/05/02 - Siggi - start development
-     # 12/06/02 - Siggi - first version finished
-     # 12/09/02 - Siggi - ibmh (hanni.hlrn.de) included
-     # 19/12/02 - Siggi - ibmb included
-     # 05/02/03 - Siggi - hostname nobela included
-     # 04/03/03 - Siggi - host nech included
-     # 06/03/03 - Siggi - make_call_string is echoed without '' to
-     #                    file LAST_MAKE_CALL (otherwise error on NEC, because
-     #                    '' are part of compiler options
-     # 16/03/03 - Siggi - Two underscores are placed in front of every define
-     #                    string, in case that palm.f90 version contains
-     #                    such strings
-     # 16/04/03 - Siggi - First extensions for linux machines
-     # 24/06/03 - Siggi - host orkan included
-     # 17/07/03 - Siggi - IP adress set to new "cross" machine at DKRZ
-     # 24/07/03 - Siggi - host maestro admitted
-     # 06/08/03 - Siggi - host gregale admitted
-     # 05/11/03 - Siggi - hosts irifi and quanero are now belonging to lcmuk
-     # 19/11/03 - Heiko - on lcmuk, mbuild does not tar the *.i files
-     # 08/01/04 - Siggi - additional preprocessor directive for ibm included
-     #                    (-D$OMP=OMP) in order to avoid problems with
-     #                    OMP_NUM_THREADS
-     # 09/01/04 - Siggi - action above cancelled
-     # 28/01/04 - Siggi - action above re-cancelled
-     # 08/03/04 - Siggi - host scirocco admitted
-     # 26/03/04 - Siggi - .o and .mod files are also deleted in depository, if
-     #                    the respective .f90 file is not listed in the makefile
-     #                    and deletion is demanded by the user
-     # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha
-     #                    due to error in ssh installation (otherwise a prompt
-     #                    for the password appears)
-     # 23/07/04 - Siggi - changes due to the new berni configuration
-     #                    (federation switch)
-     # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10
-     # 23/09/04 - Joerg - correction of IP-Address for 'cross' (DKRZ)
-     # 09/03/05 - Siggi - on nech, mbuild does not tar the *.i files
-     # 31/03/05 - Siggi - mbuild does not tar *.i files any more
-     # 24/04/05 - Siggi - netcdf support on lcmuk
-     # 25/04/05 - Siggi - netcdf support on gfdl3 (decalpha)
-     # 12/05/05 - Siggi - netcdf support on ibm
-     #                    set OBJECT_MODE=64 for compiling on ibmb, ibmh
-     # 18/05/05 - Siggi - netcdf support on nec
-     # 19/05/05 - Siggi - IP addres 134.75.155.74 changed to 165.132.26.56
-     # 23/05/05 - Siggi - netcdf support on ibms
-     # 01/06/05 - Siggi - reset of cpp_options to "" on lcmuk
-     # 30/06/05 - Siggi - netcdf support on bora
-     # 20/10/05 - Siggi - update of netcdf-version on decalpha (gfdl3)
-     # 04/11/05 - Siggi - netcdf 3.6.0-p1 on ibmh/ibmb
-     # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105
-     #                    host gfdl5 (ibmy) admitted
-     # 10/01/06 - Siggi - cpp directive for NetCDF 64bit support
-     # 20/01/06 - Siggi - cpp directive for ibmy
-     # 09/02/06 - Marcus- compile only once on lcmuk (as on ibmh/ibmb)
-     # 10/02/06 - Siggi - modifications for scp on decalpha
-     # 13/04/06 - Siggi - ostria admitted
-     # 19/04/06 - Siggi - preprocessor directive -D$OMP=OMP for ibm removed
-     # 23/05/05 - Siggi - lctit (SUN Fire X4600) admitted
-     # 29/05/05 - Siggi - atmos (lcide) admitted
-     # 23/08/06 - Siggi - netcdf support for scirocco (notebook)
-     # 24/11/06 - Siggi - breva and levanto admitted
-     # 07/02/07 - Siggi - adapted for RIAM (neck)
-     # 10/02/07 - Siggi - all hpmuk-related code removed
-     # 02/03/07 - Siggi - compilation of utility programs and transfer of
-     #                    scripts to remote hosts added (option -u)
-     # 14/03/07 - Siggi - fimm admitted, revision number added to terminal
-     #                    output
-     # 16/03/07 - Siggi - adjustments (netcdf) for lctit
-     #                    adjustments for running under pdksh, local ip-addres
-     #                    is not determined any more
-     # 30/03/07 - Siggi - cpp-directives/options + netcdf-options are read
-     #                    from configuration file
-     #                    host identifier (local_host) is read from config file
-     # 10/10/07 - Siggi - bugfix: handling of comment lines
-     # 18/07/08 - Siggi - adapted for lcsgih
-     # 21/07/08 - Siggi - mainprog (executable) is added to the tar-file
-     #                    ({mainprog}_current_version)
-     # 02/10/08 - Siggi - adapted for lcxt4
-     # 14/11/08 - Siggi - update mechanism completely revised: source tarfile
-     #                    remains in source directory, one depository per block
-     #                    (given in the config-file) is created, allways all
-     #                    files from the source directory are copied to the
-     #                    respective depository, no additional file checks are
-     #                    done any more (version 2.1)
-     # 13/01/09 - Marcus- re-enable compilation more than once on lcmuk (as on 
-     #                    other machines)
-     # 21/03/09 - Siggi - -u copies also copies process_dvr_output and
-     #                    .dvrserver.config
-     # 21/04/09 - Siggi - adjustments for new IBM at DKRZ, which is now ibmh
-     # 25/08/09 - BjornM- adapted for lck
-     # 01/12/09 - BjornM- re-adjustments for lcxt4
-     # 01/02/10 - Siggi - adjustments for lcxt5m
-     # 03/02/10 - Siggi - make options (mopts) to be set by configuration file
-     #                    implemented, remoted mode option -r completely
-     #                    removed, t3e related parts removed
-     # 26/02/10 - BjornM- re-adjustments for lcxt4 (new modules)
-     # 01/03/10 - Siggi - mpilib replaced by modules: explicit module settings
-     #                    removed; modules should now be given in the
-     #                    configuration file
-     # 02/03/10 - Siggi - utility programs are created separately for each
-     #                    block in the configuration file,
-     #                    parallel make for utility programs
-     # 12/03/10 - Siggi - bugfix: remode_md was given a wrong value
-     # 16/08/10 - BjornM- bugfix: call of modules on local host, new workaround
-     #                    for lcxt4
-     # 07/09/10 - Siggi - bugfix for wrong netcdf/3.6.3 module on lcsgi
-     # 08/12/10 - Siggi - initialization of the module command changed for
-     #                    SGI-ICE/lcsgi
-     #                    adjustments for Kyushu Univ. (lcrte, ibmku)
-     # 14/12/10 - Siggi - adjustments for new Tsubame system at Tokyo
-     #                    institute of technology (lctit)
-     # 04/03/11 - BjornM- re-adjustments for lcxt4
-     # 06/03/11 - Siggi - adjustments for ibmkisti
-     # 03/04/11 - Micha - added lckordi
-     # 17/08/11 - Siggi - HLRN access via hicegate0 (130.75.4.101)
-     # 27/11/11 - Siggi - Bugfix for make options setting (-j) 
-     # 12/12/11 - BjornM- added mrun GUI to ulitity programs
-     # 25/01/12 - BjornM- compilation of check_namelist_files (namelist file 
-     #                    check program) has been added to the utility branch),
-     #                    modfified the compilation of mrungui
-     # 31/01/12 - BjornM- bugfix for compilation of utility programs on 
-     #                    multiple localhost branches
-     # 08/03/12 - BjornM- bugfix: cpp directive for namelist check program
-     #                    corrected
-     # 02/05/12 - Bjoern- lcxt4 is now lcxe6, adjustments for lcxe6, 
-     #                    bugfixes for the parameter file check, initial 
-     #                    commands on ssh calls sourced out to .mrun.config
-     # 05/06/12 - Bjoern- bugfixes for execution of login_init_cmd
-     # 18/06/12 - Siggi - option -v (silent mode) added
-     # 25/06/12 - Siggi - option -K (block conditions) added
-     # 27/09/12 - Siggi - compiler options (F90FLAGS) added for namelist check
-     # 02/10/12 - Siggi - added lcsb
-     # 02/11/12 - Siggi - added lckiaps
+#
+# Procedure to compile code on local and remote hosts using the
+# make-mechanism. The source code must be provided on the local host.
+#--------------------------------------------------------------------------------#
 
 
@@ -581,4 +456,5 @@
         (lck)            remote_addres=165.132.26.61;;
         (lckiaps)        remote_addres=118.128.66.223;;
+        (lckyut)         remote_addres=133.5.4.37;;
         (lctit)          remote_addres=10.1.6.170;;
         (lcxe6)          remote_addres=129.177.20.113;;
Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 1086)
+++ palm/trunk/SCRIPTS/mrun	(revision 1090)
@@ -21,5 +21,6 @@
 #
 # Current revisions:
-# -----------------
+# ------------------
+# adjustments for Kyushu-University computing center (lckyut)
 #
 # Former revisions:
@@ -40,6 +41,9 @@
 # code put under GPL (PALM 3.9)
 #
-# 21/03/94 - Siggi - first version (1.0)
-# 03/03/94 - Siggi - start with developing the script
+# 21/03/94 - Siggi - first version finished
+# 03/03/94 - Siggi - script development started
+#
+#--------------------------------------------------------------------------------#
+# mrun - script for running PALM jobs
 #--------------------------------------------------------------------------------#
 
@@ -502,5 +506,5 @@
     do_remote=true
     case  $host  in
-        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|nech|necriam|lckyoto|lcsgib|lcsgih|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lcsb)  true;;
+        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|nech|necriam|lckyoto|lcsgib|lcsgih|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyut|lcsb)  true;;
         (*)  printf "\n"
              printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
@@ -666,5 +670,5 @@
                    do_remote=true
                    case  $host  in
-                       (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lcsb)  true;;
+                       (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyut|lcsb)  true;;
                        (*)  printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
                             printf "\n      is not available"
@@ -950,5 +954,5 @@
     do_remote=true
     case  $host  in
-        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lcsb)  true;;
+        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyut|lcsb)  true;;
         (*)  printf "\n"
              printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
@@ -1102,4 +1106,5 @@
         (lckiaps)    queue=normal;;
         (lckyoto)    queue=ph;;
+        (lckyut)     queue=cx-dbg;;
         (lcsgib)     queue=testq;;
         (lcsgih)     queue=testq;;
@@ -1849,8 +1854,8 @@
  lopts="$lopts $netcdf_lib $dvr_lib"
  ROPTS="$ropts"
- if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lckyoto  ||  $host = lcsgih  ||  $host = lcsgib  ||  $host = lctit  ||  $host = lcfimm  ||  $host = lcxe6 ||  $host = lcxt5m || $host = lck || $host = lckiaps || $host = lckordi || $host = lcsb )  &&  -n $numprocs ]]
- then
+# if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lckyoto  ||  $host = lcsgih  ||  $host = lcsgib  ||  $host = lctit  ||  $host = lcfimm  ||  $host = lcxe6 ||  $host = lcxt5m || $host = lck || $host = lckiaps || $host = lckordi || $host = lcsb || $host )  &&  -n $numprocs ]]
+# then
     XOPT="-X $numprocs"
- fi
+# fi
 
 
@@ -3610,4 +3615,7 @@
                 then
                    mpirun -np $ii  -f $PBS_NODEFILE  a.out  <  runfile_atmos  $ROPTS
+                elif [[ $host = lckyu* ]]
+                then
+                   mpiexec -n $ii   a.out  <  runfile_atmos  $ROPTS
                 else
                    mpiexec  -machinefile hostfile  -n $ii  a.out  < runfile_atmos  $ROPTS
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1086)
+++ palm/trunk/SCRIPTS/subjob	(revision 1090)
@@ -1,3 +1,7 @@
 #!/bin/ksh
+
+# subjob - script for automatic generation and submission of batch-job files
+#          for various batch queuing systems
+
 #--------------------------------------------------------------------------------#
 # This file is part of PALM.
@@ -18,5 +22,7 @@
 #
 # Current revisions:
-# -----------------
+# ------------------
+# adjustments for Kyushu-University computing center (lckyut)
+# old changelog messages removed
 #
 # Former revisions:
@@ -27,145 +33,10 @@
 # code put under GPL (PALM 3.9)
 #
-# subjob - Plot-Shellskript         Version:  @(#)SUBJOB 1.0
-     # Prozedur zum automatischen Generieren von Batch-Jobs, die unter NQS
-     # laufen sollen und deren Ergebnis (Dayfile) zum Job-generierenden
-     # Host zurueckgeschickt werden sollen
-
-
-     # letzte Aenderung:
-     # 29/06/94 - Siggi - Beginn mit Erstellung der Originalversion
-     # 08/07/94 - Siggi - Originalversion abgeschlossen (Version 1.0)
-     # 06/02/98 - Siggi - berte validiert
-     # 27/01/01 - Siggi - ground.yonsei.ac.kr validiert, Jobs zur T3E in Korea
-     #                    moeglich
-     # 08/02/01 - Siggi - alle subjob-Meldungen ins englische uebersetzt
-     # 25/05/02 - Siggi - Unterstuetzung des LoadLeveler
-     # 30/05/02 - Siggi - Validierung fuer ibm-Rechner in Seoul (nobel) sowie
-     #                    allgemeine Anpassungen fuer ibm-Rechner
-     # 15/10/02 - Siggi - Neue Default-Jobklasse (p_normal) fuer IBM in Seoul
-     #                    Ruecktransfer des Jobprotokolls fuer diese
-     #                    Maschine abgeschaltet
-     # 31/10/02 - Siggi - berni validiert
-     # 06/11/02 - Siggi - Neue Jobklassen auf ibmb und ibmh
-     # 08/11/02 - Siggi - quanero validiert
-     # 11/12/02 - Siggi - Notification fuer Transfer-Jobs abgeschaltet
-     # 23/01/03 - Siggi - hostname nobel changed to nobela
-     # 06/02/03 - Siggi - gregale validated
-     # 12/02/03 - Siggi - orkan and maestro validated
-     # 21/02/03 - Siggi - all nobel nodes in Seoul validated
-     # 12/03/03 - Siggi - nec at DKRZ validated
-     # 13/03/03 - Siggi - new nqs resource variable Memory
-     # 07/04/03 - Siggi - processor request option -c on nech needs tasks per
-     #                    node
-     # 11/04/03 - Siggi - network on ibms has attribute "shared"
-     # 31/07/03 - Siggi - nqs2 on nech implemented (provisional: -h nech2)
-     #                    cxxl added to ibmh
-     # 29/08/03 - Siggi - changes in job queues and communication system on
-     #                    ibms
-     # 24/10/03 - Siggi - using alternate hanni address 130.75.4.2
-     # 30/10/03 - Siggi - nech is not supported any more
-     # 10/11/03 - Siggi - nech2 renamed to nech
-     # 20/11/03 - Siggi - submit command on nech changed from qsub.test to qsub
-     # 29/03/04 - Siggi - ground not supported any more, gfdl3 validated
-     # 31/03/04 - Siggi - new option -N for node usage
-     # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha
-     #                    due to error in ssh installation (otherwise a prompt
-     #                    for the password appears)
-     # 23/07/04 - Siggi - changes due to the new berni configuration
-     #                    (federation switch)
-     # 01/09/04 - Gerald  new job-classes on hanni
-     # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10
-     # 23/11/04 - Siggi - new job class cdata on hanni and berni
-     # 03/12/04 - Siggi - notification on ibm switched of in case of
-     #                    delete_dayfile = true, node usage in cdev set to
-     #                    shared
-     # 16/02/05 - Gerald  hababai validated
-     # 29/03/05 - Micha - new job class channi on hanni
-     # 11/05/05 - Siggi - ConsumableMemory is now required as resource keyword
-     #                    on ibms
-     # 24/05/05 - Siggi - Default queue on ibms changed from p_normal_1.3 to
-     #                    p_normal
-     # 30/06/05 - Siggi - network changed for queue cdev from "us" to "ip"
-     # 12/07/05 - Siggi - in network.mpi on ibmh/ibmb "csss" changed to
-     #                    "sn_all", new job class cexp
-     # 08/09/05 - Siggi - IP-address of gfdl3 changed
-     # 31/10/05 - Siggi - new job class pp on hurricane, serial jobs on
-     #                    hurricane (with -X0)
-     # 01/11/05 - Siggi - missing queue for jobs submitted on nech (for nech)
-     #                    added
-     # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105
-     # 09/02/06 - Siggi - ibmy admitted
-     # 10/02/06 - Siggi - scp2 changed to /bin/scp on decalpha
-     # 13/04/06 - Siggi - ostria admitted
-     # 18/04/06 - Siggi - new option -O for OpenMP usage
-     # 24/05/06 - Siggi - lctit admitted, ftpjob renamed scpjob
-     # 25/07/06 - Siggi - gfdl5 (ibmy) admitted for submitting jobs
-     # 27/09/06 - Siggi - breg/hreg extended with berni/hanni
-     # 25/10/06 - Siggi - data_limit set to 1.76 GByte on hanni and berni
-     # 28/11/06 - Siggi - levanto admitted
-     # 13/02/07 - Siggi - hpmuk releated code removed
-     # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx)
-     # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only
-     # 27/07/07 - Siggi - autan admitted
-     # 03/08/07 - Marcus- lcfimm admitted
-     # 08/10/07 - Siggi - further job classes added for hanni (csoloh...)
-     # 15/10/07 - Siggi - preliminary adjustments for lctit based on Jin's
-     #                    suggestions
-     # 19/10/07 - Marcus- add new optional argument -g group_number
-     # 19/10/07 - Siggi - a ";" was missing in the last change done by Marcus
-     # 30/10/07 - Marcus- further adjustments for queues on lctit
-     # 15/05/08 - Siggi - adjustments for lcxt4 (Bergen Center for Computational
-     #                    Science)
-     # 14/07/08 - Siggi - adjustments for lcsgih
-     # 23/09/08 - Gerald- paesano admitted
-     # 02/10/08 - Siggi - PBS adjustments for lcxt4
-     # 02/03/09 - Siggi - Adjustments for new NEC-SX9 at RIAM
-     # 16/04/09 - Marcus- Adjustments for lcsgib and lcsgih
-     # 21/04/09 - Siggi - adjustments for new IBM at DKRZ, which is now ibmh
-     # 18/05/09 - Siggi - Settings for serial jobs on lcsgi changed
-     # 24/06/09 - BjornM- adjustments for lcxt4 (loading modules manually)
-     # 08/07/09 - Siggi - option -e added (email notification on lcsgih/b)
-     # 20/07/09 - Siggi - On lcsgi, jobs for returning the job protocol are
-     #                    now run on the data nodes (feature=data)
-     # 25/08/09 - BjornM- adapted for lck
-     # 26/08/09 - Marcus- caurus admitted; optional qos feature hiprio on lcsgi
-     # 03/09/09 - Siggi - PBS sgi feature directive only used if explicitly
-     #                    set in the config file by the user
-     # 16/10/09 - Carolin-adjustments for archiving on SGI-ICE of binary files;
-     #                    adding special1q
-     # 01/12/09 - BjornM- re-adjustments for lcxt4, added sno (130.75.105.113)
-     # 16/10/09 - Carolin-adding permq
-     # 01/02/10 - Siggi - adapted for lcxt5m and lckyoto (Fujitsu HX600)
-     # 03/02/10 - Siggi - bug in serial jobs removed
-     # 26/02/10 - BjornM- re-adjustments for lcxt4 (new modules, email
-     #                    notification)
-     # 01/03/10 - Siggi - loading of modules controlled by environment variable
-     #                    module_calls
-     # 17/08/10 - BjornM- re-adjustments for lcxt4 (location of qsub)
-     # 25/08/10 - BjornM- account geofysisk replaced by guest for lcxt4
-     # 25/08/10 - Siggi - new variable project_account in pbs-statements for
-     #                    lcxt4
-     # 08/12/10 - Siggi - initialization of the module command changed for
-     #                    SGI-ICE/lcsgi
-     #                    adjustments for Kyushu Univ. (lcrte, ibmku)
-     # 14/12/10 - Siggi - adjustments for new Tsubame system at Tokyo
-     #                    institute of technology (lctit)
-     # 02/02/11 - Siggi - further asjustments for Tsubame concerning openMP
-     # 06/03/11 - Siggi - adjustments for ibmkisti
-     # 17/03/11 - Siggi - adjustments for openmp usage on ibmkisti
-     # 03/04/11 - Micha - added lckordi
-     # 17/08/11 - Siggi - hicegate0 added
-     # 18/08/11 - Siggi - workaround on lcsgi in order to avoid appends to file
-     #                    last_job_transfer_protocol
-     # 21/08/11 - Siggi - inferno admitted
-     # 29/11/11 - Siggi - adjustments for lcsgih/lcsgib queues, pingui admitted
-     # 21/12/11 - Theres- solano admitted
-     # 31/01/12 - Matthias - adjustments for ibmh
-     # 02/05/12 - Bjoern  - lcxt4 is now lcxe6, adjustments for lcxe6, 
-     #                      bugfixes for the parameter file check, initial 
-     #                      commands on ssh calls sourced out to .mrun.config
-     # 02/10/12 - Siggi - adjustments for lcsb
-     # 01/11/12 - Siggi - adjustments for lckiaps
-
+# 08/07/94 - Siggi - first version finished
+# 29/06/94 - Siggi - script development started
+#--------------------------------------------------------------------------------#
+# subjob - script for automatic generation and submission of batch-job files
+#          for various batch queuing systems
+#--------------------------------------------------------------------------------#
 
 
@@ -284,4 +155,5 @@
      (scirocco)              local_addres=172.20.25.41;   local_host=lcmuk;;
      (solano)                local_addres=130.75.105.110; local_host=lcmuk;;
+     (sugoka*)               local_addres=172.31.120.1;   local_host=lckyut;;
      (sun1|sun2)             local_addres=130.75.6.1;     local_host=unics;;
      (sx-*)                  local_addres=172.16.1.131;   local_host=necriam;;
@@ -423,4 +295,5 @@
         (lckiaps) remote_addres=118.128.66.223; submcom=/cm/shared/apps/pbspro/11.0.2.110766/bin/qsub;;
         (lckordi) remote_addres=210.219.61.8; submcom=/usr/torque/bin/qsub;;
+        (lckyut)  remote_addres=133.5.4.37; submcom=/usr/bin/pjsub;;
         (lcsb)    remote_addres=147.46.30.151; submcom=/usr/torque/bin/qsub;;
         (lctit)   queue=S; remote_addres=10.1.6.165; submcom=/opt/pbs/tools/bin/t2sub;;
@@ -474,4 +347,8 @@
         (lckyoto) case  $ndq  in
                      (eh|ph)                                 error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (lckyut) case  $ndq  in
+                     (cx-dbg|cx-single|cx-small|cx-middle|cx-large)  error=false;;
                      (*)                                     error=true;;
                  esac;;
@@ -1134,4 +1011,20 @@
     fi
 
+ elif [[ $remote_host = lckyut ]]
+ then
+    cat > $job_to_send << %%END%%
+#!/bin/bash
+#PJM -L "vnode=$numprocs"
+#PJM -L "vnode-core=1"
+#PJM -L "rscgrp=$queue"
+#PJM --no-stging
+#PJM -L "elapse=$timestring"
+#PJM --mpi proc=$numprocs
+#PJM -o $remote_dayfile
+#PJM -j
+
+export LANG=en_US.UTF-8
+%%END%%
+
  elif [[ $remote_host = nech ]]
  then
@@ -1251,5 +1144,5 @@
     echo "trap '"                               >>  $job_to_send
     echo "set +vx"                              >>  $job_to_send
-    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lckiaps ]]
+    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lckiaps  ||  $remote_host = lckyut ]]
     then
        if [[ $remote_host = ibmh ]]
@@ -1277,4 +1170,7 @@
        then
           return_queue=express
+       elif [[ $remote_host = lckyut ]]
+       then
+          return_queue=cx-single
        else
           return_queue=unknown
@@ -1336,4 +1232,21 @@
           echo "#PBS -j o"                         >>  $job_to_send
           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 "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
+          echo "%%END%%"                           >>  $job_to_send
+
+       elif [[ $remote_host = lckyut ]]
+       then
+          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
+          echo "#!/bin/bash"                       >>  $job_to_send
+          echo "#PJM -L \"vnode=1\""               >>  $job_to_send
+          echo "#PJM -L \"rscgrp=$return_queue\""  >>  $job_to_send
+          echo "#PJM --no-stging"                  >>  $job_to_send
+          echo "#PJM -L \"elapse=30:00\""          >>  $job_to_send
+          echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol"  >>  $job_to_send
+          echo "#PJM -j"                           >>  $job_to_send
+          echo " "                                 >>  $job_to_send
+          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
@@ -1403,4 +1316,8 @@
           echo "ssh ${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
        else
           echo "$submcom  scpjob.$kennung"      >>  $job_to_send
@@ -1520,5 +1437,5 @@
        then
           eval  $submcom  $job_on_remhost
-       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxe6  ||  $localhost = lck  || $localhost = lckordi ||  $localhost = lcyon || $localhost = lcsb ]]
+       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxe6  ||  $localhost = lck  || $localhost = lckordi ||  $localhost = lcyon || $localhost = lcsb  ||  $localhost = lckyut ]]
        then
           chmod  u+x  $job_on_remhost
