Index: /palm/trunk/SCRIPTS/mrun
===================================================================
--- /palm/trunk/SCRIPTS/mrun	(revision 1058)
+++ /palm/trunk/SCRIPTS/mrun	(revision 1059)
@@ -1,3 +1,5 @@
 #!/bin/ksh
+
+# mrun - script for running PALM jobs
 
 #--------------------------------------------------------------------------------#
@@ -20,6 +22,5 @@
 # Current revisions:
 # -----------------
-# Intel inspector (inspxe) is given the number of PEs instead of the number of
-# nodes
+# 
 #
 # Former revisions:
@@ -27,281 +28,14 @@
 # $Id$
 #
+# 1058 2012-11-21 07:00:35Z raasch
+# Intel inspector (inspxe) is given the number of PEs instead of the number of
+# nodes
+#
 # 1046 2012-11-09 14:38:45Z maronga
 # code put under GPL (PALM 3.9)
 #
-# mrun - script for running PALM jobs
-
-
-     # Procedure for interactive/batch PALM runs (initial runs and automatic
-     # restart runs)
-
-     # Last changes:
-     # 03/03/94 - Siggi - Entwicklungsbeginn
-     # 21/03/94 - Siggi - Entwicklungsabschluss (Version 1.0)
-     # 09/12/94 - Siggi - allexport unterbunden; statt dessen werden jetzt ein-
-     #                    zelne Variable exportiert. Dies ist noetig, weil an-
-     #                    sonsten irgendein Speicher ueberlaeuft und von mrun
-     #                    aufgerufene Programme (z.B. stageout) mit Fehlern
-     #                    abbrechen (too many arguments)
-     # 20/06/95 - Siggi - noclobber muss explizit abgeschaltet, da jetzt
-     #                    defaultmaessig im RRZN-Profile eingeschaltet
-     # 10/06/97 - Siggi - Zusaetzliche Option -C bei cpp, damit // nicht
-     #                    wegfallen
-     # 25/04/00 - Siggi - Version 1.5
-     #                    remote_addres und remote_user in return_addres bzw.
-     #                    return_username umbenannt, return_username wird dem
-     #                    mrun-Aufruf im Job ueber Option -U mitgegeben.
-     #                    Neue Variable remote_username, die beim interaktiven
-     #                    mrun-Aufruf zwingend ueber die neue Option -u oder
-     #                    in der Konfigurationsdatei angegeben werden muss.
-     # 08/02/01 - Siggi - Alle mrun-Meldungen ins englische uebersetzt,
-     #                    Version 1.7
-     # 05/05/02 - Siggi - Uebersetzungen mittels make-Mechanismus moeglich
-     # 21/11/02 - Siggi - ENV-Variable XLFRTEOPTS wird vor Ausfuehrung auf
-     #                    IBM gesetzt, um Record-Laenge der NAMELIST-Dateien,
-     #                    zu bestimmen; Praeprozessoroptionen haben nun alle
-     #                    die Form -Dtext=text, weil auf IBM sonst text durch
-     #                    die leere Zeichenkette ersetzt wird
-     # 01/08/03 - Siggi  - Test of implementing dvrp+1PE on ibm
-     # 07/01/04 - Siggi  - additional preprocessor directive for ibm included
-     #                     (-D$OMP=OMP) in order to avoid problems with
-     #                     OMP_NUM_THREADS
-     # 04/01/05 - Siggi  - archiving on hanni and berni is done in separate
-     #                     tar files, one for each node used
-     # 07/01/04 - Siggi  - old code for t3e, vpp and hpcs eliminated
-     # 09/01/05 - Siggi  - workaround for getting the IP address on gfdl3
-     # 17/01/05 - Siggi  - job for data transfer to local machine now within
-     #                     job class c1 (HLRN)
-     # 27/01/05 - Siggi  - IP address workaround for gfdl3 removed
-     # 28/01/05 - Siggi  - tar-filenames on $PERM (HLRN) now include the
-     #                     base filename and cycle number
-     # 16/02/05 - Gerald - hababai validated
-     # 14/03/05 - Siggi  - abort on NEC after first runtime error (F_ERRCNT)
-     # 29/03/05 - Marcus - berni*-en0 validated
-     # 21/04/05 - Siggi  - transfer-job-protocol for avs-data is no more stored
-     # 24/04/05 - Siggi  - netcdf support on lcmuk
-     # 25/04/05 - Siggi  - netcdf support on gfld3 (decalpha)
-     # 11/05/05 - Siggi  - files with non-numeric extensions (.xxx after cycle
-     #                     number) can now be used within interactive runs
-     # 12/05/05 - Siggi  - netcdf support on ibm
-     # 13/05/05 - Siggi  - error in tar-filenames on $PERM (HLRN) removed
-     # 18/05/05 - Siggi  - netcdf support on nec
-     # 24/05/05 - Siggi  - netcdf support on ibms
-     # 14/06/05 - Siggi  - sleep interval after submit of restart job increased
-     #                     to 30 seconds
-     # 28/06/05 - Siggi  - bora adjusted to new intel compiler (LD_LIBRARY_
-     #                     PATH is temporarily set)
-     # 07/09/05 - Siggi  - setting of MP_EAGER_LIMIT switched off because it
-     #                     caused warnings in the job protocol
-     # 20/10/05 - Siggi  - update of netcdf-version on decalpha (gfdl3)
-     # 25/10/05 - Siggi  - error in listing files for getting the cycle number
-     #                     removed
-     # 26/10/05 - Siggi  - new paths for dvrp-library, transfer of catalogs
-     #                     realized by file attribute trpe
-     # 28/10/05 - Siggi  - if existing, the file extension is output in case
-     #                     of missing input file - no job abort in case of
-     #                     missing input files with file extensions
-     #                     (preliminary solution)
-     # 31/10/05 - Siggi  - data transfer from nech now within seperate job
-     # 04/11/05 - Siggi  - netcdf 3.6.0-p1 on ibmh/ibmb
-     # 07/12/05 - Siggi  - gallego and elephanta admitted
-     # 30/12/05 - Siggi  - gfdl5 (ibmy) admitted
-     # 10/01/06 - Siggi  - cpp directive for NetCDF 64bit support
-     # 20/01/06 - Siggi  - cpp directive for ibmy
-     # 09/02/06 - Siggi  - ibmy admitted for batch mode
-     # 13/04/06 - Siggi  - ostria admitted
-     # 18/04/06 - Siggi  - usage of OpenMP implemented (additional option -O)
-     # 10/05/06 - Siggi  - environment variable XLSMPOPTS set on IBM for
-     #                     optimization of OpenMP runs (option stacksize is
-     #                     necessary for large gridpoint numbers because
-     #                     otherwise a segmentation fault occurs)
-     # 23/05/05 - Siggi  - lctit (SUN Fire X4600) admitted
-     # 21/08/06 - Siggi  - standard mrun path on scirocco is as on bora
-     # 23/08/06 - Siggi  - netcdf support for scirocco (notebook)
-     # 20/09/06 - Marcus - add DVRP library on nech
-     # 24/10/06 - Siggi  - Environment variables for PALM steering are written
-     #                     on local NAMELIST file ENVPAR
-     # 24/11/06 - Siggi  - levanto admitted, maestro switched to ifc 9.1
-     # 28/11/06 - Siggi  - call to interpret_config.x_levanto because of SuSe 10
-     # 06/02/07 - Siggi  - add DVRP library on lcmuk
-     # 07/02/07 - Siggi  - revision of source code handling, source code is
-     #                     now expected in directory given by source_path and
-     #                     not in the current working directory, source code
-     #                     files provided in add_source_path are allways
-     #                     compiled, source code to be compiled is allways
-     #                     sampled in SOURCES_FOR_RUN_$fname which is a
-     #                     subdirectory of the current working directory,
-     #                     -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
-     # 14/02/07 - Siggi  - dvrp support for neck added
-     # 28/02/07 - Siggi  - empty lines in configuration file are accepted
-     #                     mrun_path replaced by PALM_BIN,
-     #                     all machines are calling interpret_config.x
-     # 14/03/07 - Siggi  - fimm admitted, revision number added to terminal
-     #                     output
-     # 16/03/07 - Siggi  - adjustments for lctit
-     # 29/03/07 - Siggi  - global revision transfered to batch job by new
-     #                     option -G
-     # 30/03/07 - Siggi  - compilation "by hand" removed, cpp-directives/options
-     #                     + netcdf/dvrp-options are read from configuration
-     #                     file, host identifier (local_host) is read from
-     #                     config file, code related to ftp filetransfer
-     #                     removed (incl. option -f)
-     # 19/06/07 - Siggi  - time limit for cdata jobs increased
-     # 25/07/07 - Siggi  - two sets of executables can be started on lcmuk,
-     #                     if new option -Y (coupling) is given,
-     #                     output of executables to aout_output removed,
-     #                     messages are immediately written to stdout instead
-     # 03/08/07 - Marcus - add XOPT="-X $numprocs" for lcfimm
-     # 09/08/07 - Marcus - workaround on lcfimm to propagate environment 
-     #                     variables out to the nodes in coupled mode -disabled-
-     # 13/08/07 - Marcus - start local restart jobs per ssh on lcfimm
-     # 28/08/07 - Marcus - completely remove workaround on lcfimm to propagate
-     #                     environment variables out to the nodes in coupled mode
-     # 15/10/07 - Siggi  - Preliminary adjustments for lctit, based on Jin's
-     #                     suggestions
-     # 19/10/07 - Marcus - further adjustments for lctit: add new optional 
-     #                     argument -g group_number, admit all sla* node_usage 
-     #                     queues
-     # 30/10/07 - Marcus - further adjustments for queues on lctit
-     # 14/02/08 - Bjoern - link of restart files with long file name possible
-     # 28/02/08 - Marcus - If environment variable link_local_output is set to 
-     #                     true, mrun tries "ln -f" on local output and resorts 
-     #                     to "cp" or "cp -r" on error
-     # 15/04/08 - Siggi  - argument -c introduced to most of the subjob calls,
-     #                     which allows the user to choose his own job catalog
-     #                     by setting job_catalog in the configuration file
-     #                     (default is ~/job_queue),
-     #                     workaround for mpiexec with -env option,
-     #                     adjustments for lcxt4 (Bergen Center for Computational
-     #                     Science)
-     # 22/05/08 - Marcus - If environment variable link_local_input is set to 
-     #                     true, mrun tries "ln -f" on local input and resorts 
-     #                     to "cp" or "cp -r" on error
-     # 27/05/08 - Siggi  - PATH is set to PALM_BIN everywhere (missing so far)
-     # 14/07/08 - Siggi  - adjustments for lcsgih
-     # 08/08/08 - Marcus - typo removed in lcxt4 branch
-     # 17/09/08 - Siggi  - restart mechanism adjusted for lcsgi
-     # 02/10/08 - BjornM - argument "-Y" modified, adjustments for coupled runs
-     # 21/10/08 - Siggi  - bugfix for the case that -K has more than one
-     #                     argument
-     # 08/11/08 - Siggi  - bugfix for depository path settings in configuration
-     #                     file
-     # 11/11/08 - Siggi  - rules for using user code files changed: user
-     #                     code splitted into one file per subroutine,
-     #                     user can provide his/her own makefile, only
-     #                     default source-code filenames are allowed
-     # 14/11/08 - Siggi  - cond1 and cond2 are part of the depository name
-     # 08/01/09 - Siggi  - mpi module on sgi machines to be used can be set
-     #                     with environment variable mpilib
-     # 13/01/09 - Siggi  - totalview on hice/bice can be used in debug mode
-     #                     using environment variable totalview
-     # 25/02/09 - Siggi  - cputime-option (-t) is allowed to be omitted for
-     #                     interactive runs
-     # 05/03/09 - Siggi  - adjustments for new NEC-SX9 at RIAM (necriam)
-     # 16/03/09 - Siggi  - dvrp_lib, dvrp_inc replaced by dvr_lib, dvr_inc,
-     #                     dvr streaming server is automatically started using
-     #                     new variable dvr_server and a configuration file
-     #                     .dvrserver.config,
-     #                     processing of dvr output files using new script
-     #                     process_dvr_output implemented, in order to make
-     #                     dvr application more user friendly
-     # 20/03/09 - Marcus - update of n1ge command for lctit
-     # 16/04/09 - Siggi  - new option -y for precursor (uncoupled) ocean runs
-     #                     to be followed by a coupled atmosphere-ocean run
-     # 21/04/09 - Siggi  - adjustments for new IBM at DKRZ, which is now ibmh
-     # 24/06/09 - BjornM - adjustments for coupled/precursor runs on ibmy
-     # 08/07/09 - Siggi  - default value for email_notification is none,
-     #                     option -e added to subjob
-     # 19/08/09 - Marcus - MPI debug option
-     # 21/08/09 - Marcus - totalview on hice/bice also available for mvapich2
-     # 25/08/09 - BjornM - adpated for lck
-     # 26/08/09 - Siggi  - additional environment variables for mpt on ice2
-     # 26/08/09 - Marcus - adjustment for ice2 on lcsgib
-     # 29/09/09 - Siggi  - default value for archiving is false, option "-A"
-     #                     switches on archiving, archiving on SGI-ICE enabled
-     # 16/10/09 - Carolin- adjustments for archiving on SGI-ICE of binary files;
-     #                     adjustment for special1q
-     # 18/12/09 - Carolin- modification of archiving (permq)
-     # 01/02/10 - Siggi  - adapted for lcxt5m and lckyoto (Fujitsu HX600)
-     # 03/02/10 - Siggi  - make options (mopts) to be set by configuration file
-     #                     implemented
-     # 08/02/10 - Siggi  - loading of modules now controlled via configuration
-     #                     file (modules)
-     # 02/03/10 - Siggi  - for each block in the configuration file, separate
-     #                     utility programs are used, combine_plot_fields is
-     #                     directly called and must not be given by an output
-     #                     command in the configuration file any more
-     # 15/06/10 - Rieke  - ssh from compute nodes to login nodes on hosts 
-     #                     lcsgih/lcsgib is done using the names 
-     #                     hicegate0/bicegate0 instead of the IP addresses
-     # 17/08/10 - BjornM - adjustments for interactive runs on lcxt4
-     # 07/09/10 - Siggi  - bugfix for wrong netcdf/3.6.3 module on lcsgi
-     # 08/12/10 - Siggi  - new handling of openmp/hybrid runs, option -O
-     #                     has now argument threads_per_task
-     #                     adjustments for Kyushu Univ. (lcrte, ibmku)
-     # 14/12/10 - Siggi  - adjustments for new Tsubame system at Tokyo
-     #                     institute of technology (lctit)
-     # 23/12/10 - Micha  - different number of processors in ocean and
-     #                     atmosphere is now allowed 
-     # 02/02/10 - Siggi  - further adjustments on Tsubame and concerning openMP
-     #                     usage
-     # 09/03/10 - Siggi  - adjustments for ibmkisti, mpt bugfix for netCDF4
-     #                     usage, totalview usage extended
-     # 17/03/11 - Siggi  - adjustments for openmp usage on ibmkisti
-     # 03/04/11 - Micha  - added lckordi
-     # 06/04/11 - BjornM - bugfix for runs with mpt on lcsgi
-     # 17/08/11 - Siggi  - extensions for impi library
-     # 18/08/11 - Siggi  - bugfix for local append of output files with suffix
-     #                     (.nc)
-     # 18/08/11 - Marcus - support for Linux OS with German locale
-     #                   - properly report hosts on general Linux clusters
-     # 29/08/11 - BjornW - adapted for lcflow (ForWind cluster in Oldenburg)
-     # 29/08/11 - Carolin- initiating restart-run: adjustment of the path at
-     #                     IMUK
-     # 15/09/11 - Siggi  - new option -w tp set the maximum number of parallel
-     #                     io streams, option -T is obligatory from now on
-     # 25/01/12 - BjornM - a namelist file check prior to the model run has
-     #                     been implemented (check_namelist_files). 
-     #                     New option -z can be used to skip the check
-     # 03/02/12 - BjornM - namelist file check temporary disabled
-     #                     until severel bugs are fixed
-     # 08/02/12 - BjornM - bugfixes: skipping namelist file check in case of 
-     #                     restart runs. check is now possible with topography 
-     #                     and the -v (silent) option is considered
-     # 14/02/12 - BjornM/- bugfix: removed slash in \$queue, changed default
-     #            Farah    queue for lcsgi to testq, since bigq is not
-     #                     available on ice1
-     # 16/02/12 - BjornM - bugfix: replaced $localhost by $host in the ENVPAR
-     #                     file, which is generated for the namelist file check
-     # 17/02/12 - Siggi  - -z included in description of options (mrun ?)
-     # 22/02/12 - Siggi  - -s info updated
-     # 22/02/12 - Siggi  - case "-s WP" removed
-     # 28/02/12 - BjornM - further adjustments for namelist file check
-     # 09/03/12 - Siggi  - -T option not obligatory for lcflow
-     # 12/03/12 - Siggi  - tasks_per_node divisor check not for lcflow
-     # 21/03/12 - Matthias - default compiler on ibmh changed
-     # 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 the parameter file check on lcxe6.
-     #                      combine_plot_fields can be switched off by the
-     #                      new mrun option -Z
-     # 08/06/12 - Bjoern  - max_pr_user enabled for the namelist file check,
-     #                      sleep commands are now disabled in silent mode (-v)
-     # 06/08/12 - Bjoern  - update: system update at imuk now requires (new) 
-     #                      initial shell commands on ssh calls (automatic
-     #                      restart runs were not possible)
-     # 22/08/12 - Bjoern  - bugfix: missing export statement in the previous
-     #                      update of the ssh calls
-     # 06/09/12 - Bjoern  - typo removed: "-D_parallel" -> "-D__parallel"
-     # 02/10/12 - Siggi   - adjusted for lcsb (urban00)
-     # 31/10/12 - Siggi   - -T option not obligatory for lcxt5m,
-     #                      tasks_per_node not checked for this machine
-     # 01/11/12 - Siggi   - adjusted for lckiaps
-     # 07/11/12 - Bjoern  - parameter file check adapted for batch jobs on
-     #                      local host
+# 21/03/94 - Siggi - first version (1.0)
+# 03/03/94 - Siggi - start with developing the script
+#--------------------------------------------------------------------------------#
 
 
