Index: palm/trunk/SCRIPTS/.mrun.config.default
===================================================================
--- palm/trunk/SCRIPTS/.mrun.config.default	(revision 502)
+++ palm/trunk/SCRIPTS/.mrun.config.default	(revision 503)
@@ -31,7 +31,8 @@
 %compiler_name     mpif90                                        <hi> parallel
 %compiler_name_ser ifort                                         <hi> parallel
-%cpp_options       -D__mpi2:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf:-D__netcdf_64bit   <hi> parallel
+%cpp_options       -D__mpi2:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf   <hi> parallel
 %netcdf_inc        -I:<replace by netcdf include path>           <hi> parallel
 %netcdf_lib        -L<replace by netcdf library path>:-lnetcdf   <hi> parallel
+%mopts             -j:4                                          <hi> parallel
 %fopts             -axW:-cpp:-r8:-nbs:-convert:little_endian:-I:<replace by mpi include path>   <hi> parallel
 %lopts             -axW:-cpp:-r8:-nbs:-Vaxlib:-L:<replace by mpi library path>                  <hi> parallel
@@ -64,7 +65,4 @@
 # Combine all particle information files
 OC:[[ -f PARTICLE_INFOS/_0000 ]]  &&  cat  PARTICLE_INFOS/* >> PARTICLE_INFO
-#
-# Collect plot data (2d/3d) into one file
-OC:combine_plot_fields.x
 #
 #----------------------------------------------------------------------------
Index: palm/trunk/SCRIPTS/.mrun.config.imuk_hlrn
===================================================================
--- palm/trunk/SCRIPTS/.mrun.config.imuk_hlrn	(revision 502)
+++ palm/trunk/SCRIPTS/.mrun.config.imuk_hlrn	(revision 503)
@@ -37,7 +37,8 @@
 %compiler_name     mpif90                                        lcmuk parallel
 %compiler_name_ser ifort                                         lcmuk parallel
-%cpp_options       -D__mpi2:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf:-D__netcdf_64bit   lcmuk parallel
+%cpp_options       -D__mpi2:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf   lcmuk parallel
 %netcdf_inc        -I:/muksoft_64/packages/netcdf/3.6.2/include            lcmuk parallel
 %netcdf_lib        -L/muksoft_64/packages/netcdf/3.6.2/lib:-lnetcdf        lcmuk parallel
+%mopts             -j:4                                          lcmuk parallel
 %fopts             -axW:-cpp:-r8:-nbs:-convert:little_endian:-I:/muksoft_64/packages/mpich2/2.1.0.5/include     lcmuk parallel
 %lopts             -axW:-cpp:-r8:-nbs:-Vaxlib:-L:/muksoft_64/packages/mpich2/2.1.0.5/lib                    lcmuk parallel
@@ -53,4 +54,5 @@
 %netcdf_inc        -I:/sw/dataformats/netcdf/3.6.2/include    lcsgih parallel
 %netcdf_lib        -L/sw/dataformats/netcdf/3.6.2/lib:-lnetcdf:-lnetcdff      lcsgih parallel
+%mopts             -j:4                                       lcsgih parallel
 %fopts             -g:-w:-xT:-O3:-cpp:-r8:-ftz:-fno-alias:-no-prec-div:-no-prec-sqrt:-ip:-nbs:-convert:little_endian  lcsgih parallel
 %lopts             -g:-w:-xT:-O3:-cpp:-r8:-ftz:-fno-alias:-no-prec-div:-no-prec-sqrt:-ip:-nbs:-Vaxlib   lcsgih parallel
@@ -82,7 +84,4 @@
 # Combine all particle information files
 OC:[[ -f PARTICLE_INFOS/_0000 ]]  &&  cat  PARTICLE_INFOS/* >> PARTICLE_INFO
-#
-# Collect plot data (2d/3d) into one file
-OC:combine_plot_fields.x
 #
 #----------------------------------------------------------------------------
Index: palm/trunk/SCRIPTS/.mrun.config.imuk_ice2_netcdf4
===================================================================
--- palm/trunk/SCRIPTS/.mrun.config.imuk_ice2_netcdf4	(revision 502)
+++ palm/trunk/SCRIPTS/.mrun.config.imuk_ice2_netcdf4	(revision 503)
@@ -37,7 +37,8 @@
 %compiler_name     mpif90                                        lcmuk parallel
 %compiler_name_ser ifort                                         lcmuk parallel
-%cpp_options       -D__mpi2:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf:-D__netcdf_64bit   lcmuk parallel
+%cpp_options       -D__mpi2:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__netcdf   lcmuk parallel
 %netcdf_inc        -I:/muksoft_64/packages/netcdf/3.6.2/include            lcmuk parallel
 %netcdf_lib        -L/muksoft_64/packages/netcdf/3.6.2/lib:-lnetcdf        lcmuk parallel
+%mopts             -j:4                                          lcmuk parallel
 %fopts             -axW:-cpp:-r8:-nbs:-convert:little_endian:-I:/muksoft_64/packages/mpich2/2.1.0.5/include     lcmuk parallel
 %lopts             -axW:-cpp:-r8:-nbs:-Vaxlib:-L:/muksoft_64/packages/mpich2/2.1.0.5/lib                    lcmuk parallel
@@ -83,7 +84,4 @@
 # Combine all particle information files
 OC:[[ -f PARTICLE_INFOS/_0000 ]]  &&  cat  PARTICLE_INFOS/* >> PARTICLE_INFO
-#
-# Collect plot data (2d/3d) into one file
-OC:combine_plot_fields.x
 #
 #----------------------------------------------------------------------------
Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 502)
+++ palm/trunk/SCRIPTS/mbuild	(revision 503)
@@ -1,25 +1,14 @@
 #!/bin/ksh
-# mbuild - Programmuebersetzungsscript
+# mbuild - script for compiling the PALM code and its utility programs
 # $Id$
 
-     # Prozedur zur Uebersetzung von Programmteilen mittels make-Mechanismus
-     # auf einem Remote-Rechner, ausgehend von Quellcode auf einem lokalen
-     # Rechner
-
-     # Folgende Probleme existieren unter Linux, wenn keine AT&T-Korn-Shell
-     # verwendet wird:
-     # Wertzuweisungen an Variablen innerhalb von DO-Schleifen werden nicht
-     # nach aussen weitergegeben. "while read line" funktioniert nicht
-     # innerhalb einer Pipe.
-
-     # letzte Aenderung:
-     # 06/05/02 - Siggi - Beginn der Entwicklung
-     # 12/06/02 - Siggi - Abschluss der Entwicklungsarbeiten
-     # 23/06/02 - Siggi - voerst kein make-clean, Abbruch bei batch-mode
-     # 24/07/02 - Siggi - Keine Verwendung der temporaeren Datei tmp_mbuild
-     #                    unter linux mehr noetig, da nun AT&T-Korn-Shell
-     #                    benutzt wird
-     # 12/09/02 - Siggi - ibmh (hanni.hlrn.de) validiert
-     # 19/12/02 - Siggi - ibmb validiert
+     # 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
@@ -116,8 +105,10 @@
      #                    removed; modules should now be given in the
      #                    configuration file
-
-
-
-    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
+     # 02/03/10 - Siggi - utility programs are created separately for each
+     #                    block in the configuration file,
+     #                    parallel make for utility programs
+
+
+    # VARIABLE DECLARATIONS + DEFAULT VALUES
  compile_utility_programs=false
  config_file=.mrun.config
@@ -142,6 +133,6 @@
  typeset  -L40 version="MBUILD  2.1  Rev$Rev$"
 
-    # FEHLERBEHANDLUNG
-    # BEI EXIT:
+    # ERROR HANDLING
+    # IN CASE OF EXIT:
  trap 'rm -rf  $working_directory/tmp_mbuild
        if [[ $locat != normal ]]
@@ -153,5 +144,5 @@
 
 
-    # BEI TERMINAL-BREAK:
+    # IN CASE OF TERMINAL-BREAK:
  trap 'rm -rf  $working_directory/tmp_mbuild
        printf "\n\n +++ mbuild killed by \"^C\" \n\n"
@@ -162,5 +153,5 @@
  tmp_mbuild=${working_directory}/tmp_mbuild
 
-    # SHELLSCRIPT-OPTIONEN EINLESEN
+    # READ SHELLSCRIPT-OPTIONS
  while  getopts  :c:h:m:s:u  option
  do
@@ -178,5 +169,5 @@
 
 
-    # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN
+    # CHECK, IF CONFIGURATION-FILE EXISTS
  if [[ ! -f $config_file ]]
  then
@@ -189,5 +180,5 @@
 
 
-    # LOKALEN RECHNER ERMITTELN
+    # DETERMINE THE LOCAL HOST
  local_host_real_name=$(hostname)
 # local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
@@ -195,5 +186,5 @@
 
 
-    # HOST-IDENTIFIER (local_host) AUS KONFIGURATIONSDATEI BESTIMMEN
+    # DETERMINE HOST-IDENTIFIER (local_host) FROM THE CONFIG-FILE
  line=""
  grep  "%host_identifier"  $config_file  >  $tmp_mbuild
@@ -238,5 +229,5 @@
 
  
-    # BENUTZERNAMEN AUF LOKALEM RECHNER AUS KONFIGURATIONSDATEI ERMITTELN
+    # DETERMINE USER NAME ON LOCAL HOST FROM THE CONFIG-FILE
  line=""
  grep  " $local_host" $config_file | grep "%remote_username"  >  $tmp_mbuild
@@ -258,9 +249,8 @@
 
 
-    # LOKALEN QUELLTEXTPFAD ERMITTELN.
-    # ZUERST PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD FUER ALLE RECHNER
-    # VEREINBART WURDE.
-    # DAZU ZUNAECHST ALLE IN DER KONFIGURATIONSDATEI VEREINBARTEN GLOBALEN
-    # VARIABLEN SETZEN, WEIL DIESE EVTL. IN PFADNAMEN VERWENDET WERDEN
+    # DETERMINE LOCAL SOURCE-CODE PATH.
+    # FIRST CHECK, IF A GLOBAL SOURCE-CODE PATH HAS BEEN DECLARED FOR ALL HOSTS.
+    # THEREFORE, FIRST SET ALL GLOBAL VARIABLES DECLARED IN THE CONFIG-FILE,
+    # BECAUSE THEY MAY BE USED AS PART OF THE PATH NAME.
  line=""
  grep "%" $config_file  >  $tmp_mbuild
@@ -272,9 +262,8 @@
        value=`echo $line | cut -d" " -s -f2`
        eval export $var=\$value
-#       eval echo \"   $var=\$$var \"   # AUSGABE ZU TESTZWECKEN
     fi
  done < $tmp_mbuild
 
-    # NUN PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD VEREINBART WURDE
+    # NOW CHECK, IF A GLOBAL SOURCE-CODE-PATH HAS BEEN DECLARED
  line=""
  grep "%source_path" $config_file  >  $tmp_mbuild
@@ -317,5 +306,5 @@
 
 
-    # GLOBALEN DEPOSITORY-PFAD ERMITTELN
+    # DETERMINE GLOBAL DEPOSITORY-PATH
  line=""
  grep "%depository_path" $config_file  >  $tmp_mbuild
@@ -333,6 +322,5 @@
 
 
-    # PRUEFEN, OB IN KONFIGURATIONSDATEI EIN HAUPTPROGRAMM
-    # VEREINBART WURDE
+    # CHECK, IF A MAIN PROGRAM HAS BEEN DEFINED IN THE CONFIG-FILE
  if [[ $(grep -c "%mainprog" $config_file) != 1 ]]
  then
@@ -352,5 +340,5 @@
 
 
-    # MAKEFILE vorhanden
+    # CHECK IF MAKEFILE EXITS
  [[ "$makefile" = "" ]]  &&  makefile=$local_source_path/Makefile
  if [[ ! -f $makefile ]]
@@ -363,5 +351,5 @@
 
 
-    # HEADER-AUSGABE (TEIL1: MELDUNGEN UEBER LOKALEN RECHNER)
+    # HEADER-OUTPUT (PART1: MESSAGES CONCERNING THE LOCAL HOST)
  calltime=$(date)
  printf "\n"
@@ -389,6 +377,6 @@
  then
 
-       # IN JEDEM FALL ALLEN DATEIEN WRITE-PERMIT GEBEN, DAMIT ES AUF
-       # DEN REMOTE-RECHNERN NICHT EVTL. ZU PROBLEMEN BEIM UEBERSCHREIBEN KOMMT
+       # IN ANY CASE, GIVE ALL FILES WRITE-PERMIT, IN ORDER TO AVOID PROBLEMS
+       # WITH OVERWRITING FILES ON THE REMOTE HOST
     cd  $local_source_path
     printf "\n\n  *** tar of makefile and source files in $local_source_path"  
@@ -400,5 +388,5 @@
 
 
-    # BESTAETIGUNG ZUM WEITERMACHEN EINHOLEN
+    # GET CONFIRMATION TO CONTINUE
  if [[ $host = all ]]
  then
@@ -487,5 +475,5 @@
                          then
                             printf "\n  +++ remote host \"$remote_host\" unknown";
-                            printf "\n      please inform S. Raasch!"
+                            printf "\n      please inform PALM group support!"
                          fi;;
     esac
@@ -588,6 +576,8 @@
 
     remote_md=$(eval echo $remote_md)
-    [[ "$condition1" != "" ]]  &&  remote_md=${remote_md}_$condition1
-    [[ "$condition2" != "" ]]  &&  remote_md=${remote_md}_$condition2
+    block=""
+    [[ "$condition1" != "" ]]  &&  block=_$condition1
+    [[ "$condition2" != "" ]]  &&  block=${block}_$condition2
+    remote_md==${remote_md}$block
 
 
@@ -803,5 +793,5 @@
 
 
-       # get modules to be load
+       # get modules to be loaded
     line=""
     grep  "$remote_host_string" $config_file | grep "%modules"  >  $tmp_mbuild
@@ -959,5 +949,5 @@
        if [[ $answer = c  ||  $answer = C ]]
        then
-          silent=false
+          silent=true
        fi
        if [[ $answer = s  ||  $answer = S ]]
@@ -1042,4 +1032,6 @@
           then
              module_calls="module load ${modules};"
+          else
+             module_calls=""
           fi
 
@@ -1138,5 +1130,5 @@
              ssh  ${remote_username}@${remote_addres} "[[ ! -d ${remote_ud} ]]  &&  (echo \"  *** ${remote_ud} will be created\"; mkdir -p  ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]]  &&  (echo \"  *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)"
           else
-                # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS
+                # TIT ERLAUBT NUR DIE AUSFUEHRUNG GANZ BESTIMMTER KOMMANDOS
                 # MIT SSH, DESHALB AUFRUF PER PIPE
              print "[[ ! -d ${remote_ud} ]]  &&  (echo \"  *** ${remote_ud} will be created\"; mkdir -p  ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]]  &&  (echo \"  *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p  ${remote_ud}/../SCRIPTS)"  |  ssh ${remote_username}@${remote_addres}  2>&1
@@ -1146,5 +1138,5 @@
           if [[ $local_host = decalpha ]]
           then
-                # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTï¿œNDIGEN PFADES
+                # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTAENDIGEN PFADES
                 # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM
                 # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN
@@ -1181,7 +1173,7 @@
           if [[ $remote_host = nech ]]
           then
-             make_call_string="sxmake  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
-          else
-             make_call_string="make  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
+             make_call_string="sxmake  $make_options  BLOCK=$block  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
+          else
+             make_call_string="make  $make_options  BLOCK=$block  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
           fi
 
@@ -1190,4 +1182,6 @@
           then
              module_calls="module load ${modules};"
+          else
+             module_calls=""
           fi
 
@@ -1292,5 +1286,5 @@
 
 
-             # NEUE VERSION AUF LOKALEM RECHNER ZUSAMMENPACKEN
+             # TAR NEW VERSION ON LOCAL HOST
           printf "\n  *** tar update on local host ..."
           tar -cf  ${mainprog}_current_version.tar  *.$suf *.o *.mod
@@ -1303,5 +1297,8 @@
           echo "  *** compiling the utility programs ..."
           cd ${local_source_path}/../UTIL
-          make  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$loader_options"
+
+             # TOUCH FILES IN ORDER TO FORCE COMPILATION FOR EVERY BLOCK
+          touch  *.f90
+          make  $make_options  BLOCK=$block  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$loader_options"
           cd  -  > /dev/null
        fi
@@ -1325,5 +1322,5 @@
 
 
-    # ABSCHLIESSENDE ARBEITEN
+    # FINAL WORK
  rm -f  hosts_found_in_config_file
 
Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 502)
+++ palm/trunk/SCRIPTS/mrun	(revision 503)
@@ -1,9 +1,10 @@
 #!/bin/ksh
-# mrun - Plot-Shellskript
+# mrun - script for running PALM jobs
 # $Id$
 
-     # Prozedur zum Starten von Modellaeufen
-
-     # letzte Aenderung:
+     # 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)
@@ -200,4 +201,8 @@
      # 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
 
 
@@ -671,4 +676,6 @@
        locat=options; exit
     fi
+    block=_$cond1
+    [[ -n $cond2 ]]  &&  block=${block}_$cond2
  fi
 
@@ -973,5 +980,32 @@
        /home/COAR/NC/raasch/pub/interpret_config_necriam.x
     else
-       interpret_config.x
+
+       if [[ "$host" != $localhost ]]
+       then
+
+             # REMOTE JOB FROM LOCAL HOST: JUST TAKE THE FIRST EXECUTABLE FOUND
+          interpret_config_executable=`ls -1 ${PALM_BIN}/interpret_config*.x 2>/dev/null`
+          if [[ $? != 0 ]]
+          then
+             printf "\n\n  +++ no interpret_config found"
+             printf "\n      run \"mbuild -u -h ...\" to generate utilities for this host"
+             locat=interpret_config; exit
+          fi
+          interpret_config_executable=`echo $interpret_config_executable | cut -d" " -f1`
+          $interpret_config_executable
+
+       else
+
+             # CHECK, IF THERE IS AN EXECUTABLE FOR THE BLOCK
+          if [[ ! -f ${PALM_BIN}/interpret_config${block}.x ]]
+          then
+             printf "\n\n  +++ no interpret_config found for given block \"$cond1 $cond2\""
+             printf "\n      run \"mbuild -u -h ...\" to generate utilities for this block"
+             locat=interpret_config; exit
+          else
+             interpret_config${block}.x
+          fi
+
+       fi
     fi
     rm .mrun_environment
@@ -3355,10 +3389,4 @@
                 fi
 
-#             if [[ $scirocco = true ]]
-#             then
-#                mpiexec  -machinefile hostfile  -n $ii  a.out  $ROPTS
-#             else
-#                mpirun  -machinefile hostfile  -np $ii  a.out  $ROPTS
-#             fi
              fi
           elif [[ $host = decalpha ]]
@@ -3470,4 +3498,18 @@
 
        fi
+    fi
+
+
+
+       # Call of combine_plot_fields in order to merge single files written
+       # by each PE into one file.
+    if [[ ! -f ${PALM_BIN}/combine_plot_fields${block}.x ]]
+    then
+       printf "\n\n\n  +++ WARNING: no combine_plot_fields found for given block \"$cond1 $cond2\""
+       printf "\n      2d- and/or 3d-data may be incomplete!"
+       printf "\n      Run \"mbuild -u -h $localhost\" to generate utilities for this block.\n"
+    else
+       printf "\n\n\n *** post-processing: now executing \"combine_plot_fields${block}.x\" ..."
+       combine_plot_fields${block}.x
     fi
 
Index: palm/trunk/UTIL/Makefile
===================================================================
--- palm/trunk/UTIL/Makefile	(revision 502)
+++ palm/trunk/UTIL/Makefile	(revision 503)
@@ -3,4 +3,6 @@
 # Actual revisions:
 # -----------------
+# utility programs are created separately for each block in the configuration
+# file,
 # compare_palm_logs added
 # added PROG3 in 'all:' statement (line 39, bugfix)
@@ -17,7 +19,7 @@
 #------------------------------------------------------------------------------!
 
-PROG1 =  ../SCRIPTS/combine_plot_fields.x
-PROG2 =  ../SCRIPTS/compare_palm_logs.x
-PROG3 =  ../SCRIPTS/interpret_config.x
+PROG1 =  ../SCRIPTS/combine_plot_fields$(BLOCK).x
+PROG2 =  ../SCRIPTS/compare_palm_logs$(BLOCK).x
+PROG3 =  ../SCRIPTS/interpret_config$(BLOCK).x
 
 OBJS1 =  combine_plot_fields.o
