Index: palm/trunk/SCRIPTS/.mrun.config.hayaka
===================================================================
--- palm/trunk/SCRIPTS/.mrun.config.hayaka	(revision 1103)
+++ palm/trunk/SCRIPTS/.mrun.config.hayaka	(revision 1103)
@@ -0,0 +1,158 @@
+#$Id: .mrun.config.kiaps 1043 2012-11-06 06:18:09Z raasch $
+#column 1          column 2                                   column 3
+#name of variable  value of variable (~ must not be used)     scope
+#----------------------------------------------------------------------------
+%mainprog          palm.f90
+%base_directory    $HOME/palm/current_version
+%base_data         ~/palm/current_version/JOBS
+%source_path       $base_directory/trunk/SOURCE
+%add_source_path   $base_directory/USER_CODE/$fname
+%depository_path   $base_directory/MAKE_DEPOSITORY
+%use_makefile      true
+#
+# Enter your own host below by adding another line containing in the second
+# column your hostname (as provided by the unix command "hostname") and in the
+# third column the host identifier. Depending on your operating system, the
+# first characters of the host identifier should be "lc" (Linux cluster), "ibm"
+# (IBM-AIX), or "nec" (NEC-SX), respectively.
+#
+%host_identifier   hayaka*     lckyuh
+%host_identifier   pcj*        lckyuh
+#
+#
+# The next block contains all informations for compiling the PALM code
+# and for generating and running the PALM executable using MPI. Replace all
+# required paths (given in <>) by the respective paths valid on your host.
+#
+%tmp_user_catalog  <replace by your preferred tmp directory>     lckyuh parallel
+%tmp_data_catalog  <replace by your preferred data directory>    lckyuh parallel
+%compiler_name     mpifrtpx                                      lckyuh parallel
+%compiler_name_ser frtpx                                         lckyuh parallel
+%cpp_options       -Cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf   lckyuh parallel
+%netcdf_inc        -I:/home/usr1/g70491a/netcdf-4.1.3/include  lckyuh parallel
+%netcdf_lib        -L/home/usr1/g70491a/netcdf-4.1.3/lib:-lnetcdff:-lnetcdf  lckyuh parallel
+%mopts             -j:4                                          lckyuh parallel
+%memory            1000                                          lckyuh parallel
+%fopts             -Kfast:-Ad:-Knooptmsg                         lckyuh parallel
+%lopts             -Kfast:-Ad                                    lckyuh parallel
+%scp_port          22                                            lckyuh parallel
+%remote_username   <replace by your hayaka username>             lckyuh parallel
+#             
+%write_binary        true                             restart
+#
+#----------------------------------------------------------------------------
+# INPUT-commands, executed before running PALM - lines must start with "IC:" 
+#----------------------------------------------------------------------------
+#IC:
+#
+#----------------------------------------------------------------------------
+# ERROR-commands - executed when program terminates abnormally
+#----------------------------------------------------------------------------
+EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
+EC:pwd; ls -al
+#
+#----------------------------------------------------------------------------
+# OUTPUT-commands - executed when program terminates normally
+#----------------------------------------------------------------------------
+#
+# Combine 1D- and 3D-profile output (these files are not usable for plotting)
+OC:[[ -f LIST_PROFIL_1D     ]]  &&  cat  LIST_PROFIL_1D  >>  LIST_PROFILE
+OC:[[ -f LIST_PROFIL        ]]  &&  cat  LIST_PROFIL     >>  LIST_PROFILE
+#
+# Combine all particle information files
+OC:[[ -f PARTICLE_INFOS/_0000 ]]  &&  cat  PARTICLE_INFOS/* >> PARTICLE_INFO
+#
+#----------------------------------------------------------------------------
+# List of input-files
+#----------------------------------------------------------------------------
+PARIN                    in:job        d3#      $base_data/$fname/INPUT    _p3d
+PARIN                    in:job        d3f      $base_data/$fname/INPUT    _p3df
+TOPOGRAPHY_DATA          in:locopt     d3#:d3f  $base_data/$fname/INPUT    _topo
+BININ                    in:loc:flpe   d3f      $base_data/$fname/RESTART  _d3d
+PARTICLE_RESTART_DATA_IN in:loc:flpe   prtf     $base_data/$fname/RESTART  _rprt
+DATA_1D_PR_NETCDF        in:locopt     prf      $base_data/$fname/OUTPUT   _pr     nc
+DATA_1D_SP_NETCDF        in:locopt     spf      $base_data/$fname/OUTPUT   _sp     nc
+DATA_1D_TS_NETCDF        in:locopt     tsf      $base_data/$fname/OUTPUT   _ts     nc
+DATA_1D_PTS_NETCDF       in:locopt     ptsf     $base_data/$fname/OUTPUT   _pts    nc
+DATA_2D_XY_NETCDF        in:locopt     xyf      $base_data/$fname/OUTPUT   _xy     nc
+DATA_2D_XY_AV_NETCDF     in:locopt     xyf      $base_data/$fname/OUTPUT   _xy_av  nc
+DATA_2D_XZ_NETCDF        in:locopt     xzf      $base_data/$fname/OUTPUT   _xz     nc
+DATA_2D_YZ_NETCDF        in:locopt     yzf      $base_data/$fname/OUTPUT   _yz     nc
+DATA_3D_NETCDF           in:locopt     3df      $base_data/$fname/OUTPUT   _3d     nc
+DATA_PRT_NETCDF          in:locopt:pe  prtf     $base_data/$fname/OUTPUT   _prt
+#
+#----------------------------------------------------------------------------
+# List of output-files
+#----------------------------------------------------------------------------
+BINOUT                    out:loc:flpe restart   $base_data/$fname/RESTART  _d3d
+PARTICLE_RESTART_DATA_OUT out:loc:flpe prt#:prtf $base_data/$fname/RESTART  _rprt
+#
+RUN_CONTROL       out:loc:tr   d3#     $base_data/$fname/MONITORING  _rc
+RUN_CONTROL       out:loc:tra  d3f     $base_data/$fname/MONITORING  _rc
+HEADER            out:loc:tr   d3#     $base_data/$fname/MONITORING  _header
+HEADER            out:loc:tra  d3f     $base_data/$fname/MONITORING  _header
+CPU_MEASURES      out:loc:tr   d3#     $base_data/$fname/MONITORING  _cpu
+CPU_MEASURES      out:loc:tra  d3f     $base_data/$fname/MONITORING  _cpu
+#
+DATA_1D_PR_NETCDF    out:loc:tr   pr#:prf   $base_data/$fname/OUTPUT  _pr     nc
+DATA_1D_SP_NETCDF    out:loc:tr   sp#:spf   $base_data/$fname/OUTPUT  _sp     nc
+DATA_1D_TS_NETCDF    out:loc:tr   ts#:tsf   $base_data/$fname/OUTPUT  _ts     nc
+DATA_1D_PTS_NETCDF   out:loc:tr   pts#:ptsf $base_data/$fname/OUTPUT  _pts    nc
+DATA_2D_XY_NETCDF    out:loc:tr   xy#:xyf   $base_data/$fname/OUTPUT  _xy     nc
+DATA_2D_XY_AV_NETCDF out:loc:tr   xy#:xyf   $base_data/$fname/OUTPUT  _xy_av  nc
+DATA_2D_XZ_NETCDF    out:loc:tr   xz#:xzf   $base_data/$fname/OUTPUT  _xz     nc
+DATA_2D_XZ_AV_NETCDF out:loc:tr   xz#:xzf   $base_data/$fname/OUTPUT  _xz_av  nc
+DATA_2D_YZ_NETCDF    out:loc:tr   yz#:yzf   $base_data/$fname/OUTPUT  _yz     nc
+DATA_2D_YZ_AV_NETCDF out:loc:tr   yz#:yzf   $base_data/$fname/OUTPUT  _yz_av  nc
+DATA_3D_NETCDF       out:loc:tr   3d#:3df   $base_data/$fname/OUTPUT  _3d     nc
+DATA_3D_AV_NETCDF    out:loc:tr   3d#:3df   $base_data/$fname/OUTPUT  _3d_av  nc
+DATA_MASK_01_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m01     nc
+DATA_MASK_01_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m01_av  nc
+DATA_MASK_02_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m02     nc
+DATA_MASK_02_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m02_av  nc
+DATA_MASK_03_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m03     nc
+DATA_MASK_03_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m03_av  nc
+DATA_MASK_04_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m04     nc
+DATA_MASK_04_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m04_av  nc
+DATA_MASK_05_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m05     nc
+DATA_MASK_05_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m05_av  nc
+DATA_MASK_06_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m06     nc
+DATA_MASK_06_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m06_av  nc
+DATA_MASK_07_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m07     nc
+DATA_MASK_07_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m07_av  nc
+DATA_MASK_08_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m08     nc
+DATA_MASK_08_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m08_av  nc
+DATA_MASK_09_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m09     nc
+DATA_MASK_09_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m09_av  nc
+DATA_MASK_10_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m10     nc
+DATA_MASK_10_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m10_av  nc
+DATA_MASK_11_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m11     nc
+DATA_MASK_11_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m11_av  nc
+DATA_MASK_12_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m12     nc
+DATA_MASK_12_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m12_av  nc
+DATA_MASK_13_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m13     nc
+DATA_MASK_13_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m13_av  nc
+DATA_MASK_14_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m14     nc
+DATA_MASK_14_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m14_av  nc
+DATA_MASK_15_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m15     nc
+DATA_MASK_15_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m15_av  nc
+DATA_MASK_16_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m16     nc
+DATA_MASK_16_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m16_av  nc
+DATA_MASK_17_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m17     nc
+DATA_MASK_17_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m17_av  nc
+DATA_MASK_18_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m18     nc
+DATA_MASK_18_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m18_av  nc
+DATA_MASK_19_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m19     nc
+DATA_MASK_19_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m19_av  nc
+DATA_MASK_20_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m20     nc
+DATA_MASK_20_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m20_av  nc
+DATA_PRT_NETCDF      out:loc:pe   prt#:prtf $base_data/$fname/OUTPUT  _prt    nc
+DATA_PRT_NETCDF      out:loc:trpe prt#:prtf $base_data/$fname/OUTPUT  _prt    nc
+DATA_DVR             out:loc:trpe dvr       $base_data/$fname/OUTPUT  _dvr 
+#
+DVRP_LOG          out:loc:tr   dv#       $base_data/$fname/MONITORING  _dvrp_log
+DVRP_LOG          out:loc:tra  dvf       $base_data/$fname/MONITORING  _dvrp_log
+PARTICLE_INFO     out:loc:tr   pt#       $base_data/$fname/MONITORING  _prt_info
+PARTICLE_INFO     out:loc:tra  ptf       $base_data/$fname/MONITORING  _prt_info
+PARTICLE_DATA     out:loc:flpe prt#:prtf $base_data/$fname/OUTPUT      _prt_dat
+# A BLANK LINE MUST FOLLOW
Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 1102)
+++ palm/trunk/SCRIPTS/mrun	(revision 1103)
@@ -1,3 +1,3 @@
-#!/bin/bash 
+#!/bin/ksh 
 
 # mrun - script for running PALM jobs
@@ -22,5 +22,10 @@
 # Current revisions:
 # ------------------
-# 
+# default script runs again under ksh, because of unsolved problems with read
+# from stdin: when bash script is called from a ksh, message "read error: 0:
+# Resource temporarily unavailable" appears and script does not stop,
+# further bash compatibility adjustments,
+# shebang line replaced by /bin/bash when running jobs on lckyuh; no restarts
+# on lckyuh, but mrun does not terminate and issues a warning instead
 #
 # Former revisions:
@@ -151,14 +156,14 @@
  if [[ `hostname` = rte10 ]]
  then
-   return_addres=133.5.185.60
-   echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
+    return_addres=133.5.185.60
+    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
  elif [[ `hostname` = climate0 ]]
  then
-   return_addres=165.132.26.68
-   echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
+    return_addres=165.132.26.68
+    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
  elif [[ `hostname` = urban00 ]]
  then
-   return_addres=147.46.30.151
-   echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
+    return_addres=147.46.30.151
+    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
  else
     return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
@@ -1494,5 +1499,5 @@
 
              # QUELLTEXT-DATEI DARF KEINE PFADE BEINHALTEN
-          if [[ $(print $filename | grep -c "/") != 0 ]]
+          if [[ $(echo $filename | grep -c "/") != 0 ]]
           then
              printf "\n  +++ source code file:  $filename"
@@ -2599,5 +2604,5 @@
     fi
  else
-    printf "\n\n  +++ skipping parameter file check due to following reason: $reason" 
+    printf "\n\n  +++ skipping parameter file check due to following reason: $reason \n" 
  fi
 
@@ -4577,4 +4582,9 @@
              then
                 ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 
+             elif [[ $localhost = lckyuh ]]
+             then
+                printf "\n  +++ WARNING: no restart mechanism available for host \"$localhost\" "
+                printf "\n               please restart job manually using command:\n"
+                printf "\n               \"$mc\" "
              else
                 eval  $mc                # ' MUESSEN AUSGEWERTET WERDEN
@@ -4582,5 +4592,10 @@
              cd -  > /dev/null
           fi
-          printf "\n$striche\n  *** restart-run initiated \n"
+          if [[ $localhost = lckyuh ]]
+          then
+             printf "\n$striche\n  *** restart-run to be initiated manually\n"
+          else
+             printf "\n$striche\n  *** restart-run initiated \n"
+          fi
 
 
@@ -4801,5 +4816,10 @@
           # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
        echo  "cat > $mrun_script_name <<\"%END%\""  >>  $jobfile
-       cat   ${PALM_BIN}/$mrun_script_name          >>  $jobfile
+       if [[ $host = lckyuh ]]
+       then
+          sed 's/\/bin\/ksh/\/bin\/bash/g' ${PALM_BIN}/$mrun_script_name  >>  $jobfile
+       else
+          cat  ${PALM_BIN}/$mrun_script_name        >>  $jobfile
+       fi
        echo  "%END%"                                >>  $jobfile
        echo  "chmod u+x $mrun_script_name"          >>  $jobfile
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1102)
+++ palm/trunk/SCRIPTS/subjob	(revision 1103)
@@ -23,5 +23,7 @@
 # Current revisions:
 # ------------------
-# 
+# bash compatibility adjustments (usage of OPTIND, output formatting with printf
+# instead typeset -L/R),
+# further adjustments for lckyuh
 #
 # Former revisions:
@@ -73,7 +75,4 @@
  typeset  -i   cputime=0  memory=0  Memory=0  minuten  resttime  sekunden  stunden
  typeset  -i   inumprocs  mpi_tasks=0  nodes=0  processes_per_node=0 tasks_per_node=0  threads_per_task=1
- typeset  -L20 spalte1
- typeset  -R40 spalte2
- typeset  -L60 spalte3
 
 
@@ -123,4 +122,5 @@
      (bd4)                   local_addres=130.73.232.67;  local_host=lcsgib;;
      (b01*|bicegate1)        local_addres=130.73.232.102; local_host=lcsgib;;
+     (b04*)                  local_addres=133.5.4.33;     local_host=lckyuh;;
      (bicegate2)             local_addres=130.73.232.103; local_host=lcsgib;;
      (blizzard1)             local_addres=136.172.40.15;  local_host=ibmh;;
@@ -220,5 +220,6 @@
 
     # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN
- shift OPTIND-1; file_to_send=$1
+ (( to_shift = $OPTIND - 1 ))
+ shift $to_shift; file_to_send=$1
 
 
@@ -525,19 +526,25 @@
     printf "#--------------------------------------------------------------# \n"
     spalte1=SUBJOB;spalte2=$(date)
-    printf "| $spalte1$spalte2 | \n"
+    printf "| %-20s%40s | \n" "$spalte1" "$spalte2"
     printf "|                                                              | \n"
     printf "| values of parameters/options:                                | \n"
-    spalte1=local_host$punkte; spalte2=$punkte$local_host
-    printf "| $spalte1$spalte2 | \n"
-    spalte1=remote_host$punkte; spalte2=$punkte$remote_host
-    printf "| $spalte1$spalte2 | \n"
-    spalte1=queue$punkte; spalte2=$punkte$queue
-    printf "| $spalte1$spalte2 | \n"
-    spalte1=memory$punkte; spalte2="$punkte$memory mb"
-    printf "| $spalte1$spalte2 | \n"
-    spalte1=cputime$punkte; spalte2="$punkte$cputime sec"
-    printf "| $spalte1$spalte2 | \n"
-    spalte1=job_name$punkte; spalte2="$punkte$job_name"
-    printf "| $spalte1$spalte2 | \n"
+    spalte1=$(echo local_host$punkte | cut -c-20)
+    spalte2=$punkte$local_host
+    printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}"
+    spalte1=$(echo remote_host$punkte | cut -c-20)
+    spalte2=$punkte$remote_host
+    printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}"
+    spalte1=$(echo queue$punkte | cut -c-20)
+    spalte2=$punkte$queue
+    printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}"
+    spalte1=$(echo memory$punkte | cut -c-20)
+    spalte2="$punkte$memory mb"
+    printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}"
+    spalte1=$(echo cputime$punkte | cut -c-20)
+    spalte2="$punkte$cputime sec"
+    printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}"
+    spalte1=$(echo job_name$punkte | cut -c-20)
+    spalte2="$punkte$job_name"
+    printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}"
     printf "#--------------------------------------------------------------# \n\n"
 
@@ -1577,5 +1584,4 @@
        then
           chmod  u+x  $job_on_remhost
-          echo "$submcom  $job_on_remhost"
           eval  $submcom  $job_on_remhost
        elif [[ $local_host = nech ]]
