Index: palm/trunk/SCRIPTS/.csd.config.default
===================================================================
--- palm/trunk/SCRIPTS/.csd.config.default	(revision 4901)
+++ 	(revision )
@@ -1,231 +1,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Change default values for some global attributes to be compatible with
-# (UC)2 data standard
-# 
-# 4481 2020-03-31 18:55:54Z maronga
-# Updated configuration
-# 
-# 3567 2018-11-27 13:59:21Z maronga
-# Initial revisions
-#
-# Description:
-# ------------
-# Default configuration file for palm_csd
-#
-# @Author Bjoern Maronga (maronga@muk.uni-hannover.de)
-#------------------------------------------------------------------------------#
-
-[global]
-author = Bjoern Maronga, maronga@muk.uni-hannover.de
-contact_person = Bjoern Maronga, maronga@muk.uni-hannover.de
-acronym = LUHimuk
-comment = created with palm_csd
-data_content = 
-dependencies = 
-keywords = 
-source = 
-campaign = 
-location = B
-site = Berlin Mitte
-institution = Leibniz University Hannover, Institute of Meterology and Climatology
-palm_version = 6.0
-rotation_angle = 0.0
-references = 
-
-
-[settings]
-lai_roof_intensive = 1.5
-lai_roof_extensive = 3.0
-lai_high_vegetation_default = 6.0
-lai_low_vegetation_default = 3.0
-lai_alpha = 5.0
-lai_beta = 3.0
-patch_height_default = 10.0
-bridge_width = 3.0
-debug_mode = False
-season = "summer"
-
-[input_01]
-path = /ldata2/MOSAIK/Berlin_static_driver_data
-pixel_size = 15.0
-file_x = Berlin_CoordinatesUTM_x_15m_DLR.nc
-file_y = Berlin_CoordinatesUTM_y_15m_DLR.nc
-file_x_UTM = Berlin_CoordinatesUTM_y_15m_DLR.nc
-file_y_UTM = Berlin_CoordinatesUTM_x_15m_DLR.nc
-file_lat = Berlin_CoordinatesLatLon_y_15m_DLR.nc
-file_lon = Berlin_CoordinatesLatLon_x_15m_DLR.nc
-file_zt = Berlin_terrain_height_15m_DLR.nc
-file_buildings_2d = Berlin_building_height_15m_DLR.nc
-file_building_id = Berlin_building_id_15m_DLR.nc
-file_building_type = Berlin_building_type_15m_DLR.nc
-file_bridges_2d = Berlin_bridges_height_15m_DLR.nc
-file_bridges_id = Berlin_bridges_id_15m_DLR.nc
-file_lai =  Berlin_leaf_area_index_15m_DLR_WANG_summer.nc
-file_vegetation_type = Berlin_vegetation_type_15m_DLR.nc
-file_vegetation_height = Berlin_vegetation_patch_height_15m_DLR.nc
-file_pavement_type = Berlin_pavement_type_15m_DLR.nc
-file_water_type = Berlin_water_type_15m_DLR.nc
-file_soil_type = Berlin_soil_type_15m_DLR.nc
-file_street_type =  Berlin_street_type_15m_DLR.nc
-file_street_crossings =  Berlin_street_crossings_15m_DLR.nc
-file_tree_height =  Berlin_trees_height_clean_15m_DLR.nc
-file_tree_crown_diameter =  Berlin_trees_crown_clean_15m_DLR.nc
-file_tree_trunk_diameter =  Berlin_trees_trunk_clean_15m.nc
-file_tree_type =  Berlin_trees_type_15m_DLR.nc
-file_patch_height =  Berlin_vegetation_patch_height_15m_DLR.nc
-file_vegetation_on_roofs =  Berlin_vegetation_on_roofs_15m_DLR.nc
-
-[input_02]
-path = /ldata2/MOSAIK/Berlin_static_driver_data
-pixel_size = 10.0
-file_x = Berlin_CoordinatesUTM_x_10m_DLR.nc
-file_y = Berlin_CoordinatesUTM_y_10m_DLR.nc
-file_x_UTM = Berlin_CoordinatesUTM_y_10m_DLR.nc
-file_y_UTM = Berlin_CoordinatesUTM_x_10m_DLR.nc
-file_lat = Berlin_CoordinatesLatLon_y_10m_DLR.nc
-file_lon = Berlin_CoordinatesLatLon_x_10m_DLR.nc
-file_zt = Berlin_terrain_height_10m_DLR.nc
-file_buildings_2d = Berlin_building_height_10m_DLR.nc
-file_building_id = Berlin_building_id_10m_DLR.nc
-file_building_type = Berlin_building_type_10m_DLR.nc
-file_bridges_2d = Berlin_bridges_height_10m_DLR.nc
-file_bridges_id = Berlin_bridges_id_10m_DLR.nc
-file_lai =  Berlin_leaf_area_index_10m_DLR_WANG_summer.nc
-file_vegetation_type = Berlin_vegetation_type_10m_DLR.nc
-file_vegetation_height = Berlin_vegetation_patch_height_10m_DLR.nc
-file_pavement_type = Berlin_pavement_type_10m_DLR.nc
-file_water_type = Berlin_water_type_10m_DLR.nc
-file_soil_type = Berlin_soil_type_10m_DLR.nc
-file_street_type =  Berlin_street_type_10m_DLR.nc
-file_street_crossings =  Berlin_street_crossings_10m_DLR.nc
-file_tree_height =  Berlin_trees_height_clean_10m_DLR.nc
-file_tree_crown_diameter =  Berlin_trees_crown_10m_DLR.nc
-file_tree_trunk_diameter =  Berlin_trees_trunk_clean_10m.nc
-file_tree_type =  Berlin_trees_type_10m_DLR.nc
-file_patch_height =  Berlin_vegetation_patch_height_10m_DLR.nc
-file_vegetation_on_roofs =  Berlin_vegetation_on_roofs_10m_DLR.nc
-
-[input_03]
-path = /ldata2/MOSAIK/Berlin_static_driver_data
-pixel_size = 1.0
-file_x = Berlin_CoordinatesUTM_x_1m_DLR.nc
-file_y = Berlin_CoordinatesUTM_y_1m_DLR.nc
-file_x_UTM = Berlin_CoordinatesUTM_x_1m_DLR.nc
-file_y_UTM = Berlin_CoordinatesUTM_y_1m_DLR.nc
-file_lat = Berlin_CoordinatesLatLon_y_1m_DLR.nc
-file_lon = Berlin_CoordinatesLatLon_x_1m_DLR.nc
-file_zt = Berlin_terrain_height_1m_DLR.nc
-file_buildings_2d = Berlin_building_height_1m_DLR.nc
-file_building_id = Berlin_building_id_1m_DLR.nc
-file_bridges_2d = Berlin_bridges_height_1m_DLR.nc
-file_bridges_id = Berlin_bridges_id_1m_DLR.nc
-file_building_type = Berlin_building_type_1m_DLR.nc
-file_lai =  Berlin_leaf_area_index_1m_DLR_WANG_summer.nc
-file_vegetation_type = Berlin_vegetation_type_1m_DLR.nc
-file_vegetation_height = Berlin_vegetation_patch_height_1m_DLR.nc
-file_pavement_type = Berlin_pavement_type_1m_DLR.nc
-file_water_type = Berlin_water_type_1m_DLR.nc
-file_soil_type = Berlin_soil_type_1m_DLR.nc
-file_street_type =  Berlin_street_type_1m_DLR.nc
-file_street_crossings =  Berlin_street_crossings_1m_DLR.nc
-file_tree_height =  Berlin_trees_height_clean_1m_DLR.nc
-file_tree_crown_diameter =  Berlin_trees_crown_clean_1m_DLR.nc
-file_tree_trunk_diameter =  Berlin_trees_trunk_clean_1m.nc
-file_tree_type =  Berlin_trees_type_1m_DLR.nc
-file_patch_height =  Berlin_vegetation_patch_height_1m_DLR.nc
-file_vegetation_on_roofs =  Berlin_vegetation_on_roofs_1m_DLR.nc
-
-[input_04]
-path = /ldata2/MOSAIK/Berlin_static_driver_data
-pixel_size = 2.0
-file_x = Berlin_CoordinatesUTM_x_2m_DLR.nc
-file_y = Berlin_CoordinatesUTM_y_2m_DLR.nc
-file_x_UTM = Berlin_CoordinatesUTM_x_2m_DLR.nc
-file_y_UTM = Berlin_CoordinatesUTM_y_2m_DLR.nc
-file_lat = Berlin_CoordinatesLatLon_y_2m_DLR.nc
-file_lon = Berlin_CoordinatesLatLon_x_2m_DLR.nc
-file_zt = Berlin_terrain_height_2m_DLR.nc
-file_buildings_2d = Berlin_building_height_2m_DLR.nc
-file_building_id = Berlin_building_id_2m_DLR.nc
-file_bridges_2d = Berlin_bridges_height_2m_DLR.nc
-file_bridges_id = Berlin_bridges_id_2m_DLR.nc
-file_building_type = Berlin_building_type_2m_DLR.nc
-file_lai =  Berlin_leaf_area_index_2m_DLR_WANG_summer.nc
-file_vegetation_type = Berlin_vegetation_type_2m_DLR.nc
-file_vegetation_height = Berlin_vegetation_patch_height_2m_DLR.nc
-file_pavement_type = Berlin_pavement_type_2m_DLR.nc
-file_water_type = Berlin_water_type_2m_DLR.nc
-file_soil_type = Berlin_soil_type_2m_DLR.nc
-file_street_type =  Berlin_street_type_2m_DLR.nc
-file_street_crossings =  Berlin_street_crossings_2m_DLR.nc
-file_tree_height =  Berlin_trees_height_clean_2m_DLR.nc
-file_tree_crown_diameter = Berlin_trees_crown_clean_2m_DLR.nc
-file_tree_trunk_diameter =  Berlin_trees_trunk_clean_2m.nc
-file_tree_type =  Berlin_trees_type_2m_DLR.nc
-file_patch_height =  Berlin_vegetation_patch_height_2m_DLR.nc
-file_vegetation_on_roofs =  Berlin_vegetation_on_roofs_2m_DLR.nc
-
-
-[output]
-path = /ldata2/MOSAIK/
-file_out = showcase_berlin
-version = 1
-
-[domain_root]
-pixel_size = 15.0
-origin_x = 0
-origin_y = 0
-nx = 3119
-ny = 2573
-buildings_3d = False
-dz = 15.0
-allow_high_vegetation = False
-generate_vegetation_patches = True
-use_palm_z_axis= False
-interpolate_terrain = False
-domain_parent
-vegetation_on_roofs = False
-street_trees = True
-overhanging_trees = False
-
-[domain_N02]
-pixel_size = 1.0
-origin_x = 19605
-origin_y = 20895
-nx = 1023
-ny = 1023
-buildings_3d = True
-dz = 1.0
-allow_high_vegetation = False
-generate_vegetation_patches = True
-use_palm_z_axis= True
-interpolate_terrain = True
-domain_parent = root
-vegetation_on_roofs = False
-street_trees = True
-overhanging_trees = False
Index: palm/trunk/SCRIPTS/.cvd.config.default
===================================================================
--- palm/trunk/SCRIPTS/.cvd.config.default	(revision 4901)
+++ 	(revision )
@@ -1,107 +1,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Change default values for some global attributes to be compatible with
-# (UC)2 data standard
-# 
-# 4400 2020-02-10 20:32:41Z suehring
-# Initial revision
-# 
-# 
-# 3668 2019-01-14 12:49:24Z maronga
-#
-# Description:
-# ------------
-# Processing tool for creating PIDS conform virtual measurement setup file
-# from UC2 data-standard conform observational data or from prescribed input
-# coordinates.
-#
-# @Author Matthias Suehring (suehring@muk.uni-hannover.de)
-#
-#--------------------------------------------------------------------------------#
-
-# Section where some global file attributes can be specified.
-[global]
-
-author = Suehring, Matthias, suehring@muk.uni-hannover.de
-contact_person = Suehring, Matthias, suehring@muk.uni-hannover.de
-acronym = LUHimuk
-comment = 
-data_content = measurement coordinates
-dependencies = 
-keywords = virtual measurement setup file
-source = 
-campaign = winter iop 1
-location = B
-site = Ernst Reuter Platz
-institution = Leibniz UniversitÃ€t Hannover, Institute of Meterology and Climatology # for (UC)2 conform in/output please follow guidelines in table A3
-palm_version = 6.0
-references = 
-
-# Section for observational input data. If non observational input data is available
-# just omit this section.
-[input]
-
-data_path = < path to your observational input data >
-
-# Section to specify the output path and the output filename.
-[output]
-
-output_path     = < your output path >
-output_filename = vm_driver
-
-# Section to specify further sampling locations and sampling variables. Please note,
-# at the moment only timeseries can be specified. 
-# If non customized sampling location is desired, just set number_positions to zero.
-[custom_positions]
-
-# Give the number of custom sampling coordinates
-number_positions = 4
-
-# Give site coordinates: E_UTM (m), N_UTM (m), z (m).
-# Please give z in meters above ground.
-#
-#             [ E_UTM,    N_UTM,      z (agl) ]
-
-coordinates1: [ 387670.0, 5819090.0,  4.0     ]
-coordinates2: [ 387676.0, 5819139.0,  1.0     ]
-coordinates3: [ 387630.0, 5819065.0,  41.0    ]
-coordinates4: [ 387270.0, 5819191.0,  8.5     ]
-# ...
-
-# Give the variables that shall be sampled. Note, there is a 
-# number of default variables that will be always sampled, which is:
-# u, v, w, theta and hus (mixing ratio).
-# On top of these, you can individually prescribe further variables
-# for each site. In order to prescribe further variables, please
-# follow the naming convention defined in the [UC]2 data standard.
-
-vars_to_be_measured1: [ "u", "v", "w", "theta", "rlus", "rsus" ]
-vars_to_be_measured2: [ "rnds", "wdir" ]
-vars_to_be_measured3: [ "us" ]
-vars_to_be_measured4: [ "utheta", "vtheta", "wtheta", "wspeed" ]
-# ...
Index: palm/trunk/SCRIPTS/.dvrserver.config
===================================================================
--- palm/trunk/SCRIPTS/.dvrserver.config	(revision 4901)
+++ 	(revision )
@@ -1,8 +1,0 @@
-SOCKBUF=262144
-MTU=262144
-BASEDIR=<replace by dvr data directory>
-RTSPPORT=1876
-DATAPORT=1878
-UID=<replace by user id>
-GID=<replace by group id>
-# comment
Index: palm/trunk/SCRIPTS/.mrun.config.default
===================================================================
--- palm/trunk/SCRIPTS/.mrun.config.default	(revision 1)
+++ palm/trunk/SCRIPTS/.mrun.config.default	(revision 1)
@@ -0,0 +1,294 @@
+#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/SOURCE
+%add_source_path   $base_directory/USER_CODE/$fname
+%depository_path   $base_directory/MAKE_DEPOSITORY
+%use_makefile      true
+#
+%remote_username   raasch                                        lcmuk parallel
+%tmp_user_catalog  /tmp                                          lcmuk parallel
+%compiler_name     mpif90                                        lcmuk parallel
+%fopts             -axW:-cpp:-openmp:-r8:-nbs:-convert:little_endian     lcmuk parallel
+%lopts             -axW:-cpp:-openmp:-r8:-nbs:-Vaxlib                    lcmuk parallel
+#%hostfile          $base_directory/.hostfile                    lcmuk parallel
+#
+%remote_username   raasch                                        lcmuk
+%tmp_user_catalog  /tmp                                          lcmuk
+%compiler_name     ifort                                         lcmuk
+%fopts             -axW:-cpp:-r8:-nbs:-convert:little:endian     lcmuk
+%lopts             -axW:-cpp:-r8:-nbs:-Vaxlib                    lcmuk
+#
+%remote_username   raasch                                        lcmuk trace
+%tmp_user_catalog  /tmp                                          lcmuk trace
+%compiler_name     ifort                                         lcmuk trace
+%fopts             -axW:-cpp:-g:-CB:-inline_debug_info:-r8:-nbs:-convert:little:endian     lcmuk trace
+%lopts             -axW:-cpp:-g:-CB:-inline_debug_info:-r8:-nbs:-Vaxlib                    lcmuk trace
+#
+%compiler_name     mpxlf95_r                                  ibmh parallel
+%fopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qarch=pwr4:-qnosave:-qnoescape    ibmh parallel
+%lopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qarch=pwr4:-qnosave:-qnoescape:-lesslsmp   ibmh parallel
+%memory            1630                                       ibmh parallel
+%cpumax            1000                                       ibmh parallel
+%numprocs          4                                          ibmh parallel
+%remote_username   niksiraa                                   ibmh parallel
+%tmp_data_catalog  /fastfs/work/niksiraa/palm_restart_data    ibmh parallel
+%tmp_user_catalog  /fastfs/work/niksiraa                      ibmh parallel
+%email_notification  raasch@muk.uni-hannover.de               ibmh parallel
+#
+%compiler_name     mpxlf95_r                                  ibmh parallel debug
+%fopts             -qnoopt:-g:-qsmp=noopt:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap    ibmh parallel debug
+%lopts             -qnoopt:-g:-qsmp=noopt:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap:-lesslsmp  ibmh parallel debug
+%memory            1000                                       ibmh parallel debug
+%cpumax            1000                                       ibmh parallel debug
+%numprocs          4                                          ibmh parallel debug
+%remote_username   niksiraa                                   ibmh parallel debug
+%tmp_data_catalog  /fastfs/work/niksiraa/palm_restart_data    ibmh parallel debug
+#
+%compiler_name     mpxlf95_r                                  ibmh parallel trace
+%fopts             -qnoopt:-g:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap    ibmh parallel trace
+%lopts             -qnoopt:-g:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap:-lesslsmp  ibmh parallel trace
+%memory            1000                                       ibmh parallel trace
+%cpumax            1000                                       ibmh parallel trace
+%numprocs          4                                          ibmh parallel trace
+%remote_username   niksiraa                                   ibmh parallel trace
+%tmp_data_catalog  /fastfs/work/niksiraa/palm_restart_data    ibmh parallel trace
+#
+%compiler_name     mpxlf95_r                                  ibmh parallel hpmcount
+%fopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qsmp=omp:-qarch=pwr4:-qnosave:-qnoescape    ibmh parallel hpmcount
+%lopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qsmp=omp:-qarch=pwr4:-qnosave:-qnoescape:-lesslsmp  ibmh parallel hpmcount
+%memory            1000                                       ibmh parallel hpmcount
+%cpumax            1000                                       ibmh parallel hpmcount
+%numprocs          4                                          ibmh parallel hpmcount
+%remote_username   niksiraa                                   ibmh parallel hpmcount
+%tmp_data_catalog  /fastfs/work/niksiraa/palm_restart_data    ibmh parallel hpmcount
+%email_notification  raasch@muk.uni-hannover.de               ibmh parallel hpmcount
+#
+%compiler_name     mpxlf95_r                                  ibmb parallel
+%fopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qarch=pwr4:-qnosave:-qnoescape    ibmb parallel
+%lopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qarch=pwr4:-qnosave:-qnoescape:-lesslsmp  ibmb parallel
+%memory            1630                                       ibmb parallel
+%cpumax            1000                                       ibmb parallel
+%numprocs          4                                          ibmb parallel
+%remote_username   niksiraa                                   ibmb parallel
+%tmp_data_catalog  /fastfs/work/niksiraa/palm_restart_data    ibmb parallel
+#
+%compiler_name     mpxlf95_r                                  ibmb parallel deb
+%fopts             -qnoopt:-g:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap    ibmb parallel deb
+%lopts             -qnoopt:-g:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap:-lesslsmp  ibmb parallel deb
+%memory            1000                                       ibmb parallel deb
+%cpumax            1000                                       ibmb parallel deb
+%numprocs          4                                          ibmb parallel deb
+%remote_username   niksiraa                                   ibmb parallel deb
+%tmp_data_catalog  /fastfs/work/niksiraa/palm_restart_data    ibmb parallel deb
+#
+%compiler_name     sxmpif90                                   nech parallel
+%fopts             -C:hopt:-Wf:\'-init:stack=nan:-init:heap=nan:-A:idbl4:-pvctl:fullmsg\':-ftrace:-P:stack:-pi:auto:-pi:line=1000  nech parallel
+%lopts             -C:hopt:-Wf:\'-init:stack=nan:-init:heap=nan:-A:idbl4\':-ftrace:-P:stack:-pi:auto:-pi:line=1000:-L/SX/opt/MathKeisan/MK1_6/lib/:-l:fft  nech parallel
+%memory            4000                                       nech parallel
+%cpumax            1000                                       nech parallel
+%numprocs          4                                          nech parallel
+%tmp_data_catalog  $WRKSHR/palm_restart_data                  nech parallel
+%remote_username   b323011                                    nech parallel
+%email_notification  raasch@muk.uni-hannover.de               nech parallel
+#
+%remote_username   raasch                                     decalpha parallel
+%tmp_user_catalog  /usr2/users/raasch/work                    decalpha parallel
+%tmp_data_catalog  /usr2/users/raasch/work/palm_restart_data  decalpha parallel
+%compiler_name     f95                                        decalpha parallel
+%fopts             -fast:-r8                                  decalpha parallel
+%lopts             -fast:-r8:-lfmpi:-lmpi                     decalpha parallel
+%memory            100                                        decalpha parallel
+%cpumax            100                                        decalpha parallel
+#
+%source_path       /edun/z051nyg/palm/current_version/SOURCE  ibms parallel
+%compiler_name     mpxlf95_r                                  ibms parallel
+%fopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qsmp=omp:-qarch=pwr4:-qnosave:-qnoescape    ibms parallel
+%lopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qsmp=omp:-qarch=pwr4:-qnosave:-qnoescape:-lesslsmp  ibms parallel
+%memory            1000                                       ibms parallel
+%cpumax            1000                                       ibms parallel
+%numprocs          4                                          ibms parallel
+%remote_username   z051nyg                                    ibms parallel
+%tmp_data_catalog  /edun/z051nyg/work                         ibms parallel
+%tmp_user_catalog  /edun/z051nyg/work                         ibms parallel
+#%tmp_data_catalog  /xtmp1                                     ibms parallel
+#%tmp_user_catalog  /xtmp1                                     ibms parallel
+%email_notification  raasch@muk.uni-hannover.de               ibms parallel
+#
+%source_path       $base_directory/SOURCE                     ibmy parallel
+%compiler_name     mpxlf95_r                                  ibmy parallel
+%fopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qarch=pwr4:-qnosave:-qnoescape    ibmy parallel
+%lopts             -O3:-g:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:-qarch=pwr4:-qnosave:-qnoescape    ibmy parallel
+%memory            1000                                       ibmy parallel
+%cpumax            1000                                       ibmy parallel
+%numprocs          4                                          ibmy parallel
+%remote_username   raasch                                     ibmy parallel
+%tmp_data_catalog  /usr1/users/raasch/work                    ibmy parallel
+%tmp_user_catalog  /usr1/users/raasch/work                    ibmy parallel
+%email_notification  raasch@muk.uni-hannover.de               ibmy parallel
+#
+%compiler_name     mpxlf95_r                                  ibmy parallel trace
+%fopts             -qnoopt:-g:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap  ibmy parallel trace
+%lopts             -qnoopt:-g:-C:-qinitauto=FFFFFFFF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide::invalid::enable:-qsigtrap  ibmy parallel trace
+%memory            1000                                       ibmy parallel trace
+%cpumax            1000                                       ibmy parallel trace
+%numprocs          4                                          ibmy parallel trace
+%remote_username   raasch                                     ibmy parallel trace
+%tmp_data_catalog  /usr1/users/raasch/work                    ibmy parallel trace
+%tmp_user_catalog  /usr1/users/raasch/work                    ibmy parallel trace
+%email_notification  raasch@muk.uni-hannover.de               ibmy parallel trace
+#
+%write_binary                true                             restart
+#
+#----------------------------------------------------------------------------
+# INPUT-commands, executed before running PALM - lines must start with "IC:" 
+#----------------------------------------------------------------------------
+#IC:[[ \$( echo \$localhost | cut -c1-3 ) = t3e ]]  &&  assign -F cachea:512:1:1 f:BININ
+#
+#----------------------------------------------------------------------------
+# ERROR-commands - executed when program terminates abnormally
+#----------------------------------------------------------------------------
+EC:[[ \$locat = compile && ( \$( echo \$localhost | cut -c1-3 ) = t3e ) ]]  &&  cat  cflist.out
+EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
+EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
+EC:[[ \$( echo \$localhost | cut -c1-3 ) = t3e ]]  &&  ls -al
+EC:[[ \$( echo \$localhost | cut -c1-3 ) = ibm ]]  &&  ls -al
+#
+#----------------------------------------------------------------------------
+# OUTPUT-commands - executed when program terminates normally
+#----------------------------------------------------------------------------
+#
+OC:[[ -f CPU_MEASURES/_0000 ]]  &&  cat  CPU_MEASURES/* >> CPU_MEASURE_ALL
+# 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
+#
+# Extend number of files to be opened simultaneously (sometimes necessary
+# for combine_plot_fields
+#OC:[[ \$( echo \$localhost | cut -c1-3 ) = t3e ]]  &&  limit -v -f 255 -p 0
+#
+# Combine the 2D- and 3D-plot-data of the subdomains (one file per PE) to
+# one file respectively
+OC:[[ \$( echo \$localhost | cut -c1-3 ) = t3e ]]  &&  combine_plot_fields.x
+OC:[[ \$( echo \$localhost | cut -c1-3 ) = ibm ]]  &&  combine_plot_fields.x
+OC:[[ \$( echo \$localhost | cut -c1-3 ) = nec ]]  &&  combine_plot_fields.x
+OC:[[ \$( echo \$localhost | cut -c1-3 ) = dec ]]  &&  combine_plot_fields.x
+#
+# Combine parameter files necessary for plot software (iso2d + AVS)
+OC:[[ -f PLOT2D_XY_GLOBAL   ]]  &&  cat  PLOT2D_XY_LOCAL >> PLOT2D_XY_GLOBAL
+OC:[[ -f PLOT2D_XZ_GLOBAL   ]]  &&  cat  PLOT2D_XZ_LOCAL >> PLOT2D_XZ_GLOBAL
+OC:[[ -f PLOT2D_YZ_GLOBAL   ]]  &&  cat  PLOT2D_YZ_LOCAL >> PLOT2D_YZ_GLOBAL
+OC:[[ -f PLOT3D_FLD         ]]  &&  cat  PLOT3D_FLD_COOR >> PLOT3D_FLD
+#
+# tar all 3D-plot-data files in case that compressed output is switched on
+OC:[[ -f PLOT3D_COMPRESSED  ]]  &&  tar cf  PLOT3D_DATA  PLOT3D_DATA_*
+#
+#----------------------------------------------------------------------------
+# 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#   ~/$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
+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
+#
+DATA_1D_PR_NETCDF out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr  nc
+#DATA_1D_PR_NETCDF out:loc      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_SP_NETCDF out:loc      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_TS_NETCDF out:loc      ts#:tsf ~/$base_data/$fname/OUTPUT      _ts  nc
+DATA_1D_PTS_NETCDF out:loc     pts#:ptsf ~/$base_data/$fname/OUTPUT      _pts  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_XY_NETCDF out:loc      xy#:xyf ~/$base_data/$fname/OUTPUT      _xy  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_XZ_NETCDF out:loc      xz#:xzf ~/$base_data/$fname/OUTPUT      _xz  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_2D_YZ_NETCDF out:loc      yz#:yzf ~/$base_data/$fname/OUTPUT      _yz  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_3D_NETCDF    out:loc      3d#:3df ~/$base_data/$fname/OUTPUT      _3d  nc
+DATA_PRT_NETCDF   out:loc:pe   prt#:prtf ~/$base_data/$fname/OUTPUT    _prt
+DATA_PRT_NETCDF   out:loc:trpe prt#:prtf ~/$base_data/$fname/OUTPUT    _prt
+PLOTTS_PAR        out:loc:tr   ts#:tsf ~/$base_data/$fname/OUTPUT      _ts_par
+PLOTTS_DATA       out:loc:tr   ts#     ~/$base_data/$fname/OUTPUT      _ts_in
+PLOTTS_DATA       out:loc:tra  tsf     ~/$base_data/$fname/OUTPUT      _ts_in
+PLOT1D_PAR        out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr_par
+PLOT1D_DATA       out:loc:tr   pr#     ~/$base_data/$fname/OUTPUT      _pr_in
+PLOT1D_DATA       out:loc:tr   prf     ~/$base_data/$fname/OUTPUT      _pr_in
+PLOTSP_X_PAR      out:loc:tr   spx     ~/$base_data/$fname/OUTPUT      _spx_par
+PLOTSP_X_DATA     out:loc:tr   spx     ~/$base_data/$fname/OUTPUT      _spx_in
+PLOTSP_Y_PAR      out:loc:tr   spy     ~/$base_data/$fname/OUTPUT      _spy_par
+PLOTSP_Y_DATA     out:loc:tr   spy     ~/$base_data/$fname/OUTPUT      _spy_in
+#PLOT2D_XY_GLOBAL  out:loc:tr   xy      ~/$base_data/$fname/OUTPUT      _xy_par
+#PLOT2D_XY         out:loc:tr   xy      ~/$base_data/$fname/OUTPUT      _xy_in
+#PLOT2D_XZ_GLOBAL  out:loc:tr   xz      ~/$base_data/$fname/OUTPUT      _xz_par
+#PLOT2D_XZ         out:loc:tr   xz      ~/$base_data/$fname/OUTPUT      _xz_in
+#PLOT2D_YZ_GLOBAL  out:loc:tr   yz      ~/$base_data/$fname/OUTPUT      _yz_par
+#PLOT2D_YZ         out:loc:tr   yz      ~/$base_data/$fname/OUTPUT      _yz_in
+PLOT3D_FLD        out:loc:tr   avs     ~/$base_data/$fname/OUTPUT      _fld  fld
+PLOT3D_COOR       out:loc:tr   avs     ~/$base_data/$fname/OUTPUT      _avscor
+PLOT3D_DATA       out:loc:tr   avs     ~/$base_data/$fname/OUTPUT      _avs
+PARTICLE_DATA     out:loc:flpe prt#:prtf ~/$base_data/$fname/OUTPUT    _prt_dat
+#
+# Output-example for using more than one statistical region
+#PLOTTS_PAR_0      out:loc:tr   ts#:tsf ~/$base_data/$fname/OUTPUT      _ts_0_par
+#PLOTTS_DATA_0     out:loc:tr   ts#     ~/$base_data/$fname/OUTPUT      _ts_0_in
+#PLOTTS_DATA_0     out:loc:tra  tsf     ~/$base_data/$fname/OUTPUT      _ts_0_in
+#PLOTTS_PAR_1      out:loc:tr   ts#:tsf ~/$base_data/$fname/OUTPUT      _ts_1_par
+#PLOTTS_DATA_1     out:loc:tr   ts#     ~/$base_data/$fname/OUTPUT      _ts_1_in
+#PLOTTS_DATA_1     out:loc:tra  tsf     ~/$base_data/$fname/OUTPUT      _ts_1_in
+#PLOTTS_PAR_2      out:loc:tr   ts#:tsf ~/$base_data/$fname/OUTPUT      _ts_2_par
+#PLOTTS_DATA_2     out:loc:tr   ts#     ~/$base_data/$fname/OUTPUT      _ts_2_in
+#PLOTTS_DATA_2     out:loc:tra  tsf     ~/$base_data/$fname/OUTPUT      _ts_2_in
+PLOT1D_PAR_0      out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr_0_par
+PLOT1D_DATA_0     out:loc:tr   pr#     ~/$base_data/$fname/OUTPUT      _pr_0_in
+PLOT1D_PAR_1      out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr_1_par
+PLOT1D_DATA_1     out:loc:tr   pr#     ~/$base_data/$fname/OUTPUT      _pr_1_in
+PLOT1D_PAR_2      out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr_2_par
+PLOT1D_DATA_2     out:loc:tr   pr#     ~/$base_data/$fname/OUTPUT      _pr_2_in
+PLOT1D_PAR_3      out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr_3_par
+PLOT1D_DATA_3     out:loc:tr   pr#     ~/$base_data/$fname/OUTPUT      _pr_3_in
+PLOT1D_PAR_4      out:loc:tr   pr#:prf ~/$base_data/$fname/OUTPUT      _pr_4_par
+PLOT1D_DATA_4     out:loc:tr   pr#     ~/$base_data/$fname/OUTPUT      _pr_4_in
+LIST_PROFIL_1D    out:loc:tr   d3#     ~/$base_data/$fname/MONITORING  _list_pr
+PLOTTS_PAR_0      out:loc:tr   ts#:tsf ~/$base_data/$fname/OUTPUT      _ts_par
+PLOTTS_DATA_0     out:loc:tr   ts#     ~/$base_data/$fname/OUTPUT      _ts_in
+PLOTTS_DATA_0     out:loc:tra  tsf     ~/$base_data/$fname/OUTPUT      _ts_in
Index: palm/trunk/SCRIPTS/.palm.config.atosb
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.atosb	(revision 4901)
+++ 	(revision )
@@ -1,89 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           $HOME/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     /scratch/usr/<replace_by_your_HLRN_username>
-%restart_data_path   $fast_io_catalog
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-%remote_jobcatalog   $base_data/$run_identifier/LOG_FILES
-
-%local_ip            <replace by IP of your local computer>
-%local_username      <replace_by_your_local_username>
-%remote_ip           130.73.234.1
-%remote_loginnode    blogin1
-%remote_username     <replace_by_your_HLRN_username>
-%ssh_key             id_rsa_hlrn
-%defaultqueue        standard96:test
-%project_account     <replace_by_your_default_HLRN_project_account>
-%submit_command      /cm/shared/apps/slurm/current/bin/sbatch
-
-%compiler_name       mpiifort
-%compiler_name_ser   ifort
-%cpp_options         -cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__lc -D__parallel -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__intel_compiler -D__fftw
-%make_options        -j 4
-%compiler_options    -fpe0 -g -traceback -O3 -fp-model source -ftz -xCORE-AVX512 -no-prec-div -no-prec-sqrt -ip -convert little_endian -I /sw/dataformats/netcdf/intel.18/4.7.3/skl/include/ -I /sw/numerics/fftw3/impi/intel/3.3.8/skl/include/
-%linker_options      -Wl,-rpath=\\$LD_RUN_PATH \\`nf-config --flibs\\` -L /sw/numerics/fftw3/impi/intel/3.3.8/skl/lib -lfftw3
-%module_commands     module load intel/18.0.6 impi/2018.5 netcdf-parallel/impi/intel fftw3/impi/intel
-%execute_command     srun --propagate=STACK --kill-on-bad-exit -n {{mpi_tasks}} -N {{nodes}} --ntasks-per-node={{tasks_per_node}}  palm
-%execute_command_for_combine   srun --propagate=STACK -n 1 --ntasks-per-node=1  combine_plot_fields.x
-%memory              2300
-
-# BATCH-directives to be used for batch jobs. If $-characters are required, hide them with 3 backslashes
-BD:#!/bin/bash
-#BD:#SBATCH --dependency=afterany:{{previous_job}}
-BD:#SBATCH -A {{project_account}}
-BD:#SBATCH --job-name={{run_id}}
-BD:#SBATCH --time={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#SBATCH --ntasks={{mpi_tasks}}
-BD:#SBATCH --nodes={{nodes}}
-BD:#SBATCH --ntasks-per-node={{tasks_per_node}}
-BD:#SBATCH --partition={{queue}}
-BD:#SBATCH --output={{job_protocol_file}}
-BD:#SBATCH --error={{job_protocol_file}}
-#BD:#SBATCH --mail-type=ALL
-#BD:#SBATCH --mail-user=<replace_by_your_email_address>
-
-# BATCH-directives for batch jobs used to send back the jobfile from a remote to a local host
-BDT:#!/bin/bash
-BDT:#SBATCH -A {{project_account}}
-BDT:#SBATCH --job-name=job_transfer
-BDT:#SBATCH --time=00:30:00
-BDT:#SBATCH --ntasks=1
-BDT:#SBATCH --nodes=1
-BDT:#SBATCH --ntasks-per-node=1
-BDT:#SBATCH --partition={{queue}}
-BDT:#SBATCH --output={{job_transfer_protocol_file}}
-BDT:#SBATCH --error={{job_transfer_protocol_file}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-# my settings
-IC:ulimit -s unlimited # requires --propagate=STACK in srun command to distribute to all nodes
-IC:export I_MPI_PMI_LIBRARY=libpmi.so
-IC:export I_MPI_FABRICS=shm:ofi
-IC:export I_MPI_OFI_PROVIDER=psm2
-IC:export I_MPI_ADJUST_ALLTOALL=3
-IC:export I_MPI_HYDRA_BRANCH_COUNT=128
-IC:module list
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.atosb_debug
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.atosb_debug	(revision 4901)
+++ 	(revision )
@@ -1,89 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           $HOME/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     /scratch/usr/<replace_by_your_HLRN_username>
-%restart_data_path   $fast_io_catalog
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-%remote_jobcatalog   $base_data/$run_identifier/LOG_FILES
-
-%local_ip            <replace by IP of your local computer>
-%local_username      <replace_by_your_local_username>
-%remote_ip           130.73.234.1
-%remote_loginnode    blogin1
-%remote_username     <replace_by_your_HLRN_username>
-%ssh_key             id_rsa_hlrn
-%defaultqueue        standard96:test
-%project_account     <replace_by_your_default_HLRN_project_account>
-%submit_command      /cm/shared/apps/slurm/current/bin/sbatch
-
-%compiler_name       mpiifort
-%compiler_name_ser   ifort
-%cpp_options         -cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__lc -D__parallel -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__intel_compiler -D__fftw
-%make_options        -j 4
-%compiler_options    -fpe0 -check -check nooutput_conversion -check noarg_temp_created -traceback -g -O0 -align all -ftz -xCORE-AVX512 -no-prec-div -no-prec-sqrt -ip -convert little_endian -I /sw/dataformats/netcdf/intel.18/4.7.3/skl/include/ -I /sw/numerics/fftw3/impi/intel/3.3.8/skl/include/
-%linker_options      -Wl,-rpath=\\$LD_RUN_PATH \\`nf-config --flibs\\` -L /sw/numerics/fftw3/impi/intel/3.3.8/skl/lib -lfftw3
-%module_commands     module load intel/18.0.6 impi/2018.5 netcdf-parallel/impi/intel fftw3/impi/intel
-%execute_command     srun --propagate=STACK --kill-on-bad-exit -n {{mpi_tasks}} -N {{nodes}} --ntasks-per-node={{tasks_per_node}}  palm
-%execute_command_for_combine   srun --propagate=STACK -n 1 --ntasks-per-node=1  combine_plot_fields.x
-%memory              2300
-
-# BATCH-directives to be used for batch jobs. If $-characters are required, hide them with 3 backslashes
-BD:#!/bin/bash
-#BD:#SBATCH --dependency=afterany:{{previous_job}}
-BD:#SBATCH -A {{project_account}}
-BD:#SBATCH --job-name={{run_id}}
-BD:#SBATCH --time={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#SBATCH --ntasks={{mpi_tasks}}
-BD:#SBATCH --nodes={{nodes}}
-BD:#SBATCH --ntasks-per-node={{tasks_per_node}}
-BD:#SBATCH --partition={{queue}}
-BD:#SBATCH --output={{job_protocol_file}}
-BD:#SBATCH --error={{job_protocol_file}}
-#BD:#SBATCH --mail-type=ALL
-#BD:#SBATCH --mail-user=<replace_by_your_email_address>
-
-# BATCH-directives for batch jobs used to send back the jobfile from a remote to a local host
-BDT:#!/bin/bash
-BDT:#SBATCH -A {{project_account}}
-BDT:#SBATCH --job-name=job_transfer
-BDT:#SBATCH --time=00:30:00
-BDT:#SBATCH --ntasks=1
-BDT:#SBATCH --nodes=1
-BDT:#SBATCH --ntasks-per-node=1
-BDT:#SBATCH --partition={{queue}}
-BDT:#SBATCH --output={{job_transfer_protocol_file}}
-BDT:#SBATCH --error={{job_transfer_protocol_file}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-# my settings
-IC:ulimit -s unlimited # requires --propagate=STACK in srun command to distribute to all nodes
-IC:export I_MPI_PMI_LIBRARY=libpmi.so
-IC:export I_MPI_FABRICS=shm:ofi
-IC:export I_MPI_OFI_PROVIDER=psm2
-IC:export I_MPI_ADJUST_ALLTOALL=3
-IC:export I_MPI_HYDRA_BRANCH_COUNT=128
-IC:module list
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.atosg
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.atosg	(revision 4901)
+++ 	(revision )
@@ -1,89 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           $HOME/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     /scratch/usr/<replace_by_your_HLRN_username>
-%restart_data_path   $fast_io_catalog
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-%remote_jobcatalog   $base_data/$run_identifier/LOG_FILES
-
-%local_ip            <replace by IP of your local computer>
-%local_username      <replace_by_your_local_username>
-%remote_ip           134.76.43.141
-%remote_loginnode    glogin1
-%remote_username     <replace_by_your_HLRN_username>
-%ssh_key             id_rsa_hlrn
-%defaultqueue        standard96:test
-%project_account     <replace_by_your_default_HLRN_project_account>
-%submit_command      /cm/shared/batch/bin/sbatch
-
-%compiler_name       mpiifort
-%compiler_name_ser   ifort
-%cpp_options         -cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__lc -D__parallel -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__intel_compiler -D__fftw
-%make_options        -j 4
-%compiler_options    -fpe0 -O3 -g -traceback -fp-model source -ftz -xCORE-AVX512 -no-prec-div -no-prec-sqrt -ip -convert little_endian -I /sw/dataformats/netcdf/intel.18/4.7.3/skl/include/ -I /sw/numerics/fftw3/impi/intel/3.3.8/skl/include/
-%linker_options      -Wl,-rpath=\\$LD_RUN_PATH \\`nf-config --flibs\\` -L /sw/numerics/fftw3/impi/intel/3.3.8/skl/lib -lfftw3
-%module_commands     module use /sw/modules/HLRN; module load HLRNenv sw.skl slurm intel/19.1.2 impi  netcdf-parallel/impi/intel fftw3/impi/intel
-%execute_command     srun --propagate=STACK --kill-on-bad-exit -n {{mpi_tasks}} -N {{nodes}} --ntasks-per-node={{tasks_per_node}}  palm
-%execute_command_for_combine   srun --propagate=STACK -n 1 --ntasks-per-node=1  combine_plot_fields.x
-%memory              2300
-
-# BATCH-directives to be used for batch jobs. If $-characters are required, hide them with 3 backslashes
-BD:#!/bin/bash
-#BD:#SBATCH --dependency=afterany:{{previous_job}}
-BD:#SBATCH -A {{project_account}}
-BD:#SBATCH --job-name={{run_id}}
-BD:#SBATCH --time={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#SBATCH --ntasks={{mpi_tasks}}
-BD:#SBATCH --nodes={{nodes}}
-BD:#SBATCH --ntasks-per-node={{tasks_per_node}}
-BD:#SBATCH --partition={{queue}}
-BD:#SBATCH --output={{job_protocol_file}}
-BD:#SBATCH --error={{job_protocol_file}}
-#BD:#SBATCH --mail-type=ALL
-#BD:#SBATCH --mail-user=<replace_by_your_email_address>
-
-# BATCH-directives for batch jobs used to send back the jobfile from a remote to a local host
-BDT:#!/bin/bash
-BDT:#SBATCH -A {{project_account}}
-BDT:#SBATCH --job-name=job_transfer
-BDT:#SBATCH --time=00:30:00
-BDT:#SBATCH --ntasks=1
-BDT:#SBATCH --nodes=1
-BDT:#SBATCH --ntasks-per-node=1
-BDT:#SBATCH --partition={{queue}}
-BDT:#SBATCH --output={{job_transfer_protocol_file}}
-BDT:#SBATCH --error={{job_transfer_protocol_file}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-# my settings
-IC:ulimit -s unlimited # requires --propagate=STACK in srun command to distribute to all nodes
-IC:export I_MPI_PMI_LIBRARY=libpmi.so
-IC:export I_MPI_FABRICS=shm:ofi
-IC:export I_MPI_OFI_PROVIDER=psm2
-IC:export I_MPI_ADJUST_ALLTOALL=3
-IC:export I_MPI_HYDRA_BRANCH_COUNT=128
-IC:module list
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.atosg_debug
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.atosg_debug	(revision 4901)
+++ 	(revision )
@@ -1,89 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           $HOME/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     /scratch/usr/<replace_by_your_HLRN_username>
-%restart_data_path   $fast_io_catalog
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-%remote_jobcatalog   $base_data/$run_identifier/LOG_FILES
-
-%local_ip            <replace by IP of your local computer>
-%local_username      <replace_by_your_local_username>
-%remote_ip           134.76.43.141
-%remote_loginnode    glogin1
-%remote_username     <replace_by_your_HLRN_username>
-%ssh_key             id_rsa_hlrn
-%defaultqueue        standard96:test
-%project_account     <replace_by_your_default_HLRN_project_account>
-%submit_command      /cm/shared/batch/bin/sbatch
-
-%compiler_name       mpiifort
-%compiler_name_ser   ifort
-%cpp_options         -cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__lc -D__parallel -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__intel_compiler -D__fftw
-%make_options        -j 4
-%compiler_options    -fpe0 -check -check nooutput_conversion -traceback -g -O0 -align all -ftz -xCORE-AVX512 -no-prec-div -no-prec-sqrt -ip -convert little_endian -I /sw/dataformats/netcdf/intel.18/4.7.3/skl/include/ -I /sw/numerics/fftw3/impi/intel/3.3.8/skl/include/
-%linker_options      -Wl,-rpath=\\$LD_RUN_PATH \\`nf-config --flibs\\` -L /sw/numerics/fftw3/impi/intel/3.3.8/skl/lib -lfftw3
-%module_commands     module use /sw/modules/HLRN; module load HLRNenv sw.skl slurm intel/19.1.2 impi  netcdf-parallel/impi/intel fftw3/impi/intel
-%execute_command     srun --propagate=STACK --kill-on-bad-exit -n {{mpi_tasks}} -N {{nodes}} --ntasks-per-node={{tasks_per_node}}  palm
-%execute_command_for_combine   srun --propagate=STACK -n 1 --ntasks-per-node=1  combine_plot_fields.x
-%memory              2300
-
-# BATCH-directives to be used for batch jobs. If $-characters are required, hide them with 3 backslashes
-BD:#!/bin/bash
-#BD:#SBATCH --dependency=afterany:{{previous_job}}
-BD:#SBATCH -A {{project_account}}
-BD:#SBATCH --job-name={{run_id}}
-BD:#SBATCH --time={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#SBATCH --ntasks={{mpi_tasks}}
-BD:#SBATCH --nodes={{nodes}}
-BD:#SBATCH --ntasks-per-node={{tasks_per_node}}
-BD:#SBATCH --partition={{queue}}
-BD:#SBATCH --output={{job_protocol_file}}
-BD:#SBATCH --error={{job_protocol_file}}
-#BD:#SBATCH --mail-type=ALL
-#BD:#SBATCH --mail-user=<replace_by_your_email_address>
-
-# BATCH-directives for batch jobs used to send back the jobfile from a remote to a local host
-BDT:#!/bin/bash
-BDT:#SBATCH -A {{project_account}}
-BDT:#SBATCH --job-name=job_transfer
-BDT:#SBATCH --time=00:30:00
-BDT:#SBATCH --ntasks=1
-BDT:#SBATCH --nodes=1
-BDT:#SBATCH --ntasks-per-node=1
-BDT:#SBATCH --partition={{queue}}
-BDT:#SBATCH --output={{job_transfer_protocol_file}}
-BDT:#SBATCH --error={{job_transfer_protocol_file}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-# my settings
-IC:ulimit -s unlimited # requires --propagate=STACK in srun command to distribute to all nodes
-IC:export I_MPI_PMI_LIBRARY=libpmi.so
-IC:export I_MPI_FABRICS=shm:ofi
-IC:export I_MPI_OFI_PROVIDER=psm2
-IC:export I_MPI_ADJUST_ALLTOALL=3
-IC:export I_MPI_HYDRA_BRANCH_COUNT=128
-IC:module list
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.aurora
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.aurora	(revision 4901)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           ~/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     /scratch/<replace by LUIS username>
-%restart_data_path   /scratch/<replace by LUIS username>
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-
-%local_ip            130.75.7.130
-%local_username      <replace by LUIS username>
-%defaultqueue        all
-%submit_command      /usr/bin/qsub
-
-%compiler_name       mpinfort
-%compiler_name_ser   mpinfort
-%cpp_options         -fpp -D__parallel -D__nec -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__fftw -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION
-%make_options        -j 4
-%compiler_options    -O3 -traceback -finline-functions -g -report-all -Werror -I /home/nhbkklau/opt/NetCDF_parallel_nec/include -I /home/nhbkklau/opt/fftw3_nec/include
-%linker_options      -L/home/nhbkklau/opt/NetCDF_parallel_nec/lib -lnetcdff -lnetcdf -Wl,-rpath=/home/nhbkklau/opt/NetCDF_parallel_nec/lib -L/home/nhbkklau/opt/hdf5_parallel_nec/lib -lhdf5 -lhdf5_hl -Wl,-rpath=/home/nhbkklau/opt/hdf5_parallel_nec/lib -L/home/nhbkklau/opt/fftw3_nec/lib -lfftw3 -lmpi
-%execute_command     mpirun -v -ve 0-3  -np {{mpi_tasks}}  ./palm
-%memory              2000
-%login_init_cmd      source /opt/nec/ve/mpi/2.2.0/bin/necmpivars.sh
-
-# BATCH-directives to be used for batch jobs.
-# ATTENTION: The following batch directives still need to be adjusted for the
-#            NEC Aurora system!!!!!!!!!!!!!!
-BD:#!/bin/bash
-#BD:#PBS -A {{project_account}}
-BD:#PBS -N {{run_id}}
-BD:#PBS -l walltime={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#PBS -l ncpus={{cores}}
-BD:#PBS -l nodes={{nodes}}:ppn={{tasks_per_node}}
-BD:#PBS -l mem={{memory}}mb
-BD:#PBS -W x=PARTITION:lena
-BD:#PBS -o {{job_protocol_file}}
-BD:#PBS -j oe
-BD:#PBS -q {{queue}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-#IC:ulimit -s unlimited
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.aurora_debug
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.aurora_debug	(revision 4901)
+++ 	(revision )
@@ -1,66 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           ~/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     /scratch/<replace by LUIS username>
-%restart_data_path   /scratch/<replace by LUIS username>
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-
-%local_ip            130.75.7.130
-%local_username      <replace by LUIS username>
-%defaultqueue        all
-%submit_command      /usr/bin/qsub
-
-%compiler_name       mpinfort
-%compiler_name_ser   mpinfort
-%cpp_options         -fpp -D__parallel -D__nec -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__fftw -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION
-%make_options        -j 4
-%compiler_options    -O0 -fcheck=all -traceback -ftrace -proginf -report-all -g -Werror -fdiag-vector=0  -I /home/nhbkklau/opt/NetCDF_parallel_nec/include -I /home/nhbkklau/opt/fftw3_nec/include
-%linker_options      -ftrace -L/home/nhbkklau/opt/NetCDF_parallel_nec/lib -lnetcdff -lnetcdf -Wl,-rpath=/home/nhbkklau/opt/NetCDF_parallel_nec/lib -L/home/nhbkklau/opt/hdf5_parallel_nec/lib -lhdf5 -lhdf5_hl -Wl,-rpath=/home/nhbkklau/opt/hdf5_parallel_nec/lib -L/home/nhbkklau/opt/fftw3_nec/lib -lfftw3 -lmpi
-%execute_command     mpirun -v -ve 0  -np {{mpi_tasks}}  ./palm
-%memory              2000
-%login_init_cmd      source /opt/nec/ve/mpi/2.2.0/bin/necmpivars.sh
-
-# BATCH-directives to be used for batch jobs.
-# ATTENTION: The following batch directives still need to be adjusted for the
-#            NEC Aurora system!!!!!!!!!!!!!!
-BD:#!/bin/bash
-#BD:#PBS -A {{project_account}}
-BD:#PBS -N {{run_id}}
-BD:#PBS -l walltime={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#PBS -l ncpus={{cores}}
-BD:#PBS -l nodes={{nodes}}:ppn={{tasks_per_node}}
-BD:#PBS -l mem={{memory}}mb
-BD:#PBS -W x=PARTITION:lena
-BD:#PBS -o {{job_protocol_file}}
-BD:#PBS -j oe
-BD:#PBS -q {{queue}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-#IC:ulimit -s unlimited
-IC:export VE_ERRCTL_DEALLOCATE=ABORT
-IC:export VE_FPE_ENABLE=DIV,FOF,INV
-IC:export VE_TRACEBACK=ALL
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.default
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.default	(revision 4901)
+++ 	(revision )
@@ -1,174 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used except for base_data)
-#-----------------------------------------------------------------------------
-# working directory from where palmrun or palmbuild are called
-%base_directory      $HOME/palm/current_version
-
-# directory where PALM I/O is stored (used in .palm.iofiles)
-%base_data           ~/palm/current_version/JOBS
-
-# path to PALM's FORTRAN sources (installation folder)
-%source_path         $base_directory/trunk/SOURCE
-
-# path to user interface routines
-%user_source_path    $base_data/$run_identifier/USER_CODE
-
-# path to temporary working directory. This folder contains the files
-# temporarily created by PALM during execution.
-# WARNING:
-# Large I/O files are generated during execution! It is recommended to direct
-# this path to a file system with fast discs (if available). This folder must
-# be accessible from all compute nodes, i.e. it must reside in a global file
-# system.
-%fast_io_catalog     $base_directory/tmp
-
-# directory where PALM restart files are stored. It is recommended to set this
-# path to the same file system as the temporary directory (fast_io_catalog) to
-# allow internal linking of the restart files instead of copying (increases
-# post-processing performance of palmrun).
-%restart_data_path   $fast_io_catalog
-
-# directory where PALM output files are stored (see also .palm.iofiles)
-%output_data_path    $base_data
-
-# folder for job protocols
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-
-# folder for job protocols to be used on the remote host
-#%remote_jobcatalog   $local_jobcatalog
-
-# local ip of your computer. Use 127.0.0.0 if you are running PALM
-# in interactive mode on your local computer
-%local_ip            <replace by your computers IP address>
-
-# your local UNIX username
-%local_username      <replace by your unix username>
-
-# ip address of the remote host
-#%remote_ip           <ip>
-
-# username on the remote host
-#%remote_username     <username>
-
-# ssh-key to be used for ssh/scp calls to the remote host
-#%ssh_key             ~/.ssh/id_rsa
-
-# name of login-node on the remote machine
-#%remote_loginnode    <loginnode>
-
-# default queue to be used if palmrun-option -q is omitted
-#%defaultqueue        <queue>
-
-# default project account to be used if palmrun-option -A is omitted. For this
-# setting to be active, the batch directive must also be activated (see BD and
-# BDT settings below).
-#%project_account     <project-account>
-
-# command to submit batch jobs
-#%submit_command      /opt/moab/default/bin/msub -E
-
-# compilername to generate MPI executables
-%compiler_name       mpif90
-
-# compilername to generate non-MPI executables running on one core
-%compiler_name_ser   ifort
-
-# preprocessor directives to be used for compiling the PALM code
-%cpp_options         -cpp -D__parallel -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__fftw -D__netcdf
-
-# used for parallel compilation
-%make_options        -j 4
-
-# options to be used to compile PALM
-%compiler_options    -fpe0 -O3 -xHost -fp-model source -ftz -no-prec-div -no-prec-sqrt -ip -I /path/to/fftw/include -I /path/to/netcdf/include
-
-# options to be used to link the PALM executable
-%linker_options      -L/path/to/fftw/lib -lfftw3 -L/path/to/netcdf/lib -lnetcdf -lnetcdff
-
-# name of hostfile to be used (see online documentation for more details)
-#%hostfile            auto
-
-# command to start the PALM executable
-%execute_command     mpirun -n {{mpi_tasks}}  ./palm
-
-# memory request per core
-#%memory              2300
-
-# module commands to load required libraries
-#%module_commands     module switch env-ivybridge env-haswell && module load fftw netcdf
-
-# special commands to be carried out at login and start of batch jobs on the remote host
-#%login_init_cmd      .execute_special_profile
-
-#-------------------------------------------------------------------------------
-# Directives to be used for batch jobs
-# Lines must start with "BD:". If $-characters are required, hide them with \
-# Internal variables can be used as {{variable_name}}. Please see documentation.
-#-------------------------------------------------------------------------------
-# Example using PBS:
-BD:#!/bin/bash
-#BD:#PBS -A {{project_account}}
-BD:#PBS -N {{run_id}}
-BD:#PBS -l walltime={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#PBS -l nodes={{nodes}}:ppn={{tasks_per_node}}
-BD:#PBS -o {{job_protocol_file}}
-BD:#PBS -j oe
-BD:#PBS -q {{queue}}
-#
-# Example using SLURM:
-#BD:#!/bin/bash
-##BD:#SBATCH --dependency=afterany:{{previous_job}}
-#BD:#SBATCH -A {{project_account}}
-#BD:#SBATCH --job-name={{run_id}}
-#BD:#SBATCH --time={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-#BD:#SBATCH --ntasks={{mpi_tasks}}
-#BD:#SBATCH --nodes={{nodes}}
-#BD:#SBATCH --ntasks-per-node={{tasks_per_node}}
-#BD:#SBATCH --partition={{queue}}
-#BD:#SBATCH --output={{job_protocol_file}}
-#BD:#SBATCH --error={{job_protocol_file}}
-#BD:#SBATCH --mail-type=ALL
-#BD:#SBATCH --mail-user=user@somewhere
-
-#-------------------------------------------------------------------------------
-# Directives for batch jobs used to send back the jobfiles from a remote to a local host
-# Lines must start with "BDT:". If $-characters are required, excape them with triple backslash
-# Internal variables can be used as {{variable_name}}. Please see documentation.
-#-------------------------------------------------------------------------------
-# Example using PBS:
-BDT:#!/bin/bash
-#BDT:#PBS -A {{project_account}}
-BDT:#PBS -N job_protocol_transfer
-BDT:#PBS -l walltime=00:30:00
-BDT:#PBS -l nodes=1:ppn=1
-BDT:#PBS -o {{job_transfer_protocol_file}}
-BDT:#PBS -j oe
-BDT:#PBS -q dataq
-#
-# Example using SLURM:
-#BDT:#!/bin/bash
-#BDT:#SBATCH -A {{project_account}}
-#BDT:#SBATCH --job-name=job_transfer
-#BDT:#SBATCH --time=00:30:00
-#BDT:#SBATCH --ntasks=1
-#BDT:#SBATCH --nodes=1
-#BDT:#SBATCH --ntasks-per-node=1
-#BDT:#SBATCH --partition={{queue}}
-#BDT:#SBATCH --output={{job_transfer_protocol_file}}
-#BDT:#SBATCH --error={{job_transfer_protocol_file}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-#IC:ulimit -s unlimited
-#
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-#EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-#
-#----------------------------------------------------------------------------
-# OUTPUT-commands - executed when program terminates normally
-#----------------------------------------------------------------------------
-#OC:echo \\\"PALM job finished\\\" | mailx user@somewhere
Index: palm/trunk/SCRIPTS/.palm.config.default.in
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.default.in	(revision 4901)
+++ 	(revision )
@@ -1,97 +1,0 @@
-################################################################################
-# This is a configuration file for PALM. It must be named: .palm.config.<suffix>
-# in order to use it, call palmbuild and palmrun with the option: -h <suffix>
-# Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/jobcontrol
-################################################################################
-#
-#-------------------------------------------------------------------------------
-# General compiler and host configuration section.
-# Variable declaration lines must start with a percent character
-# Internal variables can be used as {{VARIABLE_NAME}}. Please see documentation.
-#-------------------------------------------------------------------------------
-%base_directory      @CMAKE_INSTALL_PREFIX@
-%base_data           @CMAKE_INSTALL_PREFIX@/JOBS
-%source_path         @CMAKE_INSTALL_PREFIX@/trunk/SOURCE
-%user_source_path    @CMAKE_INSTALL_PREFIX@/JOBS/$run_identifier/USER_CODE
-%fast_io_catalog     @CMAKE_INSTALL_PREFIX@/tmp
-%restart_data_path   @CMAKE_INSTALL_PREFIX@/tmp
-%output_data_path    @CMAKE_INSTALL_PREFIX@/JOBS
-%local_jobcatalog    @CMAKE_INSTALL_PREFIX@/JOBS/$run_identifier/LOG_FILES
-#%remote_jobcatalog   <path/to/directory>
-#
-%local_ip            127.0.0.1
-%local_hostname      @PALM_HOSTNAME@
-%local_username      @CMAKE_USERNAME@
-#
-#%remote_ip           <ip>
-#%remote_hostname     <hostname>
-#%remote_loginnode    <loginnode>
-#%remote_username     <username>
-#%ssh_key             ~/.ssh/id_rsa
-#
-#%defaultqueue        <queue>
-#%project_account     <project-account>
-#%submit_command      /opt/moab/default/bin/msub -E
-#
-%compiler_name       @MPI_Fortran_COMPILER@
-%compiler_name_ser   @CMAKE_Fortran_COMPILER@
-%cpp_options         @PALM_CPP_OPTIONS_STR@
-%make_options        -j @PALM_CORES@
-%compiler_options    @PALM_COMPILER_OPTIONS@
-%linker_options      @PALM_LINKER_OPTIONS@
-%execute_command     @PALM_EXECUTE_COMMAND@ ./palm
-#%memory              2300
-#%module_commands     module switch craype-ivybridge craype-haswell; module load fftw cray-hdf5-parallel cray-netcdf-hdf5parallel
-#%login_init_cmd      .execute_special_profile
-#
-#-------------------------------------------------------------------------------
-# Directives to be used for batch jobs
-# Lines must start with "BD:". If $-characters are required, hide them with \
-# Internal variables can be used as {{variable_name}}. Please see documentation.
-#-------------------------------------------------------------------------------
-BD:#!/bin/bash
-#BD:#PBS -A {{project_account}}
-BD:#PBS -N {{run_id}}
-BD:#PBS -l walltime={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#PBS -l nodes={{nodes}}:ppn={{tasks_per_node}}
-BD:#PBS -o {{job_protocol_file}}
-BD:#PBS -j oe
-BD:#PBS -q {{queue}}
-#
-#-------------------------------------------------------------------------------
-# Directives for batch jobs used to send back the jobfiles from a remote to a local host
-# Lines must start with "BDT:". If $-characters are required, excape them with triple backslash
-# Internal variables can be used as {{variable_name}}. Please see documentation.
-#-------------------------------------------------------------------------------
-BDT:#!/bin/bash
-#BDT:#PBS -A {{project_account}}
-BDT:#PBS -N job_protocol_transfer
-BDT:#PBS -l walltime=00:30:00
-BDT:#PBS -l nodes=1:ppn=1
-BDT:#PBS -o {{job_transfer_protocol_file}}
-BDT:#PBS -j oe
-BDT:#PBS -q dataq
-#
-#-------------------------------------------------------------------------------
-# INPUT-commands. These commands are executed before running PALM
-# Lines must start with "IC:"
-#-------------------------------------------------------------------------------
-IC:ulimit  -s unlimited
-#
-#-------------------------------------------------------------------------------
-# ERROR-commands. These commands are executed when PALM terminates abnormally
-# Lines must start with "EC:"
-#-------------------------------------------------------------------------------
-EC:[[ $locat = execution ]]  &&  cat  RUN_CONTROL
-#
-#-------------------------------------------------------------------------------
-# OUTPUT-commands. These commands are executed when PALM terminates normally
-# Lines must start with "OC:"
-#-------------------------------------------------------------------------------
-#
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.default_trace
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.default_trace	(revision 4901)
+++ 	(revision )
@@ -1,174 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used except for base_data)
-#-----------------------------------------------------------------------------
-# working directory from where palmrun or palmbuild are called
-%base_directory      $HOME/palm/current_version
-
-# directory where PALM I/O is stored (used in .palm.iofiles)
-%base_data           ~/palm/current_version/JOBS
-
-# path to PALM's FORTRAN sources (installation folder)
-%source_path         $base_directory/trunk/SOURCE
-
-# path to user interface routines
-%user_source_path    $base_data/$run_identifier/USER_CODE
-
-# path to temporary working directory. This folder contains the files
-# temporarily created by PALM during execution.
-# WARNING:
-# Large I/O files are generated during execution! It is recommended to direct
-# this path to a file system with fast discs (if available). This folder must
-# be accessible from all compute nodes, i.e. it must reside in a global file
-# system.
-%fast_io_catalog     $base_directory/tmp
-
-# directory where PALM restart files are stored. It is recommended to set this
-# path to the same file system as the temporary directory (fast_io_catalog) to
-# allow internal linking of the restart files instead of copying (increases
-# post-processing performance of palmrun).
-%restart_data_path   $fast_io_catalog
-
-# directory where PALM output files are stored (see also .palm.iofiles)
-%output_data_path    $base_data
-
-# folder for job protocols
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-
-# folder for job protocols to be used on the remote host
-#%remote_jobcatalog   $local_jobcatalog
-
-# local ip of your computer. Use 127.0.0.0 if you are running PALM
-# in interactive mode on your local computer
-%local_ip            <replace by your computers IP address>
-
-# your local UNIX username
-%local_username      <replace by your unix username>
-
-# ip address of the remote host
-#%remote_ip           <ip>
-
-# username on the remote host
-#%remote_username     <username>
-
-# ssh-key to be used for ssh/scp calls to the remote host
-#%ssh_key             ~/.ssh/id_rsa
-
-# name of login-node on the remote machine
-#%remote_loginnode    <loginnode>
-
-# default queue to be used if palmrun-option -q is omitted
-#%defaultqueue        <queue>
-
-# default project account to be used if palmrun-option -A is omitted. For this
-# setting to be active, the batch directive must also be activated (see BD and
-# BDT settings below).
-#%project_account     <project-account>
-
-# command to submit batch jobs
-#%submit_command      /opt/moab/default/bin/msub -E
-
-# compilername to generate MPI executables
-%compiler_name       mpif90
-
-# compilername to generate non-MPI executables running on one core
-%compiler_name_ser   ifort
-
-# preprocessor directives to be used for compiling the PALM code
-%cpp_options         -cpp -D__parallel -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__fftw -D__netcdf
-
-# used for parallel compilation
-%make_options        -j 4
-
-# options to be used to compile PALM
-%compiler_options    -fpe0 -O0 -check -check nooutput_conversion-ffree-line-length-none  -traceback -g -I /path/to/fftw/include -I /path/to/netcdf/include
-
-# options to be used to link the PALM executable
-%linker_options      -L/path/to/fftw/lib -lfftw3 -L/path/to/netcdf/lib -lnetcdf -lnetcdff
-
-# name of hostfile to be used (see online documentation for more details)
-#%hostfile            auto
-
-# command to start the PALM executable
-%execute_command     mpirun -n {{mpi_tasks}}  ./palm
-
-# memory request per core
-#%memory              2300
-
-# module commands to load required libraries
-#%module_commands     module switch env-ivybridge env-haswell && module load fftw netcdf
-
-# special commands to be carried out at login and start of batch jobs on the remote host
-#%login_init_cmd      .execute_special_profile
-
-#-------------------------------------------------------------------------------
-# Directives to be used for batch jobs
-# Lines must start with "BD:". If $-characters are required, hide them with \
-# Internal variables can be used as {{variable_name}}. Please see documentation.
-#-------------------------------------------------------------------------------
-# Example using PBS:
-BD:#!/bin/bash
-#BD:#PBS -A {{project_account}}
-BD:#PBS -N {{run_id}}
-BD:#PBS -l walltime={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#PBS -l nodes={{nodes}}:ppn={{tasks_per_node}}
-BD:#PBS -o {{job_protocol_file}}
-BD:#PBS -j oe
-BD:#PBS -q {{queue}}
-#
-# Example using SLURM:
-#BD:#!/bin/bash
-##BD:#SBATCH --dependency=afterany:{{previous_job}}
-#BD:#SBATCH -A {{project_account}}
-#BD:#SBATCH --job-name={{run_id}}
-#BD:#SBATCH --time={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-#BD:#SBATCH --ntasks={{mpi_tasks}}
-#BD:#SBATCH --nodes={{nodes}}
-#BD:#SBATCH --ntasks-per-node={{tasks_per_node}}
-#BD:#SBATCH --partition={{queue}}
-#BD:#SBATCH --output={{job_protocol_file}}
-#BD:#SBATCH --error={{job_protocol_file}}
-#BD:#SBATCH --mail-type=ALL
-#BD:#SBATCH --mail-user=user@somewhere
-
-#-------------------------------------------------------------------------------
-# Directives for batch jobs used to send back the jobfiles from a remote to a local host
-# Lines must start with "BDT:". If $-characters are required, excape them with triple backslash
-# Internal variables can be used as {{variable_name}}. Please see documentation.
-#-------------------------------------------------------------------------------
-# Example using PBS:
-BDT:#!/bin/bash
-#BDT:#PBS -A {{project_account}}
-BDT:#PBS -N job_protocol_transfer
-BDT:#PBS -l walltime=00:30:00
-BDT:#PBS -l nodes=1:ppn=1
-BDT:#PBS -o {{job_transfer_protocol_file}}
-BDT:#PBS -j oe
-BDT:#PBS -q dataq
-#
-# Example using SLURM:
-#BDT:#!/bin/bash
-#BDT:#SBATCH -A {{project_account}}
-#BDT:#SBATCH --job-name=job_transfer
-#BDT:#SBATCH --time=00:30:00
-#BDT:#SBATCH --ntasks=1
-#BDT:#SBATCH --nodes=1
-#BDT:#SBATCH --ntasks-per-node=1
-#BDT:#SBATCH --partition={{queue}}
-#BDT:#SBATCH --output={{job_transfer_protocol_file}}
-#BDT:#SBATCH --error={{job_transfer_protocol_file}}
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-#IC:ulimit -s unlimited
-#
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-#EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-#
-#----------------------------------------------------------------------------
-# OUTPUT-commands - executed when program terminates normally
-#----------------------------------------------------------------------------
-#OC:echo \\\"PALM job finished\\\" | mailx user@somewhere
Index: palm/trunk/SCRIPTS/.palm.config.eddy_gfort
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.eddy_gfort	(revision 4901)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#$Id: .palm.config.eddy_gfort 3193 2018-08-07 09:55:00Z witha $
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           $HOME/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     $WORK/palm_restart_tmp
-%restart_data_path   $fast_io_catalog
-%output_data_path    $WORK/palm/current_version/JOBS
-%local_jobcatalog    $HOME/job_queue
-################################################################################
-# Replace abcd1234 by your username on Eddy:
-################################################################################
-%local_username      abcd1234
-#
-%defaultqueue        eddy.p
-%submit_command      sbatch
-#
-%compiler_name       mpifort
-%compiler_name_ser   gfortran
-%cpp_options         -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__lc -D__netcdf -D__netcdf4 -D__parallel
-%make_options        -j 4
-%compiler_options    -O3 -mtune=native -march=native -cpp -fconvert=little-endian -I/cm/shared/uniol/software/netCDF-Fortran/4.4.4-goolf-5.2.01/include
-%linker_options      -O3 -mtune=native -march=native -cpp -lnetcdff -lnetcdf
-%execute_command     mpirun -n {{mpi_tasks}} palm
-%execute_command_for_combine     mpirun  -n 1  ./combine_plot_fields.x
-%memory              2333
-%module_commands     module load PALMDependencies/.gcc
-#
-# BATCH-directives to be used for batch jobs
-BD:#!/bin/bash
-BD:#SBATCH -J {{run_id}}
-BD:#SBATCH -t {{timestring}}
-BD:#SBATCH -n {{mpi_tasks}}
-BD:#SBATCH -N {{nodes}}
-BD:#SBATCH --cpus-per-task 1
-BD:#SBATCH -p {{queue}}
-BD:#SBATCH -o {{job_protocol_file}}
-BD:#SBATCH -e {{job_protocol_file}}
-BD:#SBATCH --mem-per-cpu {{memory}}
-BD:#SBATCH --exclusive
-#
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-IC:export ATP_ENABLED=1
-IC:export MPICH_GNI_BTE_MULTI_CHANNEL=disabled
-IC:ulimit  -s unlimited
-#
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-#
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.eddy_ifort
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.eddy_ifort	(revision 4901)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#$Id: .palm.config.eddy_ifort 3193 2018-08-07 09:55:00Z witha $
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           $HOME/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_data/$run_identifier/USER_CODE
-%fast_io_catalog     $WORK/palm_restart_tmp
-%restart_data_path   $fast_io_catalog
-%output_data_path    $WORK/palm/current_version/JOBS
-%local_jobcatalog    $HOME/job_queue
-################################################################################
-# Replace abcd1234 by your username on Eddy:
-################################################################################
-%local_username      abcd1234
-#
-%defaultqueue        eddy.p
-%submit_command      sbatch
-#
-%compiler_name       mpiifort
-%compiler_name_ser   ifort
-%cpp_options         -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__lc -D__netcdf -D__netcdf4 -D__parallel
-%make_options        -j 4
-%compiler_options    -O3 -mtune=native -march=native -cpp -I/cm/shared/uniol/software2/netCDF-Fortran/4.4.4-intel-2017a/include
-%linker_options      -O3 -mtune=native -march=native -cpp -lnetcdff -lnetcdf
-%execute_command     mpirun -n {{mpi_tasks}} palm
-%execute_command_for_combine     mpirun  -n 1  ./combine_plot_fields.x
-%memory              2333
-%module_commands     module load PALMDependencies/icc
-#
-# BATCH-directives to be used for batch jobs
-BD:#!/bin/bash
-BD:#SBATCH -J {{run_id}}
-BD:#SBATCH -t {{timestring}}
-BD:#SBATCH -n {{mpi_tasks}}
-BD:#SBATCH -N {{nodes}}
-BD:#SBATCH --cpus-per-task 1
-BD:#SBATCH -p {{queue}}
-BD:#SBATCH -o {{job_protocol_file}}
-BD:#SBATCH -e {{job_protocol_file}}
-BD:#SBATCH --mem-per-cpu {{memory}}
-BD:#SBATCH --exclusive
-#
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-IC:export ATP_ENABLED=1
-IC:export MPICH_GNI_BTE_MULTI_CHANNEL=disabled
-IC:ulimit  -s unlimited
-#
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-#
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.idefix
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.idefix	(revision 4901)
+++ 	(revision )
@@ -1,73 +1,0 @@
-#$Id$
-#This configuration file is for running jobs locally (interactive or batch mode)
-#on host idefix.
-#-------------------------------------------------------------------------------
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#-------------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           ~/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_directory/JOBS/$run_identifier/USER_CODE
-%fast_io_catalog     /work/<replace_by_your_IDEFIX_username>
-%restart_data_path    $fast_io_catalog
-%output_data_path    /work/<replace_by_your_IDEFIX_username>/JOBS/
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-%remote_jobcatalog   $base_data/$run_identifier/LOG_FILES
-
-%local_ip            130.75.105.239
-%local_username      <replace_by_your_IDEFIX_username>
-%defaultqueue        workq
-%submit_command      /opt/pbspro/default/bin/qsub
-
-%compiler_name       mpif90
-%compiler_name_ser   ifort
-%cpp_options         -cpp -D__parallel -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__netcdf -D__netcdf4 -D__netcdf4_parallel -D__fftw -D__intel_compiler
-%make_options        -j 4
-%compiler_options    -fpe0 -O3 -cpp -fp-model source -ftz -no-prec-div -no-prec-sqrt -ip -I /opt/netcdf4_hdf5parallel/4411c_443f/intel/include -L/opt/netcdf4_hdf5parallel/4411c_443f/intel/lib -L/opt/hdf5-parallel/1.10.0-patch1/intel/lib -lnetcdf -lnetcdff -I /opt/fftw/3.3.6-pl1/mvapich2-intel/include -L/opt/fftw/3.3.6-pl1/mvapich2-intel/lib -lfftw3
-%linker_options      -fpe0 -O3 -cpp -fp-model source -ftz -no-prec-div -no-prec-sqrt -ip -I /opt/netcdf4_hdf5parallel/4411c_443f/intel/include -L/opt/netcdf4_hdf5parallel/4411c_443f/intel/lib -L/opt/hdf5-parallel/1.10.0-patch1/intel/lib -lnetcdf -lnetcdff -I /opt/fftw/3.3.6-pl1/mvapich2-intel/include -L/opt/fftw/3.3.6-pl1/mvapich2-intel/lib -lfftw3
-%hostfile            auto
-%module_commands     module load intel-compiler/2017.1.132 mvapich2/2.2/intel fftw/3.3.6-pl1/mvapich2-intel hdf5-parallel/1.10.0-patch1/intel netcdf4_hdf5parallel/4411c_443f/intel
-%execute_command     mpirun  -machinefile hostfile  -n {{mpi_tasks}} palm
-
-# BATCH-directives to be used for batch jobs.
-BD:#!/bin/bash
-BD:#PBS -N{{run_id}}
-BD:#PBS -l walltime={{cpu_hours}}:{{cpu_minutes}}:{{cpu_seconds}}
-BD:#PBS -l ncpus={{cores}}
-BD:#PBS -o{{job_protocol_file}}
-BD:#PBS -j oe
-BD:#PBS -q{{queue}}
-
-# BATCH-directives for batch jobs used to send back the jobfile from a remote to a local host
-BDT:#!/bin/bash
-BDT:#PBS -N job_protocol_transfer
-BDT:#PBS -l walltime=00:30:00
-BDT:#PBS -l ncpus=1
-BDT:#PBS -o{{job_transfer_protocol_file}}
-BDT:#PBS -j oe
-BDT:#PBS -q workq
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-IC:export MV2_ENABLE_AFFINITY=0
-IC:export MV2_SHOW_CPU_BINDING=1
-IC:export MV2_CPU_BINDING_POLICY=scatter
-IC:ulimit -s unlimited
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.config.imuk
===================================================================
--- palm/trunk/SCRIPTS/.palm.config.imuk	(revision 4901)
+++ 	(revision )
@@ -1,45 +1,0 @@
-#$Id$
-#column 1          column 2
-#name of variable  value of variable (~ must not be used)
-#----------------------------------------------------------------------------
-%base_directory      $HOME/palm/current_version
-%base_data           ~/palm/current_version/JOBS
-%source_path         $HOME/palm/current_version/trunk/SOURCE
-%user_source_path    $base_directory/JOBS/$run_identifier/USER_CODE
-%fast_io_catalog     /localdata/<your user directory>
-%restart_data_path   $fast_io_catalog
-%output_data_path    $base_data
-%local_jobcatalog    $base_data/$run_identifier/LOG_FILES
-
-%local_ip            130.75.105.<your pc's id>
-%local_username      <username>
-
-%compiler_name       mpif90
-%compiler_name_ser   ifort
-%cpp_options         -cpp -D__parallel -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__fftw -D__netcdf -D__netcdf4 -D__netcdf4_parallel
-%make_options        -j 4
-%compiler_options    -fpe0 -O3 -xHost -fp-model source -ftz -fno-alias -no-prec-div -no-prec-sqrt -ip -I /muksoft/packages/fftw/3.3.7/mvapich2-2.3rc1/gnu/include/ -I /muksoft/packages/netcdf4_hdf5parallel/4411c_443f/hdf5-1.10.0-patch1/mvapich2-2.3rc1/intel/2018.1.163/include/
-%linker_options      -L/muksoft/packages/fftw/3.3.7/mvapich2-2.3rc1/gnu/lib64/ -lfftw3 -L/muksoft/packages/netcdf4_hdf5parallel/4411c_443f/hdf5-1.10.0-patch1/mvapich2-2.3rc1/intel/2018.1.163/lib64/ -lnetcdf -lnetcdff
-%hostfile            auto
-%execute_command     mpiexec  -machinefile hostfile  -n {{mpi_tasks}}  palm
-
-#----------------------------------------------------------------------------
-# INPUT-commands, executed before running PALM - lines must start with "IC:"
-#----------------------------------------------------------------------------
-IC:ulimit -s unlimited
-
-#----------------------------------------------------------------------------
-# ERROR-commands - executed when program terminates abnormally
-#----------------------------------------------------------------------------
-EC:[[ \$locat = execution ]]  &&  cat  RUN_CONTROL
-EC:[[ \$locat = execution ]]  &&  cat  PARTICLE_INFOS/*
-
-#----------------------------------------------------------------------------
-# 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
Index: palm/trunk/SCRIPTS/.palm.iofiles
===================================================================
--- palm/trunk/SCRIPTS/.palm.iofiles	(revision 4901)
+++ 	(revision )
@@ -1,87 +1,0 @@
-#$Id$
-#
-#------------------------------------------------------------------------------------------------------------
-# List of input-files
-#------------------------------------------------------------------------------------------------------------
-PARIN                    in:tr      d3#        $base_data/$run_identifier/INPUT            _p3d*
-PARIN                    in:tr      d3r        $base_data/$run_identifier/INPUT            _p3dr*
-PARIN                    in:tr      pcr        $base_data/$run_identifier/INPUT            _pcr*
-NAVIGATION_DATA          inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _nav*
-TOPOGRAPHY_DATA          inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _topo*
-PLANT_CANOPY_DATA_3D     inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _canopy*
-PIDS_STATIC              inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _static*
-PIDS_DYNAMIC             inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _dynamic*
-PIDS_SALSA               inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _salsa*
-PIDS_CHEM                inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _chemistry*
-PIDS_UVEM                inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _uvlookup*
-PIDS_VM                  inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _vmeas*
-PIDS_WTM                 inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _wtmpar*
-RRTMG_LW                 inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _rlw
-RRTMG_SW                 inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _rsw
-WTM_DATA                 inopt:tr   d3#:d3r    $base_data/$run_identifier/INPUT            _wtm
-BININ                    in:lnpe    d3r:cyclic $restart_data_path/$run_identifier/RESTART  _d3d*
-PARTICLE_RESTART_DATA_IN in:lnpe    prtr       $restart_data_path/$run_identifier/RESTART  _rprt
-SVFIN                    in:lnpe    svfin      $restart_data_path/$run_identifier/SVF      _svf*
-DATA_1D_FL_NETCDF        inopt      flr        $output_data_path/$run_identifier/OUTPUT    _fl*       nc
-DATA_1D_PR_NETCDF        inopt      prr        $output_data_path/$run_identifier/OUTPUT    _pr*       nc
-DATA_1D_PTS_NETCDF       inopt      ptsr       $output_data_path/$run_identifier/OUTPUT    _pts*      nc
-DATA_1D_SP_NETCDF        inopt      spr        $output_data_path/$run_identifier/OUTPUT    _sp*       nc
-DATA_1D_SPTS_NETCDF      inopt      sptsr      $output_data_path/$run_identifier/OUTPUT    _spts*     nc
-DATA_1D_TS_NETCDF        inopt      tsr        $output_data_path/$run_identifier/OUTPUT    _ts*       nc
-DATA_2D_XY_AV_NETCDF     inopt      xyr        $output_data_path/$run_identifier/OUTPUT    _av_xy*    nc
-DATA_2D_XY_NETCDF        inopt      xyr        $output_data_path/$run_identifier/OUTPUT    _xy*       nc
-DATA_2D_XZ_AV_NETCDF     inopt      xzr        $output_data_path/$run_identifier/OUTPUT    _av_xz*    nc
-DATA_2D_XZ_NETCDF        inopt      xzr        $output_data_path/$run_identifier/OUTPUT    _xz*       nc
-DATA_2D_YZ_AV_NETCDF     inopt      yzr        $output_data_path/$run_identifier/OUTPUT    _av_yz*    nc
-DATA_2D_YZ_NETCDF        inopt      yzr        $output_data_path/$run_identifier/OUTPUT    _yz*       nc
-DATA_3D_NETCDF           inopt      3dr        $output_data_path/$run_identifier/OUTPUT    _3d*       nc
-DATA_3D_AV_NETCDF        inopt      3dr        $output_data_path/$run_identifier/OUTPUT    _av_3d*    nc
-DATA_MASK_AV_NETCDF      inopt      mar        $output_data_path/$run_identifier/OUTPUT    _av_masked nc
-DATA_MASK_NETCDF         inopt      mar        $output_data_path/$run_identifier/OUTPUT    _masked    nc
-#DATA_PRT_NETCDF          inopt:pe   prtr       $output_data_path/$run_identifier/OUTPUT    _prt*      nc
-#
-#------------------------------------------------------------------------------------------------------------
-# List of output-files
-#------------------------------------------------------------------------------------------------------------
-BINOUT*                    out:lnpe restart:pcr $restart_data_path/$run_identifier/RESTART    _d3d
-PARTICLE_RESTART_DATA_OUT* out:lnpe prt#:prtr   $restart_data_path/$run_identifier/RESTART    _rprt
-SVFOUT*                    out:lnpe svfout      $restart_data_path/$run_identifier/SVF        _svf
-#
-PARIN*                     out:tr   d3#:d3r:pcr $output_data_path/$run_identifier/MONITORING  _parin
-STDOUT*                    out:tr   d3#:d3r:pcr $output_data_path/$run_identifier/MONITORING  _stdout
-RUN_CONTROL*               out:tr   d3#:d3r:pcr $output_data_path/$run_identifier/MONITORING  _rc
-HEADER*                    out:tr   d3#:d3r:pcr $output_data_path/$run_identifier/MONITORING  _header
-CPU_MEASURES*              out:tr   d3#:d3r:pcr $output_data_path/$run_identifier/MONITORING  _cpu
-PARTICLE_INFOS*            out:tr   *           $output_data_path/$run_identifier/MONITORING  _prt_info
-LIST_PROFIL*               out:tr   *           $output_data_path/$run_identifier/MONITORING  _list_pr
-#
-DATA_1D_FL_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _fl          nc
-DATA_1D_PR_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _pr          nc
-DATA_1D_PTS_NETCDF*        out:tr   *           $output_data_path/$run_identifier/OUTPUT      _pts         nc
-DATA_1D_SP_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _sp          nc
-DATA_1D_SPTS_NETCDF*       out:tr   *           $output_data_path/$run_identifier/OUTPUT      _spts        nc
-DATA_1D_TS_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _ts          nc
-DATA_1D_TS_WTM_NETCDF*     out:tr   *           $output_data_path/$run_identifier/OUTPUT      _wtm         nc
-DATA_2D_XY_AV_NETCDF*      out:tr   *           $output_data_path/$run_identifier/OUTPUT      _av_xy       nc
-DATA_2D_XY_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _xy          nc
-DATA_2D_XZ_AV_NETCDF*      out:tr   *           $output_data_path/$run_identifier/OUTPUT      _av_xz       nc
-DATA_2D_XZ_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _xz          nc
-DATA_2D_YZ_AV_NETCDF*      out:tr   *           $output_data_path/$run_identifier/OUTPUT      _av_yz       nc
-DATA_2D_YZ_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _yz          nc
-DATA_3D_AV_NETCDF*         out:tr   *           $output_data_path/$run_identifier/OUTPUT      _av_3d       nc
-DATA_3D_NETCDF*            out:tr   *           $output_data_path/$run_identifier/OUTPUT      _3d          nc
-DATA_AGT_NETCDF*           out:tr   *           $output_data_path/$run_identifier/OUTPUT      _agt         nc
-DATA_MASK_AV_NETCDF*       out:tr   *           $output_data_path/$run_identifier/OUTPUT      _av_masked   nc
-DATA_MASK_NETCDF*          out:tr   *           $output_data_path/$run_identifier/OUTPUT      _masked      nc
-#DATA_PRT_NETCDF*           out:pe   *           $output_data_path/$run_identifier/OUTPUT      _prt         nc
-#DATA_PRT_NETCDF*           out:trpe *           $output_data_path/$run_identifier/OUTPUT      _prt         nc
-PARTICLE_DATA*             out:lnpe *           $output_data_path/$run_identifier/OUTPUT      _prt_bin
-SURFACE_DATA_AV_BIN*       out:lnpe *           $output_data_path/$run_identifier/OUTPUT      _av_surf_bin
-SURFACE_DATA_BIN*          out:lnpe *           $output_data_path/$run_identifier/OUTPUT      _surf_bin
-SURFACE_DATA_AV_NETCDF*    out:tr   *           $output_data_path/$run_identifier/OUTPUT      _av_surf     nc
-SURFACE_DATA_NETCDF*       out:tr   *           $output_data_path/$run_identifier/OUTPUT      _surf        nc
-VM_OUTPUT*                 out:pe   *           $output_data_path/$run_identifier/OUTPUT      _vm
-#------------------------------------------------------------------------------------------------------------
-# Deprecated settings (will be removed in a future revision)
-#------------------------------------------------------------------------------------------------------------
-BININ                      in:lnpe  rec         $restart_data_path/$run_identifier/RESTART  _d3d*
Index: palm/trunk/SCRIPTS/batch_scp
===================================================================
--- palm/trunk/SCRIPTS/batch_scp	(revision 4901)
+++ palm/trunk/SCRIPTS/batch_scp	(revision 1)
@@ -1,98 +1,50 @@
-#! /bin/bash
-
-# batch_scp - script for automatic file/directory transfer using scp
-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# add cycle number to initial files too (000),
-# remove compatibility for cycle numbers which are less than three digits wide
-# 
-# 3549 2018-11-21 15:44:44Z raasch
-# english translation of german comments / variable names
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-# 
-# 2715 2017-12-27 11:31:43Z raasch
-# last commit documented
-# 
-# 2714 2017-12-27 11:25:57Z raasch
-# bugfix: variable cycle explicitly interpreted with 10 as the number base
-# 
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2600 2017-11-01 14:11:20Z raasch
-# cycle numbers made three digits wide
-# host depending code completely removed
-# 
-# 2261 2017-06-08 14:25:57Z raasch
-# option usecycle added, script is running under bash now,
-# filenames are allowed to contain arbitrary number of dots "."
-#
-# 1310 2014-03-14 08:01:56Z raasch
-#
-# 1202 2013-07-10 16:22:07Z witha
-# adjustments for Forwind cluster (lcflow): using absolute paths for ssh
-#
-# 1099 2013-02-10 01:47:43Z raasch
-# LANG variable is unset in some ssh calls to guarantee messages in English
-#
-# 1094 2013-02-03 01:52:12Z raasch
-# new option -P for explicit setting of ssh/scp port
-#
-# 1090 2013-02-02 07:06:13Z raasch 
-# code put under GPL (PALM 3.9) 
-# adjustments for Kyushu-University computing center (lckyut)
-# old changelog messages removed
-#
-# 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 up to 5 arguments (first 4 are mandatory):
-#               $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
-#               $5 = file extension (optional argument)
-#
-# 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).
-#--------------------------------------------------------------------------------#
+#! /bin/ksh
+# batch_scp - Shellskript         Version:  @(#)batch_scp 1.0a     25/10/05
+
+     # 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
 
 
  
-    # VARIABLE DECLARATIONS + DEFAULT VALUES 
+    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE 
  random=$RANDOM
 
@@ -101,11 +53,9 @@
  catalog_copy=false
  check=false
- cyclestring=""
  delete=false
- errfile=batch_scp.errfile.$random
+ errfile=ftpcopy.errfile.$random
  filelist=filelist.$random
  get=false
  local_host=`hostname`
- local_wdir=`pwd`
  locat=normal
  make_catalog=false
@@ -116,13 +66,12 @@
  silent=false
  transfermode=binary
- typeset -i iii icycle maxcycle=0 usecycle wait=0
-
-
-    # ERROR HANDLING IN CASE ...
-    # ... EXIT
+ zyklusnr=""
+ typeset -i iii icycle maxcycle=0 wait=0
+
+    # FEHLERBEHANDLUNG
+    # BEI EXIT:
  trap 'if [[ $locat != normal ]]
        then
-          [[ -f "$filelist" ]]  &&  cat $filelist
-          [[ -f "$errfile"  ]]  &&  cat $errfile
+          cat $filelist $errfile
           rm -rf $filelist $errfile
           printf " +++ BATCH_SCP terminated \n"
@@ -133,5 +82,5 @@
 
 
-    # ... TERMINAL-BREAK:
+    # BEI TERMINAL-BREAK:
  trap 'rm -rf $filelist $errfile
        printf " +++ BATCH_SCP terminated \n\n"
@@ -140,6 +89,6 @@
 
 
-    # READ SHELLSCRIPT-OPTIONS
- while  getopts  :aAbcCdgmnoP:qsu:U:w:  option
+    # SHELLSCRIPT-OPTIONEN EINLESEN
+ while  getopts  :aAbcCdgmnoqsu:w:  option
  do
    case  $option  in
@@ -154,9 +103,7 @@
        (n)   print_local_filename=true;;  # Option ist nicht dokumentiert !
        (o)   overwrite=true;;
-       (P)   scp_port=$OPTARG;;
        (q)   quote_wait=true;;
        (s)   silent=true;;
        (u)   remote_user=$OPTARG;;
-       (U)   usecycle=$OPTARG;;
        (w)   wait=$OPTARG;;
        (\?)  printf "  +++ option $OPTARG unknown \n"
@@ -165,16 +112,13 @@
    esac
  done
-
- (( to_shift = $OPTIND - 1 ))
- shift $to_shift
-
+ shift OPTIND-1
 
 
  
-    # LIST SHORT DESCRIPTION OF AVAILABLE OPTIONS
+    # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
  if [ "$1" = "?" ]
  then
    (printf "\n  *** batch_scp can be called as follows:\n"
-    printf "\n      batch_scp -a -b -d -g -o -q -s -u.. -U.. -w..  <param1> <param2> <param3> <param4>\n"
+    printf "\n      batch_scp -a -b -d -g -o -q -s -u.. -w..  <param1> <param2> <param3> <param4>\n"
     printf "\n      Description of available options:\n"
     printf "\n      Option  Description                            Default-Value"
@@ -195,5 +139,4 @@
     printf "\n        -s    do not display informative messages    ---"
     printf "\n        -u    username on remote machine             <username>"
-    printf "\n        -U    cycle number to be used                ---"
     printf "\n        -w    waiting time in seconds, before trans- 0"
     printf "\n              fer will be initiated"
@@ -202,5 +145,5 @@
     printf "\n      any time and have the following meaning:"
     printf "\n        <param1>  -  IP-adress of destination host"
-    printf "\n                     or \"?\"  (creates this short summary of options)"
+    printf "\n                     or \"?\"  (creates this outline)"
     printf "\n        <param2>  -  abs. or rel. path of file to be transferred"
     printf "\n        <param3>  -  directory (abs.!) on destination host. Special cahracters"
@@ -214,5 +157,5 @@
 
 
-    # CHECK FOR COMPLETENESS OF ARGUMENTS
+    # PRUEFEN, OB ALLE ARGUMENTE VORLIEGEN
  if [[ "$1" = "" ]]
  then
@@ -237,11 +180,19 @@
  if [[ -z $remote_user ]]
  then
-    printf " +++ option -u is missing \n"
-    locat=remote_user; exit
- fi
-
-
-    # APPEND IS ONLY ALLOWED FOR TRANSFER OF SINGLE FILES WITHOUT OVERWRITING
-    # IN SUCH A CASE GET IS NOT ALLOWED TOO
+
+       # PRUEFEN, OB NETRC-DATEI VORHANDEN
+    if [[ ! -f ~/.netrc ]]
+    then
+       printf " +++ option -u not given; \n"
+       printf "     getting remote-username from password file failed \n"
+       printf "     because ~/.netrc does not exist \n"
+       locat=netrc; exit
+    fi
+    grep  $1  ~/.netrc | read dum dum dum remote_user dum dum
+ fi
+
+
+    # APPEND IST NUR BEI TRANSFER EINZELNER DATEIEN OHNE UEBERSCHREIBEN
+    # ERLAUBT. GET IST DABEI EBENFALLS NICHT ERLAUBT
  if [[ $append = true  &&  ( $get = true || $catalog_copy = true || $overwrite = true ) ]]
  then
@@ -251,5 +202,15 @@
 
 
-    # QUOTE WAIT DOES NOT WORK IF COMPLETE FOLDERS ARE COPIED
+    # DATEINAME IM 4. ARGUMENT DARF NUR BEIM UEBERSCHREIBEN ODER IM ABSOLUT-
+    # MODUS PUNKTE ENTHALTEN
+ if [[ $overwrite = false  &&  $absolut = false  &&  $(echo $4 | grep -c "\.") != 0 ]]
+ then
+    printf " +++ 4th argument may only contain dots (".") , if one of the \n"
+    printf "     options -a or -o are given \n"
+    locat=argument; exit
+ fi
+
+
+    # QUOTE WAIT FUNKTIONIERT NICHT BEIM KOPIEREN GANZER VERZEICHNISSE
  if [[ $quote_wait = true  &&  $catalog_copy = true ]]
  then
@@ -259,22 +220,14 @@
 
 
-    # SCRIPT WILL BE ENDED HERE IN CASE OF CHECK-MODE
+    # IM CHECK-MODUS WIRD SCRIPT HIER BEENDET
  [[ $check = true ]]  &&  exit
 
 
-    # WAIT A BIT (MAY BE REQUIRED IN CASE OF TRANSFERS OF JOB PROTOCOLS FROM
-    # WITHIN A JOB)
+    # BESTIMMTE ZEIT WARTEN, BIS WEITERGEMACHT WIRD (NOETIG Z.B. BEI TRANSFER
+    # VON JOBPROTOKOLLEN AUS JOBS HERAUS)
  sleep  $wait
 
 
-    # SET PORT NUMBER OPTION FOR CALLS OF SSH/SCP
- if [[ "$scp_port" != "" ]]
- then
-    PORTOPT="-P $scp_port"
-    SSH_PORTOPT="-p $scp_port"
- fi
-
-
-    # CHECK, IF LOCAL FILE/FOLDER EXISTS
+    # PRUEFEN, OB LOKALE DATEI/LOKALES VERZEICHNIS VORHANDEN BZW. NICHT VORHANDEN
  if [[ $get = false ]]
  then
@@ -308,5 +261,5 @@
        else
 
-             # CHECK, IF LOCAL FILE CAN BE CREATED
+             # PRUEFEN, OB SICH LOKALE DATEI ANLEGEN LAESST
           local_dirname=`dirname $2`
           if [[ ! -d $local_dirname ]]
@@ -330,6 +283,6 @@
 
 
-    # CREATE FILE LIST OF THE TARGET HOST FOLDER
- ssh $SSH_PORTOPT $1 -l $remote_user "unset LANG; cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
+    # VERZEICHNISLSTE DES ZIELRECHNERS ERSTELLEN
+ ssh $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
  ssh_status=$?
 
@@ -350,6 +303,7 @@
 
 
-    # CHECK, IF FOLDER EXISTS. A FOLDER MUST NOT EXIST, IF COMPLETE FOLDERS
-    # SHALL BE COPIED TO THE TARGET HOST
+    # PRUEFEN, OB VERZEICHNIS VORHANDEN IST. WENN GANZES VERZEICHNISS ZUM
+    # ZIELRECHNER KOPIERT WERDEN SOLL, DARF DORT NOCH KEIN ENTSPRECHENDES
+    # VERZEICHNIS VORHANDEN SEIN
  if [[ $(cat $filelist | grep -c "not found") != 0  || \
        $(cat $filelist | grep -c "No such file or directory") != 0 ]]
@@ -374,94 +328,96 @@
 
 
-    # CHECK, IF FILE/FOLDER EXISTS. IF SO, DETERMINE HIGHEST CYCLE NUMBER
-    # (OR CHECK, IN ABSOLUT-MODE, IF FILE EXSITS)
-    # BUT DO THIS IN NON-OVERWRITE-MODE ONLY
+    # PRUEFEN, OB DATEI/VERZEICHNIS VORHANDEN, WENN JA, HOECHSTEN ZYKLUS
+    # ERMITTELN (BZW. IM ABSOLUT-MODUS PRUEFEN, OB DATEI VORHANDEN IST)
+    # DAS GANZE ABER NUR, WENN NICHT OVERWRITE-MODUS GEWAEHLT WURDE, DIE
+    # EVENTUELL VORHANDENE DATEI ALSO UEBERSCHRIEBEN WERDEN SOLL
  found=false
  if [[ ( $overwrite = false   &&  $get = false )  ||  $get = true ]]
  then
-    while  read line
+    while  read zeile
     do
        if [[ $absolut = false ]]
        then
-             # REMOVE EXTENSION, IF EXISTING AND GIVEN AS ARGUMENT
-          if [[ "$5" != ""  &&  "$5" != " " ]]
-          then
-             extension=${line##*.}
-             if [[ $extension = $5 ]]
-             then
-                text=${line%.*}
+          text=$(echo $zeile | cut -f1 -d".")
+          if [[ "$text" = "$4" ]]
+          then
+             found=true
+             cycle=$(echo $zeile | cut -f2 -d".")
+             if [[ "$cycle" = "$text" ]]
+             then
+                (( icycle = 0 ))
              else
-                text=${line}
-             fi
+
+                   # PRUEFEN, OB CYCLE EINE ZAHL IST
+                (( iii = 1 ))
+                character=`echo $cycle | cut -c$iii`
+                character_found=false
+                while [[ "$character" != ""  &&  $character_found = false ]]
+                do
+                   case  $character  in
+                      (0|1|2|3|4|5|6|7|8|9)  true;;
+                      (*)  character_found=true
+                   esac
+                   (( iii = iii + 1 ))
+                   character=`echo $cycle | cut -c$iii`
+                done
+
+                if [[ $character_found = false ]]
+                then
+                   (( icycle = $cycle ))
+                fi
+             fi >|$errfile 2>&1    # AUSGABE FEHLER AUF ERRFILE WENN CYCLE NICHTNUMERISCH
+
+
+                # INFORMATIVE AUSGABE, WENN DATEI NICHTNUMERISCHE EXTENSION HAT
+                # if [[ $(cat $errfile | grep -c "bad number") != 0 ]]
+             if [[ $character_found = true ]]
+             then
+                if [[ $cycle != "$5" ]]
+                then
+                   printf "  +++ file \"$text\" has non-numerical extension \".$cycle\" \n"
+                   locat=file; exit
+                else
+                   if [[ $silent = false ]]
+                   then
+                      printf "  >>> file \"$text\" has non-numerical extension \".$cycle\" \n"
+                   fi
+                fi
+             fi
+
+             if (( icycle > maxcycle ))
+             then
+                (( maxcycle = icycle ))
+             fi
+          fi
+
+       else
+
+             # IM ABSOLUT-MODUS MUSS NUR GEPRUEFT WERDEN, OB DIE DATEI
+             # VORHANDEN IST
+          [[ $4 = $zeile ]]  &&  found=true
+       fi
+
+    done <$filelist
+ fi
+
+ if [[ $found = true ]]
+ then
+    if [[ $get = false ]]
+    then
+       if [[ $absolut = false ]]
+       then
+          if [[ $append = false ]]
+          then
+             (( maxcycle = maxcycle + 1 ))
+             zyklusnr=".$maxcycle"
           else
-             text=${line}
-          fi
-
-             # GET AND REMOVE CYCLE NUMBER, IF EXISTING, AND CHECK, IF FILE EXISTS
-          cycle=${text##*.}
-          if [[ $cycle = $text ]]
-          then
-                # filename contains no dot, i.e. no cycle number
-             if [[ "$text" = "$4" ]]
-             then
-                found=true
-                (( icycle = 0 ))
-             fi
-          else
-                # filename contains at least one dot
-                # find out if the string after the last dot is a number
-             if [[ $cycle =~ ^-?[0-9]+$ ]]
-             then
-                text=${text%.*}
-                if [[ "$text" = "$4" ]]
-                then
-                   found=true
-                   (( icycle = $((10#$cycle)) ))
-                fi
+             if (( maxcycle == 0 ))
+             then
+                zyklusnr=""
              else
-                if [[ "$text" = "$4" ]]
-                then
-                   found=true
-                   (( icycle = 0 ))
-                fi
-             fi
-          fi
-
-          if (( icycle > maxcycle ))
-          then
-             (( maxcycle = icycle ))
-          fi
-
-       else
-
-             # ABSOLUT-MODE ONLY REQUIRES TO CHECK IF FILE EXISTS
-          [[ $4 = $line ]]  &&  found=true
-       fi
-
-    done <$filelist
- fi
-
- if [[ $found = true ]]
- then
-    if [[ $get = false ]]
-    then
-       if [[ $absolut = false ]]
-       then
-          if [[ $append = false ]]
-          then
-             (( maxcycle = maxcycle + 1 ))
-
-                # TRY TO USE FIXED CYCLE NUMBER, IF GIVEN AS OPTION
-             if [[ "$usecycle" != "" ]]
-             then
-                if (( usecycle >= maxcycle ))
-                then
-                   (( maxcycle = usecycle ))
-                else
-                    printf "  >>> Unified cycle number cannot be used\n"
-                fi
-             fi
-          fi
-          cyclestring=`printf ".%03d" $maxcycle`
+                zyklusnr=".$maxcycle"
+             fi
+          fi
        else
           if [[ $overwrite = false ]]
@@ -475,20 +431,20 @@
        if [[ $absolut = false ]]
        then
-             # MAKE CYCLE NUMBER THREE DIGITS WIDE
-          cyclestring=`printf ".%03d" $maxcycle`
-       else
-          cyclestring=""
-       fi
-    fi
-
+          if (( maxcycle == 0 ))
+          then
+             zyklusnr=""
+          else
+             zyklusnr=".$maxcycle"
+             (( maxcycle = 0 ))
+          fi
+       else
+          zyklusnr=""
+       fi
+    fi
  else
-
-    if [[ "$usecycle" != "" ]]
-    then
-       (( maxcycle = usecycle ))
-    fi
-    cyclestring=`printf ".%03d" $maxcycle`
-
-       # EXIT, IF FILE SHALL BE GET FROM THE TARGET HOST, BUT DOESN'T EXIST
+    zyklusnr=""
+
+       # ABBRUCH, WENN DATEI VON ZIELRECHNER GEHOLT WERDEN SOLL, DORT ABER
+       # NICHT VORHANDEN IST
     if [[ $get = true ]]
     then
@@ -500,9 +456,18 @@
 
 
-    # IF NAME-OPTION (-n) IS CHOSEN, ONLY DETERMINE THE LOCAL FILENAME ON THE
-    # TARGET HOST AND EXIT THE SCRIPT
+    # FALLS KATALOG ERZEUGT WIRD, DARF DIE DATEI IN KEINEM FALL EINE
+    # ZYKLUSNUMMER BESITZEN, DA SIE JA NOCh GARNICHT EXISTIEREN KANN
+ if [[ $make_catalog = force ]]
+ then
+    zyklusnr=""
+    (( maxcycle = 0 ))
+ fi
+
+ 
+    # FALLS NAMENSOPTION (-n) GEWAEHLT WURDE, NUR DEN ERMITTELTEN LOKALEN
+    # DATEINAMEN DES ZIELRECHNERS AUSGEBEN UND SCRIPT BEENDEN
  if [[ $print_local_filename = true ]]
  then
-    printf "$4$cyclestring\n"
+    printf "$4$zyklusnr\n"
     rm -r $filelist
     exit
@@ -510,20 +475,19 @@
 
 
-    # IF A 5. ARGUMENT IS GIVEN, IT WILL BE PUT AS FILENAME EXTENSION/APPENDIX
-    # AFTER THE CYCLE NUMBER (ONLY WORKS IN CASE OF FILE COPY TO THE TARGET HOST)
+    # FALLS 5. ARGUMENT ANGEGEBEN WURDE, WIRD DIES ALS FILE-EXTENSION
+    # HINTER DIE ZYKLUS-NUMMER GEHAENGT (FUNKTIONIERT NUR BEI KOPIEREN EINER
+    # DATEI AUF ZIELRECHNER
  if [[ "$5" != ""  &&  $get = false ]]
  then
-    cyclestring=${cyclestring}.$5
- fi
-
-
-    # IN CASE OF FOLDER TRANSER TO THE TARGET HOST, CHECK IF ARGUMENT $3 REALLY
-    # REFERS TO A FOLDER ON THE TARGET HOST
+    zyklusnr=${zyklusnr}.$5
+ fi
+
+
+    # BEI VERZEICHNISTRANSFER VON ZIELRECHNER AUF LOKALEN RECHNER PRUEFEN, OB
+    # $3 AUF ZIELRECHNER WIRKLICH EIN VERZEICHNIS IST
  if [[ $catalog_copy = true  &&  $get = true ]]
  then
-
     rm -rf $filelist
-    ssh $SSH_PORTOPT $1 -l $remote_user "cd $3" > $filelist
-
+    ssh $1 -l $remote_user "cd $3" > $filelist
     if [[ $? != 0 ]]
     then
@@ -536,10 +500,9 @@
        locat=directory; exit
     fi
-
- fi
-
-
-    # IN CASE OF FOLDER TRANSFER FROM THE TARGET HOST TO THE LOCAL HOST,
-    # CREATE THE RESPECTIVE FOLDER ON THE LOCAL HOST
+ fi
+
+
+    # BEI KATALOGTRANSFER AUF LOKALEN RECHNER ENTSPRECHENDES VERZEICHNIS
+    # ANLEGEN
  if [[ $catalog_copy = true ]]
  then
@@ -551,9 +514,16 @@
 
 
+    # Auf IBM-Rechnern (HLRN) Tilde aus Katalognamen entfernen, da scp
+    # diese nicht versteht
  catalog_name=$3
+ if [[ $(hostname | cut -c1-4) = hreg  ||  $(hostname | cut -c1-4) = breg ]]
+ then
+    catalog_name=${catalog_name#"~/"}
+    catalog_name=${catalog_name#"~"}
+ fi
  [[ "$catalog_name" != "" ]]  &&  catalog_name=${catalog_name}/
 
 
-    # COPY FILE/FOLDER VIA SCP
+    # DATEI/VERZEICHNIS PER SCP UEBERTRAGEN
  if [[ $get = false ]]
  then
@@ -562,10 +532,19 @@
        if [[ $append = false ]]
        then
-
-          if [[ $catalog_copy = false ]]
-          then
-             scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$cyclestring  > /dev/null
+          if [[ $(echo $local_host | cut -c1-2) = cs ]]
+          then
+             if [[ $catalog_copy = false ]]
+             then
+                scp -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
+             else
+                scp -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
+             fi
           else
-             scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$cyclestring  > /dev/null
+             if [[ $catalog_copy = false ]]
+             then
+                scp $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+             else
+                scp -r $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
+             fi
           fi
           scp_status=$?
@@ -573,9 +552,10 @@
           if [[ $scp_status != 0 ]]
           then
-                # CHECK, IF FILE SIZES ON LOCAL HOST AND TARGET HOST MATCH
+                # CHECK, OB DATEIGROESSEN AUF LOKALEM UND REMOTERECHNER
+                # UEBEREINSTIMMEN
              local_size=`ls -al  $2`
              local_size=`echo $local_size | cut -d" " -f5`
 
-             remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al $catalog_name$4$cyclestring"`
+             remote_size=`ssh $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"`
              remote_size=`echo $remote_size | cut -d" " -f5`
 
@@ -588,16 +568,14 @@
              fi
           fi
-
-       else
-
-          scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
-
+       else
+          scp $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
           if [[ $? != 0 ]]
           then
-                # CHECK, IF FILE SIZES ON LOCAL HOST AND TARGET HOST MATCH
+                # CHECK, OB DATEIGROESSEN AUF LOKALEM UND REMOTERECHNER
+                # UEBEREINSTIMMEN
              local_size=`ls -al  $2`
              local_size=`echo $local_size | cut -d" " -f5`
 
-             remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
+             remote_size=`ssh $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
              remote_size=`echo $remote_size | cut -d" " -f5`
 
@@ -613,6 +591,5 @@
           rm  $filelist
 
-          ssh $SSH_PORTOPT $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$cyclestring; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist
-
+          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
           if [[ $? != 0 ]]
           then
@@ -628,16 +605,11 @@
           fi
        fi
-
     else
-
-       ssh $SSH_PORTOPT $1 -l $remote_user "mkdir -p $3"
-
+       ssh $1 -l $remote_user "mkdir -p $3"
        if [[ $? != 0 ]]
        then
           locat=ssh_failed_4; exit
        fi
-
-       scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$cyclestring  > /dev/null
-
+       scp $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
        if [[ $? != 0 ]]
        then
@@ -658,6 +630,5 @@
        else
 
-          scp $PORTOPT -p $remote_user@$1:$catalog_name$4$cyclestring $2  > /dev/null
-
+          scp $remote_user@$1:$catalog_name$4$zyklusnr $2  > /dev/null
           if [[ $? != 0 ]]
           then
@@ -666,5 +637,4 @@
 
        fi
-
     else
 
@@ -672,11 +642,16 @@
        locat=unavailable_feature; exit
 
-    fi
-
- fi
-
-
-
-    # DELETE TRANSFERED FILE ON THE LOCAL HOST
+#       ftp -i $1 << %END%  > /dev/null
+#$transfermode
+#cd $3
+#mget *
+#quit
+#%END%
+    fi
+ fi
+
+
+
+    # EVTL. TRANSFERIERTE DATEI AUF LOKALEM RECHNER LOESCHEN
  if [[ $delete = true  &&  $get = false ]]
  then
@@ -686,5 +661,5 @@
 
 
-    # FINAL MESSAGES
+    # ABSCHLUSSMELDUNG
  if [[ $silent = false ]]
  then
@@ -703,10 +678,10 @@
           if [[ $catalog_copy = false ]]
           then
-             printf "      new file has cycle number .%03d \n" $maxcycle
+             printf "      new file has cycle number $maxcycle \n"
           else
-             printf "      new catalog has cycle number .%03d \n" $maxcycle
-          fi
-       else
-          printf "      append to cycle number .%03d \n" $maxcycle
+             printf "      new catalog has cycle number $maxcycle \n"
+          fi
+       else
+          printf "      append to cycle number $maxcycle \n"
        fi
     fi
Index: palm/trunk/SCRIPTS/compile_tutorial
===================================================================
--- palm/trunk/SCRIPTS/compile_tutorial	(revision 4901)
+++ 	(revision )
@@ -1,185 +1,0 @@
-#!/bin/ksh
-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 1046 2012-11-09 14:38:45Z maronga
-# code put under GPL (PALM 3.9)
-#
-# Typo removed
-# 981 2012-08-09 14:57:44Z maronga
-#
-# 915 2012-05-30 15:11:11Z maronga
-# Initial revision
-#
-# Description:
-# ------------
-# This script compiles all LaTeX files that are located in TUTORIAL/SOURCE/.
-# Three PDFs are generated for each source file: 
-# the lecture version has a step-by-step layout, the handout version contains 
-# lines for notes, the web version can contain additional comments by the 
-# authors and has no step-by-step layout.
-# If a file is given as input parameter, only this file will be compiled.
-#
-# Execution:
-# ----------
-# compile_tutorial                 --> compiles all *.tex files in directory.
-# compile_tutorial -f filename.tex --> compiles filename.tex only.
-#------------------------------------------------------------------------------!
-
-    cycles=3
-    debug=false
-    file=""
-
-    full_name=`readlink -f $0`
-    directory="$(dirname $full_name)/../TUTORIAL/SOURCE"
-    output_dir="$(dirname $full_name)/../TUTORIAL"
-    cd $directory
-
-    while  getopts  :df: option
-    do
-       case  $option  in
-          (d)   debug=true;;
-          (f)   file=$OPTARG;;
-          (\?)  printf "\n  +++ unknown option $OPTARG \n"
-                printf "\n  --> type \"$0 ?\" for available options \n"
-                locat=parameter;exit;;
-       esac
-    done
-
-    shift OPTIND-1
-
-
-#   Print help
-    if [[ "$1" = "?" ]]
-    then
-       (printf "\n  *** compile_tutorial can be called as follows:\n"
-        printf "\n     compile_tutorial  -d  -f..\n"
-        printf "\n     Description of available options:\n"
-        printf "\n      Option      Description                                 Default-Value"
-        printf "\n        -d        show all debug output                               false"
-        printf "\n        -f        Filename (single file compilation mode)                \"\""
-        printf "\n         ?        this outline \n\n") | more
-        exit
-    fi
-
-    if [[ "$file" != "" ]] then
-       file_list=`readlink -f $(basename $file)`
-    else
-       file_list="$directory/*.tex"
-    fi
-
-
-    if [[ ! -d $output_dir/LECTURE ]] then
-       printf " $output_dir/LECTURE will be created.\n"
-       mkdir -p $output_dir/LECTURE
-    fi
-
-    if [[ ! -d $output_dir/HANDOUT ]] then
-       printf " $output_dir/HANDOUT will be created.\n"
-       mkdir -p $output_dir/HANDOUT
-    fi
-
-    if [[ ! -d $output_dir/WEB ]] then
-       printf " $output_dir/WEB will be created.\n"
-       mkdir -p $output_dir/WEB
-    fi
-
-    for i in $file_list;
-    do 
-       if [[ "$(echo $(basename $i)|cut -c1-6)" != "header" ]] then
-          printf "\n Compiling $i.\ Please wait..."
-
-#         Check if file exists
-          if [[ ! -f "$i" ]] then
-             printf " error."
-             printf "\n File $i does not exist. Skipping..."
-             break
-          fi
-
-          compiling_type="LECTURE"
-          for (( j=0; j<=2; j+=1 ))
-          do
-             rm -rf tmp_dir
-             mkdir tmp_dir
-             cp header_${compiling_type}.tex header_tmp.tex
-             for (( k=1; k<=$cycles; k+=1 ))
-             do
-                if ( $debug ) then
-                   printf "\n pdflatex output:\n\n\n"
-                   pdflatex -halt-on-error -output-directory=tmp_dir $i
-                   if [[ "$?" != "0" ]] 
-                   then
-                      printf "\n\n Compilation aborted. Please check your source code.\n"
-                      rm -rf tmp_dir
-                      exit
-                    fi
-                else
-                   pdflatex -halt-on-error -output-directory=tmp_dir $i  2>&1 > error_file
-
-                   if [[ "$?" != "0" ]] 
-                   then
-                      printf " error."
-                      printf "\n The following error occured during the compilation:\n\n\n"
-                      cat error_file |grep "Error"
-                      printf "\n\n Compilation aborted. Please check your source code.\n"
-                      rm -rf tmp_dir
-                      rm error_file
-                      exit
-                   fi
-                fi
-                mv tmp_dir/*.pdf $output_dir/$compiling_type
-             done
-             if [[ "$compiling_type" = "LECTURE" ]]
-             then
-                compiling_type="WEB"
-             elif [[ "$compiling_type" = "WEB" ]]
-             then
-                compiling_type="HANDOUT"
-             fi
-          done  
-          printf " done."
-       fi
-
-#      Cleaning up
-       if [[ -f header_tmp.tex ]] then
-          rm header_tmp.tex
-       fi
-       if [[ -f error_file ]] then
-          rm error_file
-       fi
-       if [[ -d tmp_dir ]] then
-          rm -rf tmp_dir
-       fi
-
-    done
-
-    printf "\n\n *** All actions finished.\n"
-
-exit
Index: palm/trunk/SCRIPTS/create_basic_static_driver.py
===================================================================
--- palm/trunk/SCRIPTS/create_basic_static_driver.py	(revision 4901)
+++ 	(revision )
@@ -1,465 +1,0 @@
-#!/usr/bin/env python3
-# -------------------------------------------------------------------- #
-# This file is part of the PALM model system.
-#
-# 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-2021 Leibniz Universitaet Hannover
-# -------------------------------------------------------------------- #
-
-import datetime
-import math
-import pytz
-
-from netCDF4 import Dataset
-import numpy as np
-
-
-class StaticDriver:
-    """This is an example script to generate static drivers for PALM.
-
-    You can use it as a starting point for creating your setup specific
-    driver.
-    """
-
-    def __init__(self):
-        """Open the static driver as netCDF4 file. Here, you have to
-        give the full path to the static driver that shall be created.
-        Existing file with same name is deleted.
-        """
-        print('Opening file...')
-        self.nc_file = Dataset('example_static_file.nc', 'w', format='NETCDF4')
-
-    def write_global_attributes(self):
-        """Write global attributes to static driver."""
-        print("Writing global attributes...")
-
-        # Optional global attributes
-        # --------------------------
-        self.nc_file.title = 'Example PALM static driver'
-        self.nc_file.author = 'PALM user'
-        self.nc_file.institution = 'Institut of Meteorology and Climatology,' \
-            'Leibniz University Hannover'
-        self.nc_file.comment = 'Generic crossing example'
-        self.nc_file.creation_date = \
-            pytz.utc.localize(datetime.datetime.utcnow()).strftime('%y-%m-%d %H:%M:%S %z')[:-2]
-        self.nc_file.history = ''
-        self.nc_file.keywords = 'example, PALM-4U'
-        self.nc_file.license = ''
-        self.nc_file.palm_version = ''
-        self.nc_file.references = ''
-        self.nc_file.source = 'PALM trunk'
-        self.nc_file.version = '1'
-
-        # Mandatory global attributes
-        # ---------------------------
-        self.nc_file.Conventions = 'CF-1.7'
-        self.nc_file.origin_lat = 52.50965  # (overwrite initialization_parameters)
-        self.nc_file.origin_lon = 13.3139  # Used to initialize Coriolis parameter
-        self.nc_file.origin_time = '2019-03-06 10:00:00 +00'
-        self.nc_file.origin_x = 3455249.0
-        self.nc_file.origin_y = 5424815.0
-        self.nc_file.origin_z = 0.0
-        self.nc_file.rotation_angle = 0.0
-
-    def define_dimensions(self):
-        """Set dimensions on which variables are defined."""
-        print("Writing dimensions...")
-
-        # Specify general grid parameters
-        # These values must equal to those set in the initialization_parameters
-        self.nx = 19
-        self.ny = 19
-        self.nz = 20
-        dx = 2
-        dy = 2
-        dz = 2
-
-        # Create soil grid (only relevant if land surface module is used)
-        dz_soil = np.array((0.01, 0.02, 0.04, 0.06, 0.14, 0.26, 0.54, 1.86))
-        zsoil_fullLayers = np.zeros_like(dz_soil)
-        zsoil_fullLayers = np.around(
-            [np.sum(dz_soil[:zs]) for zs in np.arange(1, len(dz_soil)+1)], 2)
-        zsoil_array = zsoil_fullLayers - dz_soil/2.
-
-        # Coordinates
-        # -----------
-        self.nc_file.createDimension('x', self.nx+1)
-        self.x = self.nc_file.createVariable('x', 'f4', ('x',))
-        self.x.long_name = 'distance to origin in x-direction'
-        self.x.units = 'm'
-        self.x.axis = 'X'
-        self.x[:] = np.arange(0, (self.nx+1)*dx, dx) + 0.5 * dx
-
-        self.nc_file.createDimension('y', self.ny+1)
-        self.y = self.nc_file.createVariable('y', 'f4', ('y',))
-        self.y.long_name = 'distance to origin in y-direction'
-        self.y.units = 'm'
-        self.y.axis = 'Y'
-        self.y[:] = np.arange(0, (self.ny+1)*dy, dy) + 0.5 * dy
-
-        # NOTE if your simulation uses a stretched vertical grid, you
-        # need to modify the z coordinates, e.g. z_array = (...)
-        z_array = np.append(0, np.arange(dz/2, (self.nz)*dz, dz))
-        self.nc_file.createDimension('z', self.nz+1)
-        self.z = self.nc_file.createVariable('z', 'f4', ('z',))
-        self.z.long_name = 'height above origin'
-        self.z.units = 'm'
-        self.z.axis = 'Z'
-        self.z.positive = 'up'
-        self.z[:] = z_array
-
-        zlad_array = self.z[:6]
-        self.nc_file.createDimension('zlad', len(zlad_array))
-        self.zlad = self.nc_file.createVariable('zlad', 'f4', ('zlad',))
-        self.zlad.long_name = 'height above ground'
-        self.zlad.units = 'm'
-        self.zlad.axis = 'Z'
-        self.zlad.positive = 'up'
-        self.zlad[:] = zlad_array
-
-        # self.nc_file.createDimension('zsoil', len(zsoil_array))
-        # self.zsoil = self.nc_file.createVariable('zsoil', 'f4', ('zsoil',))
-        # self.zsoil.long_name = 'depth in the soil'
-        # self.zsoil.units = 'm'
-        # self.zsoil.axis = 'Z'
-        # self.zsoil.positive = 'down'
-        # self.zsoil[:] = zsoil_array
-
-        # Other dimensions
-        # ----------------
-        # self.nc_file.createDimension('nalbedo_pars', 3)
-        # self.nalbedo_pars = self.nc_file.createVariable(
-        #     'nalbedo_pars', 'i4', ('nalbedo_pars',))
-        # self.nalbedo_pars[:] = np.arange(8)
-        #
-        # self.nc_file.createDimension('nbuilding_pars', 46)
-        # self.nbuilding_pars = self.nc_file.createVariable(
-        #     'nbuilding_pars', 'i4', ('nbuilding_pars',))
-        # self.nbuilding_pars[:] = np.arange(46)
-        #
-        # self.nc_file.createDimension('npavement_pars', 4)
-        # self.npavement_pars = self.nc_file.createVariable(
-        #     'npavement_pars', 'i4', ('npavement_pars',))
-        # self.npavement_pars[:] = np.arange(4)
-        #
-        # self.nc_file.createDimension('npavement_subsurface_pars', 2)
-        # self.npavement_subsurface_pars = self.nc_file.createVariable(
-        #     'npavement_subsurface_pars', 'i4', ('npavement_subsurface_pars',))
-        # self.npavement_subsurface_pars[:] = np.arange(2)
-        #
-        # self.nc_file.createDimension('nsoil_pars', 8)
-        # self.nsoil_pars = self.nc_file.createVariable(
-        #     'nsoil_pars', 'i4', ('nsoil_pars',))
-        # self.nsoil_pars[:] = np.arange(8)
-        #
-        self.nc_file.createDimension('nsurface_fraction', 3)
-        self.nsurface_fraction = self.nc_file.createVariable(
-            'nsurface_fraction', 'i4', ('nsurface_fraction',))
-        self.nsurface_fraction[:] = np.arange(3)
-
-        # self.nc_file.createDimension('nvegetation_pars', 12)
-        # self.nvegetation_pars = self.nc_file.createVariable(
-        #     'nvegetation_pars', 'i4', ('nvegetation_pars',))
-        # self.nvegetation_pars[:] = np.arange(12)
-        #
-        # self.nc_file.createDimension('nwater_pars', 6)
-        # self.nwater_pars = self.nc_file.createVariable(
-        #     'nwater_pars', 'i4', ('nwater_pars',))
-        # self.nwater_pars[:] = np.arange(7)
-
-    def define_variables(self):
-        """Define variables for the static driver.
-
-        Be aware that some variables depend on others. For a description
-        of each variable, please have a look at the documentation at
-        palm.muk.uni-hannover.de/trac/wiki/doc/app/iofiles/pids/static
-
-        An example of how you modify the variables is given below:
-
-        building_2d_array = np.ones((self.ny+1, self.nx+1)) * -9999.0
-        south_wall, north_wall, left_wall, right_wall = 20, 25, 20, 25
-        building_2d_array[
-            south_wall:north_wall,
-            left_wall:right_wall
-            ] = 50
-        nc_buildings_2d = self.nc_file.createVariable(
-            'buildings_2d', 'f4', ('y', 'x'), fill_value=-9999.0)
-        nc_buildings_2d.lod = 1
-        nc_buildings_2d[:, :] = building_2d_array
-        """
-        print("Writing variables...")
-
-        # Topography set-up
-        # -----------------
-        nc_building_id = self.nc_file.createVariable(
-            'building_id', 'i4', ('y', 'x'), fill_value=-9999)
-        nc_building_id.long_name = "building id number"
-        nc_building_id.units = "1"
-        nc_building_id[:, :] = nc_building_id._FillValue
-
-        nc_buildings_2d = self.nc_file.createVariable(
-            'buildings_2d', 'f4', ('y', 'x'), fill_value=-9999.0)
-        nc_buildings_2d.long_name = "building height"
-        nc_buildings_2d.units = "m"
-        nc_buildings_2d.lod = np.int32(1)
-        nc_buildings_2d[:, :] = nc_buildings_2d._FillValue
-
-        nc_buildings_3d = self.nc_file.createVariable(
-            'buildings_3d', 'i1', ('z', 'y', 'x'), fill_value=-127)
-        nc_buildings_3d.long_name = "building flag"
-        nc_buildings_3d.units = "1"
-        nc_buildings_3d.lod = np.int32(2)
-        nc_buildings_3d[:, :, :] = nc_buildings_3d._FillValue
-
-        nc_zt = self.nc_file.createVariable(
-            'zt', 'f4', ('y', 'x'), fill_value=-9999.0)
-        nc_zt.long_name = 'terrain height'
-        nc_zt.units = 'm'
-        nc_zt[:, :] = nc_zt._FillValue
-
-        # nc_z0 = self.nc_file.createVariable(
-        #     'z0', 'f4', ('y', 'x'), fill_value=-9999.0)
-        # nc_z0.long_name = 'roughness length for momentum'
-        # nc_z0.units = 'm'
-        # nc_z0[:, :] = nc_z0._FillValue
-
-        # Main surface clasification
-        # --------------------------
-        # nc_albedo_type = self.nc_file.createVariable(
-        #     'albedo_type', 'f4', ('y', 'x'), fill_value=-9999.0)
-        # nc_albedo_type.long_name = "albedo type"
-        # nc_albedo_type.units = "1"
-        # nc_albedo_type[:, :] = nc_albedo_type._FillValue
-        #
-        nc_building_type = self.nc_file.createVariable(
-            'building_type', 'i1', ('y', 'x'), fill_value=-127)
-        nc_building_type.long_name = "building type classification"
-        nc_building_type.units = "1"
-        nc_building_type[:, :] = nc_building_type._FillValue
-
-        nc_pavement_type = self.nc_file.createVariable(
-            'pavement_type', 'i1', ('y', 'x'), fill_value=-127)
-        nc_pavement_type.long_name = "pavement type classification"
-        nc_pavement_type.units = "1"
-        nc_pavement_type[:, :] = nc_pavement_type._FillValue
-
-        nc_soil_type = self.nc_file.createVariable(
-            'soil_type', 'i1', ('y', 'x'), fill_value=-127)
-        nc_soil_type.long_name = "soil type classification"
-        nc_soil_type.units = "1"
-        nc_soil_type.lod = np.int32(1)
-        nc_soil_type[:, :] = nc_soil_type._FillValue
-
-        # NOTE alternatively, define different soil types for different
-        # soil layers
-        # nc_soil_type = self.nc_file.createVariable(
-        #     'soil_type', 'i1', ('zsoil', 'y', 'x'), fill_value=-127)
-        # nc_soil_type.long_name = "soil type"
-        # nc_soil_type.units = "1"
-        # nc_soil_type.lod = np.int32(2)
-        # nc_soil_type[:, :, :] = nc_soil_type._FillValue
-        #
-        # nc_street_crossing = self.nc_file.createVariable(
-        #     'street_crossing', 'i1', ('y', 'x'),
-        #     fill_value=-127)
-        # nc_street_crossing.long_name = "street crossing"
-        # nc_street_crossing.units = "1"
-        # nc_street_crossing.valid_range = np.byte(1)
-        # nc_street_crossing[:, :] = nc_street_crossing._FillValue
-        #
-        nc_street_type = self.nc_file.createVariable(
-            'street_type', 'i1', ('y', 'x'),
-            fill_value=-127)
-        nc_street_type.long_name = "street type classification"
-        nc_street_type.units = "1"
-        nc_street_type[:, :] = nc_street_type._FillValue
-
-        nc_surface_fraction = self.nc_file.createVariable(
-            'surface_fraction', 'f4', ('nsurface_fraction', 'y', 'x'), fill_value=-9999.0)
-        nc_surface_fraction.long_name = "surface fraction"
-        nc_surface_fraction.units = "1"
-        nc_surface_fraction[0, :, :] = nc_surface_fraction._FillValue  # vegetation fraction
-        nc_surface_fraction[1, :, :] = nc_surface_fraction._FillValue  # pavement fraction
-        nc_surface_fraction[2, :, :] = nc_surface_fraction._FillValue  # water fraction
-
-        nc_vegetation_type = self.nc_file.createVariable(
-            'vegetation_type', 'i1', ('y', 'x'), fill_value=-127)
-        nc_vegetation_type.long_name = "vegetation type classification"
-        nc_vegetation_type.units = "1"
-        nc_vegetation_type[:, :] = nc_vegetation_type._FillValue
-
-        nc_water_type = self.nc_file.createVariable(
-            'water_type', 'i1', ('y', 'x'), fill_value=-127)
-        nc_water_type.long_name = "water type classification"
-        nc_water_type.units = "1"
-        nc_water_type[:, :] = nc_water_type._FillValue
-
-        # Pixel-based surface and sub-surface parameters
-        # ----------------------------------------------
-        # nc_albedo_pars = self.nc_file.createVariable(
-        #     'albedo_pars', 'f4', ('nalbedo_pars', 'y', 'x'), fill_value=-9999.0)
-        # nc_albedo_pars.long_name = 'albedo parameters'
-        # nc_albedo_pars[:, :, :] = nc_albedo_pars._FillValue
-        #
-        # nc_building_pars = self.nc_file.createVariable(
-        #     'building_pars', 'f4', ('nbuilding_pars', 'y', 'x'), fill_value=-9999.0)
-        # nc_building_pars.long_name = 'building parameters'
-        # nc_building_pars[:, :, :] = nc_building_pars._FillValue
-        #
-        # nc_pavement_pars = self.nc_file.createVariable(
-        #     'pavement_pars', 'f4', ('npavement_pars', 'y', 'x'), fill_value=-9999.0)
-        # nc_pavement_pars.long_name = "pavement parameters"
-        # nc_pavement_pars[:, :, :] = nc_pavement_pars._FillValue
-        #
-        # nc_pavement_subsurface_pars = self.nc_file.createVariable(
-        #     'pavement_subsurface_pars', 'i1',
-        #     ('npavement_subsurface_pars','zsoil', 'y', 'x'), fill_value=-9999.0)
-        # nc_pavement_subsurface_pars.long_name = "pavement subsurface parameters"
-        # nc_pavement_subsurface_pars[:, :, :, :] = nc_pavement_subsurface_pars._FillValue
-        #
-        # nc_soil_pars = self.nc_file.createVariable(
-        #     'soil_pars', 'f', ('nsoil_pars','zsoil', 'y', 'x'), fill_value=-9999.0)
-        # nc_soil_pars.long_name = "soil parameters"
-        # nc_soil_pars.lod = np.int32(2) # if set to 1, adjust dimensions of soil_pars
-        # nc_soil_pars[:, :, :, :] = nc_soil_pars._FillValue
-        #
-        # nc_vegetation_pars = self.nc_file.createVariable(
-        #     'vegetation_pars', 'f', ('nvegetation_pars', 'y', 'x'), fill_value=-9999.0)
-        # nc_vegetation_pars.long_name = 'vegetation parameters'
-        # nc_vegetation_pars[:, :, :] = nc_vegetation_pars._FillValue
-        #
-        # nc_water_pars = self.nc_file.createVariable(
-        #     'water_pars', 'i1', ('nwater_pars', 'y', 'x'), fill_value=-9999.0)
-        # nc_water_pars.long_name = "water parameters"
-        # nc_water_pars[:, :, :] = nc_water_pars._FillValue
-
-        # Vegetation parameters
-        # ---------------------
-        nc_lad = self.nc_file.createVariable(
-            'lad', 'f4', ('zlad', 'y', 'x'), fill_value=-9999.0)
-        nc_lad.long_name = "leaf area density"
-        nc_lad.units = "m2 m-3"
-        nc_lad[:, :, :] = nc_lad._FillValue
-
-        # nc_bad = self.nc_file.createVariable(
-        #     'bad', 'f4', ('zlad', 'y', 'x'), fill_value=-9999.0)
-        # nc_bad.long_name = "basal area density"
-        # nc_bad.units = "m2 m-3"
-        # nc_bad[:, :, :] = nc_bad._FillValue
-        #
-        # nc_root_area_dens_r = self.nc_file.createVariable(
-        #     'root_area_dens_s', 'f4', ('zsoil', 'y', 'x'), fill_value=-9999.0)
-        # nc_root_area_dens_r.long_name = 'root area density of resolved vegetation'
-        # nc_root_area_dens_r.units = '1'
-        # nc_root_area_dens_r[:, :, :] = nc_root_area_dens_r._FillValue
-        #
-        # nc_root_area_dens_s = self.nc_file.createVariable(
-        #     'root_area_dens_s', 'f4', ('zsoil', 'y', 'x'), fill_value=-9999.0)
-        # nc_root_area_dens_s.long_name = 'root area density of parameterized vegetation'
-        # nc_root_area_dens_s.units = '1'
-        # nc_root_area_dens_s[:, :, :] = nc_root_area_dens_s._FillValue
-        #
-        # nc_tree_id = self.nc_file.createVariable(
-        #     'tree_id', 'i4', ('y', 'x'), fill_value=-9999.0)
-        # nc_tree_id.long_name = "tree id"
-        # nc_tree_id.units = "1"
-        # nc_tree_id[:, :, :] = nc_tree_id._FillValue
-
-        # Set topography
-        # --------------
-        nc_building_id[:5, :5] = 1
-        nc_building_id[-5:, :5] = 2
-        nc_building_id[:5, -5:] = 3
-        nc_building_id[-5:, -5:] = 4
-
-        nc_buildings_2d[:, :] = np.where(
-            nc_building_id[:, :] > nc_building_id._FillValue,
-            nc_building_id[:, :] * 10.0,
-            nc_buildings_2d[:, :])
-
-        for k in range(self.nz+1):
-            nc_buildings_3d[k, :, :] = np.where(nc_buildings_2d[:, :] > self.z[k], 1, 0)
-
-        nc_zt[:, :] = 4.0
-
-        # Set surface types
-        # -----------------
-        nc_building_type[:, :] = np.where(
-            nc_building_id[:, :] > nc_building_id._FillValue,
-            nc_building_id[:, :] * 1,
-            nc_building_type[:, :])
-
-        nc_pavement_type[9:11, :5] = 1
-        nc_pavement_type[:, 7:13] = 2
-
-        nc_vegetation_type[:, 5:7] = 3
-        nc_vegetation_type[:, 13:15] = 3
-        nc_vegetation_type[5:15, 15:] = 3
-        nc_vegetation_type[7:9, 15:17] = 1
-        nc_vegetation_type[11:13, 15:17] = 1
-
-        nc_water_type[5:9, :5] = 2
-        nc_water_type[11:15, :5] = 2
-
-        nc_soil_type[:, :] = np.where(
-            nc_vegetation_type[:, :] > nc_vegetation_type._FillValue,
-            2,
-            nc_soil_type[:, :])
-        nc_soil_type[:, :] = np.where(
-            nc_pavement_type[:, :] > nc_pavement_type._FillValue,
-            2,
-            nc_soil_type[:, :])
-
-        nc_street_type[:, :] = np.where(nc_pavement_type[:, :] == 1, 11, nc_street_type[:, :])
-        nc_street_type[:, :] = np.where(nc_pavement_type[:, :] == 2, 13, nc_street_type[:, :])
-
-        nc_surface_fraction[0, :, :] = np.where(
-            nc_building_id[:, :] > nc_building_id._FillValue,
-            nc_surface_fraction[0, :, :],
-            0)
-        nc_surface_fraction[2, :, :] = nc_surface_fraction[1, :, :] = nc_surface_fraction[0, :, :]
-        nc_surface_fraction[0, :, :] = np.where(
-            nc_vegetation_type[:, :] > nc_vegetation_type._FillValue,
-            1,
-            nc_surface_fraction[0, :, :])
-        nc_surface_fraction[1, :, :] = np.where(
-            nc_pavement_type[:, :] > nc_pavement_type._FillValue,
-            1,
-            nc_surface_fraction[1, :, :])
-        nc_surface_fraction[2, :, :] = np.where(
-            nc_water_type[:, :] > nc_water_type._FillValue,
-            1,
-            nc_surface_fraction[2, :, :])
-
-        # Set vegetation
-        # --------------
-        lad_profile = [0.0, 0.01070122, 0.1070122, 0.3130108, 0.3879193, 0.1712195]
-        for k in range(len(self.zlad)):
-            nc_lad[k, 7:9, 15:17] = lad_profile[k]
-            nc_lad[k, 11:13, 15:17] = lad_profile[k]
-
-    def finalize(self):
-        """Close file."""
-        print("Closing file...")
-
-        self.nc_file.close()
-
-
-if __name__ == '__main__':
-    driver = StaticDriver()
-    driver.write_global_attributes()
-    driver.define_dimensions()
-    driver.define_variables()
-    driver.finalize()
Index: palm/trunk/SCRIPTS/cut_empty_timesteps.py
===================================================================
--- palm/trunk/SCRIPTS/cut_empty_timesteps.py	(revision 4901)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#!/usr/bin/env python3
-
-import subprocess
-import os
-import sys
-import netCDF4
-from netCDF4 import Dataset, stringtochar
-import numpy as np
-
-
-def cut(input_path, output_path):
-    """Cycle through all netCDF files within input_path and remove all
-    empty time levels. Output is saved in output_path"""
-
-    if not os.path.isdir(input_path):
-        raise OSError("Error: input path does not exist: {0}".format(input_path))
-    if not os.path.isdir(output_path):
-        os.makedirs(output_path)
-
-    list_input_data = \
-        [file for file in os.listdir(input_path) if os.path.splitext(file)[1] == '.nc']
-
-    for nc_file in list_input_data:
-        file_in = input_path + "/" + nc_file
-        ncfile = Dataset(file_in, "r", format="NETCDF4", encoding='ascii')
-        time_dim = ncfile.dimensions["time"]
-        time_var = ncfile.variables["time"][:]
-        time_mask = ~np.ma.getmaskarray(time_var)
-
-        print("process file ", file_in)
-        if not time_dim.isunlimited() and any(time_mask):
-            start_index = np.where(time_mask)[0][0]
-            end_index = np.where(time_mask)[0][-1]
-            file_out = output_path + "/" + nc_file
-
-            ncks_command = "ncks -O -d time,{0},{1} {2} {3}".format(
-                start_index,
-                end_index,
-                file_in,
-                file_out,
-                )
-
-            ncks_output = subprocess.run(
-                ncks_command,
-                stdout=subprocess.PIPE,
-                stderr=subprocess.STDOUT,
-                shell=True
-                )
-
-            if ncks_output.returncode != 0:
-                raise RuntimeError("Error: {0}".format(ncks_output.stdout))
-
-
-if __name__ == '__main__':
-    arg_list = sys.argv
-    if arg_list.__len__() == 3:
-        input_path = arg_list[1]
-        output_path = arg_list[2]
-        cut(input_path, output_path)
-    else:
-        sys.exit('Arguments are missing! ' +
-                 'Usage:\n cut_empty_timesteps.py <input_path> <output_path>')
Index: palm/trunk/SCRIPTS/document_changes
===================================================================
--- palm/trunk/SCRIPTS/document_changes	(revision 4901)
+++ 	(revision )
@@ -1,297 +1,0 @@
-#!/bin/bash
-#------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021 Leibniz Universitaet Hannover
-#------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Do not add whitespaces at current-revision section
-#
-# 4481 2020-03-31 18:55:54Z maronga
-# Bugfix for copyright updates
-#
-# 4370 2020-01-10 14:00:44Z raasch
-# script made bash compatible
-#
-# 3665 2019-01-10 08:28:24Z raasch
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2235 2017-05-31 08:03:49Z maronga
-# Changed the submission procedure in order to reduce the number of required
-# commits to one per change.
-#
-# 2117 2017-01-16 16:28:44Z maronga
-#
-# 1827 2016-04-07 12:12:23Z maronga
-# Added note that the script does not work on MAC OS
-#
-# 1813 2016-04-06 09:38:56Z maronga
-# Added update of the copyright statements in the file headers.
-#
-# 1810 2016-04-05 20:25:29Z maronga
-# document_changes now checks all subdirectories. Modified printing to screen.
-#
-# 1804 2016-04-05 16:30:18Z maronga
-# Removed printing of "this is an alpha version"
-#
-# 1326 2014-03-21 10:44:31Z maronga
-# Initial revision
-#
-# Description:
-# ------------
-# This tool moves text from "Current Revisions:" to "Former Revisions:" and
-# adds the svn timestamp. It works with the folders SOURCE and SCRIPTS
-#
-# Usage:
-# a) go to the source directory (e.g. current_version/trunk and perform:
-#    "document_changes",
-# b) or call "document_changes" directly and add the path to the source code as
-#    argument
-#    (e.g. document_changes trunk)
-#
-# Note:
-# The script will only work properly if the two following conditions are met:
-# 1) the 2nd line after "Current Revisions:" must contain text,
-# 2) the last line before "Former Revisions:" must not contain text.
-#------------------------------------------------------------------------------#
-
-#
-#-- define variables
-    comments=""         #: variable contains the CR text
-    comment_char=="!"   #: comment character
-    count_changes=0     #: count the number of files with CR text
-    count_updates=0     #: count the number of files with copyright update
-    count_files=0       #: count the number of files
-    fn=""               #: current file name to be scanned
-    file_firstchar=""   #: first character of filename
-    file_lastchar=""    #: last character of filename
-    file_extension=""   #: filename extension
-    found_comment=false #: true/false if a CR text was found
-    IFS=''              #: set standard delimiter to empty string
-    input_dir=""        #: directory of the source code
-    line=""             #: containts the current line of filename
-    line_count=0        #: counter to the line no. of the file
-    line_start=9999999  #: line no. where CR text starts
-    line_stop=0         #: line no. where CR text ends
-    line_tmp=""         #: first 19 characters of line
-    list_delete=""      #: contains the line no. that must be deleted from CR
-    timestamp=""        #: the svn timestamp of the file
-    current_year=$(date +"%Y")
-
-#
-#-- get input directory
-    input_dir=$1
-    if  [[ "$input_dir" == "" ]]
-    then
-       input_dir=`pwd`
-    fi
-
-    printf "\n"
-    printf "#------------------------------------------------------------------------# \n"
-    printf "| \e[1mdocument_changes\e[0m                                                       | \n"
-    printf "|                                                                        | \n"
-    printf "| This tool moves the change comments in the all PALM file headers from  | \n"
-    printf "| 'Current revisions' to 'Former revisions' and saves the time stamp.    | \n"
-    printf "#------------------------------------------------------------------------# \n"
-
-    printf "\n  *** Checking files in $input_dir and all recursive subdirectories...\n"
-
-
-#
-#-- scan all (sub-)directories for files.
-    IFS=$'\n';
-    for fn in $(find $input_dir -not -name '*.pdf'  -and -not -name '*.x'      \
-                           -and -not -name '*.eps'  -and -not -name '*.png'    \
-                           -and -not -name '*.svn*' -and -not -name '*~'       \
-                           -and -not -name '*.tar'  -and -not -type d ); do
-
-#
-#--    exclude invisible files
-       file_firstchar=${fn:0:1}
-       file_lastchar=`echo -n $fn| tail -c -1`
-       file_extension=${fn##*.}
-       if [[ "$file_firstchar" == "." ]]
-       then
-          continue
-       fi
-
-       (( count_files = count_files + 1 ))
-
-       line_count=0
-       found_comment=false
-       list_delete=""
-       line_start=9999999
-       line_stop=0
-       comments=""
-
-#
-#--    read one line at a time and move revision comments
-       while read line
-       do
-
-          (( line_count = line_count + 1 ))
-          line_tmp=""
-          line_tmp=${line:2:17}
-
-#
-#--       check if stopping point is reached
-          if [[ $line_stop -eq 0 && "$line_tmp" == "Former revisions:" ]]
-          then
-             line_stop=$line_count
-          fi
-
-#
-#--       check if starting point is reached
-          if [[ $line_start -eq 9999999 && "$line_tmp" == "Current revisions" ]]
-          then
-             (( line_start = line_count + 2 ))
-             comment_char=${line:0:1}
-          fi
-
-#
-#--       read comment line
-          if [[ $line_count -ge $line_start && $line_stop -eq 0 ]]
-          then
-
-#
-#--          check for empty comments
-             line_no_space=`echo ${line:2:10} | sed -e 's/^[ \t]*//'`
-             if [[ $line_count -eq $line_start && "$line_no_space" != "" ]]
-             then
-
-
-                printf "\r%$(tput cols)s" " "
-                printf "\r  \e[1;92m*** Comments found in $fn\e[0m\n"
-
-                found_comment=true
-                cp $fn $fn~
-             fi
-
-#
-#--          when comments are found, save comment lines to $comments
-             if [[ "$found_comment" == true ]]
-             then
-                comments="$comments\n$line"
-                list_delete="$list_delete;${line_count}d"
-             fi
-          fi
-
-#
-#--       get the timestamp from the current revision
-          if [[ "$comments" != "" && $line_count -eq $line_stop+2 ]]
-          then
-            comments="$comment_char $line$comments"
-            timestamp=`echo $line | cut -d" " -s -f4-7`
-            timestamp_string="$comment_char $timestamp"
-          fi
-
-       done <"$fn"
-
-
-#
-#--    check for updates of the copyright statement
-       while read line
-       do
-
-          line_tmp=""
-          line_tmp2=""
-          line_tmp=${line:22:29}
-          line_tmp2=${line:2:10}
-
-          if  [[ "$line_tmp2" == "Copyright " ]]
-          then
-             year_in_file1=${line:12:4}
-             year_in_file2=${line:17:4}
-             institution=${line:22}
-
-             if  [[ "$year_in_file2" != "$current_year" ]]
-             then
-                printf "\r%$(tput cols)s" " "
-                printf "\r  \e[1;33m*** Copyright update required in $fn\e[0m\n"
-
-                comment_char=${line:0:1}
-                cp $fn $fn~
-
-                (( count_updates = count_updates + 1 ))
-                sed -i "s/$comment_char Copyright .*$institution/$comment_char Copyright $year_in_file1-$current_year $institution/" $fn
-
-             fi
-          fi
-
-       done <"$fn"
-
-       printf "\r%$(tput cols)s" " "
-       printf "\r\e[1m  *** Searched files: $count_files. Comments found: $count_changes. Copyright updates found: $count_updates\e[0m"
-
-#
-#--    move comments from current revisions to former revisions
-       if [[ "$found_comment" == true ]]
-       then
-
-          (( count_changes = count_changes + 1 ))
-
-#
-#--       remove leading \n characters in string
-          comments=${comments:2}
-
-#
-#--       fix old time stamp
-          (( line_time = line_stop + 2 ))
-          sed -i "${line_time}d" $fn
-          sed -i "${line_time}i$timestamp_string" $fn
-
-
-
-#
-#--       insert comments to Former Revisions
-          (( line_stop = line_stop + 2 ))
-          sed -i "${line_stop}i$comments" $fn
-
-
-
-#
-#--       delete comments from current revisions and insert two blank lines
-          list_delete=${list_delete#?}
-          sed -i "$list_delete" $fn
-          sed -i "${line_start}i${comment_char}" $fn
-          sed -i "${line_start}i${comment_char}" $fn
-
-       fi
-
-    done
-
-#
-#-- inform the user about the changes
-    printf "\r%$(tput cols)s" " "
-    printf "\r\e[1m  *** Searched files: $count_files. Comments found: $count_changes. Copyright updates found: $count_updates\e[0m. - \e[1;32mfinished.\e[0m\n\n"
-
-    if  [[ $count_changes -gt 0 ]]
-    then
-       printf "  *** You can now proceed with\n      \e[0;91msvn commit -m 'your commit message' trunk\e[0m\n"
-       printf "  *** Please do not forget to commit your changes in the changelog at\n      \e[0;91mhttps://palm.muk.uni-hannover.de/trac/wiki/doc/tec/changelog\e[0m!\n"
-    else
-        printf "  *** No comments found in files!\n"
-
-    fi
Index: palm/trunk/SCRIPTS/generate_documentation
===================================================================
--- palm/trunk/SCRIPTS/generate_documentation	(revision 4901)
+++ 	(revision )
@@ -1,98 +1,0 @@
-#!/bin/bash
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Corrected "Former revisions" section
-# svn propset keyword
-# 
-# 
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-# 
-# 1714 knoop
-# Initial revision
-# 
-#--------------------------------------------------------------------------------#
-# generate_documentation - script for generating the PALM code documentation
-#--------------------------------------------------------------------------------#
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
-  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-  SOURCE="$(readlink "$SOURCE")"
-  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
-done
-SCRIPT_LOCATION="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-working_dir=$(readlink -f "${SCRIPT_LOCATION}/../../")
-
-echo "Generating PALM source code documentation..."
-
-
-doc_dir=$working_dir/documentation
-
-# Checking for doxygen
-if type -t doxygen; then
-
-   # Removing old documentation
-   if [[ -d $doc_dir ]];then
-      echo "Remove old documentation"
-      rm -r $doc_dir
-   fi
-   # Generating HTML documentation
-   echo "found doxygen. Continuing..."
-   cd $SCRIPT_LOCATION
-   doxygen palm2doxygen.config
-   if [[ $? -ne 0 ]];then
-      echo "doxygen detected an error."
-      exit 1
-   fi
-   cd $doc_dir
-   doc_dir=$(pwd)
-   ln -s $(pwd)/html/index.html PALM_doc.html
-   echo "HTML source code documentation generated."
-   
-   # Checking for pdflatex
-   if type -t pdflatex; then
-   
-      # Generating PDF documentation
-      cd $doc_dir/latex
-      make pdf
-      cd $doc_dir
-      ln -s $(pwd)/latex/refman.pdf PALM_doc.pdf
-      echo "PDF source code documentation generated."
-   
-   else
-      echo "ERROR: pdflatex not found."
-      echo "Skipping PDF documentation generation. Terminating!"
-      exit 1
-   fi
-else
-   echo "ERROR: doxygen not found."
-   echo "Skipping PALM documentation generation. Terminating!"
-   exit 1
-fi
-
-echo "The PALM source code documentation is located in: $doc_dir"
-echo "Done."
Index: palm/trunk/SCRIPTS/inifor_script
===================================================================
--- palm/trunk/SCRIPTS/inifor_script	(revision 4901)
+++ 	(revision )
@@ -1,1621 +1,0 @@
-#!/bin/bash
-
-# inifor - The Mesoscale Interface for Initializing and Forcing PALM
-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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 2017-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# initial revision
-# 
-# 
-# 
-#--------------------------------------------------------------------------------#
-# inifor - script for running the inifor executable
-#--------------------------------------------------------------------------------#
-
-
- 
-    # DECLARATION OF VARIABLES AND THEIR DEFAULT VALUES
-
- set +o allexport    # SUPPRESS EXPORT OF ALL VARIABLES, SINCE IN THE PAST THIS
-                     # LEAD TO PROBLEMS IN ROUTINES CALLED BY PALMRUN
-                     # (TOO MANY ARGUMENTS - PROBLEM)
- set +o noclobber    # EXISTING FILES ARE ALLOWED TO BE OVERWRITTEN
-
- typeset -i  i iec=0
-
- activation_string_list="inifor"
- configuration_identifier="default"
- delete_temporary_catalog=true
- fileconnection_file=trunk/SCRIPTS/.palm.iofiles
- locat=normal
- run_identifier=test
- silent=false
- version="inifor  0.1 Rev$Rev$"
- working_directory=`pwd`
-
-
-    # ERROR HANDLING IN CASE OF EXIT
- trap 'if [[ $locat != normal  &&  $locat != control_c ]]
-       then
-
-              # CARRY OUT ERROR-COMMANDS GIVEN IN THE CONFIGURATION FILE (EC:)
-          (( i = 0 ))
-          while (( i < iec ))
-          do
-             (( i = i + 1 ))
-             printf "\n  *** Execution of ERROR-command:\n"
-             printf "  >>> ${err_command[$i]}\n"
-             eval  ${err_command[$i]}
-          done
-          [[ $delete_temporary_catalog = true ]]  &&  (cd; rm -rf $tempdir)
-          printf "\n\n+++ inifor crashed \n\n"
-          exit 1
-       elif [[ $locat != normal ]]
-       then
-          [[ $delete_temporary_catalog = true ]]  &&  (cd; rm -rf $tempdir)
-          printf "\n+++ inifor killed by \"^C\" \n\n"
-          exit 2
-       else
-          printf "\n --> inifor finished\n\n"
-          exit 0
-       fi' exit
-
-
-    # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C):
- trap 'locat=control_c
-       exit 1
-      ' 2
-
-
-    # READ SHELLSCRIPT-OPTIONS
-    # TODO: add additional inifor options
- while  getopts  :a:Bc:r:v  option
- do
-   case  $option  in
-       (a)   activation_string_list=$OPTARG;;
-       (B)   delete_temporary_catalog=false;;
-       (c)   configuration_identifier=$OPTARG;;
-       (r)   run_identifier=$OPTARG;;
-       (v)   silent=true;;
-       (\?)  printf "\n  +++ unknown option $OPTARG \n"
-             printf "\n  --> type \"$0 ?\" for available options \n"
-             locat=parameter;exit;;
-   esac
- done
-
-
-    # SKIP GIVEN OPTIONS TO READ POSITIONAL PARAMETER, IF GIVEN
-    # CURRENTLY ONLY PARAMETER ? (TO OUTPUT A SHORT COMMAND INFO) IS ALLOWED
- (( to_shift = $OPTIND - 1 ))
- shift $to_shift
-
-    # PRINT SHORT DESCRIPTION OF PALMRUN OPTIONS
-    # TODO: add description of additional inifor options
- if [[ "$1" = "?" ]]
- then
-   (printf "\n  *** Description of available palmrun options:\n"
-    printf "\n      Option  Description                              Default-Value"
-    printf "\n        -a    activation string list                   \"\" "
-    printf "\n        -c    configuration identifier                 \"default\" "
-    printf "\n        -r    run identifier                           test"
-    printf "\n        -v    no prompt for confirmation               ---"
-    printf "\n "
-    printf "\n      Possible values of positional parameter <modus>:"
-    printf "\n        \"?\"       -  this outline \n\n") | more
-    exit
- elif [[ "$1" != "" ]]
- then
-    printf "\n  +++ positional parameter $1 unknown \n"
-    locat=parameter; exit
- fi
-
-
-
-    # SHORT STARTING MESSAGE
- printf "\n*** $version "
- printf "\n    will be executed.     Please wait ..."
-
-
-    # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME
- config_file=.palm.config.$configuration_identifier
- sources_for_run_catalog=SOURCES_FOR_RUN_${configuration_identifier}_$run_identifier
-
-
-    # CHECK, IF CONFIGURATION FILE EXISTS
- if [[ ! -f $config_file ]]
- then
-
-    printf "\n\n  +++ configuration file: "
-    printf "\n           $config_file"
-    printf "\n      does not exist"
-    locat=connect; exit
-
- fi
-
-
-    # CHECK, IF USER PROVIDES OWN FILE CONNECTION FILE
- if [[ -f .palm.iofiles ]]
- then
-
-       # CHECK VERSION MISMATCH
-    if [[ $(head -n1 $fileconnection_file) != $(head -n1 .palm.iofiles) ]]
-    then
-       printf "\n\n  +++ WARNING: A file connection file has been found in your"
-       printf "\n               working directory, but its revision does not match"
-       printf "\n               the revision of the default (trunk) version."
-       printf "\n               You may need to update your connection file"
-       printf "\n               \"${working_directory}/.palm.iofiles\" !"
-    fi
-
-    fileconnection_file=.palm.iofiles
-
- fi
-
-
-    # CHECK, IF FILE CONNECTION FILE EXISTS
- if [[ ! -f $fileconnection_file ]]
- then
-    printf "\n\n  +++ file connection file: "
-    printf "\n           $fileconnection_file"
-    printf "\n      does not exist"
-    locat=connect; exit  
- fi
-
-
-    # CHECK, IF THE ACTIVATION_STRING_LIST HAS BEEN GIVEN
-    # TODO: I suggest to use/extend the .palm.iofiles file to set the inifor I/O files,
-    #       activation string could be "inifor"
- if [[ "$activation_string_list" = "" ]]
- then
-    printf "\n\n  +++ no activation string list given: "
-    printf "\n        please set palmrun option \"-a\" "
-    locat=palmrun_option; exit  
- fi
-
-
-    # READ AND EVALUATE THE CONFIGURATION-FILE
-    # TODO: we can think about if it is really required tio read and interpret the whole file
-    #       since many settings are not relevant for inifor. Instead, we could read only lines
-    #       inifor-specific variables are set (like it is done in palmbuild)
- [[ $silent = false ]]  &&  printf "\n\n    Reading the configuration file... "
-
-
-    # READ VARIABLE SETTINGS FROM CONFIG FILE LINE BY LINE
- while  read line
- do
-
-       # FIRST REPLACE ENVIRONMENT-VARIABLES BY THEIR RESPECTIVE VALUES
-    eval  line=\"$line\"
-
-
-       # INTERPRET THE LINE
-    if [[ "$(echo $line)" = "" ]]
-    then
-
-          # EMPTY LINE, NO ACTION
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "#" ]]
-    then
-
-          # LINE IS A COMMENT LINE
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "%" ]]
-    then
-
-          # LINE DEFINES AN ENVIRONMENT-VARIABLE
-       var=`echo $line | cut -d" " -s -f1 | cut -c2-`
-       value=`echo $line | cut -d" " -s -f2-`
-
-
-          # VALUE FROM THE CONFIGURATION-FILE IS ASSIGNED TO THE
-          # ENVIRONMENT-VARIABLE, BUT ONLY IF NO VALUE HAS BEEN ALREADY
-          # ASSIGNED WITHIN THIS SCRIPT (E.G. BY SCRIPT-OPTIONS).
-          # NON-ASSIGNED VARIABLES HAVE VALUE "" OR 0 (IN CASE OF INTEGER).
-          # HENCE THE GENERAL RULE IS: SCRIPT-OPTION OVERWRITES THE
-          # CONFIGURATION-FILE.
-       if [[ "$(eval echo \$$var)" = ""  ||  "$(eval echo \$$var)" = "0" ]]
-       then
-          eval  export  $var="\$value"
-
-             # TERMINAL OUTPUT OF ENVIRONMENT-VARIABLES, IF TRACEBACK IS SWITCHED on
-          if [[ $do_trace = true ]]
-          then
-             printf "\n*** ENVIRONMENT-VARIABLE $var = $value"
-          fi
-       fi
-
-    elif [[ "$(echo $line | cut -c1-3)" = "BD:" ]]
-    then
-
-          # LINE DEFINES BATCH-DIRECTIVE
-       (( ibd = ibd + 1 ))
-       line=$(echo $line | cut -c4-)
-       batch_directive[$ibd]="$line"
-
-    elif [[ "$(echo $line | cut -c1-4)" = "BDT:" ]]
-    then
-
-          # LINE DEFINES BATCH-DIRECTIVE FOR SENDING BACK THE JOBFILE FROM A
-          # REMOTE TO A LOCAL HOST
-       (( ibdt = ibdt + 1 ))
-       line=$(echo $line | cut -c5-)
-       batch_directive_transfer[$ibdt]="$line"
-
-    elif [[ "$(echo $line | cut -c1-3)" = "EC:" ]]
-    then
-
-          # LINE DEFINES ERROR-COMMAND
-       (( iec = iec + 1 ))
-       line=$(echo $line | cut -c4-)
-       err_command[$iec]="$line"
-
-    elif [[ "$(echo $line | cut -c1-3)" = "IC:" ]]
-    then
-
-          # LINE DEFINES INPUT-COMMAND
-       (( iic = iic + 1 ))
-       line=$(echo $line | cut -c4-)
-       in_command[$iic]="$line"
-
-    elif [[ "$(echo $line | cut -c1-3)" = "OC:" ]]
-    then
-
-          # LINE DEFINES OUTPUT-COMMAND
-       (( ioc = ioc + 1 ))
-       line=$(echo $line | cut -c4-)
-       out_command[$ioc]="$line"
-
-    else
-
-          # SKIP ALL OTHER LINES
-       continue
-
-    fi
-
- done < $config_file
-
-
-    # CHECK SETTING OF REQUIRED PARAMETERS
-    # TODO: we probably need to include such a line in the configuration file
- if [[ "$execute_command_inifor" = "" ]]
- then
-    printf "\n  +++ no execute command found for inifor in $config_file"
-    printf "\n      Please add line \"execute_command_inifor ...\" to that file."
-    locat=config_file; exit
- fi
-
-
-    # DETERMINE THE CALL STATUS
- if [[ "$remote_ip" != "" ]]
- then
-    run_on_remote=true
- else
-    run_on_remote=false
- fi
-
-
-    # READ AND EVALUATE THE I/O-FILE LIST
- [[ $silent = false ]]  &&  printf "\n    Reading the I/O files... "
-
-
-    # READ THE FILE CONNECTION FILE LINE BY LINE
- while  read line
- do
-
-       # REPLACE REPEATING SPACES BETWEEN THE COLUMNS BY A SINGLE SPACE
-       # HERE, TR IS USED INSTEAD OF SED TO GUARANTEE MAC COMPATIBILITY
-    line=`echo "$line" | tr -s " "`
-
-       # INTERPRET THE LINE
-    if [[ "$(echo $line)" = "" ]]
-    then
-          # EMPTY LINE, NO ACTION
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "#" ]]
-    then
-
-          # LINE IS A COMMENT LINE
-       true
-
-    else
-
-          # LINE DEFINES FILE CONNECTION. READ THE FILE ATTRIBUTES.
-          # s2a: in/out - field
-          # s2b: action - field (optional)
-       s1=`echo "$line" | cut -d" " -f1`
-       s2=`echo "$line" | cut -d" " -s -f2`
-       if [[ $(echo $s2 | grep -c ":") = 0 ]]
-       then
-          s2a=$s2
-          s2b=""
-       else
-          s2a=`echo $s2 | cut -d":" -f1`
-          s2b=`echo $s2 | cut -d":" -f2`
-       fi
-       s3=`echo "$line" | cut -d" " -f3 | sed 's/*/wildcard /g'`
-       s4=`echo "$line" | cut -d" " -s -f4`
-       eval s4=\"$s4\"    # REPLACE ENVIRONMENT-VARIABLES IN PATH BY THEIR RESPECTIVE VALUES
-       s5=`echo "$line" | cut -d" " -s -f5`
-       s6=`echo "$line" | cut -d" " -s -f6`
-
-       
-          # STORE FILE CONNECTION, IF ACTIVATED BY ACTIVATION-STRING FROM
-          # INPUT- OR OUTPUT-LIST.
-          # VARIABLE S3 MAY CONTAIN A LIST OF ACTIVATION STRINGS (FIELD-SEPERATOR ":").
-          # IF EXECUTION IS SCHEDULED FOR A REMOTE-MACHINE AND THE FILE IS ONLY
-          # LOCALLY REQUIRED ON THAT MACHINE (I.E. s2b != tr), THE FILE CONNECTION
-          # IS NOT CHECKED AND STORED.
-       IFSALT="$IFS"; IFS="$IFS:"      # ADD ":" AS FIELD SEPARATOR
-       if [[ ( "$s2a" = in  || "$s2a" = inopt )  &&  ! ( $create_remote_batch_job = true  &&  "$s2b" != tr ) ]]
-       then
-          found=false
-          for  actual  in  $activation_string_list
-          do
-             for  formal  in  $s3
-             do
-                [[ $actual = $formal  ||  "$formal" = "-" ]]  &&  found=true
-             done
-          done
-          if [[ $found = true ]]
-          then
-             (( iin = iin + 1 ))
-             localin_pre[$iin]=$s1; actionin_pre[$iin]=$s2b;
-             pathin_pre[$iin]=$s4; endin_pre[$iin]=$s5; extin_pre[$iin]=$s6
-             if [[ "$s2a" = inopt ]]
-             then
-                optin_pre[$iin]=yes
-             else
-                optin_pre[$iin]=no
-             fi 
-
-                # FILES WITH JOB-ATTRIBUTE ARE STORED IN THE SOURCES_FOR_RUN
-                # FOLDER IF THE JOB IS RUNNING ON A REMOTE HOST
-             if [[ $running_on_remote = true  &&  "$s2b" = tr ]]
-             then
-                pathin_pre[$iin]=${fast_io_catalog}/${sources_for_run_catalog}
-             fi
-
-                # CHECK FOR MULTIPLE FILES, SET A RESPECTIVE FLAG AND REMOVE
-                # THE WILDCARD FROM THE ENDING
-             if [[ "${s5: -1}" = "*" ]]
-             then
-                if [[ "$s2b" = "di" ]]
-                then
-                   printf "\n    +++ wildcards (*) not allowed with \"di\" file attribute."
-                   printf "\n        see file \"$fileconnection_file\", line"
-                   printf "\n$line"
-                   locat=iofiles_file; exit
-                fi
-                multin[$iin]=true
-                string=${endin_pre[$iin]}
-                endin_pre[$iin]="${string%?}"
-             else
-                multin[$iin]=false
-             fi
-          fi
-       elif [[ "$s2a" = out  &&  ! ( $create_remote_batch_job = true ) ]]
-       then
-          found=false
-          for  actual  in  $activation_string_list
-          do
-             for  formal  in  $s3  
-             do
-                [[ $actual = $formal  ||  $formal = wildcard  ]]  &&  found=true
-             done
-          done
-          if [[ $found = true ]]
-          then
-             (( iout = iout + 1 ))
-             localout_pre[$iout]=$s1; actionout_pre[$iout]=$s2b
-             pathout_pre[$iout]=$s4; endout_pre[$iout]=$s5; extout_pre[$iout]=$s6
-
-                # CHECK IF WILDCARD IS USED AS ACTIVATION STRING
-                # IN SUCH CASES, NO WARNING WILL LATER BE OUTPUT IF LOCAL FILES DO NOT EXIST
-             if [[ $formal = wildcard  ]]
-             then
-                warnout_pre[$iout]=false
-             else
-                warnout_pre[$iout]=true
-             fi
-
-                # CHECK FOR MULTIPLE FILES, SET A RESPECTIVE FLAG AND REMOVE
-                # THE WILDCARD FROM THE LOCAL FILENAME
-             if [[ "${s1: -1}" = "*" ]]
-             then
-                if [[ "$s2b" = "di" ]]
-                then
-                   printf "\n    +++ wildcards (*) not allowed with \"di\" file attribute."
-                   printf "\n        see file \"$fileconnection_file\", line"
-                   printf "\n$line"
-                   locat=iofiles_file; exit
-                fi
-                multout[$iout]=true
-                string=${localout_pre[$iout]}
-                localout_pre[$iout]="${string%?}"
-             else
-                multout[$iout]=false
-             fi
-          fi
-       elif [[ "$s2a" != in  &&  "$s2a" != inopt  &&  "$s2a" != out ]]
-       then
-          printf "\n  +++ I/O-attribute in file $fileconnection_file has invalid"
-          printf "\n      value \"$s2\". Only \"in\", \"inopt\", and \"out\" are allowed!"
-          locat=connect; exit
-       fi
-       IFS="$IFSALT"
-    fi
-
- done < $fileconnection_file
-
-
-
-    # VALUES OF INIFOR-OPTIONS OVERWRITE THOSE FROM THE CONFIGURATION-FILE
-    # next line is just an example
-    # TODO: default values for inifor script options could be set in the configuration file
-    #       (if it makes sense)
- [[ "$inifor_cores"  != "" ]]  &&  cores=$inifor_cores
-
-
-
-    # CHECK IF INIFOR EXECUTABLE EXISTS
- if [[ $run_on_remote = false ]]
- then
- 
-    if [[ ! -f ${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}/inifor ]]
-    then
-       printf "\n  +++ no inifor executable found in folder"
-       printf "\n      \"${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}\" "
-       printf "\n      You may run \"palmbuild -c ${configuration_identifier}\" to create"
-       printf "\n      the utility routines."
-       locat=connect; exit
-    fi
-
- else
-
-    printf "\n  +++ remote call of inifor not realized yet"
-    locat=inifor_remote; exit
-
- fi
-
-
-
-    # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY
-    # (HANDED OVER TO RESTART-RUNS USING OPTION -G)
- if [[ "$global_revision" = "" ]]
- then
-    global_revision=`svnversion $source_path  2>/dev/null`
-    global_revision="Rev: $global_revision"
- fi
-
-
-
-    # SET PORT NUMBER OPTION FOR CALLS OF SSH/SCP AND batch_scp SCRIPT
- if [[ "$scp_port" != "" ]]
- then
-    PORTOPT="-P $scp_port"
-    SSH_PORTOPT="-p $scp_port"
- fi
-
-
-    # DETERMINE THE SSH-OPTION IN CASE THAT AN SSH-KEY IS EXPLICITLY GIVEN IN THE
-    # CONFIG-FILE
- if [[ "$ssh_key" != "" ]]
- then
-    ssh_key="-i $HOME/.ssh/$ssh_key"
- fi
-
-
-    # GENERATE FULL FILENAMES OF INPUT-FILES, INCLUDING THEIR PATH
-    # CHECK, IF INPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST)
- (( i = 0 ))
- (( nr_of_input_files = 0 ))
- while (( i < iin ))
- do
-    (( i = i + 1 ))
-
-       # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE
-       # FILE IDENTIFIER IS NOT PART OF THE FILENAME))
-    if [[ "${actionin_pre[$i]}" = di ]]
-    then
-       eval filename=${pathin_pre[$i]}/${endin_pre[$i]}
-    else
-       eval filename=${pathin_pre[$i]}/${run_identifier}${endin_pre[$i]}
-    fi
-
-
-       # CHECK IF FILE EXISTS
-    if ! ls $filename* 1>/dev/null 2>&1
-    then
-
-          # FILES WITH ATTRIBUTE opt ARE OPTIONAL. NO ABORT, IF THEY DO NOT EXIST.
-       if [[ "${optin_pre[$i]}" != "yes" ]]
-       then
-          printf "\n\n  +++ INPUT-file: "
-          if [[ "${extin_pre[$i]}" = ""  ||  "${extin_pre[$i]}" = " " ]]
-          then
-             printf "\n           $filename"
-          else
-             printf "\n           $filename.${extin_pre[$i]}"
-          fi
-          printf "\n      does not exist\n"
-          locat=input; exit
-       else
-          (( nr_of_input_files = nr_of_input_files + 1 ))
-          localin[$nr_of_input_files]="${localin_pre[$i]}"
-          optin[$nr_of_input_files]="${optin_pre[$i]}"
-          actionin[$nr_of_input_files]="unavailable"
-          pathin[$nr_of_input_files]="${pathin_pre[$i]}"
-          endin[$nr_of_input_files]="${endin_pre[$i]}"
-          extin[$nr_of_input_files]="${extin_pre[$i]}"
-       fi
-
-    else
-
-          # FIRST CHECK FOR MULTIPLE NAMES WITH THE SAME BASENAME
-          # ($run_identifier) AND CREATE A LIST FOR THE DETECTED BASENAME
-          # ENDINGS
-       if [[ "${multin[$i]}" = true ]]
-       then
-             # DETERMINE THE EXISTING EXTENSIONS FROM THE LIST OF FILES
-          ls -1 -d ${filename}    >   filelist  2>/dev/null
-          ls -1 -d ${filename}.*  >>  filelist  2>/dev/null
-          ls -1 -d ${filename}_*  >>  filelist  2>/dev/null
-
-          endings=""
-          while  read line
-          do
-                 # filename without path (i.e. after the last "/")
-              basefilename=$(basename ${line})
-
-                 # check if there is an extension and remove it
-              ext=${basefilename##*.}
-              if [[ "$ext" = "${extin_pre[$i]}" ]]
-              then
-                 basefilename=${basefilename%.*}
-              fi
-
-                 # check for an existing cycle number and remove it
-              cycle=${basefilename##*.}
-              if [[ $cycle =~ ^-?[0-9]+$ ]]
-              then
-                 basefilename=${basefilename%.*}
-              fi
-
-                 # remove the run_identifier from the beginning
-              length_run_identifier=${#run_identifier}
-              ending=${basefilename:${length_run_identifier}}
-
-                 # remove the ending given in the .iofiles from the beginning
-              endingstring="${endin_pre[$i]}"
-              length_ending=${#endingstring}
-              ending=${ending:${length_ending}}
-
-              if [[ "$ending" = "" ]]
-              then
-                    # standard ending as given in the .iofiles
-                 if [[ $(echo $endings | grep -c DEFAULT) = 0 ]]
-                 then
-                    endings="$endings DEFAULT"
-                 fi
-              else
-                    # ending must start with "_", otherwise its a different file
-                 if [[ "${ending:0:1}" = "_" ]]
-                 then
-                    if [[ $(echo $endings | grep -c "$ending") = 0 ]]
-                    then
-                       endings="$endings $ending"
-                    fi
-                 fi
-              fi
- 
-          done <filelist
-
-          rm filelist
-
-       else
-
-             # SINGLE NAME
-          endings=DEFAULT
-
-       fi
-
-          # FOR EACH BASENAME ENDING CREATE AN ENTRY IN THE FINAL INPUT FILE LIST
-       for  ending  in  $endings
-       do
-
-             # DEFAULT MEANS THAT THE ENDING GIVEN IN .iofiles SHALL BE USED
-          if [[ $ending = DEFAULT ]]
-          then
-             ending=""
-          fi
-
-             # NEW ENTRY (ENDING IS ALSO ADDED TO LOCAL FILENAME READ BY PALM!)
-          (( nr_of_input_files = nr_of_input_files + 1 ))
-          localin[$nr_of_input_files]="${localin_pre[$i]}"$ending
-          optin[$nr_of_input_files]="${optin_pre[$i]}"
-          actionin[$nr_of_input_files]="${actionin_pre[$i]}"
-          pathin[$nr_of_input_files]="${pathin_pre[$i]}"
-          endin[$nr_of_input_files]="${endin_pre[$i]}"$ending
-          extin[$nr_of_input_files]="${extin_pre[$i]}"
-
-
-             # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE
-             # FILE IDENTIFIER IS NOT PART OF THE FILENAME))
-          if [[ "${actionin[$nr_of_input_files]}" = di ]]
-          then
-             eval filename=${pathin[$nr_of_input_files]}/${endin[$nr_of_input_files]}
-          else
-             eval filename=${pathin[$nr_of_input_files]}/${run_identifier}${endin[$nr_of_input_files]}
-          fi
-
-             # DETERMINE THE FILE'S CYCLE NUMBER
-          (( maxcycle = 0 ))
-          ls -1 -d $filename    >   filelist  2>/dev/null
-          ls -1 -d $filename.*  >>  filelist  2>/dev/null
-          while  read line
-          do
-                 # filename without path (i.e. after the last "/")
-              basefilename=$(basename ${line})
-   
-                 # check if there is an extension
-              extension=${basefilename##*.}
-              if [[ "$extension" = "${extin[$nr_of_input_files]}" ]]
-              then
-                 basefilename=${basefilename%.*}
-              fi
-   
-                 # check for an existing cycle number
-              cycle=${basefilename##*.}
-              if [[ $cycle =~ ^-?[0-9]+$ ]]
-              then
-                    # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS
-                    # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10
-                 (( icycle = $((10#$cycle)) ))
-              else
-                 (( icycle = 0 ))
-              fi
-   
-              if (( icycle > maxcycle ))
-              then
-                 (( maxcycle = icycle ))
-   
-                    # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS
-                    # CHECK IF CYCLE NUMBER CONTAINS LEADING ZEROS
-                 if [[ $(echo $cycle | cut -c1) = 0 ]]
-                 then
-                    leading_zero=true
-                 else
-                    leading_zero=false
-                 fi
-              fi
-   
-          done <filelist
-          rm filelist
-   
-             # MAKE CYCLE NUMBER THREE DIGITS WIDE
-          if [[ $leading_zero = true ]]
-          then
-             cyclestring=`printf "%03d" $maxcycle`
-          else
-             cyclestring=$maxcycle
-          fi
-   
-             # APPEND CYCLE NUMBER TO FILENAME
-          if (( maxcycle > 0 ))
-          then
-             if [[ "${extin[$nr_of_input_files]}" != " "  &&   "${extin[$nr_of_input_files]}" != "" ]]
-             then
-                filename=${filename}.$cyclestring.${extin[$nr_of_input_files]}
-             else
-                filename=${filename}.$cyclestring
-             fi
-          else
-             if [[ "${extin[$nr_of_input_files]}" != " "  &&   "${extin[$nr_of_input_files]}" != "" ]]
-             then
-                filename=${filename}.${extin[$nr_of_input_files]}
-             fi
-          fi
-          
-             # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER,
-             # IS LATER USED FOR TRANSFERRING FILES WIHIN THE JOB (SEE END OF FILE)
-          absnamein[$nr_of_input_files]=$filename
-          if (( maxcycle > 0 ))
-          then
-             if [[ "${actionin[$nr_of_input_files]}" = di ]]
-             then
-                frelin[$nr_of_input_files]=${endin[$nr_of_input_files]}.$cyclestring
-             else
-                frelin[$nr_of_input_files]=${run_identifier}${endin[$nr_of_input_files]}.$cyclestring
-             fi
-          else
-             if [[ "${actionin[$nr_of_input_files]}" = di ]]
-             then
-                frelin[$nr_of_input_files]=${endin[$nr_of_input_files]}
-             else
-                frelin[$nr_of_input_files]=${run_identifier}${endin[$nr_of_input_files]}
-             fi
-          fi
-
-       done
-
-    fi
-
- done
-
-
-    # GENERATE FULL FILENAMES OF OUTPUT-FILES (WITHOUT $ OR ~),
-    # CHECK, IF OUTPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST),
-    # OR, IN CASE THAT FILE DOES NOT EXIST, CHECK, IF IT CAN BE CREATED  
-    # THESE ACTIONS ARE NOT CARRIED OUT, IF FILES SHALL BE TRANSFERRED FROM THE REMOTE TO
-    # THE LOCAL HOST (BECAUSE THEIR IS NO DIRECT ACCESS TO THE LOCAL DIRECTORIES FROM THE
-    # REMOTE HOST)
- (( i = 0 ))
- while (( i < iout ))
- do
-    (( i = i + 1 ))
-    if [[ ! ( $running_on_remote = true  &&  ( "${actionout_pre[$i]}" = tr || "${actionout_pre[$i]}" = tra || "${actionout_pre[$i]}" = trpe ) ) ]]
-    then
-       if [[ "${actionout_pre[$i]}" = tr ]]
-       then
-          actionout_pre[$i]=""
-       elif [[ "${actionout_pre[$i]}" = trpe ]]
-       then
-          actionout_pre[$i]=pe
-       elif [[ "${actionout_pre[$i]}" = tra ]]
-       then
-          actionout_pre[$i]=a
-       fi
-       (( maxcycle = 0 ))
-       eval filename=${pathout_pre[$i]}/${run_identifier}${endout_pre[$i]}
-       eval catalogname=${pathout_pre[$i]}
-       if ! ls $filename* 1>/dev/null 2>&1
-       then
-      
-             # IF OUTPUT-FILE DOES NOT EXIST CHECK, IF IT CAN BE CREATED
-          if  cat /dev/null > $filename  
-          then
-             rm  $filename
-          else
-
-                # CHECK, IF THE DIRECTORY WHERE FILE SHALL BE COPIED TO EXISTS
-                # IF IT DOES NOT EXIST, TRY TO CREATE IT
-             if [[ ! -d $catalogname ]]
-             then
-                if  mkdir -p  $catalogname
-                then
-                   printf "\n\n  *** directory:"
-                   printf "\n           $catalogname"
-                   printf "\n      was created\n"
-                else
-                   printf "\n\n  +++ OUTPUT-file:"
-                   printf "\n           $filename"
-                   printf "\n      cannot be created, because directory does not exist"
-                   printf "\n      and cannot be created either"
-                   printf "\n"
-                   locat=output  ; exit
-                fi 2>/dev/null 
-             else
-                printf "\n\n  +++ OUTPUT-file:"
-                printf "\n           $filename"
-                printf "\n      cannot be created, although directory exists"
-                printf "\n"
-                locat=output  ; exit
-             fi
-          fi 2>/dev/null
-
-       fi
-
-    fi
- done
-
-
-    # DETERMINE THE NAME OF INIFOR'S TEMPORARY WORKING DIRECTORY
- run_id_number=$RANDOM
- run_id=${run_identifier}.$run_id_number
- tempdir=$fast_io_catalog/$run_id
-
-
-
-
-    # OUTPUT OF THE INIFOR-HEADER
- calltime=$(date)
- printf "\n"
- printf "#------------------------------------------------------------------------# \n"
- printf "| %-35s%35s | \n" "$version" "$calltime"
- printf "| %-35s%35s | \n" "PALM code    $global_revision" " "
- printf "|                                                                        | \n"
- column1="called on:"; column2=$(hostname)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- if [[ $run_on_remote = true ]]
- then
-    column1="config. identifier:"; column2="$configuration_identifier (execute on IP: $remote_ip)"
- else
-    column1="config. identifier:"; column2="$configuration_identifier (execute on IP: $local_ip)"
- fi
- printf "| %-25s%-45s | \n" "$column1" "$column2"
-
-
- if [[ "$login_init_cmd" != "" ]]
- then
-    column1="login init commands:"; column2=$(echo "$login_init_cmd" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$login_init_cmd" | cut -c46-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c-45)
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c46-)
-    done
- fi
-
- if [[ "$module_commands" != "" ]]
- then
-    column1="module commands:"; column2=$(echo "$module_commands" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$module_commands" | cut -c46-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c-45)
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c46-)
-    done
- fi
- printf "|                                                                        | \n"
- column1="run identifier:"; column2=$run_identifier
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- column1="activation string list:"; column2=$(echo $activation_string_list)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
-
- printf "#------------------------------------------------------------------------#"
-
-
-
-
-    # QUERY FOR CONTINUE
- if [[ $silent = false ]]
- then
-    antwort=dummy
-    printf "\n\n"
-    printf " >>> everything o.k. (y/n) ?  "
-    while  read antwort
-    do
-       if [[ "$antwort" != y  &&  "$antwort" != Y  &&  "$antwort" != n  &&  "$antwort" != N ]]
-       then
-          printf " >>> everything o.k. (y/n) ?  "
-       else
-          break
-       fi
-    done
-    if [[ $antwort = n  ||  $antwort = N ]]
-    then
-       locat=user_abort; (( iec = 0 )); exit
-    fi
-    if [[ $run_on_remote ]]
-    then
-       printf "\n ***  inifor will now run on remote"
-    else
-       printf "\n ***  inifor will now continue to execute on this machine"
-    fi
- fi
-
- 
-    # NOW PERFORM THOSE ACTIONS REQUIRED TO EXECUTE INIFOR ON THIS MACHINE (COPYING I/O FILES)
-    # CHANGE TO THE TEMPORARY WORKING DIRECTORY
-
- mkdir -p  $tempdir
- chmod  go+rx  $tempdir
- cd  $tempdir
-
- printf "\n  *** changed to temporary directory: $tempdir"
-
-
-
-    # PROVIDE THE INPUT FILES
-    # LOOP OVER ALL ACTIVATED FILES (LISTED IN THE CONFIGURATION FILE)
- optional_files_missing=false
- (( i = 0 ))
- while (( i < nr_of_input_files ))
- do
-    (( i = i + 1 ))
-    if (( i == 1 ))
-    then
-       printf "\n\n  *** providing INPUT-files:\n$dashes"
-    fi
-
-
-       # SKIP OPTIONAL FILES, IF THEY DO NOT EXIST
-    if [[ "${actionin[$i]}" = unavailable ]]
-    then
-       optional_files_missing=true
-       continue
-    fi
-
-       # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION)
-    files_for_cores=false; filetype=file
-    if [[ "${actionin[$i]}" = pe  &&  -n $cores ]]
-    then
-       files_for_cores=true; filetype=files
-       actionin[$i]=""
-    elif [[ "${actionin[$i]}" = pe  &&  ! -n $cores ]]
-    then
-       actionin[$i]=""
-    elif [[ "${actionin[$i]}" = lnpe  &&  -n $cores ]]
-    then
-       files_for_cores=true; filetype=files
-       actionin[$i]="ln"
-    elif [[ "${actionin[$i]}" = lnpe  &&  ! -n $cores ]]
-    then
-       actionin[$i]="ln"
-    fi
-
-    if [[ $files_for_cores = true ]]
-    then
-       printf "\n  >>> INPUT: ${absnamein[$i]}/....  to  ${localin[$i]}"
-    else
-       printf "\n  >>> INPUT: ${absnamein[$i]}  to  ${localin[$i]}"
-    fi
-
-       # INPUT-FILES TO BE LINKED
-    if [[ "${actionin[$i]}" = ln ]]
-    then
-
-       printf "\n      $filetype will be linked"
-       if [[ $files_for_cores = false ]]
-       then
-          if [[ -f "${absnamein[$i]}" ]]
-          then
-             ln  ${absnamein[$i]}  ${localin[$i]}
-             got_tmp[$i]=true
-          fi
-       else
-          if [[ -d "${absnamein[$i]}" ]]
-          then
-             mkdir -p ${localin[$i]}
-             cd ${absnamein[$i]}
-             for file in $(ls *)
-             do
-                ln $file $tempdir/${localin[$i]}
-             done >|/dev/null 2>&1
-             cd $tempdir
-          fi
-
-             # IF "ln -f" HAS FAILED DO A NORMAL COPY "cp -r"
-          if [[ ! -f "${localin[$i]}/_000000" ]]
-          then
-             printf "\n  --- WARNING: ln failed, using cp instead (might be time consuming...)"
-             cp -r  ${absnamein[$i]}/*  ${localin[$i]}
-          fi
-
-          got_tmp[$i]=true
-       fi
-    fi
-
-       # FILE IS STORED IN THE RESPECTIVE DIRECTORY GIVEN IN THE CONFIGURATION FILE
-    if [[ "${actionin[$i]}" = ""  ||  "${actionin[$i]}" = "di"  ||  "${actionin[$i]}" = "tr"  ||  "${actionin[$i]}" = "npe" ]]
-    then
-
-       if [[ "${actionin[$i]}" = "npe"  &&  -n $cores ]]
-       then
-
-             # FILE COPIES ARE PROVIDED FOR ALL CORES
-             # EACH FILE GETS A UNIQUE FILENAME WITH A FOUR DIGIT NUMBER
-          printf "\n      file will be provided for $cores processors"
-          mkdir -p ${localin[$i]}
-          ival=$cores
-          (( ii = 0 ))
-          while (( ii <= ival-1 ))
-          do
-             if (( ii < 10 ))
-             then
-                cp  ${absnamein[$i]}  ${localin[$i]}/_000$ii
-             elif (( ii < 100 ))
-             then
-                cp  ${absnamein[$i]}  ${localin[$i]}/_00$ii
-             elif (( ii < 1000 ))
-             then
-                cp  ${absnamein[$i]}  ${localin[$i]}/_0$ii
-             else
-                cp  ${absnamein[$i]}  ${localin[$i]}/_$ii
-             fi
-             (( ii = ii + 1 ))
-          done
-
-       else
-
-          if [[ $files_for_cores = true ]]
-          then
-
-                # PROVIDE FILES FOR EACH CORE
-                # FIRST CREATE THE LOCAL DIRECTORY, THEN COPY FILES
-                # FROM THE PERMANENT DIRECTORY BY LINKING THEM TO THE LOCAL ONE
-             printf "\n      providing $cores files for the respective cores"
-             mkdir -p ${localin[$i]}
-            	if [[ $link_local_input = true ]]
-             then
-                printf "      files will be linked\n"
-                cd ${absnamein[$i]}
-                for file in $(ls *)
-                do
-                   ln -f $file  ${localin[$i]}
-                done
-                cd $tempdir
-             fi
-
-                # IF "ln -f" FAILED OR IF "$link_local_input = false" DO A NORMAL "cp -r"
-             if [[ ! -f "${localin[$i]}/_000000" ]]
-             then
-                if [[ $link_local_input = true ]]
-               	then
-                 		printf "\n  --- WARNING: ln failed, using cp instead (might be time consuming...)"
-                fi
-                cp -r  ${absnamein[$i]}/*  ${localin[$i]}
-             fi
-
-          else
-
-                # PROVIDE FILE FOR RUNS ON A SINGLE CORE
-           		if [[ $link_local_input = true ]]
-            	then
-                printf "      file will be linked\n"
-                ln -f  ${absnamein[$i]}  ${localin[$i]}
-            	fi
-               	# If "ln -f" fails or if "$link_local_input = false" do a normal "cp"
-            	if [[ ! -f "${localin[$i]}" ]]
-             then
-                if [[ $link_local_input = true ]]
-                then
-                   printf "\n  --- WARNING: ln failed, using cp instead (might be time consuming...)"
-                fi
-                if [[ $running_on_remote = true  &&  "${actionin[$i]}" = tr ]]
-                then
-                   mv  ${absnamein[$i]}  ${localin[$i]}
-                else
-		                 cp  ${absnamein[$i]}  ${localin[$i]}
-                fi
-             fi
-          fi
-       fi
-    fi
-
- done
- if (( i != 0 ))
- then
-    if [[ $optional_files_missing = true ]]
-    then
-       printf "\n  *** INFORMATIVE: some optional INPUT-files are not present"
-    fi
-    printf "\n$dashes\n  *** all INPUT-files provided \n"
- fi
-
-
-    # EXECUTE INPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE
- (( i = 0 ))
- while (( i < iic ))
- do
-    (( i = i + 1 ))
-    if (( i == 1 ))
-    then
-       printf "\n\n  *** execution of INPUT-commands:\n$dashes"
-    fi
-    printf "\n  >>> ${in_command[$i]}"
-    eval  ${in_command[$i]}
-    if (( i == iic ))
-    then
-       printf "\n$dashes\n"
-    fi
- done
-
-
-       # CREATE THE NAMELIST-FILE WITH VALUES OF ENVIRONMENT-VARIABLES REQUIRED BY PALM
-       # (FILE ENVPAR WILL BE READ BY PALM)
-       # TODO: this has to be adjusted for inifor, i.e. the values of the script options
-       #       have to be converted to NAMELIST variables which are then read by inifor.
-       #       Required PALM parameters could also be extracted from local file PARIN
-       #       and added here 
-    cat  >  ENVPAR  <<  EOF
- &envpar  run_identifier = '$run_identifier', host = '$configuration_identifier',
-          write_svf = .${write_svf}., write_binary = .${write_binary}., 
-          read_svf = .${read_svf}., tasks_per_node = $tasks_per_node,
-          maximum_parallel_io_streams = $maximum_parallel_io_streams,
-          maximum_cpu_time_allowed = ${cpumax}.,
-          revision = '$global_revision',
-          progress_bar_disabled = .${progress_bar_disabled}. /
-
-EOF
-
-    # TODO: this is just an example for a possible access of the PALM parameters
- grep -Eo '(\s*\&(initialization_parameters|inipar|runtime_parameters|d3par)\s*)|(([nd][xyz]|end_time|longitude|latitude|dz_stretch_level|dz_stretch_factor|dz_max)\s*\=\s*[0-9]*\.*\,*)|((dz_stretch_level_start|dz_stretch_level_end)\s*\=(\s*[0-9]*\.*\,*)*)|\/' PARIN
-
-    # COPY EXECUTABLE TO THIS TEMPORARY FOLDER
- cp  ${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}/inifor  .
-
-    # STARTING THE EXECUTABLE
- printf "\n\n  *** inifor starts in directory\n      \"`pwd`\"\n$dashes\n"
- PATH=$PATH:$tempdir
-
-
-    # REPLACE PARAMETERS IN THE EXECUTION COMMAND WITH REAL VALUES
- line=`echo  "${execute_command_inifor}" | sed 's/{{/$/g' | sed 's/}}//g'`
- eval line=\"$line\"
- execute_command="$line"
-
-
-
-    # SET THE NUMBER OF OPENMP-THREADS
- if [[ $use_openmp = true ]]
- then
-    export OMP_NUM_THREADS=$threads_per_task
-    printf "\n  *** number of OpenMP threads per MPI-task: $OMP_NUM_THREADS"
- else
-    export OMP_NUM_THREADS=1
- fi
-
-
- printf "\n  *** execute command:"
- printf "\n      \"$execute_command\" \n\n"
-
-
- $execute_command    &> >(tee STDOUT)
- exit_code=${PIPESTATUS[0]}
-
- if [[ ${exit_code} != 0 ]]
- then
-
-        # ABORT IN CASE OF RUNTIME ERRORS
-    printf "\n  +++ runtime error occured"
-    locat=execution
-    exit
-
- else
-
-    printf "\n$dashes\n  *** execution finished \n"
-
- fi
-
-
-    # EXECUTE OUTPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE
- (( i = 0 ))
- while (( i < ioc ))
- do
-    (( i = i + 1 ))
-    if (( i == 1 ))
-    then
-       printf "\n\n  *** execution of OUTPUT-commands:\n$dashes"
-    fi
-
-       # REPLACE PARAMETERS IN THE OUTPUT COMMAND WITH REAL VALUES
-    out_command[$i]=`echo  "${out_command[$i]}" | sed 's/{{/$/g' | sed 's/}}//g'`
-
-    printf "\n  >>> ${out_command[$i]}"
-    eval  ${out_command[$i]}
-    if (( i == ioc ))
-    then
-       printf "\n$dashes\n"
-    fi
- done
-
-
-    # IN A FIRST PASS, ADD ADDITIONAL OUTPUT FILE CONNECTIONS IN CASE OF
-    # WILDCARDS
- (( i = 0 ))
- (( nr_of_output_files = 0 ))
-
- while (( i < iout ))
- do
-
-    (( i = i + 1 ))
-
-       # FIRST CHECK FOR MULTIPLE NAMES WITH THE SAME LOCAL NAME AND
-       # CREATE A LIST FOR THE DETECTED ENDINGS
-    if [[ "${multout[$i]}" = true ]]
-    then
-          # DETERMINE THE EXISTING EXTENSIONS FROM THE LIST OF FILES
-       ls -1 -d ${localout_pre[$i]}    >   filelist  2>/dev/null
-       ls -1 -d ${localout_pre[$i]}_*  >>  filelist  2>/dev/null
-
-       endings="DEFAULT"
-       while  read line
-       do
-              # remove the local name from the beginning
-           localnamestring="${localout_pre[$i]}"
-           length_localname=${#localnamestring}
-           ending=${line:${length_localname}}
-
-           if [[ "$ending" != "" ]]
-           then
-              endings="$endings $ending"
-           fi
- 
-       done <filelist
-
-       rm filelist
-
-    else
-
-          # SINGLE NAME
-       endings=DEFAULT
-
-    fi
-
-       # FOR EACH BASENAME ENDING CREATE AN ENTRY IN THE FINAL OUTPUT FILE LIST
-    for  ending  in  $endings
-    do
-
-          # DEFAULT MEANS THAT THE ENDING GIVEN IN .iofiles SHALL BE USED
-       if [[ $ending = DEFAULT ]]
-       then
-          ending=""
-       fi
-
-          # NEW ENTRY (ENDING IS ALSO ADDED TO LOCAL FILENAME READ BY PALM!)
-       (( nr_of_output_files = nr_of_output_files + 1 ))
-       localout[$nr_of_output_files]="${localout_pre[$i]}"$ending
-       transout[$nr_of_output_files]="${transout_pre[$i]}"
-       actionout[$nr_of_output_files]="${actionout_pre[$i]}"
-       pathout[$nr_of_output_files]="${pathout_pre[$i]}"
-       endout[$nr_of_output_files]="${endout_pre[$i]}"$ending
-       extout[$nr_of_output_files]="${extout_pre[$i]}"
-       warnout[$nr_of_output_files]="${warnout_pre[$i]}"
-
-    done
-
- done
-
-
-    # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS
- (( i = 0 ))
- while (( i < nr_of_output_files ))
- do
-    (( i = i + 1 ))
-    if (( i == 1 ))
-    then
-       printf "\n\n  *** saving OUTPUT-files:"
-
-          # GET RUN NUMBER ASSIGNED BY PALM
-       if [[ -f RUN_NUMBER ]]
-       then
-           read  run_number  <  RUN_NUMBER
-           printf "\n  *** PALM generated run_number = "$run_number" will be used as unified cycle number for all output files"
-           usecycle_option="-U $run_number"
-       else
-           run_number=0
-           usecycle_option=""
-       fi
-       if [[ $running_on_remote = true  &&  "$remote_loginnode" != "" ]]
-       then
-          printf "\n  *** in case of SCP transfers to local host"
-          printf "\n      they will be done via remote login-node \"$remote_loginnode\" "
-       fi
-       printf "\n$dashes"
-    fi
-
-    if [[ ! ( $running_on_remote = true  &&  ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]]
-    then
-
-       eval filename=${pathout[$i]}/${run_identifier}${endout[$i]}
-
-          # DETERMINE THE CYCLE NUMBER
-       ls -1 -d $filename    >   filelist  2>/dev/null
-       ls -1 -d $filename.*  >>  filelist  2>/dev/null
-       while  read line
-       do
-   
-             # filename without path (i.e. after the last "/")
-          basefilename=$(basename ${line})
-   
-             # check if there is an extension
-          extension=${basefilename##*.}
-          if [[ "$extension" = "${extout[$i]}" ]]
-          then
-             basefilename=${basefilename%.*}
-          fi
-   
-             # check for an existing cycle number
-          cycle=${basefilename##*.}
-          if [[ $cycle =~ ^-?[0-9]+$ ]]
-          then
-                # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS
-                # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10
-             (( icycle = $((10#$cycle)) + 1 ))
-          else
-             (( icycle = 1 ))
-          fi
-   
-          if (( icycle > maxcycle ))
-          then
-             (( maxcycle = icycle ))
-          fi
-   
-       done <filelist
-       rm filelist
-
-   
-          # SET THE CYCLE NUMBER
-          # IN CASE OF FILE-APPEND, IT MUST BE THE HIGHEST EXISTING CYCLE NUMBER
-       if [[ "${actionout[$i]}" = a ]]
-       then
-          (( maxcycle = maxcycle - 1 ))
-       fi
-          
-       (( cycnum[$i] = maxcycle ))
-       pathout[$i]=$filename
-
-
-          # ADD CYCLE NUMBER TO FILENAME
-          # IN APPEND MODE, FILES KEEP THEIR CURRENT CYCLE NUMBER
-       if [[ "${actionout[$i]}" != "a" ]]
-       then
-             # SET RUN NUMBER AS CYCLE NUMBER, IF THERE IS NOT A CONFLICT
-             # WITH AN EXISTING CYCLE NUMBER
-          if (( run_number >= cycnum[$i] ))
-          then
-             (( cycnum[$i] = run_number ))
-          else
-             if (( run_number > 0 ))
-             then
-                printf "\n  --- INFORMATIVE: The following file cannot get a unified cycle number"
-             fi
-          fi
-       fi
-       if (( cycnum[$i] > 0 ))
-       then
-          cyclestring=`printf "%03d" ${cycnum[$i]}`
-          pathout[$i]=${pathout[$i]}.$cyclestring
-       fi
-    fi           
-
-       # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION)
-    files_for_cores=false; filetype=file
-    link_local_output=false
-    if [[ "${actionout[$i]}" = pe  &&  -n $cores ]]
-    then
-       files_for_cores=true; filetype=directory
-       actionout[$i]=""
-    elif [[ "${actionout[$i]}" = pe  &&  ! -n $cores ]]
-    then
-       actionout[$i]=""
-    elif [[ "${actionout[$i]}" = lnpe  &&  -n $cores ]]
-    then
-       files_for_cores=true; filetype=directory
-       link_local_output=true
-       actionout[$i]=""
-    elif [[ "${actionout[$i]}" = lnpe  &&  ! -n $cores ]]
-    then
-       link_local_output
-       actionout[$i]=""
-    elif [[ "${actionout[$i]}" = trpe  &&  -n $cores ]]
-    then
-       files_for_cores=true; filetype=directory
-       actionout[$i]="tr"
-    elif [[ "${actionout[$i]}" = trpe  &&  ! -n $cores ]]
-    then
-       actionout[$i]="tr"
-    fi
-
-    if [[ ! -f ${localout[$i]}  &&  $files_for_cores = false ]]
-    then
-       if [[ ${warnout[$i]} = true ]]
-       then
-          printf "\n  +++ temporary OUTPUT-file  ${localout[$i]}  does not exist\n"
-       fi
-    elif [[ ! -d ${localout[$i]}  &&  $files_for_cores = true ]]
-    then
-       if [[ ${warnout[$i]} = true ]]
-       then
-          printf "\n  +++ temporary OUTPUT-file  ${localout[$i]}/....  does not exist\n"
-       fi
-    else
-
-
-          # COPY VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m)
-          # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT
-       if [[ "${actionout[$i]}" = tr  ||  "${actionout[$i]}" = tra ]]
-       then
-          if [[ $running_on_remote = true ]]
-          then
-
-                # SET OPTIONS FOR TRANSFER
-             if [[ "${actionout[$i]}" = tr ]]
-             then
-                if [[ $files_for_cores = false ]]
-                then
-                   catalog_option=""
-                   catalog_string=""
-                else
-                   catalog_option="-c"
-                   catalog_string="/"
-                fi
-                append_option=""
-                append_string=""
-             else
-                append_option="-A"
-                append_string="append"
-             fi
-
-             transfer_failed=false
-             printf "\n  >>> OUTPUT: ${localout[$i]}$catalog_string  $append_string by SCP to"
-             printf "\n              ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}$catalog_string\n"
-
-                # TRANSFER VIA SCP
-             if [[ "$remote_loginnode" != "" ]]
-             then
-                ssh -q $remote_username@$remote_loginnode  "cd $tempdir; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} \"${pathout[$i]}\" ${configuration_identifier}_${run_identifier}${endout[$i]}  ${extout[$i]}"
-             else
-                batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} "${pathout[$i]}" ${configuration_identifier}_${run_identifier}${endout[$i]}  ${extout[$i]}
-             fi
-             [[ ${PIPESTATUS[0]} != 0 ]]  &&  transfer_failed=true
-
-
-                # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE
-             if [[ $transfer_failed = true ]]
-             then
-                printf "  +++ transfer failed. Trying to save a copy on this host under:\n"
-                printf "      ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}_$run_id_number\n"
-
-                   # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY
-                eval  local_catalog=${pathout[$i]}
-                if [[ ! -d $local_catalog ]]
-                then
-                   printf "  *** local directory does not exist. Trying to create:\n"
-                   printf "      $local_catalog \n"
-                   mkdir -p  $local_catalog
-                fi
-                eval  cp  ${localout[$i]}  ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}_$run_id_number
-                transfer_problems=true
-             fi
-
-          else
-
-                # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST
-                # BE COPIED OR APPENDED ON THIS MACHINE
-             if [[ "${actionout[$i]}" = tr ]]
-             then
-                actionout[$i]=""
-             else
-                actionout[$i]="a"
-             fi
-          fi
-       fi
-
-
-          # APPEND ON THIS MACHINE
-       if [[ "${actionout[$i]}" = "a" ]]
-       then
-          if [[ "${extout[$i]}" != " "  &&  "${extout[$i]}" != "" ]]
-          then
-             printf "\n  >>> OUTPUT: ${localout[$i]}  append to"
-             printf "\n              ${pathout[$i]}.${extout[$i]}\n"
-             cat  ${localout[$i]}  >>  ${pathout[$i]}.${extout[$i]}
-          else
-             printf "\n  >>> OUTPUT: ${localout[$i]}  append to"
-             printf "\n              ${pathout[$i]}\n"
-             cat  ${localout[$i]}  >>  ${pathout[$i]}
-          fi
-       fi
-
-          # COPY ON THIS MACHINE
-          # COPY HAS TO BE USED, BECAUSE MOVE DOES NOT WORK IF FILE-ORIGIN AND TARGET ARE
-          # ON DIFFERENT FILE-SYSTEMS
-       if [[ "${actionout[$i]}" = ""  &&  $files_for_cores = false ]]
-       then
-
-             # COPY IN CASE OF RUNS ON SINGLE CORES
-          if [[ "${extout[$i]}" != " "  &&  "${extout[$i]}" != "" ]]
-          then
-             printf "\n  >>> OUTPUT: ${localout[$i]}  to"
-             printf "\n              ${pathout[$i]}.${extout[$i]}\n"
-             if [[ $link_local_output = true ]]
-             then
-                printf "      file will be linked\n"
-                ln -f  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
-             fi
-                # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
-             if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]]
-             then
-                if [[ $link_local_output = true ]]
-                then
-                   printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-                fi
-                cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
-             else
-                printf "+++ no copy because file ${pathout[$i]}.${extout[$i]} exists\n"
-             fi
-          else
-             printf "\n  >>> OUTPUT: ${localout[$i]}  to"
-             printf "\n              ${pathout[$i]}\n"
-             if [[ $link_local_output = true ]]
-             then
-                printf "      file will be linked\n"
-                ln -f  ${localout[$i]}  ${pathout[$i]}
-             fi
-                # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
-            	if [[ ! -f "${pathout[$i]}" ]]
-             then
-                if [[ $link_local_output = true ]]
-                then
-                   printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-                fi
-                cp  ${localout[$i]}  ${pathout[$i]}
-             else
-                printf "+++ no copy because file ${pathout[$i]} exists\n"
-             fi
-          fi
-
-       elif [[ "${actionout[$i]}" = ""  &&  $files_for_cores = true ]]
-       then
-
-             # FILES FROM THE DIFFERENT CORES ARE MOVED WITH ln-COMMAND TO THE PERMANENT DIRECTORY
-             # AS A FIRST STEP, THE PERMANENT DIRECTORY IS CREATED
-          printf "\n  >>> OUTPUT: ${localout[$i]}/_....  to"
-          printf "\n              ${pathout[$i]}\n"
-          if [[ $link_local_output = true ]]
-          then
-             printf "      files will be linked\n"
-             mkdir -p ${pathout[$i]}
-             cd ${localout[$i]}
-             for file in $(ls *)
-             do
-                ln -f $file  ${pathout[$i]}
-             done >|/dev/null 2>&1
-             cd $tempdir
-          fi
-
-             # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r"
-          if [[ ! -f "${pathout[$i]}/_000000" ]]
-          then
-             if [[ $link_local_output = true ]]
-             then
-                printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-             fi
-             [[ ! -d "${pathout[$i]}" ]]  &&  mkdir  ${pathout[$i]}
-             cp -r  ${localout[$i]}/*  ${pathout[$i]}
-    	     fi
-
-       fi
-    fi
- done
-
- if (( i != 0 ))
- then
-    if [[ $transfer_problems = true ]]
-    then
-       printf "\n$dashes\n  *** OUTPUT-files saved"
-       printf "\n  +++ WARNING: some data transfers failed! \n"
-    else
-       printf "\n$dashes\n  *** all OUTPUT-files saved \n"
-    fi
- fi
-
-
-
-
-    # ALL ACTIONS FINISHED, TEMPORARY WORKING-DIRECTORY CAN BE DELETED
- cd  -
- [[ $delete_temporary_catalog = true ]]  &&  rm -rf $tempdir
Index: palm/trunk/SCRIPTS/inifortest
===================================================================
--- palm/trunk/SCRIPTS/inifortest	(revision 4901)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#!/usr/bin/env bash
-
-# inifortest - compiles a test build of INIFOR and runs integration test
-
-#------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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 2017-2021  Leibniz Universitaet Hannover
-# Copyright 2017-2021  Deutscher Wetterdienst, Offenbach
-#------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-#
-#
-# Former revisions:
-# -----------------
-#
-# Initial revision
-#
-#
-# 
-#------------------------------------------------------------------------------#
-
-TEST_DIR="$(cd "$(dirname "$0")/../UTIL/inifor/tests" >/dev/null 2>&1 ; pwd -P)"
-MAKE_FILE="$TEST_DIR/builds/Makefile.gnu_debug"
-
-cd $TEST_DIR/..
-make -f $MAKE_FILE clean BIN_PATH=$TEST_DIR
-make -f $MAKE_FILE BIN_PATH=$TEST_DIR
-python $TEST_DIR/inifor_test.py
Index: palm/trunk/SCRIPTS/mbuild_new
===================================================================
--- palm/trunk/SCRIPTS/mbuild_new	(revision 1)
+++ palm/trunk/SCRIPTS/mbuild_new	(revision 1)
@@ -0,0 +1,1269 @@
+#!/bin/ksh
+# mbuild - Programmuebersetzungsscript   Version:  @(#)MBUILD 1.0    07/02/07
+
+     # 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
+     # 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)
+
+
+
+    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
+ config_file=.mrun.config
+ host=all
+ host_found=false
+ ibm_hb_done=false
+ lcmuk_done=false
+ locat=normal
+ makefile=""
+ remote_mode=interactive
+ scirocco=false
+ silent=false
+ suf=f90
+ update=false
+
+ typeset -i  ih ihost=0
+
+ typeset  -R50 calltime
+ typeset  -L20 column1
+ typeset  -L50 column2
+ typeset  -L70 column3
+ typeset  -L20 version="MBUILD  1.0"
+
+    # FEHLERBEHANDLUNG
+    # BEI EXIT:
+ trap 'if [[ $locat != normal ]]
+       then
+          printf "\n\n +++ mbuild killed \n\n"
+       else
+          printf "\n\n *** mbuild finished \n\n"
+       fi' exit
+
+
+    # BEI TERMINAL-BREAK:
+ trap 'printf "\n\n +++ mbuild killed by \"^C\" \n\n"
+       exit
+      ' 2
+
+
+
+    # SHELLSCRIPT-OPTIONEN EINLESEN
+ while  getopts  :c:h:m:rs:  option
+ do
+   case  $option  in
+       (c)   config_file=$OPTARG;;
+       (h)   host=$OPTARG;;
+       (m)   makefile=$OPTARG;;
+       (r)   remote_mode=batch;;
+       (s)   suf=$OPTARG;;
+       (\?)  printf "\n  +++ unknown option $OPTARG \n";
+             locat=parameter; exit;;
+   esac
+ done
+
+
+
+    # BATCH-MODE IST ZUR ZEIT NICHT FUNKTIONSFAEHIG
+ if [[ $remote_mode = batch ]]
+ then
+    printf "\n  +++ sorry, batch mode does not work! \n"
+    locat=parameter; exit
+ fi
+
+
+
+    # LOKALEN RECHNER ERMITTELN
+ local_host_real_name=$(hostname)
+ local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
+ case  $local_host_real_name  in
+     (atmos)                    local_host=lcide;;
+     (berte)                    local_host=t3eb;;
+     (bora|breva|gregale|irifi|levanto|maestro|orkan|ostria|quanero|scirocco)  local_host=lcmuk;;
+     (argestes|caurus|caver|chinook|dschani|gharra|nevados|poniente|samun|twister|yalka)  local_host=hpmuk;;
+     (gate)                     local_host=neck;;
+     (gfdl3.yonsei.ac.kr)       local_host=decalpha; local_addres=165.132.26.56;;
+     (gfdl5)                    local_host=ibmy; local_addres=165.132.26.58;;
+     (gwdk081.gwdg.de)          local_host=ibm;;
+     (hreg01a-en0|hreg02a-en0)  local_host=ibmh;;
+     (nobel|nobela)             local_host=ibms;;
+     (tgg*)                     local_host=lctit;;
+     (t3e)                      local_host=t3eh;;
+     (zam003)                   local_host=t3ej2;;
+     (zam005)                   local_host=t3ej5;;
+     (*)       printf "\n  +++ local host \"$local_host_real_name\" not admitted for mbuild \n"
+               locat=local_host; exit;;
+ esac
+
+ [[ $local_host_real_name = scirocco ]]  &&  scirocco=true
+
+
+
+    # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN
+ if [[ ! -f $config_file ]]
+ then
+    printf "\n  +++ configuration file: "
+    printf "\n           $config_file"
+    printf "\n      does not exist"
+    locat=configuration; exit  
+ fi
+ if [[ $local_host != ibms ]]
+ then
+    config_file=$PWD/$config_file
+ else
+    config_file=`pwd`/$config_file
+ fi
+
+
+ 
+    # BENUTZERNAMEN AUF LOKALEM RECHNER AUS KONFIGURATIONSDATEI ERMITTELN
+ line=""
+ grep  " $local_host" $config_file | grep "%remote_username"  |  while read line
+ do
+    if [[ "$line" != ""  ||  $(echo $line | cut -c1) != "#" ]]
+    then
+       local_username=`echo $line | cut -d" " -s -f2`
+    fi
+ done
+
+ if [[ "$local_username" = "" ]]
+ then
+    printf "\n  +++ no user name found in configuration file"
+    printf "\n      for local host \"$local_host\" "
+    locat=config_file; exit
+ fi
+
+
+    # PRUEFEN, OB IN KONFIGURATIONSDATEI EIN HAUPTPROGRAMM
+    # VEREINBART WURDE
+ if [[ $(grep -c "%mainprog" $config_file) != 1 ]]
+ then
+    printf "\n  +++ no main program or more than one main program defined"
+    printf "\n      in configuration file"
+    locat=configuration; exit
+ else
+    line=`grep "%mainprog" $config_file`
+    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
+    then
+       printf "\n  +++ no main program defined in configuration file"
+       locat=configuration; exit
+    fi
+    mainprog=`echo $line | cut -d" " -s -f2 | cut -d"." -f1`
+ fi
+
+
+
+    # LOKALEN QUELLTEXTPFAD ERMITTELN.
+    # ZUERST PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD FUER ALLE RECHNER
+    # VEREINBART WURDE
+ line=""
+ grep "%source_path" $config_file  |  while read line
+ do
+    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+    then
+       if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]]
+       then
+          global_source_path=`echo $line | cut -d" " -s -f2`
+       fi
+    fi
+ done
+
+ line=""
+ grep  " $local_host" $config_file | grep "%source_path"  |  while read line
+ do
+    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+    then
+       local_source_path=`echo $line | cut -d" " -s -f2`
+    fi
+ done
+
+ if [[ "$local_source_path" = "" ]]
+ then
+    if [[ "$global_source_path" != "" ]]
+    then
+       local_source_path=$global_source_path
+    else
+       printf "\n  +++ no source path found in configuration file"
+       printf "\n      for local host \"$local_host\" "
+       printf "\n      please set \"\%source_path\" in configuration file"
+       locat=config_file; exit
+    fi
+ fi
+ eval local_source_path=$local_source_path
+
+
+     # EBENSO PFAD FUER DAS MAKE-DEPOSITORY ERMITTELN
+ line=""
+ grep "%depository_path" $config_file  |  while read line
+ do
+    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+    then
+       if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]]
+       then
+          global_depository_path=`echo $line | cut -d" " -s -f2`
+       fi
+    fi
+ done
+
+ line=""
+ grep  " $local_host" $config_file | grep "%depository_path"  |  while read line
+ do
+    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+    then
+       local_depository_path=`echo $line | cut -d" " -s -f2`
+    fi
+ done
+
+ if [[ "$local_depository_path" = "" ]]
+ then
+    if [[ "$global_depository_path" != "" ]]
+    then
+       local_depository_path=$global_depository_path
+    else
+       printf "\n  +++ no depository path found in configuration file"
+       printf "\n      for local host \"$local_host\" "
+       printf "\n      please set \"\%depository_path\" in configuration file"
+       locat=config_file; exit
+    fi
+ fi
+ eval local_depository_path=$local_depository_path
+
+
+
+    # MAKEFILE vorhanden
+ [[ "$makefile" = "" ]]  &&  makefile=$local_source_path/Makefile
+ if [[ ! -f $makefile ]]
+ then
+    printf "\n  +++ makefile: "
+    printf "\n           $makefile"
+    printf "\n      does not exist"
+    locat=makefile; exit  
+ fi
+
+
+    # HEADER-AUSGABE (TEIL1: MELDUNGEN UEBER LOKALEN RECHNER)
+ calltime=$(date)
+ printf "\n"
+ printf "#------------------------------------------------------------------------# \n"
+ printf "| $version$calltime | \n"
+ printf "|                                                                        | \n"
+ column1="called on:"; column2=$local_host_real_name
+ printf "| $column1$column2 | \n"
+ column1="local username:"; column2=$local_username
+ printf "| $column1$column2 | \n"
+ column1="local IP-addres:"; column2=$local_addres
+ printf "| $column1$column2 | \n"
+ column1="config file:"; column2=$config_file
+ printf "| $column1$column2 | \n"
+ column1="makefile:"; column2=$makefile
+ printf "| $column1$column2 | \n"
+ column1="local source path:"; column2=$local_source_path
+ printf "| $column1$column2 | \n"
+ column1="make depository:"; column2=$local_depository_path
+ printf "| $column1$column2 | \n"
+ printf "#------------------------------------------------------------------------# \n"
+
+# printf "|                                                                        | \n"
+
+
+ cd  $local_source_path
+
+
+    # LISTE DER ZU PRUEFENDEN QUELLTEXTDATEIEN ERSTELLEN
+ source_code_files=`ls -1  *.$suf`
+
+
+
+    # VERZEICHNIS FUER DAS MAKE-DEPOSITORY ERZEUGEN,
+    # FALLS NOCH NICHT VORHANDEN. ANSONSTEN ALLE DATEIEN
+    # NEUEREN DATUMS IN DIESES VERZEICHNIS KOPIEREN
+ if [[ ! -d $local_depository_path ]]
+ then
+    if  mkdir $local_depository_path
+    then
+       printf "\n\n  *** directory for make depository:"
+       printf "\n           $local_depository_path"
+       printf "\n      was created\n"
+
+          # MAKEFILE UND QUELLTEXTDATEIEN UNTER BEIBEHALTUNG
+          # IHRES DATUMS INS VERZEICHNIS KOPIEREN
+       printf "\n  *** makefile and source code files are copied to"
+       printf "\n      $local_depository_path\n"
+       printf "\n      copying makefile \"$makefile\" ..."
+       cp -p  $makefile  $local_depository_path/Makefile
+
+          # QUELLTEXTDATEIEN MUESSEN IM MAKEFILE AUFGEFUEHRT
+          # SEIN
+       for  filename  in  $source_code_files
+       do
+          if [[ $(grep -c $filename  $makefile) = 0 ]]
+          then
+             printf "\n  +++ source code file:"
+             printf "\n         $filename"
+             printf "\n      is not listed in makefile"
+             locat=makefile; exit
+          else
+             printf "\n      copying source code file \"$filename\" ..."
+             cp -p  $filename  $local_depository_path
+          fi
+       done
+       printf "\n"
+    else
+       printf "\n  +++ directory for make depository:"
+       printf "\n           $local_depository_path"
+       printf "\n      cannot be created"
+       locat=local_depository_path; exit
+    fi
+ else
+ 
+    printf "\n  *** checking file status ..."
+
+       # MAKEFILE KOPIEREN, FALLS NEUEREN DATUMS
+    if [[ $makefile -nt $local_depository_path/Makefile ]]
+    then
+       printf "\n  *** update of \"$makefile\" "
+       cp -f -p  $makefile  $local_depository_path/Makefile
+       update=true
+
+          # PRUEFEN, OB ALLE DATEIEN IM DEPOSITORY AUCH IM NEUEN MAKEFILE
+          # VERZEICHNET SIND UND GEGEBENENFALLS DATEIEN LOESCHEN
+       cd  $local_depository_path
+       source_code_files_in_depository=`ls -1  *.$suf`
+       for  filename  in  $source_code_files_in_depository
+       do
+          if [[ $(grep -c $filename  Makefile) = 0 ]]
+          then
+             printf "\n  *** source code file in \"$local_depository_path\":"
+             printf "\n         $filename"
+             printf "\n      is not listed in makefile"
+             if [[ $silent = false ]]
+             then
+                answer=dummy
+                printf "\n\n"
+                while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
+                do
+                   printf " >>> delete \"$filename\" in \"$local_depository_path\" (y/n) ?  "
+                   read  answer
+                done
+                if [[ $answer = y  ||  $answer = Y ]]
+                then
+                   base=`echo $filename | cut -d. -f2`
+                   rm -f  $filename
+                   rm -f  ${base}.o  ${base}.mod
+                   printf "\n  *** \"$filename\" deleted in \"$local_depository_path\" "
+                else 
+                   printf "\n  *** \"$filename\" not deleted in \"$local_depository_path\" "
+                fi
+             fi
+          fi
+       done
+       cd  -  > /dev/null  2>&1
+
+    elif [[ $local_depository_path/Makefile -nt $makefile ]]
+    then
+       printf "\n  *** makefile in depository is newer than"
+       printf "\n      \"$makefile\" "
+       if [[ $silent = false ]]
+       then
+          answer=dummy
+          printf "\n\n"
+          while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
+          do
+             printf " >>> update \"$makefile\" (y/n) ?  "
+             read  answer
+          done
+          if [[ $answer = y  ||  $answer = Y ]]
+          then
+             cp -f -p  $local_depository_path/Makefile  $makefile
+             printf "\n  *** \"$makefile\" updated"
+          else 
+             printf "\n  *** \"$makefile\" not updated"
+          fi
+       fi
+    fi
+
+       # QUELLTEXTDATEIEN KOPIEREN, FALLS NEUEREN DATUMS
+       # SIE MUESSEN IM MAKEFILE AUFGEFUEHRT SEIN
+    for  filename  in  $source_code_files
+    do
+       if [[ $(grep -c $filename  $makefile) = 0 ]]
+       then
+          printf "\n  +++ source code file:"
+          printf "\n         $filename"
+          printf "\n      is not listed in makefile"
+          locat=makefile; exit
+       else
+          if [[ ! -f $local_depository_path/$filename ]]
+          then
+             cp -p  $filename  $local_depository_path
+             printf "\n  *** source code file \"$filename\" created in \"$local_depository_path\" "
+          fi
+          if [[ $filename -nt $local_depository_path/$filename ]]
+          then
+             printf "\n  *** update of source code file \"$filename\" "
+             cp -f -p  $filename  $local_depository_path
+             update=true
+          fi
+       fi
+    done
+
+
+       # PRUEFEN, OB ALLE DATEIEN IM DEPOSITORY IM AKTUELLEN ARBEITSVERZEICHNIS VORHANDEN
+       # ODER EVTL. NEUEREN DATUMS SIND
+    cd  $local_depository_path
+    source_code_files_in_depository=`ls -1  *.$suf`
+    cd  -  > /dev/null  2>&1
+    for  filename  in  $source_code_files_in_depository
+    do
+       if [[ ! -f $filename ]]
+       then
+          printf "\n  *** source code file \"$filename\" does not exist in current directory"
+          if [[ $silent = false ]]
+          then
+             answer=dummy
+             printf "\n\n"
+             while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
+             do
+                printf " >>> create \"$filename\" in current directory (y/n) ?  "
+                read  answer
+             done
+             if [[ $answer = y  ||  $answer = Y ]]
+             then
+                cp -p  $local_depository_path/$filename  $filename
+                printf "\n  *** source code file \"$filename\" created in current directory"
+             else 
+                printf "\n  *** source code file \"$filename\" not created in current directory"
+             fi
+          fi
+       elif [[ $local_depository_path/$filename -nt $filename ]]
+       then
+          ls -al $local_depository_path/$filename
+          ls -al $filename
+          printf "\n  *** source code file \"$filename\" in depository is newer than in current directory"
+          if [[ $silent = false ]]
+          then
+             answer=dummy
+             printf "\n\n"
+             while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
+             do
+                printf " >>> update \"$filename\" in current directory (y/n) ?  "
+                read  answer
+             done
+             if [[ $answer = y  ||  $answer = Y ]]
+             then
+                cp -f -p  $local_depository_path/$filename  $filename
+                printf "\n  *** source code file \"$filename\" updated in current directory"
+             else 
+                printf "\n  *** source code file \"$filename\" not updated in current directory"
+             fi
+          fi
+       fi
+    done
+
+    if [[ $update = false ]]
+    then
+       printf "\n  *** no updates necessary in \"$local_depository_path\" "
+       if [[ $silent = false ]]
+       then
+          answer=dummy
+          printf "\n\n"
+          while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
+          do
+             printf " >>> continue with updates on remote hosts (y/n) ?  "
+             read  answer
+          done
+          if [[ $answer = n  ||  $answer = N ]]
+          then
+             locat=user_abort; exit
+          fi
+       fi
+    fi
+ fi
+ 
+
+ 
+    # QUELLTEXTDATEIEN UND MAKEFILE MIT TAR ZUSAMMENBINDEN
+    # IN JEDEM FALL ALLEN DATEIEN WRITE-PERMIT GEBEN, DAMIT ES AUF
+    # DEN REMOTE-RECHNERN NICHT EVTL. ZU PROBLEMEN BEIM UEBERSCHREIBEN KOMMT
+ printf "\n\n  *** tar of makefile and source files in depository ..."  
+ cd  $local_depository_path
+ chmod u+w  Makefile  *.$suf
+ tar -cf  ${mainprog}_sources.tar  Makefile  *.$suf
+ printf "\n"
+
+
+
+    # BESTAETIGUNG ZUM WEITERMACHEN EINHOLEN
+ if [[ $host = all ]]
+ then
+    printf "\n  *** updates will be made for ALL hosts found in"
+    printf "\n      the configuration file"
+ else
+    printf "\n  *** update will be made for host \"$host\" "
+ fi
+
+ if [[ $silent = false ]]
+ then
+    answer=dummy
+    printf "\n\n"
+    while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
+    do
+       printf " >>> continue (y/n) ?  "
+       read  answer
+    done
+    if [[ $answer = n  ||  $answer = N ]]
+    then
+       locat=user_abort; exit
+    fi
+ fi
+ 
+ 
+
+    
+    # GENERIERUNG DER AKTUELLEN MODELLVERSION FUER ALLE RECHNER-/UEBERSETZUNGS-
+    # VERSIONEN, DIE IN DER KONFIGURATIONSDATEI GEFUNDEN WERDEN
+ printf "\n  *** scanning configuration file for host(s) ..."
+
+ grep  %fopts  $config_file  |  while read line
+ do
+       # KOMMENTARZEILEN UEBERSPRINGEN
+    [[ $(echo $line | cut -c1) = "#" ]]  &&  continue
+    (( ihost = ihost + 1 ))
+    hostline[$ihost]="$line"
+ done
+
+ 
+ while (( ih < ihost ))
+ do
+
+    (( ih = ih + 1 ))
+
+       # REMOTE-RECHNER UND UEBERSETZUNGS-VERSION FESTSTELLEN
+       # NUR WEITERMACHEN, WENN ENTSPRECHENDER REMOTE-RECHNER MITTELS
+       # SHELLSCRIPT-OPTION AUCH AUSGEWAEHLT WURDE
+    remote_host_string=`echo ${hostline[$ih]} | cut -d" " -s -f3-`
+    remote_host=`echo $remote_host_string | cut -d" " -f1`
+    if [[ $host != all ]]
+    then
+       [[ $remote_host != $host ]]  &&  continue
+    fi
+    host_found=true
+    condition1=`echo $remote_host_string | cut -d" " -s -f2`
+    if [[ $condition1 = $remote_host ]]
+    then
+       condition1=""
+    else
+       condition2=`echo $remote_host_string | cut -d" " -s -f3`
+    fi
+
+
+       # AUF HLRN-RECHNER NUR EINMAL UEBERSETZEN
+    if [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
+    then
+       if [[ $ibm_hb_done = true ]]
+       then
+          printf "\n *** remote host \"$remote_host\" skipped since compilation has already"
+          printf "\n     been carried out on one of the HLRN machines\n"
+          continue
+       fi
+    fi
+
+       # AUF LCMUK-RECHNER NUR EINMAL UEBERSETZEN
+    if [[ $remote_host = lcmuk ]]
+    then
+       if [[ $lcmuk_done = true ]]
+       then
+          printf "\n *** local host \"$remote_host\" skipped since compilation has already"
+          printf "\n     been carried out on this host\n"
+          continue
+       fi
+    fi
+
+
+       # IP-ADRESSE DES REMOTE-RECHNERS BESTIMMEN
+    netcdf_support=false
+    case  $remote_host  in
+        (hpmuk)          remote_addres=130.75.105.19;;
+        (lcmuk)          remote_addres=130.75.105.3; cpp_options=""
+                         netcdf_support=true
+                         if [[ $scirocco = true ]]
+                         then
+                            netcdf_path=/opt/netcdf/3.6.2-beta4
+                         else
+                            netcdf_path=/muksoft/packages/netcdf/linux
+                         fi;;
+        (lctit)          remote_addres=172.17.75.161; netcdf_support=true
+                         netcdf_path=/home/usr5/mkanda/netcdf-3.6.1/src; cpp_options="-Mpreprocess";;
+        (decalpha)       remote_addres=165.132.26.56; cpp_options="-cpp"; netcdf_support=true
+                         netcdf_path=/usr/local/netcdf-3.5.1;;
+        (ibm)            remote_addres=134.76.99.81; cpp_options="-qsuffix=cpp=f90";;
+        (ibmb)           remote_addres=130.73.230.10; cpp_options="-qsuffix=cpp=f90"; netcdf_support=true
+                         netcdf_path=/aws/dataformats/netcdf-3.6.0-p1/64-32;;
+        (ibmh)           remote_addres=130.75.4.10; cpp_options="-qsuffix=cpp=f90"; netcdf_support=true
+                         netcdf_path=/aws/dataformats/netcdf-3.6.0-p1/64-32;;
+        (ibms)           remote_addres=150.183.5.101; cpp_options="-qsuffix=cpp=f90"; netcdf_support=true
+                         netcdf_path=/applic/lib/NETCDF64;;
+        (ibmy)           remote_addres=165.132.26.58; cpp_options="-qsuffix=cpp=f90"; netcdf_support=true
+                         netcdf_path=/usr1/users/raasch/pub/netcdf-3.6.0-p1;;
+        (nech)           remote_addres=136.172.44.192; cpp_options="-Ep"; netcdf_support=true
+                         netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;;
+        (neck)           remote_addres=133.5.178.11; cpp_options="-Ep"; netcdf_support=true
+                         netcdf_path=/home/DSRC/NC/tatuyama/pub/netcdf-3.6.0-p1;;
+        (t3eb)           remote_addres=130.73.206.21; cpp_options="-eZ";;
+        (t3eh)           remote_addres=130.75.4.131; cpp_options="-eZ";;
+        (t3ej2)          remote_addres=134.94.100.22; cpp_options="-eZ";;
+        (t3ej5)          remote_addres=134.94.100.49; cpp_options="-eZ";;
+        (ground.yonsei.ac.kr) remote_addres=134.75.155.33;;
+     (*)                 printf "\n  +++ remote host \"$remote_host\" unknown";
+                         printf "\n      please inform S. Raasch!";
+                         locat=config_file; exit;;
+    esac
+
+
+       # REMOTE-USERNAMEN ERMITTELN
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%remote_username"  |  while read line1
+    do
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+    done
+
+    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
+    then
+       printf "\n  +++ no remote username found in configuration file"
+       printf "\n      for \"$remote_host_string\" "
+       locat=config_file; exit
+    else
+       remote_username=`echo $line | cut -d" " -s -f2`
+    fi
+
+
+       # REMOTE-QUELLTEXTPFAD ERMITTELN
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%source_path"  |  while read line1
+    do
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+    done
+
+    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+    then
+       remote_source_path=`echo $line | cut -d" " -s -f2`
+    fi
+    if [[ "$remote_source_path" = "" ]]
+    then
+       if [[ "$global_source_path" != "" ]]
+       then
+          remote_source_path=$global_source_path
+       else
+          printf "\n  +++ no source path found in configuration file"
+          printf "\n      for \"$remote_host_string\" "
+          locat=config_file; exit
+       fi
+    fi
+
+
+       # REMOTE-PFAD FUER MAKE-DEPOSITORY ERMITTELN
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%depository_path"  |  while read line1
+    do
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+    done
+
+    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+    then
+       remote_md=`echo $line | cut -d" " -s -f2`
+    fi
+    if [[ "$remote_md" = "" ]]
+    then
+       if [[ "$global_depository_path" != "" ]]
+       then
+          remote_md=$global_depository_path
+       else
+          printf "\n  +++ no depository path found in configuration file"
+          printf "\n      for \"$remote_host_string\" "
+          printf "\n      please set \"\%depository_path\" in configuration file"
+          locat=config_file; exit
+       fi
+    fi
+
+
+       # COMPILERNAMEN ERMITTELN
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%compiler_name"  |  while read line1
+    do
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+    done
+
+    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
+    then
+       printf "\n  +++ no compiler name found in configuration file"
+       printf "\n      for \"$remote_host_string\" "
+       locat=config_file; exit
+    else
+       compiler_name=`echo $line | cut -d" " -s -f2`
+    fi
+
+
+
+       # PRAEPROZESSOR-DIREKTIVEN SETZEN
+    if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
+    then
+       if [[ $remote_host = ibms ]]
+       then
+          cpp_options="$cpp_options -WF,-DMPI_REAL=MPI_DOUBLE_PRECISION"
+          [[ $netcdf_support = true ]]  &&  cpp_options="${cpp_options},-D__netcdf"
+       else
+          cpp_options="$cpp_options -WF,-DMPI_REAL=MPI_DOUBLE_PRECISION"
+          [[ $netcdf_support = true ]]  &&  cpp_options="${cpp_options},-D__netcdf,-D__netcdf_64bit"
+          [[ $remote_host = ibmy ]]  &&  cpp_options="${cpp_options},-D__ibmy_special"
+       fi
+    elif [[ $remote_host = lcmuk ]]
+    then
+       cpp_options="$cpp_options -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"
+       [[ $netcdf_support = true ]]  &&  cpp_options="$cpp_options -D__netcdf -D__netcdf_64bit"
+    elif [[ $remote_host = lctit ]]
+    then
+       cpp_options="$cpp_options -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"
+       [[ $netcdf_support = true ]]  &&  cpp_options="$cpp_options -D__netcdf"
+    elif [[ $remote_host = decalpha ]]
+    then
+       cpp_options="$cpp_options -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"
+       [[ $netcdf_support = true ]]  &&  cpp_options="$cpp_options -D__netcdf"
+    elif [[ $remote_host = nech  ||  $remote_host = neck ]]
+    then
+       cpp_options="$cpp_options -DMPI_REAL=MPI_REAL8 -DMPI_2REAL=MPI_2REAL8 -DSCFFT=DZFFT -DCSFFT=ZDFFT"
+       [[ $netcdf_support = true ]]  &&  cpp_options="$cpp_options -D__netcdf -D__netcdf_64bit"
+    fi
+
+    if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
+    then
+       for  string  in  $remote_host_string
+       do
+          if [[ $(echo $string | cut -c1-3) = ibm ]]
+          then
+             cpp_options="${cpp_options},-D__ibm"
+             if [[ $remote_host = ibmy ]]
+             then
+                cpp_options="${cpp_options},-D__ibmy_special"
+             fi
+          else
+             cpp_options="${cpp_options},-D__$string"
+          fi
+       done
+       cpp_options="$cpp_options "
+    elif [[ $remote_host = nech  ||  $remote_host = neck ]]
+    then
+       for  string  in  $remote_host_string
+       do
+          if [[ $(echo $string | cut -c1-3) = nec ]]
+          then
+             cpp_options="${cpp_options} -D__nec"
+          else
+             cpp_options="${cpp_options} -D__$string"
+          fi
+       done
+       cpp_options="$cpp_options "
+    else
+       for  string  in  $remote_host_string
+       do
+          cpp_options="$cpp_options -D__$string "
+       done
+    fi
+
+
+       # COMPILEROPTIONEN ERMITTELN
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%fopts"  |  while read line1
+    do
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+    done
+    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
+    then
+       printf "\n  +++ no compiler options found in configuration file"
+       printf "\n      for \"$remote_host_string\" "
+       locat=config_file; exit
+    else
+          # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN
+       compiler_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'`
+    fi
+    if [[ $netcdf_support = true ]]
+    then
+       case  $remote_host  in
+          (decalpha)  compiler_options="-I${netcdf_path}/include  $compiler_options";;
+          (ibmb|ibmh) compiler_options="-I ${netcdf_path}/include-64  $compiler_options";;
+          (ibms)      compiler_options="-I /applic/netcdf64/src/f90  $compiler_options";;
+          (ibmy)      compiler_options="-I ${netcdf_path}/include  $compiler_options";;
+          (lcmuk)     compiler_options="-I ${netcdf_path}/include  $compiler_options";;
+          (lctit)     compiler_options="-I ${netcdf_path}/f90      $compiler_options";;
+          (nech|neck) compiler_options="-I ${netcdf_path}/include  $compiler_options";;
+       esac
+    fi
+
+
+
+       # LADER-OPTIONEN ERMITTELN
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%lopts"  |  while read line1
+    do
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+    done
+
+    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
+    then
+       printf "\n  +++ no loader options found in configuration file"
+       printf "\n      for \"$remote_host_string\" "
+       locat=config_file; exit
+    else
+          # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN
+       loader_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'`
+    fi
+    if [[ $netcdf_support = true ]]
+    then
+       case  $remote_host  in
+          (decalpha)                   loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
+          (ibmb|ibmh|lcmuk|nech|neck)  loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
+          (ibms)                       loader_options="$loader_options -L${netcdf_path} -lnetcdf";;
+          (ibmy)                       loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
+          (lctit)                      loader_options="$loader_options -L${netcdf_path}/libsrc -lnetcdf";;
+       esac
+    fi
+
+
+    printf "\n\n#------------------------------------------------------------------------# \n"
+    if [[ $remote_host = $local_host ]]
+    then
+       column1="remote_host:"; column2="$remote_host (= local host!)"
+    else
+       column1="remote_host:"; column2=$remote_host
+    fi
+    printf "| $column1$column2 | \n"
+    printf "|                                                                        | \n"
+    column1="conditions:"; column2="$condition1 $condition2"
+    printf "| $column1$column2 | \n"
+    column1="make depository:"; column2=$remote_md
+    printf "| $column1$column2 | \n"
+    column1="username:"; column2=$remote_username
+    printf "| $column1$column2 | \n"
+    column1="addres:"; column2=$remote_addres
+    printf "| $column1$column2 | \n"
+    column1="compiler:"; column2=$compiler_name
+    printf "| $column1$column2 | \n"
+    column1="cpp options:"; column2=$cpp_options
+    printf "| $column1$column2 | \n"
+    line=$(echo "$cpp_options" | cut -c51-)
+    while [[ "$line" != "" ]]
+    do
+       column1=""
+       column2=$line
+       printf "| $column1$column2 | \n"
+       line=$(echo "$line" | cut -c51-)
+    done
+    column1="compiler options:"; column2=$compiler_options
+    printf "| $column1$column2 | \n"
+    line=$(echo "$compiler_options" | cut -c51-)
+    while [[ "$line" != "" ]]
+    do
+       column1=""
+       column2=$line
+       printf "| $column1$column2 | \n"
+       line=$(echo "$line" | cut -c51-)
+    done
+    column1="loader options:"; column2=$loader_options
+    printf "| $column1$column2 | \n"
+    line=$(echo "$loader_options" | cut -c51-)
+    while [[ "$line" != "" ]]
+    do
+       column1=""
+       column2=$line
+       printf "| $column1$column2 | \n"
+       line=$(echo "$line" | cut -c51-)
+    done
+    printf "#------------------------------------------------------------------------# \n"
+
+    if [[ $silent = false ]]
+    then
+       answer=dummy
+       printf "\n\n"
+       while [[ "$answer" != y  &&  "$answer" != Y  && "$answer" != c  &&  "$answer" != C  && "$answer" != s  &&  "$answer" != S  &&  "$answer" != a  &&  "$answer" != A ]]
+       do
+          printf " >>> continue (y(es)/c(ontinue)/a(bort)/s(skip)) ?  "
+          read  answer
+       done
+       if [[ $answer = a  ||  $answer = A ]]
+       then
+          locat=user_abort; exit
+       fi
+       if [[ $answer = c  ||  $answer = C ]]
+       then
+          silent=false
+       fi
+       if [[ $answer = s  ||  $answer = S ]]
+       then
+          continue
+       fi
+    fi
+
+
+    if [[ $remote_mode = batch ]]
+    then
+
+          # BATCH-JOB PARAMETER SETZEN
+       case  $remote_host  in
+           (hpmuk)          remote_addres=130.75.105.19;;
+           (t3eb)           queue=berte; memory=60; cputime=1000; xoption="-X 0";;
+           (t3eh)           queue=comp_t3e; memory=60; cputime=360;;
+           (t3ej2)          queue=normal; memory=60; cputime=1000; xoption="-X 0";;
+           (hpmuk|t3ej5|ground.yonsei.ac.kr)  printf "\n  --- remote host \"$remote_host\" does not allow batch jobs"; continue;;
+       esac
+
+
+          # BATCH-JOB ZUSAMMENSTELLEN
+       printf "\n  *** creating batch-job for remote host"
+       echo " "  >  mbuild_job
+
+          # AUF CRAY-RECHNERN IN JUELICH WIRD KEIN BENUTZER-PROFILE AUSGEFUEHRT
+          # DIES WIRD HIER GETAN, UM PFADE USW. ZU SETZEN
+       if [[ $remote_host = t3ej2 ]]
+       then
+          echo "set +vx"                       >>  mbuild_job
+          echo ". .profile"                    >>  mbuild_job
+          echo "set -x"                        >>  mbuild_job
+       fi
+
+          # AUF CRAY-RECHNERN GELADENE MODULE AUFLISTEN
+       if [[ $host = t3eb  || $host = t3eh  ||  $host = t3ej2 ]]
+       then
+          echo "module list"                   >>  mbuild_job
+       fi
+
+
+          # WECHSEL IN TEMPORAERES VERZEICHNIS
+       echo "cd ${remote_md}"  >>  mbuild_job
+
+
+          # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN
+       echo  "scp  ${local_username}@${local_addres}:~/modell/code_3dp/palm_current_version/${mainprog}_sources.tar  ${mainprog}_sources.tar"  >>  mbuild_job
+#       echo  "[[ \$? != 0 ]]  &&  (echo "+++ scp failed"; exit)"  >>  mbuild_job
+
+
+          # FALLS VORHANDEN, LETZTE VERSION AUF DEM REMOTE-RECHNER AUSPACKEN
+       echo  "[[ -f ${mainprog}_current_version.tar ]]  &&  tar -xvf  ${mainprog}_current_version.tar"  >>  mbuild_job
+
+
+          # AKTUELLE QUELLTEXTVERSION AUF REMOTE-RECHNER AUSPACKEN
+       echo  "tar -xvf  ${mainprog}_sources.tar"              >>  mbuild_job
+
+
+          # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN
+       echo  "make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "  >>  mbuild_job
+       echo  "chmod  u+w  *"                                  >>  mbuild_job
+
+          # NEUE VERSION AUF REMOTE-RECHNER ZUSAMMENPACKEN
+       echo  "tar -cvf  ${mainprog}_current_version.tar  *.f90  *.o"  >>  mbuild_job
+
+
+          # AKTUELLES VERSIONSVERZEICHNIS AUF REMOTE-RECHNER BEREINIGEN
+       echo  "make  clean"                                    >>  mbuild_job
+       echo  "rm ${mainprog}_sources.tar"                     >>  mbuild_job
+       echo  "rm *.f90 Makefile"                              >>  mbuild_job
+
+
+
+          # JOB MITTELS SUBJOB STARTEN
+       printf "\n  *** sending batch job to remote host"
+#       subjob  $xoption  -h $remote_host  -q $queue  -m $memory  -t $cputime  -v  mbuild_job
+
+
+          # JOBFILE LOESCHEN
+#       rm  aljob
+
+    else
+
+       if [[ $remote_host != $local_host ]]
+       then
+
+             # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN
+             # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT
+          echo "  *** copying \"${mainprog}_sources.tar\" to \"${remote_addres}:${remote_md}/\" "
+          if [[ $remote_host != lctit ]]
+          then
+             ssh  ${remote_username}@${remote_addres} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
+          else
+                # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
+                # MIT SSH, DESHALB AUFRUF PER PIPE
+             print "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"  |  ssh ${remote_username}@${remote_addres}  2>&1
+          fi
+          if [[ $local_host = decalpha ]]
+          then
+                # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTÄNDIGEN PFADES
+                # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM
+                # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN
+             remote_md=`echo $remote_md | sed 's/\$HOME\///'`
+             /bin/scp  ${mainprog}_sources.tar  ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar
+          else
+             scp  ${mainprog}_sources.tar  ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar
+          fi
+
+
+
+             # FALLS VORHANDEN, LETZTE VERSION AUF DEM REMOTE-RECHNER AUSPACKEN
+          echo "  *** untar previous update on remote host, if existing"
+          if [[ $remote_host != lctit ]]
+          then
+             ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
+          else
+                # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
+                # MIT SSH, DESHALB AUFRUF PER PIPE
+             print  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"  |  ssh  ${remote_username}@${remote_addres}  2>&1
+          fi
+
+
+             # AKTUELLE QUELLTEXTVERSION AUF REMOTE-RECHNER AUSPACKEN
+          echo "  *** untar actual sources on remote host"
+          if [[ $remote_host != lctit ]]
+          then
+             ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
+          else
+                # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
+                # MIT SSH, DESHALB AUFRUF PER PIPE
+             print  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"  |  ssh  ${remote_username}@${remote_addres}  2>&1
+          fi
+
+
+             # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN
+             # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND
+             # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLEN MAKE
+             # Z.B. DIE PFADE ZUM COMPILER)
+          echo "  *** execute \"make\" on remote host"
+
+          if [[ $remote_host = nech ]]
+          then
+             make_call_string="sxmake  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
+          else
+             make_call_string="make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
+          fi
+
+          if [[ $remote_host = t3eh ]]
+          then
+       
+             print "xterm\nexit\n cd ${remote_md}; make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" " | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
+
+          elif [[ $remote_host = t3ej2  ||  $remote_host = ibms  ||  $remote_host = ibmy ]]
+          then
+
+             ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; echo '$make_call_string' > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" 2>&1 | tee ${remote_host}_last_make_protokoll
+
+          elif [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
+          then
+
+             print "export OBJECT_MODE=64; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
+
+          elif [[ $remote_host = lctit ]]
+          then
+
+             echo  " "  >  ${remote_host}_last_make_protokoll
+             while [[ $(cat ${remote_host}_last_make_protokoll | grep -c "Forwarding to N1GE") = 0 ]]
+             do
+                print "cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
+             done
+
+          else
+
+             print "cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
+
+          fi
+
+          if [[ $(grep -c MAKE_ERROR ${remote_host}_last_make_protokoll) != 0 ]]
+          then
+             printf "\a\n  +++ error(s) occurred during compiling or linking on host \"$remote_host\" "
+             if [[ $silent = false ]]
+             then
+                answer=dummy
+                printf "\n"
+                while [[ "$answer" != c  &&  "$answer" != k ]]
+                do
+                   printf "  >>> continue / list errors / kill mbuild (c/l/k) ? "
+                   read  answer
+                   if [[ "$answer" = l ]]
+                   then
+                      more ${remote_host}_last_make_protokoll
+                   fi
+                done
+                if [[ $answer = k ]]
+                then
+                   locat=user_abort; exit
+                fi
+             fi
+          fi
+
+
+
+             # NEUE VERSION AUF REMOTE-RECHNER ZUSAMMENPACKEN
+          printf "\n  *** tar update on remote host ..."
+          if [[ $remote_host != lctit ]]
+          then
+             ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  *.f90 *.o *.mod"
+          else
+                # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
+                # MIT SSH, DESHALB AUFRUF PER PIPE
+             print  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  *.f90 *.o *.mod"  |  ssh  ${remote_username}@${remote_addres}  2>&1
+          fi
+
+
+             # AKTUELLES VERSIONSVERZEICHNIS AUF REMOTE-RECHNER BEREINIGEN
+#          printf "\n  *** \"make clean\" on remote host ..."
+#          ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; make clean; rm ${mainprog}_sources.tar; rm *.f90 Makefile"
+#          printf "\n"
+
+
+             # NUR AUF EINEM HLRN-RECHNER UEBERSETZEN
+          [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]  &&  ibm_hb_done=true
+
+       else
+
+             # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF LOKALEM RECHNER AUSFUEHREN
+          echo "  *** execute \"make\" on local host"
+
+          make  PROG=$mainprog  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$loader_options"  2>&1 | tee ${remote_host}_last_make_protokoll
+
+          if [[ $? != 0 ]]
+          then
+             printf "\a\n  +++ error(s) occurred during compiling or linking on host \"$remote_host\" "
+             if [[ $silent = false ]]
+             then
+                answer=dummy
+                printf "\n"
+                while [[ "$answer" != c  &&  "$answer" != k ]]
+                do
+                   printf "  >>> continue / list errors / kill mbuild (c/l/k) ? "
+                   read  answer
+                   if [[ "$answer" = l ]]
+                   then
+                      more ${remote_host}_last_make_protokoll
+                   fi
+                done
+                if [[ $answer = k ]]
+                then
+                   locat=user_abort; exit
+                fi
+             fi
+          fi
+
+
+             # NEUE VERSION AUF LOKALEM RECHNER ZUSAMMENPACKEN
+          printf "\n  *** tar update on local host ..."
+          tar -cf  ${mainprog}_current_version.tar  *.$suf *.o *.mod
+
+             # NUR EINMAL AUF LCMUK UEBERSETZEN
+          [[ $remote_host = lcmuk ]]  &&  lcmuk_done=true
+
+       fi
+
+    fi
+ done
+
+
+ if [[ $host_found = false ]]
+ then
+    if [[ $host = all ]]
+    then
+       printf "\n  +++ no hosts found in configuration file"
+    else
+       printf "\n  +++ host \"$host\" not found in configuration file"
+    fi
+    locat=config_file; exit
+ fi
+
+
+
+    # ABSCHLIESSENDE ARBEITEN
+ rm -f  hosts_found_in_config_file
+
Index: palm/trunk/SCRIPTS/mrun_new
===================================================================
--- palm/trunk/SCRIPTS/mrun_new	(revision 1)
+++ palm/trunk/SCRIPTS/mrun_new	(revision 1)
@@ -0,0 +1,3884 @@
+#!/bin/ksh
+
+##!/home/DSRC/NC/tatuyama/pub/ksh   NEEDED ON NEC AT RIAM !!!!!!!!!!
+
+# mrun - Plot-Shellskript         Version:  @(#)MRUN 1.8   07/02/07
+
+     # Prozedur zum Starten von Modellaeufen
+
+     # letzte Aenderung:
+     # 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 CHANGED_FILES  or -s CF,
+     #                     adapted for RIAM (neck)
+
+
+
+ 
+    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
+
+ set +o allexport    # SICHERHEITSHALBER UNTERBINDEN, DA SONST EVTL. STAGEOUT
+                     # NICHT LAUEFT (TOO MANY ARGUMENTS - PROBLEM)
+ set +o noclobber    # EXISTIERENDE DATEIEN DUERFEN UEBERSCHRIEBEN WERDEN
+
+ AddFilenames=""
+ additional_conditions=""
+ add_source_path=""
+ afname=""
+ archive_save=true
+ archive_system=none
+ compiler_name=""
+ cond1=""
+ cond2="" 
+ config_file=.mrun.config
+ continuation_run=false
+ cpp_opts=""
+ cpumax=0
+ cpurest=0
+ delete_temporary_catalog=true
+ do_batch=false
+ do_compile=true
+ do_remote=false
+ do_stagein=true
+ do_stageout=true
+ do_trace=false
+ email_notification=""
+ exclude=""
+ executable=""
+ execution_error=false
+ filetransfer_protocol=""
+ fname=test
+ fromhost=""
+ host=""
+ host_file=""
+ hp=""
+ ignore_archive_error=false
+ input_list=""
+ interpreted_config_file=""
+ job_on_file=""
+ keep_data_from_previous_run=false
+ localhost_realname=$(hostname)
+ local_compile=false
+ locat=normal
+ mainprog=""
+ makefile=""
+ mc=$0
+ while [[ $(echo $mc | grep -c "/") != 0 ]]
+ do
+    mc=`echo $mc | cut -f2- -d"/"`
+ done
+ module_files=""
+ MODULE_OPTIONS=""
+ mrun_script_name=$mc
+ netcdf_support=false
+ node_usage=default
+ numprocs=""
+ OOPT=""
+ openmp=false
+ output_list=""
+ package_list=""
+ punkte="..........................................................."
+ queue=none
+ read_from_config=""
+ return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
+ if [[ $return_addres = 130.75.105.158 ]]
+ then
+    return_addres=172.20.25.41
+    echo "+++ WARNING: return_addres changed to $return_addres !!!!!"
+ fi
+# if [[ $return_addres = 210.117.65.1 ]]
+# if [[ $(nslookup `hostname` 2>&1 | grep -c 210.117.65.1) = 1 ]]
+# then
+#    [[ $localhost_realname = gfdl3.yonsei.ac.kr ]]  &&  return_addres=165.132.26.56
+# fi
+ return_password=""
+ return_username=$LOGNAME
+ remotecall=false
+ remote_username=""
+ run_mode=""
+ scirocco=false
+ store_on_archive_system=true
+ striche="  ----------------------------------------------------------------------------"
+ silent=false
+ source_list=""
+ source_path=SOURCE
+ tasks_per_node=""
+ threads_per_task=1
+ tmpcreate=false
+ tmp_data_catalog=""
+ transfer_problems=false
+ usern=$LOGNAME
+ use_makefile=""
+ working_directory=`pwd`
+ TOPT=""
+ XOPT=""
+ zeit=$( date | cut -c 12-19 )
+
+ typeset -i  iec=0 iic=0 iin=0 ioc=0 iout=0 memory=0 stagein_anz=0 stageout_anz=0
+ typeset -i  cputime i ii icycle inode ival jobges jobsek maxcycle minuten nodes pes sekunden tp1
+
+ typeset  -R40 calltime
+ typeset  -L20 spalte1
+ typeset  -L40 spalte2
+ typeset  -L60 spalte3
+ typeset  -L35 string1=`date`
+ typeset  -L12 string2=$usern
+ typeset  -L12 string3=$localhost_realname
+ typeset  -L12 string4
+ typeset  -L12 string5
+ typeset  -L20 version="MRUN  1.8"
+
+
+
+    # EINZELNE VARIABLE FUER HAUPTPROGRAMM EXPORTIEREN
+ export  cpurest fname host localhost return_addres return_username remotecall tasks_per_node
+
+    # FOLGENDE VARIABLEN MUESSEN FUER DIE INTERPRETATION DER KONFIGURATIONSDATEI
+    # EXPORTIERT WERDEN
+ export  afname config_file cpp_opts cpumax do_batch do_trace fname fromhost
+ export  input_list memory numprocs output_list queue run_mode
+
+
+ 
+    # FEHLERBEHANDLUNG
+    # BEI EXIT:
+ trap 'if [[ $locat != localhost ]]
+       then
+          if [[ ! -f ${mrun_path}/statistik/mrun_statistik ]]
+          then
+             cat  >  ${mrun_path}/statistik/mrun_statistik  <<  %STATEND%
+MRUN-calls on $localhost
+
+date and time                      user        localhost   remotehost  termination mrun-command
+--------------------------------------------------------------------------------------------------------------------
+%STATEND%
+             chmod  666  ${mrun_path}/statistik/mrun_statistik
+          fi
+
+             # EINTRAG IN DIE STATISTIK-DATEI
+          string4=$host
+          string5=$locat
+          if [[ "$job_on_file" = ""  &&  $locat != control_c  &&  $locat != user_abort ]]
+          then
+             if [[ $do_batch = true ]]
+             then
+                printf "$string1$string2$string3$string4$string5$mrun_com \n"  >>  ${mrun_path}/statistik/mrun_statistik
+             else
+                printf "$string1$string2$string3$string4$string5$mc \n"  >>  ${mrun_path}/statistik/mrun_statistik
+             fi
+          fi
+       fi
+
+       if [[ $locat != normal  &&  $locat != control_c  &&  $locat != local_compile ]]
+       then
+
+              # EVENTUELLE ERROR-KOMMANDOS ABARBEITEN
+          (( i = 0 ))
+          while (( i < iec ))
+          do
+             (( i = i + 1 ))
+             printf "\n  *** Execution of ERROR-command:\n"
+             printf "  >>> ${err_command[$i]}\n"
+             eval  ${err_command[$i]}
+          done
+          if [[ -n $interpreted_config_file ]]  then
+             rm -rf  $interpreted_config_file
+          fi
+          if [[ $tmpcreate = true ]]
+          then
+             printf "\n  *** Contents of \"$TEMPDIR\":\n"
+             ls -al; cd
+             [[ $delete_temporary_catalog = true ]]  &&  rm -rf $TEMPDIR
+          fi
+          if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]]
+          then
+             rm -rf  ~/job_queue/JOBINFO.$QSUB_REQID
+          fi
+          printf "\n\n+++ MRUN killed \n\n"
+       elif [[ $locat != control_c ]]
+       then
+          printf "\n\n --> all actions finished\n\n"
+          printf "     Bye, bye $usern !!\n\n"
+       fi' exit
+
+
+    # BEI TERMINAL-BREAK:
+ trap '[[ $tmpcreate = true ]]  &&  (cd; rm -rf $TEMPDIR)
+       if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]]
+       then
+          rm -rf  ~/job_queue/JOBINFO.$QSUB_REQID
+       fi
+       printf "\n+++ MRUN killed by \"^C\" \n\n"
+       locat=control_c
+       exit
+      ' 2
+
+
+    # EVTL. NAMEN DES LOKALEN RECHNERS MIT UEBERGREIFENDEM NAMEN VERSEHEN
+ case  $localhost_realname  in
+     (atmos)                mrun_path=/home/siggi/pub
+                            localhost=lcide;;
+     (bora|breva|elephanta|gallego|gregale|hababai|irifi|levanto|maestro|orkan|ostria|poniente|quanero|scirocco|vorias)  mrun_path=/home/raasch/pub
+                            localhost=lcmuk;;
+     (caurus|caver|gharra|samun|twister|viracao|yalka)  mrun_path=/home/raasch/pub/
+                                                         localhost=hpmuk;;
+     (breg*-en0|berni*-en0) mrun_path=/home/b/niksiraa/pub
+                            localhost=ibmb; archive_system=tivoli;;
+     (cs*)                  mrun_path=/pf/b/b323011/pub
+                            localhost=nech; archive_system=ut;;
+     (gate|n-sx)            mrun_path=/home/DSRC/NC/tatuyama/pub
+                            PATH=$PATH:/usr/bin/nqsII:$mrun_path
+                            localhost=neck;;
+     (ground.yonsei.ac.kr)  mrun_path=/usr/users/raasch/pub
+                            localhost=decalpha;;
+     (gfdl3.yonsei.ac.kr)   mrun_path=/usr2/users/raasch/pub
+                            localhost=decalpha;;
+     (gfdl5)                mrun_path=/usr1/users/raasch/pub
+                            localhost=ibmy;;
+     (gwdk081.gwdg.de|gwdk082.gwdg.de|gwdk083.gwdg.de)  mrun_path=/usr/users/sraasch/pub
+                            localhost=ibm;;
+     (hreg*-en0|hanni*-en0) mrun_path=/home/h/niksiraa/pub
+                            localhost=ibmh; archive_system=tivoli;;
+     (nobel*)               mrun_path=/edun/z051nyg/pub
+                            localhost=ibms;;
+     (sun1|sun2)            mrun_path=/home/nhbksira/pub/
+                            localhost=unics;;
+     (tgg*)                 mrun_path=/home2/usr5/mkanda/pub
+                            localhost=lctit;;
+     (*)                    printf "\n  +++ Host \"$localhost_realname\" not admitted for mrun \n"
+                            locat=localhost; exit;;
+ esac
+
+ [[ $localhost_realname = scirocco ]]  &&  scirocco=true
+
+
+ 
+    # SHELLSCRIPT-OPTIONEN EINLESEN UND KOMMANDO NEU ZUSAMMENSETZEN, FALLS ES
+    # FUER FOLGEJOBS BENOETIGT WIRD
+ while  getopts  :a:AbBc:Cd:D:f:Fh:H:i:IkK:m:M:n:o:Op:P:q:r:R:s:St:T:u:U:vxX: option
+ do
+   case  $option  in
+       (a)   afname=$OPTARG;;
+       (A)   store_on_archive_system=false; mc="$mc -A";;
+       (b)   do_batch=true; mc="$mc -b";;
+       (B)   delete_temporary_catalog=false; mc="$mc -B";;
+       (c)   config_file=$OPTARG; mc="$mc -c$OPTARG";;
+       (C)   continuation_run=true; mc="$mc -C";;
+       (d)   fname=$OPTARG; mc="$mc -d$OPTARG";;
+       (D)   cpp_opts="$cpp_opts $OPTARG"; mc="$mc -D$OPTARG";;
+       (f)   filetransfer_protocol=$OPTARG; mc="$mc -f$OPTARG";;
+       (F)   job_on_file="-D"; mc="$mc -F";;
+       (h)   host=$OPTARG; mc="$mc -h$OPTARG";;
+       (H)   fromhost=$OPTARG; mc="$mc -H$OPTARG";;
+       (i)   input_list=$OPTARG; mc="$mc -i'$OPTARG'";;
+       (I)   ignore_archive_error=true; mc="$mc -I";;
+       (k)   keep_data_from_previous_run=true; mc="$mc -k";;
+       (K)   additional_conditions="$OPTARG"; mc="$mc -K$OPTARG";;
+       (m)   memory=$OPTARG; mc="$mc -m$OPTARG";;
+       (M)   makefile=$OPTARG; mc="$mc -M$OPTARG";;
+       (n)   node_usage=$OPTARG; mc="$mc -n$OPTARG";; 
+       (o)   output_list=$OPTARG; mc="$mc -o'$OPTARG'";;
+       (O)   use_openmp=true; mc="$mc -O";;
+       (p)   package_list=$OPTARG; mc="$mc -p'$OPTARG'";;
+       (P)   return_password=$OPTARG; mc="$mc -P$OPTARG";;
+       (q)   queue=$OPTARG; mc="$mc -q$OPTARG";;
+       (r)   run_mode=$OPTARG; mc="$mc -r'$OPTARG'";;
+       (R)   remotecall=true;return_addres=$OPTARG; mc="$mc -R$OPTARG";;
+       (s)   source_list=$OPTARG; mc="$mc -s'$OPTARG'";;
+       (S)   read_from_config=false; mc="$mc -S";;
+       (t)   cpumax=$OPTARG; mc="$mc -t$OPTARG";;
+       (T)   tasks_per_node=$OPTARG; mc="$mc -T$OPTARG";;
+       (u)   remote_username=$OPTARG; mc="$mc -u$OPTARG";;
+       (U)   return_username=$OPTARG; mc="$mc -U$OPTARG";;
+       (v)   silent=true; mc="$mc -v";;
+       (x)   do_trace=true;set -x; mc="$mc -x";;
+       (X)   numprocs=$OPTARG; mc="$mc -X$OPTARG";;
+       (\?)  printf "\n  +++ unknown option $OPTARG \n"
+             printf "\n  --> type \"$0 ?\" for available options \n"
+             locat=parameter;exit;;
+   esac
+ done
+
+
+    # EVTL. POSITIONSPARAMETER EINLESEN
+    # ZUR ZEIT GIBT ES NUR DEN PARAMETER ? (=KURZINFO)
+ shift OPTIND-1
+
+
+    # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
+ if [[ "$1" = "?" ]]
+ then
+   (printf "\n  *** mrun can be called as follows:\n"
+    printf "\n      $mrun_script_name  -b -c.. -d.. -D.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X..  <modus>\n"
+    printf "\n      Description of available options:\n"
+    printf "\n      Option  Description                              Default-Value"
+    printf "\n        -a    base name of input files                 equiv. -d"
+    printf "\n        -A    no archiving when using file-attribute fl"
+    printf "\n        -b    batch-job on local machine               ---"
+    printf "\n        -B    do not delete temporary directory at end ---"
+    printf "\n        -c    configuration file                       .mrun.config"
+    printf "\n        -d    base name of files attached to program   test"
+    printf "\n        -D    preprocessor(cpp)-directives             \"\" "
+    printf "\n        -f    filetransfer protocol (ftp or scp)       depending on -h"
+    printf "\n        -F    create remote job file only              ---"
+    printf "\n        -h    execution host                           $localhost_realname"
+    printf "\n        -i    INPUT control list                       \"\" "
+    printf "\n        -I    archiving errors of previous batch-jobs"
+    printf "\n              will be ignored"
+    printf "\n        -k    keep data from previous run"
+    printf "\n        -K    additional conditions for controling"
+    printf "\n              usage of conditional code and"
+    printf "\n              env-variables in configuration file      \"\" "
+    printf "\n        -m    memory demand in MB (batch-jobs)         0 MB"
+    printf "\n        -M    Makefile name                            Makefile"
+    printf "\n        -n    node usage (shared/not_shared)           depending on -h"
+    printf "\n        -o    OUTPUT control list                      \"\" "
+    printf "\n        -O    use OpenMP                               ---"
+    printf "\n        -p    software package list                    \"\" "
+    printf "\n        -q    queue                                    \"$queue\" "
+    printf "\n        -r    run control list (combines -i -o)        \"\" "
+    printf "\n        -s    filenames of routines to be compiled     \"\" "
+    printf "\n              must end with .f, .f90, .F, or .c !"
+    printf "\n              use \"..\" for more than one file and wildcards"
+    printf "\n              -s TEST compiles all files with w-permit"
+    printf "\n        -S    config file interpreted by shellscript   ---"
+    printf "\n        -t    allowed cpu-time in seconds (batch)      0"
+    printf "\n        -T    tasks per node                           depending on -h"
+    printf "\n        -u    username on remote machine               \"\" "
+    printf "\n        -v    no prompt for confirmation               ---"
+    printf "\n        -x    tracing of mrun for debug purposes       ---"
+    printf "\n        -X    # of processors (on parallel machines)   1"
+    printf "\n "
+    printf "\n      Possible values of positional parameter <modus>:"
+    printf "\n        \"?\"       -  this outline \n\n") | more
+    exit
+ elif [[ "$1" != "" ]]
+ then
+    printf "\n  +++ positional parameter $1 unknown \n"
+    locat=parameter; exit
+ fi
+
+
+
+    # KURZE STARTMELDUNG
+ printf "\n*** $version "
+ printf "\n    will be executed.     Please wait ..."
+
+
+    # BASISNAME DER INPUT-DATEIEN GLEICH ALLGEMEINEM BASISNAMEN SETZEN,
+    # WENN NICHT VOM BENUTZER ANDERS BESTIMMT
+ [[ "$afname" = "" ]]  &&  afname=$fname
+
+
+    # EVTL. RUN-MODUS DEN I/O-LISTEN HINZUFUEGEN
+ if [[ "$run_mode" != "" ]]
+ then
+    input_list="$input_list $run_mode"
+    output_list="$output_list $run_mode"
+ fi
+
+
+    # RECHNERNAMEN ABSPEICHERN, VON DEM AUS JOB GESTARTET WIRD,
+    # ALLERDINGS NUR DANN, WENN NICHT PER OPTION -H BEREITS EIN WERT
+    # ZUGEWIESEN WURDE (MRUN MACHT DIES IMMER, WENN ES SELBST BATCH-JOBS
+    # STARTET)
+ if [[ "$fromhost" = "" ]]
+ then
+    fromhost=$localhost
+ fi
+
+
+     # PRUEFEN, OB MRUN NUR TESTWEISE AUF DER LOKALEN MASCHINE KOMPILIEREN SOLL
+ if [[ "$source_list" = LOCAL_COMPILE_TEST ]]
+ then
+    source_list=TEST
+    local_compile=true
+    host=$localhost
+ fi
+    
+
+    # PRUEFEN, OB AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL
+    # WERT VON do_remote WIRD FUER DATEIVERBINDUNGEN BENOETIGT.
+    # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR,
+    # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS
+ if [[ -n $host  &&  "$host" != $localhost ]]
+ then
+    do_batch=true
+    do_remote=true
+    case  $host  in
+        (hpmuk|ibm|ibmb|ibmh|ibms|ibmy|nech|neck|lctit|unics)  true;;
+        (*)  printf "\n"
+             printf "\n  +++ execution host \"$host\" not admitted for MRUN,"
+             printf "\n      or NQS not available on execution host!"
+             locat=nqs; (( iec = 0 )); exit;;
+    esac
+ else
+    host=$localhost
+ fi
+
+
+     # ZUSATZBEDINGUNGEN (OPTION -K) AUSWERTEN
+ if [[ -n $additional_conditions ]]
+ then
+    echo $additional_conditions | cut -d" " -f1-3 | read  cond1  cond2  dummy
+#    cond1=`echo $additional_conditions | cut -d" " -f1`
+#    cond2=`echo $additional_conditions | cut -d" " -s -f2`
+#    dummy=`echo $additional_conditions | cut -d" " -s -f3`
+    if [[ -n $dummy ]]
+    then
+       printf "\n  +++ more than 2 additional conditions given for Option \"-K\""
+       locat=options; exit
+    fi
+ fi
+
+
+    # PRUEFEN, OB EVTL. BEI VORHERGEHENDEM LAUF (KETTENJOB) EINE
+    # ARCHIVIERUNG FEHLGESCHLAGEN IST
+ if [[ -f ~/job_queue/ARCHIVE_ERROR_$fname ]]
+ then
+    if [[ $ignore_archive_error = false ]]
+    then
+       printf "\n  +++ data archiving of previous run failed"
+       printf "\n      see directory \~/job_queue on remote machine"
+       locat=archive; exit
+    else
+       printf "\n  +++ warning: data archiving in a previous run failed"
+       printf "\n      MRUN continues, trying to get backup copy"
+    fi
+ fi
+
+
+    # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN
+ if [[ ! -f $config_file ]]
+ then
+    printf "\n\n  +++ configuration file: "
+    printf "\n           $config_file"
+    printf "\n      does not exist"
+    locat=connect; exit  
+ fi
+
+
+
+    # LESEN UND INTERPRETIEREN DER KONFIGURATIONS-DATEI VOM SHELLSCRIPT AUS
+    # VORUEBERGEHEND ZWINGEND AUF LINUX-RECHNERN
+ if [[ "$read_from_config" = false ]]
+ then
+
+    [[ $silent = false ]]  &&  printf "\n    Reading the configuration file... "
+    while  read zeile
+    do
+        [[ $silent = false ]]  &&  printf "."
+
+
+          # ZUERST EVENTUELL VORKOMMENDE ENVIRONMENT-VARIABLEN DURCH IHRE WERTE
+          # ERSETZEN
+       eval  zeile=\"$zeile\"
+
+
+          # INTERPRETATION DER ZEILE
+       if [[ "$(echo $zeile | cut -c1)"  =  "#" ]]
+       then
+
+             # ZEILE IST KOMMENTARZEILE
+          true
+
+       elif [[ "$(echo $zeile | cut -c1)"  =  "%" ]]
+       then
+
+             # ZEILE DEFINIERT ENVIRONMENT-VARIABLE
+          zeile=$(echo $zeile | cut -c2-)
+          echo $zeile | cut -d" " -f1-5 | read  var  value  for_host  for_cond1  for_cond2
+#          var=`echo $zeile | cut -d" " -f1`
+#          value=`echo $zeile | cut -d" " -s -f2`
+#          for_host=`echo $zeile | cut -d" " -s -f3`
+#          for_cond1=`echo $zeile | cut -d" " -s -f4`
+#          for_cond2=`echo $zeile | cut -d" " -s -f5`
+
+          if [[ "$for_host" = ""  ||  ( "$for_host" = $host  &&  "$for_cond1" = "$cond1"  &&  "$for_cond2" = "$cond2" )  ||  $(echo "$input_list$output_list"|grep -c "$for_host") != 0 ]]
+          then
+
+                # BEI COMPILER- CPP- ODER LINKEROPTIONEN EVTL ":" DURCH " "
+                # ERSETZEN. "::" WIRD DURCH ":" ERSETZT.
+             value=`echo $value | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'`
+
+
+                # ENVIRONMENT-VARIABLE WIRD WERT AUS KONFIGURATIONSDATEI
+                # ZUGEWIESEN, WENN SIE SELBST NOCH KEINEN WERT UEBER DIE
+                # ENTSPRECHENDE SCRIPT-OPTION ERHALTEN HAT. SOLCHE
+                # VARIABLEN HAETTEN DANN DEN WERT "" ODER IM INTEGER-FALL DEN
+                # WERT 0.  ALLGEMEINE REGEL ALSO: SCRIPT-OPTION GEHT UEBER
+                # KONFIGURATIONSDATEI
+             if [[ "$(eval echo \$$var)" = ""  ||  "$(eval echo \$$var)" = "0" ]]
+             then
+                eval  $var=\$value
+
+                   # EVTL. BILDSCHIRMAUSGABEN DER ENVIRONMENT-VARIABLEN
+                if [[ $do_trace = true ]]
+                then
+                   printf "\n*** ENVIRONMENT-VARIABLE $var = $value"
+                fi
+             fi
+
+                # WENN ENVIRONMENT-VARIABLE HOST VEREINBART, DANN SOFORT AUSWERTEN
+                # WERT VON do-remote WIRD BEI DATEIVERBINDUNGEN BENOETIGT
+                # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR,
+                # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS
+             if [[ $var = host ]]
+             then
+                if [[ -n $host  &&  "$host" != $localhost ]]
+                then
+                   do_batch=true
+                   do_remote=true
+                   case  $host  in
+                       (ibm|ibms|ibmy|lctit|nech|neck|unics)  true;;
+                       (*)  printf "\n  +++ no queueing system available on execution host \"$host\""
+                            locat=nqs; exit;;
+                   esac
+                else
+                   host=$localhost
+                fi
+             fi
+
+                # VOM BENUTZER DEFINIERTE ENVIRONMENT VARIABLEN MUESSEN PRINZIPIELL
+                # EXPORTIERT WERDEN, DA SIE VIELLEICHT IN WEITER UNTEN AUFZURUFEN-
+                # DEN PROGRAMMEN BENOETIGT WERDEN
+             export  $var
+          fi
+
+
+
+
+       elif [[ "$(echo $zeile | cut -c1-3)" = "EC:" ]]
+       then
+
+             # ZEILE DEFINIERT ERROR-KOMMANDO
+          (( iec = iec + 1 ))
+          zeile=$(echo $zeile | cut -c4-)
+          err_command[$iec]="$zeile"
+
+       elif [[ "$(echo $zeile | cut -c1-3)" = "IC:" ]]
+       then
+
+             # ZEILE DEFINIERT INPUT-KOMMANDO
+          (( iic = iic + 1 ))
+          zeile=$(echo $zeile | cut -c4-)
+          in_command[$iic]="$zeile"
+
+       elif [[ "$(echo $zeile | cut -c1-3)" = "OC:" ]]
+       then
+
+             # ZEILE DEFINIERT OUTPUT-KOMMANDO
+          (( ioc = ioc + 1 ))
+          zeile=$(echo $zeile | cut -c4-)
+          out_command[$ioc]="$zeile"
+
+       else
+
+             # ZEILE DEFINIERT DATEIVERBINDUNG. EINLESEN DER DATEIEIGENSCHAFTEN
+             # s2a: in/out - Feld
+             # s2b: loc    - Feld (optional)
+             # s2c: tr/ar  - Feld (optional)
+          echo $zeile | cut -d" " -f1-2 | read  s1  s2
+#          s1=`echo $zeile | cut -d" " -f1`
+#          s2=`echo $zeile | cut -d" " -s -f2`
+          s2a=$(echo $s2 | cut -d":" -f1)
+          if [[ $(echo $s2 | grep -c ":") = 0 ]]
+          then
+             s2b=""
+             s2c=""
+          else
+             echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read  s2b  s2c
+#             s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'`
+#             s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'`
+          fi
+          echo $zeile | cut -d" " -f3-6 | read  s3  s4  s5  s6
+#          s3=`echo $zeile | cut -d" " -f3`
+#          s4=`echo $zeile | cut -d" " -s -f4`
+#          s5=`echo $zeile | cut -d" " -s -f5`
+#          s6=`echo $zeile | cut -d" " -s -f6`
+
+       
+             # ABSPEICHERN DER DATEIVERBINDUNG, FALLS IN INPUT- ODER OUTPUT-LIST
+             # VERMERKT. VARIABLE S3 KANN AUCH LISTE ENTHALTEN (FELDTRENNER ":")
+             # DATEIVERBINDUNG WIRD DANN NICHT ABGESPEICHERT UND GEPRUEFT, WENN
+             # PROGRAMMLAUF AUF REMOTE-MASCHINE ERFOLGT UND DATEI NUR LOKAL VOR-
+             # HANDEN SEIN MUSS (D.H. s2b = loc)
+          IFSALT="$IFS"; IFS="$IFS:"
+          if [[ "$s2a" = in  &&  ! ( $do_remote = true  &&  ( "$s2b" = loc  ||  "$s2b" = locopt ) ) ]]
+          then
+             found=false
+             for  actual  in  $input_list
+             do
+                for  formal  in  $s3
+                do
+                   [[ $actual = $formal  ||  "$formal" = "-" ]]  &&  found=true
+                done
+             done
+             if [[ $found = true ]]
+             then
+                (( iin = iin + 1 ))
+                localin[$iin]=$s1; transin[$iin]=$s2b; actionin[$iin]=$s2c;
+                typein[$iin]=$s3; pathin[$iin]=$s4; endin[$iin]=$s5;
+                extin[$iin]=$s6
+             fi
+          elif [[ "$s2a" = out  &&  ! ( $do_remote = true  &&  "$s2b" = loc ) ]]
+          then
+             found=false
+             for  actual  in  $output_list
+             do
+                for  formal  in  $s3  
+                do
+                   [[ $actual = $formal  ||  "$formal" = "-"  ]]  &&  found=true
+                done
+             done
+             if [[ $found = true ]]
+             then
+                (( iout = iout + 1 ))
+                localout[$iout]=$s1; actionout[$iout]=$s2c; typeout[$iout]=$s3;
+                pathout[$iout]=$s4; endout[$iout]=$s5; extout[$iout]=$s6
+             fi
+          elif [[ "$s2a" != in  &&  "$s2a" != out ]]
+          then
+             printf "\n  +++ I/O-attribute in configuration file $config_file has the invalid"
+             printf "\n      value \"$s2\". Only \"in\" and \"out\" are allowed!"
+             locat=connect; exit
+          fi
+          IFS="$IFSALT"
+       fi
+    done < $config_file
+
+ else
+
+
+       # INTERPRETATION DER KONFIGURATIONSDATEI MITTELS FORTRAN 90 - PROGRAMM
+    [[ $silent = false ]]  &&  printf "..."
+    export  cond1 cond2 config_file do_remote do_trace input_list localhost output_list
+    export  interpreted_config_file=.icf.$RANDOM
+
+    case  $localhost_realname  in
+        (caurus|twister)      interpret_config.hp;;
+        (bora|breva|elephanta|gallego|gregale|hababai|maestro|orkan|ostria)  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/muksoft/packages/intel_ifc/8.1/lib/; interpret_config_9.x;;
+        (levanto|vorias)      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/muksoft/packages/intel/ifort/9.1.037/lib/; interpret_config_9.x_levanto;;
+        (quanero)             export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel_fc_80/lib; interpret_config_9.x;;
+        (*)                   interpret_config.x;;
+    esac
+
+
+       # AUSFUEHRUNG DER GENERIERTEN SHELL-KOMMANDOS IN DIESER SHELL
+    chmod  u+x  $interpreted_config_file
+    export PATH=$PATH:.
+    . $interpreted_config_file
+    rm  $interpreted_config_file
+
+ fi
+
+
+    # QUELLTEXTVERZEICHNIS AUF LOKALER MASCHINE AUS KONFIGURATIONSDATEI
+    # BESTIMMEN (WUERDE SONST EVTL. DAS VERZEICHNIS DES JEWEILS UNTER -h
+    # ANGEGEBENEN REMOTE-RECHNERS SEIN)
+    # BEI BATCH-JOBS SIND DIE ZU UEBERSETZENDEN PROGRAMMTEILE SCHON KOMPLETT
+ if [[ "$SOURCES_COMPLETE" = "" ]]
+ then
+
+       # ZUERST PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD FUER ALLE RECHNER
+       # VEREINBART WURDE
+    source_path=""
+    line=""
+    grep "%source_path" $config_file  >  tmp_mrun
+    while read line
+    do
+       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+       then
+          if [[ "$(echo $line | cut -d" " -f3)" = "" ]]
+          then
+             global_source_path=`echo $line | cut -d" " -f2`
+          fi
+       fi
+    done  <  tmp_mrun
+
+    line=""
+    found=false
+    grep  " $localhost" $config_file | grep "%source_path"  >  tmp_mrun
+    while read line
+    do
+       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+       then
+          if [[ $found = true ]]
+          then
+             printf "\n\n  +++ more than one source path found in configuration file"
+             printf "\n      for local host \"$localhost\" "
+             locat=source_path; exit
+          fi
+          source_path=`echo $line | cut -d" " -f2`
+          found=true
+       fi
+    done  <  tmp_mrun
+    rm  tmp_mrun
+
+    if [[ "$source_path" = "" ]]
+    then
+       if [[ "$global_source_path" != "" ]]
+       then
+          source_path=$global_source_path
+       else
+          printf "\n\n  +++ no source path found in configuration file"
+          printf "\n      for local host \"$localhost\" "
+          locat=source_path; exit
+       fi
+    fi
+    eval source_path=$source_path
+
+    if [[ ! -d $source_path ]]
+    then
+       printf "\n\n  +++ source path \"$source_path\" on local host"
+       printf "\n      \"$localhost\" does not exist"
+       locat=source_path; exit
+    fi
+
+ fi
+
+
+
+    # NOCHMAL PRUEFEN, OB AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL
+    # (HOST KANN IN KONFIGURATIONSDATEI ANDERS FESTGELEGT WORDEN SEIN)
+    # WERT VON do_remote WIRD FUER DATEIVERBINDUNGEN BENOETIGT.
+    # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR,
+    # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS
+ if [[ -n $host  &&  "$host" != $localhost ]]
+ then
+    do_batch=true
+    do_remote=true
+    case  $host  in
+        (hpmuk|ibm|ibmb|ibmh|ibms|ibmy|lctit|nech|neck|unics)  true;;
+        (*)  printf "\n"
+             printf "\n  +++ execution host \"$host\" not admitted for MRUN,"
+             printf "\n      or no queueing system available on execution host!"
+             locat=nqs; (( iec = 0 )); exit;;
+    esac
+ else
+    host=$localhost
+ fi
+
+
+    # PRUEFUNG EINIGER PROZESSORZAHLANGABEN BEI RECHNUNGEN AUF PARALLELRECHNERN
+ if [[ "$cond1" = parallel  ||  "$cond2" = parallel ]]
+ then
+
+       # PRUEFEN, OB DIE ANZAHL DER ZU VERWENDENDEN PES ANGEGEBEN WURDE
+    if [[ ! -n $numprocs ]]
+    then
+       printf "\n"
+       printf "\n  +++ option \"-K parallel\" requires additional specification"
+       printf "\n      of the number of processors to be used by"
+       printf "\n      mrun-option \"-X\" or by environment-variable"
+       printf "\n      \"numprocs\" in the configuration file"
+       locat=numprocs; (( iec = 0 )); exit 
+    fi
+
+       # PRUEFEN, OB DIE PROZESSORANZAHL PRO KNOTEN ANGEGEBEN WURDE (GGF.
+       # DEFAULT-WERT SETZEN) UND OB SIE EIN GANZZAHLIGER TEILER DER
+       # GESAMTPROZESSORANZAHL IST
+    if [[ $host = nech  ||  $host = neck  ||  $host = ibmh  ||  $host = ibmb  ||  $host = ibms ]]
+    then
+       [[ "$tasks_per_node" = "" ]]  &&  tasks_per_node=6
+       (( ival = $tasks_per_node ))
+       (( pes = numprocs ))
+#       if [[ $(echo $package_list | grep -c dvrp_graphics+1PE) = 1 ]]
+#       then
+#          (( pes = pes - 1 ))
+#       fi
+       (( ii = pes / ival ))
+       if (( pes - ii * ival > 0 ))
+       then
+          printf "\n"
+          printf "\n  +++ tasks per node (option \"-T\") must be an integral"
+          printf "\n      divisor of the total number of processors (option \"-X\")"
+          printf "\n      values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\""
+          locat=tasks_per_node; (( iec = 0 )); exit 
+       fi
+    fi
+
+       # IBMY HAT NUR EINEN KNOTEN
+    if [[ $host = ibmy ]]
+    then
+       if [[ "$tasks_per_node" != ""  &&  "$tasks_per_node" != "$numprocs" ]]
+       then
+          printf "\n"
+          printf "\n  +++ on ibmy, tasks per node (option \"-T\") must be equal to the"
+          printf "\n      total number of processors (option \"-X\")"
+          printf "\n      values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\""
+          locat=tasks_per_node; (( iec = 0 )); exit 
+       fi
+    fi
+
+       # FALLS OPENMP PARALLELISIERUNG VERWENDET WERDEN SOLL, ANZAHL VON THREADS
+       # SETZEN UND ZAHL DER TASKS PRO KNOTEN AUF 1 SETZEN
+    if [[ $use_openmp = true ]]
+    then
+       threads_per_task=$tasks_per_node
+       tasks_per_node=1
+    fi
+    OOPT="-O $threads_per_task"
+    TOPT="-T $tasks_per_node"
+
+       # GESAMTZAHL DER KNOTEN BESTIMMEN
+    if [[ "$tasks_per_node" != "" ]]
+    then
+       (( nodes = numprocs / ( tasks_per_node * threads_per_task ) ))
+    fi
+
+       # PRUEFEN, OB NODE USAGE EINEN ERLAUBTEN WERT HAT BZW. DEN DEFAULT
+       # SETZEN
+    if [[ $node_usage = default ]]
+    then
+       if [[ $host = ibms ]]
+       then
+          node_usage=shared
+       else
+          node_usage=not_shared
+       fi
+    fi
+    if [[ $node_usage != shared  &&  $node_usage != not_shared ]]
+    then
+       printf "\n"
+       printf "\n  +++ node usage (option \"-n\") is only allowed to be set"
+       printf "\n      \"shared\" or \"not_shared\""
+       locat=tasks_per_node; (( iec = 0 )); exit 
+    fi
+
+ fi
+
+    # PRUEFEN, OB HOSTFILE EXISTIERT
+ if [[ -n $hostfile ]]
+ then
+    if [[ ! -f $hostfile ]]
+    then
+       printf "\n"
+       printf "\n  +++ hostfile \"$hostfile\" does not exist"
+       locat=hostfile; exit
+    fi
+ fi
+
+    # PRUEFEN, OB RHOSTS DATEI EXISTIERT. GEGEBENENFALLS ANLEGEN BZW. ERWEITERN
+ if [[ $host = ibmy  &&  $do_remote = false ]]
+ then
+    if [[ ! -f $HOME/.rhosts ]]
+    then
+       echo  "gfdl5.yonsei.ac.kr"  >  $HOME/.rhosts
+       printf "\n\n  *** file:"
+       printf "\n           $HOME/.rhosts"
+       printf "\n      was created\n"
+    fi
+    if [[ $(grep -c gfdl5.yonsei.ac.kr $HOME/.rhosts) = 0 ]]
+    then
+       echo  "gfdl5.yonsei.ac.kr"  >>  $HOME/.rhosts
+       printf "\n\n  *** file:"
+       printf "\n           $HOME/.rhosts"
+       printf "\n      was extended by the name of the current host\n"
+    fi
+ fi
+
+    # DEFAULT-DATEITRANSFER-PROTOKOLL FESTLEGEN
+ if [[ "$filetransfer_protocol" = "" ]]
+ then
+    case  $host  in
+        (nech|neck|ibm|ibmb|ibmh|ibms|ibmy|lctit)  filetransfer_protocol=scp;;
+        (*)              filetransfer_protocol=ftp;;
+    esac
+ fi
+
+    # PRUEFEN, OB ZULAESSIGES DATEITRANSFER-PROTOKOLL GEWAEHLT WURDE
+ if [[ "$filetransfer_protocol" != ftp  &&  "$filetransfer_protocol" != scp ]]
+ then
+    printf "\n"
+    printf "\n  +++ illegal value \"$filetransfer_protocol\" for Option -f"
+    printf "\n      only \"ftp\" or \"scp\" are allowed"
+    locat=options; exit
+ fi
+
+
+    # FALLS NICHT VORGEGEBEN, DEFAULT-QUEUE AUF DER ZIELMASCHINE FESTLEGEN
+ if [[ $queue = none ]]
+ then
+    case  $host  in
+        (hpmuk)      queue=hpmuk;;
+        (ibmb)       if [[ $node_usage = shared ]]
+                     then
+                        queue=cshare
+                     else
+                        queue=csolo
+                     fi;;
+        (ibmh)       if [[ $node_usage = shared ]]
+                     then
+                        queue=cshare
+                     else
+                        queue=csolo
+                     fi;;
+        (ibmy)       queue=parallel;;
+        (lctit)      queue=default;;
+        (nech)       queue=none;;
+        (neck)       queue=P;;
+        (unics)      queue=unics;;
+    esac
+ fi
+
+
+    # EVTL. NETCDF-UNTERSTUETZUNG SETZEN
+ case  $host  in
+     (decalpha)   netcdf_support=true
+                  netcdf_path=/usr/local/netcdf-3.5.1;;
+     (ibmb|ibmh)  netcdf_support=true
+                  netcdf_path=/aws/dataformats/netcdf-3.6.0-p1/64-32;;
+     (ibms)       netcdf_support=true
+                  netcdf_path=/applic/lib/NETCDF64;;
+     (ibmy)       netcdf_support=true
+                  netcdf_path=/usr1/users/raasch/pub/netcdf-3.6.0-p1;;
+     (lcmuk)      netcdf_support=true
+                  if [[ $scirocco = true ]]
+                  then
+                     netcdf_path=/opt/netcdf/3.6.2-beta4
+                  else
+                     netcdf_path=/muksoft/packages/netcdf/linux
+                  fi;;
+     (lctit)      netcdf_support=true
+                  netcdf_path=/home2/usr5/mkanda/netcdf-3.6.1;;
+     (nech)       netcdf_support=true
+                  netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;;
+     (neck)       netcdf_support=true
+                  netcdf_path=/home/DSRC/NC/tatuyama/pub/netcdf-3.6.0-p1;;
+ esac
+
+
+    # VOLLSTAENDIGE DATEINAMEN DER INPUT-FILES BILDEN,
+    # INPUT-DATEIEN AUF VORHANDENSEIN PRUEFEN UND EVTL. HOECHSTE ZYKLUSNUMMER
+    # ERMITTELN
+ (( i = 0 ))
+ while (( i < iin ))
+ do
+    (( i = i + 1 ))
+    (( maxcycle = 0 ))
+
+       # NAMENSBILDUNG (EVTL. IST FESTER DATEINAME VORGEGEBEN)
+    if [[ "${actionin[$i]}" = di ]]
+    then
+       remotepathin[$i]=${pathin[$i]}/${endin[$i]}  # REMOTE-PFAD ERST AUF
+                                                    # REM-MASCHINE AUSWERTEN
+       eval filename=${pathin[$i]}/${endin[$i]}
+    else
+       remotepathin[$i]=${pathin[$i]}/${afname}${endin[$i]}  # REMOTE-PFAD ERST AUF
+                                                             # REM-MASCHINE AUSWERTEN
+       eval filename=${pathin[$i]}/${afname}${endin[$i]}
+    fi
+
+       # PRUEFEN AUF VORHANDENSEIN
+    if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1  || \
+          $(ls $filename* 2>&1 | grep -c "No such file") = 1  || \
+          $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]]
+    then
+          # DATEIEN MIT EXTENSION (Z.B. NC) MUESSEN NICHT ZWINGEND VORHANDEN
+          # SEIN, DESHALB IN SOLCHEN FAELLEN KEIN ABBRUCH. DIES IST NUR EINE
+          # VORUEBERGEHENDE LOESUNG (OKT 05). NICHT ZWINGEND BENOETIGTE
+          # EINGABEDATEIEN SOLLTEN EINE SPEZIELLE OPTION IN DER DATEI-
+          # VERBINDUNGSANWEISUNG BEKOMMEN (Z.B. inopt?)
+       if [[ "${transin[$i]}" != "locopt" ]]
+       then
+          printf "\n\n  +++ INPUT-file: "
+          if [[ "${extin[$i]}" = "" ]]
+          then
+             printf "\n           $filename"
+          else
+             printf "\n           $filename.${extin[$i]}"
+          fi
+          printf "\n      does not exist\n"
+          locat=input; exit
+       else
+          transin[$i]="unavailable"
+       fi
+    else
+
+          # ZYKLUSNUMMER FESTSTELLEN
+       ls -1 -d $filename    >   filelist  2>/dev/null
+       ls -1 -d $filename.*  >>  filelist  2>/dev/null
+       while  read zeile
+       do
+          cycle=$(print $zeile | cut -f2 -d".")
+          if [[ "$cycle" = "$zeile" ]]
+          then
+             (( icycle = 0 ))
+          elif [[ "$cycle" = "${extin[$i]}" ]]
+          then
+             (( icycle = 0 ))
+          else
+             (( icycle = $cycle ))
+          fi
+          if (( icycle > maxcycle ))
+          then
+             (( maxcycle = icycle ))
+             file_to_be_used=$zeile
+          fi
+       done <filelist
+       rm filelist
+
+          # EVTL. ZYKLUSNUMMER AN DATEINAMEN ANFUEGEN
+       if (( maxcycle > 0 ))
+       then
+          if [[ "${extin[$i]}" != " "  &&   "${extin[$i]}" != "" ]]
+          then
+             filename=${filename}.$maxcycle.${extin[$i]}
+          else
+             filename=${filename}.$maxcycle
+          fi
+       else
+          if [[ "${extin[$i]}" != " "  &&   "${extin[$i]}" != "" ]]
+          then
+             filename=${filename}.${extin[$i]}
+          fi
+       fi
+       
+          # DATEINAMEN OHNE PFAD ABER MIT ZYKLUSNUMMER ABSPEICHERN,
+          # DA SPAETER BEI RUECKSPEICHERN VOM ARCHIVSYSTEM EVTL. BENOETIGT
+       absnamein[$i]=$filename
+       if (( maxcycle > 0 ))
+       then
+          if [[ "${actionin[$i]}" = di ]]
+          then
+             frelin[$i]=${endin[$i]}.$maxcycle
+          else
+             frelin[$i]=${afname}${endin[$i]}.$maxcycle
+          fi
+       else
+          if [[ "${actionin[$i]}" = di ]]
+          then
+             frelin[$i]=${endin[$i]}
+          else
+             frelin[$i]=${afname}${endin[$i]}
+          fi
+       fi
+
+    fi
+ done
+       
+
+    # VOLLSTAENDIGE DATEINAMEN (OHNE $ ODER ~) DER OUTPUT-FILES BILDEN,
+    # OUTPUT-DATEIEN AUF VORHANDENSEIN PRUEFEN UND EVTL. HOECHSTE ZYKLUSNUMMER
+    # ERMITTELN ODER, FALLS NICHT VORHANDEN, PRUEFEN, OB SIE SICH ANLEGEN LASSEN
+    # DIESE AKTIONEN FINDEN NICHT STATT, WENN PROGRAMM AUF REMOTE-MASCHINE
+    # RECHNET UND DATEI ANSCHLIESSEND TRANSFERIERT WERDEN SOLL!
+ (( i = 0 ))
+ while (( i < iout ))
+ do
+    (( i = i + 1 ))
+    if [[ ! ( $fromhost != $localhost  &&  ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]]
+    then
+       if [[ "${actionout[$i]}" = tr  ||  "${actionout[$i]}" = trpe ]]
+       then
+          actionout[$i]=""
+       elif [[ "${actionout[$i]}" = tra ]]
+       then
+          actionout[$i]=a
+       fi
+       (( maxcycle = 0 ))
+       eval filename=${pathout[$i]}/${fname}${endout[$i]}
+       eval catalogname=${pathout[$i]}
+       if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1  || \
+             $(ls $filename* 2>&1 | grep -c "No such file") = 1  || \
+             $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]]
+       then
+      
+             # OUTPUT-DATEI NICHT VORHANDEN. PRUEFEN, OB ANLEGEN MOEGLICH.
+          if  cat /dev/null > $filename  
+          then
+             rm  $filename
+          else
+
+                # PRUEFEN, OB KATALOG VORHANDEN UND EVTL. DIESEN ANLEGEN
+             if [[ ! -d $catalogname ]]
+             then
+                if  mkdir -p  $catalogname
+                then
+                   printf "\n\n  *** directory:"
+                   printf "\n           $catalogname"
+                   printf "\n      was created\n"
+                else
+                   printf "\n\n  +++ OUTPUT-file:"
+                   printf "\n           $filename"
+                   printf "\n      cannot be created, because directory does not exist"
+                   printf "\n      and cannot be created either"
+                   printf "\n"
+                   locat=output  ; exit
+                fi 2>/dev/null 
+             else
+                printf "\n\n  +++ OUTPUT-file:"
+                printf "\n           $filename"
+                printf "\n      cannot be created, although directory exists"
+                printf "\n"
+                locat=output  ; exit
+             fi
+          fi 2>/dev/null
+       else
+
+             # ZYKLUSNUMMER FESTSTELLEN
+          ls -1 -d $filename    >   filelist  2>/dev/null
+          ls -1 -d $filename.*  >>  filelist  2>/dev/null
+          while  read zeile
+          do
+             cycle=$(print $zeile | cut -f2 -d".")
+             if [[ "$cycle" = "$zeile"  ||  "$cycle" = ${extout[$i]} ]]
+             then
+                (( icycle = 1 ))
+             else
+                (( icycle = $cycle + 1 ))
+             fi
+             if (( icycle > maxcycle ))
+             then
+                (( maxcycle = icycle ))
+             fi
+          done <filelist
+          rm filelist
+       fi
+
+          # EVTL. ZYKLUSNUMMER AN DATEINAMEN ANFUEGEN UND PRUEFEN, OB SICH
+          # DATEI AUCH WIRKLICH ANLEGEN LAESST. IM APPEND-FALL MUSS AN DEN
+          # HOECHSTEN VORHANDENEN ZYKLUS-ANGEHAENGT WERDEN. ANLAGEPRUEFUNG
+          # IST DANN NATUERLICH NICHT ZULAESSIG BZW. MOEGLICH
+       if [[ "${actionout[$i]}" != a ]]
+       then
+          if (( maxcycle > 0 ))
+          then
+             filename=${filename}.$maxcycle
+             if  cat /dev/null > $filename 
+             then
+                rm  $filename
+             else
+                printf "\n  +++ OUTPUT-file:"
+                printf "\n           $filename"
+                printf "\n      cannot be created"
+                locat=output  ; exit
+             fi
+          fi
+       else
+          (( maxcycle = maxcycle - 1 ))
+          if (( maxcycle > 0 ))
+          then
+             filename=${filename}.$maxcycle
+          fi
+       fi
+       
+          # DATEINAMEN OHNE PFAD ABER MIT ZYKLUSNUMMER ABSPEICHERN,
+          # DA SPAETER BEI ABLAGE AUF ARCHIVSYSTEM BZW. FUER
+          # DATEI OUTPUT_FILE_CONNECTIONS EVTL. BENOETIGT
+       pathout[$i]=$filename
+       if (( maxcycle > 0 ))
+       then
+          frelout[$i]=${fname}${endout[$i]}.$maxcycle
+       else
+          frelout[$i]=${fname}${endout[$i]}
+       fi
+
+    fi
+ done
+
+
+     # PRUEFEN, OB ENTWEDER HAUPTPROGRAMM ODER NUR EIN AUSFUEHRBARES
+     # PROGRAMM VEREINBART WURDE (IN DIESEM FALL BRAUCHT IM WEITEREN NICHT
+     # UEBERSETZT ZU WERDEN)
+ if [[ "$mainprog" = ""  &&  "$executable" = "" ]]
+ then
+    printf "\n  +++ neither main program nor executable defined"
+    locat=source; exit
+ elif [[ "$mainprog" != ""  &&  "$executable" != "" ]]
+ then
+    printf "\n  +++ main program as well as executable defined"
+    locat=source; exit
+ elif [[ "$mainprog" = ""  &&  "$executable" != "" ]]
+ then
+    do_compile=false
+ fi
+
+
+    # ALLE ZU UEBERSETZENDEN PROGRAMMTEILE ZUSAMMENSAMMELN
+    # BEI BATCH-JOBS IST DIES NICHT NOETIG, WEIL DIE PROGRAMMTEILE BEREITS DURCH
+    # DEN MRUN-AUFRUF ERMITTELT SIND, DER DEN BATCH-JOB GENERIERT HAT, UND
+    # IM VERZEICHNIS SOURCES_FOR_RUN_... ABGELEGT SIND
+ if [[ $do_compile = true  &&  "$SOURCES_COMPLETE" = "" ]]
+ then
+
+    [[ "$source_list" = CF ]]  &&  source_list=CHANGED_FILES
+
+    if [[ "$source_list" = CHANGED_FILES  ||  $continuation_run != true ]]
+    then
+       rm -rf  SOURCES_FOR_RUN_$fname
+       mkdir   SOURCES_FOR_RUN_$fname
+    fi
+
+
+       # EVTL. ZU UEBERSETZENDE PROGRAMMTEILE DADURCH BESTIMMEN, DASS GEPRUEFT
+       # WIRD, WELCHE DATEIEN WRITE-PERMIT BESITZEN (DATEIEN SOLLTEN DESHALB
+       # UNTER RCS-KONTROLLE STEHEN). MIT DER VARIABLEN EXCLUDE KOENNEN
+       # BESTIMMTE DATEIEN GRUNDSAETZLICH VON DER UEBERSETZUNG AUSGESCHLOSSEN
+       # WERDEN. DIES IST NUR BEI MANUELLEM START VON MRUN DURCH DEN BENUTZER
+       # MOEGLICH, DA BEI AUTOMATISCHEN RESTARTS TEST DURCH DIE TATSAECHLICH
+       # ZU UBERSETZENDEN DATEIEN ERSETZT IST.
+       # ALLE ERMITTELTEN DATEIEN WERDEN IM VERZEICHNIS SOURCES_FOR_RUN_...
+       # GESAMMELT
+    if [[ "$source_list" = CHANGED_FILES ]]
+    then
+
+       source_list=""
+
+          # ZUERST DAS DURCH DIE KONFIGURATIONSDATEI FESTGELEGTE
+          # QUELLTEXTVERZEICHNIS DURCHSUCHEN
+       cd  $source_path
+
+
+          # ALLE MOEGLICHEN QUELLCODEDATEIEN AUFLISTEN
+       Names=$(ls -1 *.f90 2>&1)
+       [[ $(echo $Names | grep -c '*.f90') = 0 ]]  &&  Filenames="$Names"
+       Names=$(ls -1 *.F90 2>&1)
+       [[ $(echo $Names | grep -c '*.F90') = 0 ]]  &&  Filenames="$Filenames $Names"
+       Names=$(ls -1 *.F 2>&1)
+       [[ $(echo $Names | grep -c '*.F') = 0   ]]  &&  Filenames="$Filenames $Names"
+       Names=$(ls -1 *.f 2>&1)
+       [[ $(echo $Names | grep -c '*.f') = 0   ]]  &&  Filenames="$Filenames $Names"
+       Names=$(ls -1 *.c 2>&1)
+       [[ $(echo $Names | grep -c '*.c') = 0   ]]  &&  Filenames="$Filenames $Names"
+
+
+          # DATEIEN MIT WRITE-PERMIT NACH SOURCES_FOR_RUN_... KOPIEREN
+       for  dateiname  in  $Filenames
+       do
+          if [[ -w $dateiname ]]
+          then
+             if [[ "$exclude" = ""  ||  $(echo $exclude | grep -c $dateiname) = 0 ]]
+             then
+                cp  $dateiname  $working_directory/SOURCES_FOR_RUN_$fname
+                source_list=$source_list"$dateiname "
+             fi
+          fi
+       done
+
+       cd -  > /dev/null
+
+
+       # MITTELS OPTION -s ANGEGEBENE DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN
+       # BEI AUTOMATISCHEN FORTSETZUNGSLAEUFEN SIND DORT SCHON ALLE DATEIEN
+       # VORHANDEN
+    elif [[ "$source_list" != ""  &&  $continuation_run != true ]]
+    then
+
+       cd  $source_path
+
+       for  filename  in  $source_list
+       do
+
+             # QUELLTEXT-DATEI DARF KEINE PFADE BEINHALTEN
+          if [[ $(print $filename | grep -c "/") != 0 ]]
+          then
+             printf "\n  +++ source code file:  $filename"
+             printf "\n      must not contain (\"/\") "
+             locat=source; exit
+          fi
+
+          if [[ ! -f $filename ]]
+          then
+             printf "\n  +++ source code file:  $filename"
+             printf "\n      does not exist"
+             locat=source; exit
+          else
+             cp  $filename  $working_directory/SOURCES_FOR_RUN_$fname
+          fi
+
+       done
+
+       cd -  > /dev/null
+
+    fi
+
+
+       # PRUEFEN, OB ENTWEDER HAUPTPROGRAMM VORHANDEN UND ES EVTL. IN DER
+       # LISTE DER ZU UEBERSETZENDEN PROGRAMMTEILE MIT ENTHALTEN IST (WENN
+       # NICHT, WIRD ES DIESER LISTE HINZUGEFUEGT)
+    if [[ $continuation_run != true ]]
+    then
+
+       if [[ ! -f "$source_path/$mainprog" ]]
+       then
+          printf "\n\n  +++ main program:  $mainprog"
+          printf "\n      does not exist in source directory"
+          printf "\n      \"$source_path\"\n"
+          locat=source; exit
+       else
+          if [[ $(echo $source_list | grep -c $mainprog) = 0 ]]
+          then
+             cp  $source_path/$mainprog  SOURCES_FOR_RUN_$fname
+             source_list=${mainprog}" $source_list"
+          fi
+       fi
+    fi
+
+
+       # DATEIEN AUS ZUSAETZLICHEM QUELLVERZEICHNIS HINZUFUEGEN
+    if [[ $continuation_run != true  &&  "$add_source_path" != "" ]]
+    then
+
+          # GIBT ES DAS VERZEICHNIS UEBERHAUPT?
+       if [[ ! -d $add_source_path ]]
+       then
+          printf "\n\n  +++ WARNING: additional source code directory"
+          printf "\n      \"$add_source_path\" "
+          printf "\n      does not exist or is not a directory."
+          printf "\n      No source code will be used from this directory!\n"
+          add_source_path=""
+          sleep 3
+       else
+
+          cd $add_source_path
+
+          Names=$(ls -1 *.f90 2>&1)
+          [[ $(echo $Names | grep -c '*.f90') = 0 ]]  &&  AddFilenames="$Names"
+          Names=$(ls -1 *.F90 2>&1)
+          [[ $(echo $Names | grep -c '*.F90') = 0 ]]  &&  AddFilenames="$AddFilenames $Names"
+          Names=$(ls -1 *.F 2>&1)
+          [[ $(echo $Names | grep -c '*.F') = 0   ]]  &&  AddFilenames="$AddFilenames $Names"
+          Names=$(ls -1 *.f 2>&1)
+          [[ $(echo $Names | grep -c '*.f') = 0   ]]  &&  AddFilenames="$AddFilenames $Names"
+          Names=$(ls -1 *.c 2>&1)
+          [[ $(echo $Names | grep -c '*.c') = 0   ]]  &&  AddFilenames="$AddFilenames $Names"
+
+          cd -  > /dev/null
+          cd  SOURCES_FOR_RUN_$fname
+
+          for  dateiname  in  $AddFilenames
+          do
+             if [[ -f $dateiname ]]
+             then
+                printf "\n  +++ source code file \"$dateiname\" found in additional"
+                printf "\n      source code directory \"$add_source_path\" "
+                printf "\n      as well as in directory \"$source_path\"."
+                locat=source; exit
+             fi
+
+             cp  $add_source_path/$dateiname  .
+             source_list="$source_list $dateiname"
+
+                # Default User-Interface von der Liste entfernen, falls Datei
+                # ein User-Interface enthaelt
+             if [[ $( cat $dateiname | grep -c "END SUBROUTINE user_parin" ) != 0 ]]
+             then
+                if [[ -f user_interface.f90 ]]
+                then
+                   rm -rf  user_interface.f90
+                   source_list=`echo $source_list | sed -e 's/user_interface.f90//'`
+                   printf "\n\n  *** \"user_interface.f90\" removed from the files to be translated"
+                   printf "\n      since a user-interface is found in file"
+                   printf "\n      \"$add_source_path/$dateiname\" \n"
+                   sleep 3
+                else
+                   printf "\n\n  *** user-interface file \"$dateiname\" "
+                   printf "\n      added to the files to be translated \n"
+                   sleep 3
+                fi
+             fi
+          done
+
+          cd -  > /dev/null
+       fi
+    fi
+
+
+       # ALLE UNTERPROGRAMME, DIE ZU VEREINBARTEN SOFTWAREPAKETEN GEHOEREN,
+       # DER LISTE DER ZU UEBERSETZENDEN DATEIEN HINZUFUEGEN
+    if [[ $continuation_run != true  &&  -n $package_list ]]
+    then
+
+       cd  $source_path
+
+       for  package  in  $package_list
+       do
+
+          [[ $package = "dvrp_graphics+1PE" ]]  &&  package=dvrp_graphics
+
+             # ERMITTELE ALLE DATEIEN, DIE ZUM PAKET GEHOEREN
+             # FEHLERMELDUNGEN WERDEN ABGEFANGEN, DA * AUCH VERZEICHNISSNAMEN
+             # LIEFERT
+          package_source_list=`grep "defined( __$package " * 2>/dev/null | cut -f1 -d:`
+
+
+             # FUEGE DIESE DATEIEN DER LISTE DER ZU UEBERSETZENDEN DATEIEN
+             # HINZU, FALLS SIE NOCH NICHT DAZUGEHOEREN
+          for  source_list_name  in  $package_source_list
+          do
+             if [[ $(echo $source_list | grep -c $source_list_name) = 0 ]]
+             then
+
+                    # NUR DATEIEN MIT GUELTIGEN ENDUNGEN VERWENDEN
+                ending=`echo $source_list_name | cut -f2 -d.`
+                if [[ "$ending" = f90  ||  "$ending" = F90  ||  "$ending" = f  ||  "$ending" = F  ||  "$ending" = c ]]
+                then
+                   cp  $source_list_name  $working_directory/SOURCES_FOR_RUN_$fname
+                   source_list="$source_list $source_list_name"
+                fi
+             fi
+          done
+       done
+
+       cd -  > /dev/null
+    fi
+
+
+       # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN
+       # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN...
+    if [[ "$use_makefile" = true  &&  "$continuation_run" != true ]]
+    then
+       [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
+       if [[ ! -f $makefile ]]
+       then
+          printf "\n  +++ file \"$makefile\" does not exist"
+          printf "\n      provide this file or set \"use_makefile=false\" in configuration file\n"
+          locat=make; exit
+       else
+          cp  $makefile  SOURCES_FOR_RUN_$fname/Makefile 
+       fi
+    fi
+
+ fi  # do_compile=true
+
+
+    # FALLS PROGRAMMTEILE UEBERSETZT WERDEN SOLLEN, FOLGEN JETZT EINIGE
+    # UEBERPRUEFUNGEN UND DAS SETZEN DER PRAEPROZESSOR-DIREKTIVEN
+ if [[ $do_compile = true ]]
+ then
+
+       # PRAEPROZESSOR-DIREKTIVEN ZUM SELEKTIVEN AUSWAEHLEN VON CODETEILEN
+       # ZUSAMMENSETZEN
+    if [[ $(echo $localhost | cut -c1-3) = ibm ]]
+    then
+       PPOPTS=-Dibm=ibm
+    elif [[ $(echo $localhost | cut -c1-3) = nec ]]
+    then
+       PPOPTS=-Dnec
+    else
+       PPOPTS=-D$localhost
+    fi
+    if [[ $(echo $localhost | cut -c1-3) = ibm ]]
+    then
+       [[ -n $cond1 ]]               &&  PPOPTS="$PPOPTS -D$cond1=$cond1"
+       [[ -n $cond2 ]]               &&  PPOPTS="$PPOPTS -D$cond2=$cond2"
+       if [[ $netcdf_support = true ]]
+       then
+          PPOPTS="$PPOPTS -Dnetcdf=netcdf"
+          [[ $localhost != ibms ]]      &&  PPOPTS="$PPOPTS -Dnetcdf_64bit=netcdf_64bit"
+       fi
+       if [[ $localhost = ibmy ]]
+       then
+          PPOPTS="$PPOPTS -Dibmy_special=ibmy_special"
+       fi
+    else
+       [[ -n $cond1 ]]               &&  PPOPTS="$PPOPTS -D$cond1"
+       [[ -n $cond2 ]]               &&  PPOPTS="$PPOPTS -D$cond2"
+       if [[ $netcdf_support = true ]]
+       then
+          PPOPTS="$PPOPTS -Dnetcdf"
+          [[ $localhost != decalpha  &&  $localhost != lctit ]]  &&  PPOPTS="$PPOPTS -Dnetcdf_64bit"
+       fi
+    fi
+    if [[ -n $package_list ]]
+    then
+       for  package  in  $package_list
+       do
+          if [[ $(echo $localhost | cut -c1-3) = ibm ]]
+          then
+             if [[ $package != "dvrp_graphics+1PE" ]]
+             then
+                PPOPTS="$PPOPTS -D$package=$package"
+             else
+                PPOPTS="$PPOPTS -Ddvrp_graphics"
+                export use_seperate_pe_for_dvrp_output=true
+             fi
+          else
+             if [[ $package != "dvrp_graphics+1PE" ]]
+             then
+                PPOPTS="$PPOPTS -D$package"
+             else
+                PPOPTS="$PPOPTS -Ddvrp_graphics"
+                export use_seperate_pe_for_dvrp_output=true
+             fi
+          fi
+       done
+    fi
+    if [[ -n $cpp_opts ]]
+    then
+       for  popts  in  $cpp_opts
+       do
+          PPOPTS="$PPOPTS -D$popts"
+       done
+    fi
+
+       # -D ARGUMENTEN EINEN DOPPELTEN UNTERSTRICH VORANSTELLEN
+    PPOPTS=`echo " $PPOPTS" | sed 's/ -D/ -D__/g'`
+
+       # OPTION ZUM EINSCHALTEN DES PRAEPROZESSORS HINZUFUEGEN
+    if [[ $host = decalpha ]]
+    then
+       C_PPOPTS="-cpp  -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION $PPOPTS"
+    elif [[ $(echo $host | cut -c1-3) = ibm ]]
+    then
+          # blanks in PPOPTS muessen durch "," ersetzt werden
+       PPOPTS=`echo $PPOPTS | sed 's/ -/,-/g'`
+       C_PPOPTS="-qsuffix=cpp=f90 -WF,-DMPI_REAL=MPI_DOUBLE_PRECISION,$PPOPTS"
+    elif [[ $host = lcmuk ]]
+    then
+       C_PPOPTS="$PPOPTS -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"
+    elif [[ $host = lctit ]]
+    then
+       C_PPOPTS="$PPOPTS -Mpreprocess -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"
+    elif [[ $(echo $host | cut -c1-3) = nec ]]
+    then
+       C_PPOPTS="-Ep -DMPI_REAL=MPI_REAL8 -DMPI_2REAL=MPI_2REAL8 -DSCFFT=dzfft -DCSFFT=zdfft $PPOPTS"
+    else
+       C_PPOPTS="$PPOPTS"
+    fi
+
+ else
+
+
+       # BEI LOKALEN RECHNUNGEN PRUEFEN, OB EXECUTABLE VORHANDEN
+    if [[ $do_remote = false ]]
+    then
+       if [[ ! -f $executable ]]
+       then
+          printf "\n  +++ executable file:  $executable"
+          printf "\n      does not exist"
+          locat=executable; exit
+       fi
+    fi
+ fi
+
+
+    # JOBMODUS FESTSTELLEN 
+ if [[ "$ENVIRONMENT" = BATCH  &&  $localhost != lctit  ||  "$QUEUE" != interactive  &&  $localhost = lctit ]]
+ then
+    jobmo=BATCH
+ else
+    jobmo=INTERACTIVE
+ fi
+
+
+    # HOSTSPEZIFISCHE DEFAULT-COMPILER SETZEN, FALLS NICHT BEREITS
+    # DURCH BENUTZER ANDERWEITIG VEREINBART
+ if [[ "$compiler_name" = "" ]]
+ then
+    case  $localhost  in
+        (hpmuk|unics)                           compiler_name=f77;;
+        (lcmuk)                                 if [[ "$cond1" = parallel  ||  "$cond2" = parallel ]]
+                                                then
+                                                   compiler_name=mpif90
+                                                else
+                                                   compiler_name=ifc
+                                                fi;;
+        (lctit)                                 if [[ "$cond1" = parallel  ||  "$cond2" = parallel ]]
+                                                then
+                                                   compiler_name=mpif90
+                                                   echo ">>> compiler=mpif90"
+                                                else
+                                                   compiler_name=pgf95
+                                                   echo ">>> compiler=pgf95"
+                                                fi;;
+        (nech)                                  compiler_name=sxmpif90;;
+        (decalpha)                              compiler_name=f95;;
+        (ibm|ibmb|ibmh|ibms|ibmy)               compiler_name=mpxlf95_r;;
+        (*)      printf "\n  +++ unknown host name: $localhost \n";
+                 locat=localhost; exit;;
+    esac
+ fi
+
+
+    # COMPILER AUF NECK UEBERSCHREIBEN
+ [[ $localhost = neck ]]  &&  compiler_name=mpif90
+
+
+
+    # PRAEPROZESSOR-PFAD BESTIMMEN
+ case  $localhost  in
+     (decalpha|ibm|ibmb|ibmh|ibms|ibmy|unics)  praeproc=cpp;;
+     (hpmuk)                                   praeproc=/usr/ccs/lbin/cpp;;
+ esac
+
+
+    # TEMPORAEREN KATALOGNAMEN BESTIMMEN
+ kennung=$RANDOM
+ if [[ "$tmp_user_catalog" = "" ]]
+ then
+    if [[ $localhost = ibmb  ||  $localhost = ibmh ]]
+    then
+       tmp_user_catalog=$TMPDIR
+    elif [[ $localhost = nech ]]
+    then
+       tmp_user_catalog=$WRKSHR
+    else
+       tmp_user_catalog=/tmp
+    fi
+ fi
+ TEMPDIR=$tmp_user_catalog/${usern}.$kennung
+
+
+    # KATALOGNAMEN FUER ZWISCHENSPEICHERUNG VON FORTSETZUNGSLAUFDATEIEN
+    # BESTIMMEN
+ if [[ "$tmp_data_catalog" = "" ]]
+ then
+    if [[ $localhost = ibmb  ||  $localhost = ibmh ]]
+    then
+       tmp_data_catalog=$WORK/mrun_restart_data
+    elif [[ $localhost = nech ]]
+    then
+       tmp_data_catalog=$WRKSHR/mrun_restart_data
+    else
+       tmp_data_catalog=/tmp/mrun_restart_data
+    fi
+ fi
+
+
+    # EVENTUELL BEI LOKALEN RECHNUNGEN $-ZEICHEN IN ENVIRONMENT-VARIABLEN
+    # ERSETZEN
+ if [[ $do_remote = false  &&  $do_compile = true ]]
+ then
+    eval  fopts=\"$fopts\"
+    eval  lopts=\"$lopts\"
+ fi
+
+
+
+    # COMPILE- UND LINK-OPTIONEN BESTIMMEN
+ FOPTS="$fopts"
+ LOPTS="$lopts"
+ ROPTS="$ropts"
+ if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lctit )  &&  -n $numprocs ]]
+ then
+    XOPT="-X $numprocs"
+ fi
+
+
+    # BEI VERWENDUNG VON DVRP-SOFTWARE MUSS ENTSPECHENDE GRAFIK-BIBLIOTHEK
+    # MIT EINGEBUNDEN WERDEN
+ if [[ -n $package_list ]]
+ then
+    if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]]
+    then
+
+          # DVRP-GRAFIK GIBT ES NUR AUF DER IBM AM HLRN, AUF NECH UND
+          # DEM NOTEBOOK SCIROCCO
+       if [[ $host != ibmh  &&  $host != nech  &&  $host != lcmuk  &&  "$local_compile" != true ]]
+       then
+          printf "\n"
+          printf "\n  +++ option -p with package \"dvrp_graphics\" only allowed on nech and ibmh"
+          locat=parameter; exit
+       fi
+       if [[ $host = ibmh ]]
+       then
+          if [[ $cond1 = debug  ||  $cond2 = debug ]]
+          then
+             FOPTS="-I/home/h/hzazchmi/lib/debug  $FOPTS"
+             LOPTS="$LOPTS -L/home/h/hzazchmi/lib/debug -lDVRP2 -lftp"
+          else
+             FOPTS="-I/home/h/nikevita/lib_stable/optimize  $FOPTS"
+             LOPTS="$LOPTS -L/home/h/nikevita/lib_stable/optimize -lDVRP2 -lftp"
+          fi
+       elif [[ $host = nech ]]
+       then
+          FOPTS="-I/import/ds9b/ipf2/b/b323013/lib/optimize  $FOPTS"
+          LOPTS="$LOPTS -L/import/ds9b/ipf2/b/b323013/lib/optimize -lDVRP2 -lftp"
+       elif [[ $host = lcmuk ]]
+       then
+          FOPTS="-I/usr/local/lib/dvrp/optimize  $FOPTS"
+          LOPTS="$LOPTS -L/usr/local/lib/dvrp/optimize -lDVRP2 -lftp"
+       fi
+    fi
+ fi
+
+
+    # EVTL. EINBINDEN DER NETCDF-BIBLIOTHEK
+ if [[ $netcdf_support = true ]]
+ then
+    case  $host  in
+       (decalpha)         FOPTS="-I${netcdf_path}/include  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
+       (ibmb|ibmh)        FOPTS="-I ${netcdf_path}/include-64  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
+       (ibms)             FOPTS="-I /applic/netcdf64/src/f90  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path} -lnetcdf";;
+       (ibmy)             FOPTS="-I ${netcdf_path}/include  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
+       (lcmuk|nech|neck)  FOPTS="-I ${netcdf_path}/include  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
+       (lctit)            FOPTS="-I ${netcdf_path}/src/f90  $FOPTS"
+                          LOPTS="$LOPTS -L${netcdf_path}/src/libsrc -lnetcdf";;
+
+    esac
+ fi
+
+    # PRUEFEN DER CPU-ZEIT. (CPUMAX WIRD ALS ENV-VARIABLE VOM HAUTPRO-
+    # GRAMM BENOETIGT
+ done=false
+ while [[ $done = false ]]
+ do
+    cputime=$cpumax
+    if (( $cputime == 0 ))
+    then
+       printf "\n  +++ cpu-time is undefined"
+       printf "\n  >>> Please type CPU-time in seconds as INTEGER:"
+       printf "\n  >>> "
+       read  cputime  1>/dev/null  2>&1
+    else
+       done=true
+    fi
+    cpumax=$cputime
+ done
+
+ (( minuten = cputime / 60 ))
+ (( sekunden = cputime - minuten * 60 ))
+
+
+    # PRUEFEN DER KERNSPEICHERANFORDERUNG
+ if [[ $do_batch = true ]]
+ then
+    done=false
+    while [[ $done = false ]]
+    do
+       if (( memory == 0 ))
+       then
+          printf "\n  +++ memory demand is undefined"
+          printf "\n  >>> Please type memory in  MByte per process  as INTEGER:"
+          printf "\n  >>> "
+          read  memory  1>/dev/null  2>&1
+       else
+          done=true
+       fi
+    done
+ fi
+
+
+    # PRUEFEN, OB FUER REMOTE-RECHNUNGEN EIN BENUTZERNAME ANGEGEBEN WURDE
+ if [[ $do_remote = true  &&  -z $remote_username ]]
+ then
+    while [[ -z $remote_username ]]
+    do
+       printf "\n  +++ username on remote host \"$host\" is undefined"
+       printf "\n  >>> Please type username:"
+       printf "\n  >>> "
+       read  remote_username
+    done
+    mc="$mc -u$remote_username"
+ fi
+
+###########################################################################
+# HEADER-AUSGABE
+###########################################################################
+
+
+ calltime=$(date)
+ printf "\n"
+# [[ $silent = false ]]  &&  clear
+ printf "#--------------------------------------------------------------# \n"
+ printf "| $version$calltime | \n"
+ printf "|                                                              | \n"
+ spalte1="called on:"; spalte2=$localhost_realname
+ printf "| $spalte1$spalte2 | \n"
+ if [[ $local_compile = false ]]
+ then
+    if [[ $do_remote = true ]]
+    then
+       spalte1="execution on:"; spalte2="$host (username: $remote_username)"
+    else
+       spalte1="execution on:"; spalte2="$host ($localhost_realname)"
+    fi
+ else
+    spalte1="compiling test only!"; spalte2=""
+ fi
+ printf "| $spalte1$spalte2 | \n"
+ if [[ -n $numprocs ]]
+ then
+    spalte1="number of PEs:"; spalte2=$numprocs
+    printf "| $spalte1$spalte2 | \n"
+ fi
+ if [[ -n $tasks_per_node ]]
+ then
+    spalte1="tasks per node:"; spalte2="$tasks_per_node (number of nodes: $nodes)"
+    printf "| $spalte1$spalte2 | \n"
+ fi
+ if [[ $threads_per_task != 1 ]]
+ then
+    spalte1="threads per task:"; spalte2="$threads_per_task"
+    printf "| $spalte1$spalte2 | \n"
+ fi
+ printf "|                                                              | \n"
+ if [[ $do_compile = true ]]
+ then
+    spalte1=cpp-directives:; spalte2=$C_PPOPTS
+    printf "| $spalte1$spalte2 | \n"
+    zeile=$(echo "$C_PPOPTS" | cut -c41-)
+    while [[ "$zeile" != "" ]]
+    do
+       spalte1=""
+       spalte2=$zeile
+       printf "| $spalte1$spalte2 | \n"
+       zeile=$(echo "$zeile" | cut -c41-)
+    done
+
+    spalte1=compiler-options:; spalte2="$FOPTS $MODULE_OPTIONS"
+    printf "| $spalte1$spalte2 | \n"
+    zeile=$(echo "$FOPTS $MODULE_OPTIONS" | cut -c41-)
+    while [[ "$zeile" != "" ]]
+    do
+       spalte1=""
+       spalte2=$zeile
+       printf "| $spalte1$spalte2 | \n"
+       zeile=$(echo "$zeile" | cut -c41-)
+    done
+
+    spalte1=linker-options:; spalte2=$LOPTS
+    printf "| $spalte1$spalte2 | \n"
+    zeile=$(echo "$LOPTS" | cut -c41-)
+    while [[ "$zeile" != "" ]]
+    do
+       spalte1=""
+       spalte2=$zeile
+       printf "| $spalte1$spalte2 | \n"
+       zeile=$(echo "$zeile" | cut -c41-)
+    done
+
+    spalte1="main program":; spalte2=$mainprog
+    printf "| $spalte1$spalte2 | \n"
+    if [[ "$use_makefile" = true ]]
+    then
+       spalte1="using \"make\" for com"; spalte2="piling and linking"
+       printf "| $spalte1$spalte2 | \n"
+    fi
+#    if [[ $vtk_graphics = true ]]
+#    then
+#       spalte1=""; spalte2="wird in C++ - Programm eingebunden (vtk)"
+#       printf "| $spalte1$spalte2 | \n"
+#    fi
+ else
+    spalte1=executable:; spalte2=$executable
+    printf "| $spalte1$spalte2 | \n"
+ fi
+ printf "|                                                              | \n"
+ spalte1="base name of files":; spalte2=$fname
+ printf "| $spalte1$spalte2 | \n"
+ if [[ $fname != $afname ]]
+ then
+    spalte1="base name of input files":; spalte2=$afname
+    printf "| $spalte1$spalte2 | \n"
+ fi
+ spalte1="INPUT control list":; spalte2=$input_list
+ printf "| $spalte1$spalte2 | \n"
+ spalte1="OUTPUT control list":; spalte2=$output_list
+ printf "| $spalte1$spalte2 | \n"
+
+ if [[ $do_batch = true  ||  "$LOADLBATCH" = yes ]]
+ then
+    spalte1="memory demand / PE":; spalte2="$memory MB"
+    printf "| $spalte1$spalte2 | \n"
+    spalte1=CPU-time:; spalte2="$minuten:$sekunden"
+    printf "| $spalte1$spalte2 | \n"
+ fi
+
+ if [[ $do_compile = true ]]
+ then
+    printf "|                                                              | \n"
+    printf "| Files to be compiled:                                        | \n"
+    zeile=$source_list
+    while [[ "$zeile" != "" ]]
+    do
+       spalte3=$zeile
+       printf "| $spalte3 | \n"
+       zeile=$(echo "$zeile" | cut -c61-)
+    done
+ fi
+ printf "#--------------------------------------------------------------#"
+
+
+
+    # BEDINGTE AUSGABE DER DATEIVERBINDUNGEN
+ if [[ $do_trace = true ]]
+ then
+    (( i = 0 ))
+    while (( i < iin ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n >>> INPUT-file assignments:\n"
+       fi
+       printf "\n     ${localin[$i]} :  ${absnamein[$i]}"
+    done
+    (( i = 0 ))
+    while (( i < iout ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n >>> OUTPUT-file assignments:\n"
+       fi
+       printf "\n     ${localout[$i]} :  ${pathout[$i]}"
+    done
+    (( i = 0 ))
+    while (( i < iic ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n >>> INPUT-commands:\n"
+       fi
+       printf "\n     ${in_command[$i]}" 
+    done
+    (( i = 0 ))
+    while (( i < ioc ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n >>> OUTPUT-commands:\n"
+       fi
+       printf "\n     ${out_command[$i]}" 
+    done
+ fi
+
+
+    # ABFRAGEN BEI AUFRUF AUF LOKALER MASCHINE 
+ if [[ $remotecall = false  &&  $silent = false  &&  $jobmo != BATCH ]]
+ then
+    antwort=dummy
+    printf "\n\n"
+    while [[ "$antwort" != y  &&  "$antwort" != Y  &&  "$antwort" != n  &&  "$antwort" != N ]]
+    do
+       printf " >>> everything o.k. (y/n) ?  "
+       read  antwort
+    done
+    if [[ $antwort = n  ||  $antwort = N ]]
+    then
+       locat=user_abort; (( iec = 0 )); exit
+    fi
+    if [[ $do_batch = true ]]
+    then
+       printf " >>> batch-job will be created and submitted"
+    else
+       if [[ $local_compile = false ]]
+       then
+          printf " >>> MRUN will now continue to execute on this machine"
+       else
+          printf " >>> a test compilation will now be carried out on this machine"
+       fi
+    fi
+ fi
+ 
+
+
+
+     # FALLS AUF DIESER MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE-
+     # CHENDE AKTIONEN DURCHGEFUEHRT
+ if [[ $do_batch = false ]]
+ then
+
+
+       # TEMPORAEREN KATALOG ERZEUGEN
+    mkdir -p  $TEMPDIR
+    chmod  go+rx  $TEMPDIR
+    tmpcreate=true
+
+
+       # SAEMTLICHE QUELLTEXT-DATEIEN BZW. AUSFUEHRBARES PROGRAMM IN 
+       # TEMPORAERES VERZEICHNIS KOPIEREN
+    if [[ $do_compile = true ]]
+    then
+
+          # ON NEC, COMPILATION IS DONE ON HOST CROSS VIA CROSS COMPILING
+          # CREATE A TEMPORARY DIRECTORY ON THAT MACHINE (HOME MOUNTED VIA NFS)
+       if [[ $localhost = nech ]]
+       then
+          TEMPDIR_COMPILE=$HOME/work/${usern}.$kennung
+          if  mkdir -p  $TEMPDIR_COMPILE
+          then
+             printf "\n  *** \"$TEMPDIR_COMPILE\" "
+             printf "\n      is generated as temporary directory for cross compiling\n"
+          else
+             printf "\n  +++ creating directory \"$TEMPDIR_COMPILE\" "
+             printf "\n      needed for cross compilation failed"
+             locat=compile
+             exit
+          fi
+       else
+          TEMPDIR_COMPILE=$TEMPDIR
+       fi
+
+       if [[ "$use_makefile" = true ]]
+       then
+
+             # PFADNAMEN FUER DAS MAKE-DEPOSITORY ERMITTELN
+          line=""
+          grep "%depository_path" $config_file  |  while read line
+          do
+             if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+             then
+                if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]]
+                then
+                   global_depository_path=`echo $line | cut -d" " -s -f2`
+                fi
+             fi
+          done
+
+          line=""
+          grep  " $localhost" $config_file | grep "%depository_path"  |  while read line
+          do
+             if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+             then
+                local_depository_path=`echo $line | cut -d" " -s -f2`
+             fi
+          done
+
+          if [[ "$local_depository_path" = "" ]]
+          then
+             if [[ "$global_depository_path" != "" ]]
+             then
+                local_depository_path=$global_depository_path
+             else
+                printf "\n\n  +++ no depository path found in configuration file"
+                printf "\n      for local host \"$localhost\" "
+                printf "\n      please set \"\%depository_path\" in configuration file\n"
+                locat=config_file; exit
+             fi
+          fi
+          eval local_depository_path=$local_depository_path
+
+          basename=`print $mainprog | cut -f1 -d"."`
+          eval make_depository=${local_depository_path}/${basename}_current_version.tar
+          if [[ ! -f $make_depository ]]
+          then
+             printf "\n"
+             printf "\n  *** WARNING: make depository \"$make_depository\" not found"
+             printf "\n               \"make\" will fail, if the Makefile or other source files are missing\n"
+          else
+             cp  $make_depository  $TEMPDIR_COMPILE
+             cd  $TEMPDIR_COMPILE
+             tar -xf  $make_depository  >  /dev/null
+             cd -  > /dev/null
+          fi
+
+          cp  SOURCES_FOR_RUN_$fname/*  $TEMPDIR_COMPILE
+
+             # FALLS USER-INTERFACE VORHANDEN UND AUF DATEI MIT ANDEREM NAMEN
+             # ALS user_interface.f90 LIEGT, DIESEN GEAENDERTEN NAMEN INS
+             # MAKEFILE EINTRAGEN
+          cd  $TEMPDIR_COMPILE
+          interface_file=`grep -l "END SUBROUTINE user_parin" $source_list`
+          if [[ "$interface_file" != "" ]]
+          then
+             interface_file=`echo $interface_file | cut -d"." -f1`
+             mv  Makefile  Makefile_old
+             sed "s/user_interface/$interface_file/g"  Makefile_old  >  Makefile
+          fi
+          cd -  > /dev/null
+       fi
+    else
+       cp  $executable   ${TEMPDIR}/a.out
+    fi
+
+
+       # WECHSEL IN TEMPORAEREN KATALOG
+    cd $TEMPDIR
+    printf "\n  *** changed to temporary directory: $TEMPDIR"
+
+
+       # OUTPUT-DATEI-VERBINDUNGEN AUF TEMPORAERER DATEI ABLEGEN
+       # DIESE DATEI KANN VON SPAETER AUFZURUFENDEN BENUTZERPROZEDUREN GELESEN
+       # WERDEN, UM ZU LOKALEN DATEINAMEN GEHOERENDE PERMANENTE NAMEN ZU
+       # ERMITTELN
+    (( i = 0 ))
+    while (( i < iout ))
+    do
+       (( i = i + 1 ))
+       if [[ "${actionout[$i]}" = tr  ||  "${actionout[$i]}" = tra  ||  "${actionout[$i]}" = trpe ]]
+       then
+          printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${localhost}_${fname}${endout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS
+       else
+          printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${frelout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS
+       fi
+    done
+
+
+       # EVTL. UEBERSETZUNGSAKTIONEN STARTEN
+    if [[ $do_compile = true ]]
+    then
+
+
+          # COMPILING WITH MAKE (ON NEC COMPILER IS CALLED ON HOST CROSS)
+       if [[ "$use_makefile" = true ]]
+       then
+          printf "\n\n\n  *** compilation starts \n$striche\n"
+          printf "  *** compilation with make using following options:\n"
+          printf "      compilername:             $compiler_name\n"
+          printf "      options:                  $FOPTS\n"
+          printf "      preprocessor-directives:  $C_PPOPTS \n"
+          printf "      linker-options:           $LOPTS \n"
+          printf "      source code files:        $source_list \n"
+
+          if [[ $localhost = nech ]]
+          then
+             ssh  136.172.44.192 -l $usern ". /SX/opt/etc/initsx.sh; cd \$HOME/work/${usern}.$kennung; sxmake -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$C_PPOPTS\"  F90FLAGS=\"$FOPTS\"  LDFLAGS=\"$LOPTS\" "
+             cp  $TEMPDIR_COMPILE/a.out  .
+             [[ $? != 0 ]]  &&  compile_error=true
+             rm -rf  $TEMPDIR_COMPILE
+          else
+             make -f Makefile PROG=a.out  F90=$compiler_name  COPT="$C_PPOPTS"  F90FLAGS="$FOPTS"  LDFLAGS="$LOPTS"
+          fi
+
+          # UEBERSETZUNG "VON HAND" (OHNE MAKE)
+       else
+
+             # HPMUK EVTL. PRAEPROZESSOR LAUFEN LASSEN
+          if [[ $localhost = hpmuk ]]
+          then
+             (( i = 0 ))
+             new_source_list=""
+             for  filename  in  $source_list
+             do
+                basename=`print $filename | cut -f1 -d"."`
+                extension=`print $filename | cut -f2 -d"."`
+                if [[ $extension = F  &&  $localhost != hpmuk ]]
+                then
+                   (( i = i + 1 ))
+                   if (( i == 1 ))
+                   then
+                      printf "\n\n  *** preprocessor-calls:\n$striche"
+                   fi
+                   printf "\n      $praeproc  $PPOPTS  -P  $filename  >  ${basename}.f  2> /dev/null"
+                   $praeproc  $PPOPTS  -P  $filename  >  ${basename}.f  2> /dev/null
+                   new_source_list="$new_source_list "${basename}.f
+                   elif [[ $extension = f90 ]]
+                then
+                   (( i = i + 1 ))
+                   if (( i == 1 ))
+                   then
+                      printf "\n\n  *** preprocessor-calls:\n$striche"
+                   fi
+                   mv  $filename  ${basename}.F90
+                   printf "\n      $praeproc  $PPOPTS  -C  -P  ${basename}.F90  >  $filename  2> /dev/null"
+                   $praeproc  $PPOPTS  -C  -P  ${basename}.F90  >  $filename  2> /dev/null
+                   new_source_list="$new_source_list "$filename
+                   rm -f  ${basename}.F90
+                else
+                   new_source_list="$new_source_list "$filename
+                fi
+             done
+             source_list="$new_source_list"
+             if (( i != 0 ))
+             then
+                printf "\n$striche\n  *** preprocessor-calls finished\n"
+             fi
+          fi
+
+
+             # UEBERSETZUNG DER QUELLTEXT-DATEIEN UND DES HAUPTPROGRAMMS
+             # $CPPOPTS FUER CPP-PRAEPROZESSOR WURDEN OBEN BESTIMMT
+          printf "\n\n\n  *** compilation starts \n$striche\n"
+
+
+             # VORWEG EVTL. UEBERSETZUNG VON PROGRAMMTEILEN MIT SPEZIELLEN
+             # COMPILERN UND/ODER COMPILEROPTIONEN. DIESE WERDEN BEI DER SPAETEREN
+             # EIGENTLICHEN UEBERSETZUNG ALS OBJECT-FILES EINGEBUNDEN
+          new_source_list=""
+          for  filename  in  $source_list
+          do
+
+             basename=`print $filename | cut -f1 -d"."`
+
+                # EVTL. SPEZIELLEN COMPILER FUER UP BESTIMMEN
+             comp_var=$(eval echo \$comp_$basename)  # \$ liefert evtl. fuer source alternativ vereinbarten Compiler
+             comp_opt_var=$(eval echo \$$basename)  # \$$ liefert evtl. fuer source vereinbarte Compiler-Environment-Variable
+
+             if [[ "$comp_var" = ""  &&  "$comp_opt_var" = "" ]]
+             then
+                new_source_list="$new_source_list "$filename
+             else
+
+                if [[ "$comp_var" = "" ]]
+                then
+                   SPECIAL_COMPILER=$compiler_name
+                else
+                   SPECIAL_COMPILER=$comp_var
+                fi
+
+                if [[ "$comp_opt_var" = "" ]]
+                then
+                   SPECIAL_FOPTS=$FOPTS
+                else
+                   SPECIAL_FOPTS="$parallel_options $(eval echo \$$comp_opt_var)"
+                fi
+
+                printf "  *** compiling of $filename with special compiler call: $SPECIAL_COMPILER  $CPPOPTS  -c $SPECIAL_FOPTS \n"
+                $SPECIAL_COMPILER  $C_PPOPTS  -c $SPECIAL_FOPTS  $MODULE_OPTIONS  $filename  
+                if [[ $? != 0 ]]
+                then
+                   printf "\n  +++ compiling error occured"
+                   locat=compile
+                   exit
+                fi
+                new_source_list="$new_source_list "${basename}.o
+             fi
+          done
+          source_list="$new_source_list"
+
+
+             # EIGENTLICHE UEBERSETZUNG MIT DEN NORMALEN OPTIONEN
+          printf "  *** compilation with standard options: $compiler_name $FOPTS $MODULE_OPTIONS \n"
+          printf "      preprocessor-directives:           $C_PPOPTS \n"
+          printf "      linker-options:                    $LOPTS \n"
+          printf "      source code files:                 $source_list \n"
+          if [[ $localhost = hpmuk ]]
+          then
+             if [[ $localhost_realname = caurus ]]
+             then
+                $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $source_list  $LOPTS
+             else
+                remsh  caurus  "export PATH=/opt/fortran90/bin:$PATH; cd `pwd`; $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $source_list  $LOPTS" 
+             fi
+          else
+             $compiler_name  $C_PPOPTS  $FOPTS  $MODULE_OPTIONS  $LOPTS  $source_list  
+          fi
+       fi
+       if [[ $? != 0  ||  "$compile_error" = true  ||  "$module_compile_error" = true ]]
+       then
+          printf "\n  +++ error occured while compiling or linking"
+          locat=compile
+          exit
+       else
+          printf "$striche\n  *** compilation finished \n"
+       fi
+    fi
+
+
+       # FALLS NUR TESTWEISE KOMPILIERT WERDEN SOLLTE, IST MRUN JETZT FERTIG
+    if [[ $local_compile = true ]]
+    then
+       cd  $HOME
+       rm -rf $TEMPDIR
+       locat=local_compile; exit
+    fi
+
+
+       # BEREITSTELLEN DER INPUT-DATEIEN
+       # SCHLEIFE UEBER ALLE VOM BENUTZER ANGEGEBENEN DATEIEN
+    (( i = 0 ))
+    while (( i < iin ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n  *** providing INPUT-files:\n$striche"
+       fi
+
+
+          # OPTIONALE DATEIEN BEI NICHTVORHANDENSEIN UEBERGEHEN
+       if [[ "${transin[$i]}" = unavailable ]]
+       then
+          if [[ "${extin[$i]}" = ""  ||  "${extin[$i]}" = " " ]]
+          then
+             printf "\n  +++ WARNING: input file \"${pathin[$i]}/${afname}${endin[$i]}\" "
+             printf "\n               is not available!"
+          else
+             printf "\n  +++ WARNING: input file \"${pathin[$i]}/${afname}${endin[$i]}.${extin[$i]}\" "
+             printf "\n               is not available!"
+          fi
+          continue
+       fi
+
+          # PRUEFEN, OB EINZELDATEI ODER DATEI PRO PROZESSOR
+       files_for_pes=false; datentyp=file
+       if [[ "${actionin[$i]}" = pe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; datentyp=directory
+          actionin[$i]=""
+       elif [[ "${actionin[$i]}" = pe  &&  ! -n $numprocs ]]
+       then
+          actionin[$i]=""
+       elif [[ "${actionin[$i]}" = arpe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; datentyp=directory
+          actionin[$i]="ar"
+       elif [[ "${actionin[$i]}" = arpe  &&  ! -n $numprocs ]]
+       then
+          actionin[$i]="ar"
+       elif [[ "${actionin[$i]}" = flpe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; datentyp=directory
+          actionin[$i]="fl"
+       elif [[ "${actionin[$i]}" = flpe  &&  ! -n $numprocs ]]
+       then
+          actionin[$i]="fl"
+       fi
+
+       if [[ $files_for_pes = true ]]
+       then
+          printf "\n  >>> INPUT: ${absnamein[$i]}/....  to  ${localin[$i]}"
+       else
+          printf "\n  >>> INPUT: ${absnamein[$i]}  to  ${localin[$i]}"
+       fi
+
+          # INPUT-DATEI FUER EINEN FORTSETZUNGSLAUF. ES WIRD GEPRUEFT,
+          # OB DIESE DATEI NOCH AUF DEM TEMPORAEREN DATENKATALOG VORHANDEN
+          # IST. FALLS NICHT, WIRD VERSUCHT, SIE ANSCHLIESSEND VOM ARCHIV-
+          # SERVER ZU HOLEN
+       if [[ "${actionin[$i]}" = fl ]]
+       then
+          printf "\n      $datentyp will be fetched from temporary directory \"${tmp_data_catalog}\" !"
+          if [[ $files_for_pes = false ]]
+          then
+             if [[ -f "$tmp_data_catalog/${frelin[$i]}" ]]
+             then
+                ln  $tmp_data_catalog/${frelin[$i]}  ${localin[$i]}
+                got_tmp[$i]=true
+             elif [[ -f "$WORK/${frelin[$i]}"  &&  $ignore_archive_error = true ]]
+             then
+                printf "\n  +++ $datentyp not found in \"$tmp_data_catalog\" !"
+                printf "\n  *** trying to use backup copy in \"$WORK\" "
+                cp  $WORK/${frelin[$i]}  ${localin[$i]}
+             else
+                printf "\n  +++ $datentyp not found in \"$tmp_data_catalog\" "
+                printf "\n      or \"$tmp_data_catalog\" does not exist!"
+                printf "\n  *** trying to get copy from archive"
+                actionin[$i]=ar
+             fi
+          else
+             if [[ -d "$tmp_data_catalog/${frelin[$i]}" ]]
+             then
+                mkdir  ${localin[$i]}
+                ln  $tmp_data_catalog/${frelin[$i]}/*  ${localin[$i]}
+                got_tmp[$i]=true
+             elif [[ -d "$WORK/${frelin[$i]}"  &&  $ignore_archive_error = true ]]
+             then
+                printf "\n  +++ $datentyp not found in \"$tmp_data_catalog\" !"
+                printf "\n  *** trying to use backup copy in \"$WORK\" "
+                cp -r  $WORK/${frelin[$i]}  ${localin[$i]}
+             else
+                printf "\n  +++ $datentyp not found in \"$tmp_data_catalog\" "
+                printf "\n      or \"$tmp_data_catalog\" does not exist!"
+                printf "\n  *** trying to get copy from archive"
+                actionin[$i]=ar
+             fi
+          fi
+       fi
+
+
+          # DATEI LIEGT AUF ARCHIV-SERVER
+       if [[ "${actionin[$i]}" = ar ]]
+       then
+
+          if [[ $files_for_pes = false ]]
+          then
+             printf "\n      file will be restored from archive-system ($archive_system)!"
+          else
+             printf "\n      directory will be restored from archive-system ($archive_system)!"
+          fi
+
+          file_restored=false
+
+          if [[ $archive_system = asterix ]]
+          then
+             do_stagein=true
+             (( stagein_anz = 0 ))
+             while [[ $do_stagein = true ]]
+             do
+                if [[ $files_for_pes = false ]]
+                then
+                   stagein  -O  ${frelin[$i]}  >  STAGEIN_OUTPUT
+                else
+                   stagein  -t  -O  ${frelin[$i]}  >  STAGEIN_OUTPUT
+                fi
+                cat  STAGEIN_OUTPUT
+                if [[ $(grep -c "st.msg:i24"  STAGEIN_OUTPUT) != 0 ]]
+                then
+                   file_restored=true
+                   do_stagein=false
+                else
+                   (( stagein_anz = stagein_anz + 1 ))
+                   if (( stagein_anz == 10 ))
+                   then
+                      printf "\n  +++ stagein stoped after 10 tries"
+                      locat=stage
+                      exit
+                   fi
+                   printf "\n  +++ restoring from archive failed, trying again:"
+                   sleep 900
+                fi
+             done
+          elif [[ $archive_system = DMF ]]
+          then
+             if [[ $files_for_pes = false ]]
+             then
+                printf "\n  +++ restoring of single files impossible with $archive_system !\n"
+                locat=DMF
+                exit
+             else
+                find  $ARCHIVE/${frelin[$i]}  -type m  -print  |  dmget
+                cp  -r $ARCHIVE/${frelin[$i]}  $PWD
+                file_restored=true
+             fi
+          elif [[ $archive_system = tivoli ]]
+          then
+             if [[ $files_for_pes = false ]]
+             then
+                if [[ $localhost = ibmh ]]
+                then
+                   ssh  $usern@hdata.hlrn.de  "cp  $PERM/${frelin[$i]}  $PWD"
+                else
+                   ssh  $usern@bdata.hlrn.de  "cp  $PERM/${frelin[$i]}  $PWD"
+                fi
+             else
+                (( inode = 0 ))
+                while (( inode < nodes ))
+                do
+                   if [[ $localhost = ibmh ]]
+                   then
+                      ssh  $usern@hdata.hlrn.de  "cd $PWD; tar  xf  $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar"
+                   else
+                      ssh  $usern@bdata.hlrn.de  "cd $PWD; tar  xf  $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar"
+                   fi
+                   (( inode = inode + 1 ))
+                done
+             fi
+             file_restored=true
+          elif [[ $archive_system = ut ]]
+          then
+             if [[ $files_for_pes = false ]]
+             then
+                cp  $UT/${frelin[$i]}  .
+             else
+                (( inode = 0 ))
+                while (( inode < nodes ))
+                do
+                   tar  xf  $UT/${frelin[$i]}/${frelin[$i]}.node_$inode.tar
+                   (( inode = inode + 1 ))
+                done
+             fi
+             file_restored=true
+          else
+             printf "\n  +++ archive_system=\"$archive_system\"   restore impossible!"
+             locat=rearchive
+             exit
+          fi
+
+          if [[ $file_restored = true ]]
+          then
+
+                # DATEI AUCH AUF TEMPORAERES DATENVERZEICHNIS LEGEN, DAMIT
+                # SIE BEI WEITEREN ZUGRIFFEN NOCH VORHANDEN IST
+             [[ ! -d $tmp_data_catalog ]]  &&  mkdir -p  $tmp_data_catalog; chmod  g+rx  $tmp_data_catalog
+             if [[ $files_for_pes = false ]]
+             then
+                ln  -f  ${frelin[$i]}  $tmp_data_catalog/${frelin[$i]}
+             else
+                mkdir  $tmp_data_catalog/${frelin[$i]}
+                ln  -f  ${frelin[$i]}/*  $tmp_data_catalog/${frelin[$i]}
+             fi
+             got_tmp[$i]=true
+
+                # DATEI UNTER LOKALEM NAMEN ZUR VERFUEGUNG STELLEN
+             mv  ${frelin[$i]}  ${localin[$i]}
+
+          fi
+       fi
+
+
+          # DATEI LIEGT IM VOM BENUTZER ANGEGEBENEN VERZEICHNIS
+       if [[ "${actionin[$i]}" = ""  ||  "${actionin[$i]}" = "di"  ||  "${actionin[$i]}" = "npe" ]]
+       then
+
+          if [[ "${actionin[$i]}" = "npe"  &&  -n $numprocs ]]
+          then
+
+                # DATEI WIRD FUER DIE PROZESSOREN EINES PARALLERECHNERS BEREITGESTELLT
+             printf "\n      file will be provided for $numprocs processors"
+             mkdir  ${localin[$i]}
+             ival=$numprocs
+             (( ii = 0 ))
+             while (( ii <= ival-1 ))
+             do
+                if (( ii < 10 ))
+                then
+                   cp  ${absnamein[$i]}  ${localin[$i]}/_000$ii
+                elif (( ii < 100 ))
+                then
+                   cp  ${absnamein[$i]}  ${localin[$i]}/_00$ii
+                elif (( ii < 1000 ))
+                then
+                   cp  ${absnamein[$i]}  ${localin[$i]}/_0$ii
+                else
+                   cp  ${absnamein[$i]}  ${localin[$i]}/_$ii
+                fi
+                (( ii = ii + 1 ))
+             done
+
+          else
+
+             if [[ $files_for_pes = true ]]
+             then
+
+                   # DIE DEN PROZESSOREN EINES PARALLELRECHNERS ZUGEHOERIGEN
+                   # DATEIEN WERDEN BEREITGESTELLT, INDEM ZUERST DER GESAMTE
+                   # KATALOGINHALT KOPIERT UND DANN DIE EINZELNEN DATEIEN
+                   # PER MOVE UMBENANNT WERDEN
+                printf "\n      providing $numprocs files for the respective processors"
+                mkdir  ${localin[$i]}
+                cp -r  ${absnamein[$i]}/*  ${localin[$i]}
+
+             else
+                   # BEREITSTELLUNG AUF EINPROZESSORRECHNERN
+                cp  ${absnamein[$i]}  ${localin[$i]}
+             fi
+          fi
+       fi
+
+    done
+    if (( i != 0 ))
+    then
+       printf "\n$striche\n  *** all INPUT-files provided \n"
+    fi
+
+
+       # NAMELIST-DATEI MIT WERTEN VON ENVIRONMENT-VARIABLEN ERZEUGEN (ZU
+       # LESEN VON PALM)
+    cat  >  ENVPAR  <<  %%END%%
+ &envpar  run_identifier = '$fname', host = '$localhost',
+          write_binary = '$write_binary', tasks_per_node = $tasks_per_node,
+          maximum_cpu_time_allowed = ${cpumax}. /
+
+%%END%%
+
+
+       # EVENTUELLE INPUT-KOMMANDOS ABARBEITEN
+    (( i = 0 ))
+    while (( i < iic ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n  *** execution of INPUT-commands:\n$striche"
+       fi
+       printf "\n  >>> ${in_command[$i]}"
+       eval  ${in_command[$i]}
+       if (( i == iic ))
+       then
+          printf "\n$striche\n"
+       fi
+    done
+
+
+       # VERBLEIBENDE CPU-ZEIT BERECHNEN
+    cpurest=${cpumax}.
+
+
+       # PROGRAMMSTART
+    printf "\n\n  *** execution starts in directory\n      \"`pwd`\"\n$striche\n"
+    PATH=$PATH:$TEMPDIR
+
+    if [[ "$cond1" = debug  ||  "$cond2" = debug ]]
+    then
+       if [[ "$ENVIRONMENT" = BATCH ]]
+       then
+          printf "\n  +++ debug is allowed in interactive mode only"
+          locat=debug
+          exit
+       fi
+       if [[ $localhost = hpmuk ]]
+       then
+          echo  "property sdir .,${source_path}, ${add_source_path}"  >  .dderc
+          dde  a.out
+       elif [[ $localhost = decalpha ]]
+       then
+          dxladebug  a.out
+       elif [[ $localhost = ibmb  ||  $localhost = ibmh ]]
+       then
+
+             # SETUP THE IBM MPI ENVIRONMENT
+          export MP_SHARED_MEMORY=yes
+          export AIXTHREADS_SCOPE=S
+          export OMP_NUM_THREADS=$threads_per_task
+          export AUTHSTATE=files
+          export XLFRTEOPTS="nlwidth=132:err_recovery=no"    # RECORD-LENGTH OF NAMELIST-OUTPUT
+
+             # FOLLOWING OPTIONS ARE MANDATORY FOR TOTALVIEW
+          export MP_ADAPTER_USE=shared
+          export MP_CPU_USE=multiple
+          export MP_TIMEOUT=1200
+
+          unset  MP_TASK_AFFINITY
+
+             # SO FAR, TOTALVIEW NEEDS HOSTFILE MECHANISM FOR EXECUTION
+          #(( ii = 1 ))
+          #while (( ii <= $numprocs ))
+          #do
+          #   echo  $localhost_realname  >>  hostfile
+          #   (( ii = ii + 1 ))
+          #done
+          #export MP_HOSTFILE=hostfile
+
+          if [[ "$LOADLBATCH" = yes ]]
+          then
+             totalview   poe  a.out  $ROPTS
+          else
+             echo totalview   poe  -a a.out  -procs $numprocs  -rmpool 0  -nodes 1   $ROPTS
+             export TVDSVRLAUNCHCMD=ssh
+             totalview   poe  -a a.out  -procs $numprocs  -rmpool 0  -nodes 1   $ROPTS
+          fi
+       else 
+          printf "\n  +++ no debug available on \"$localhost\" "
+          printf "\n      or not implemented in mrun so far"
+          locat=debug
+          exit
+       fi
+    else
+       if [[ -n $numprocs ]]
+       then
+
+             # RUNNING THE PROGRAM ON PARALLEL MACHINES
+          if [[ $(echo $host | cut -c1-3) = ibm ]]
+          then
+                # SETUP THE IBM MPI ENVIRONMENT
+             export MP_SHARED_MEMORY=yes
+             export AIXTHREAD_SCOPE=S
+             export OMP_NUM_THREADS=$threads_per_task
+             export XLSMPOPTS="spins=0:yields=0:stack=20000000"
+             export AUTHSTATE=files
+             export XLFRTEOPTS="nlwidth=132:err_recovery=no"    # RECORD-LENGTH OF NAMELIST-OUTPUT
+             #  export MP_PRINTENV=yes
+
+                # TUNING-VARIABLEN ZUR VERBESSERUNG DER KOMMUNIKATION
+                # ZEIGEN ABER DERZEIT (SEP 04, FEDERATION) KAUM WIRKUNG
+             export MP_WAIT_MODE=poll
+             [[ $node_usage = not_shared ]]  &&  export MP_SINGLE_THREAD=yes
+#             export MP_EAGER_LIMIT=65535
+
+#                # TESTWEISE FUER TURBOMPI (JAN 05)
+#             export MPJ_MTAB=128
+#             export MPJ_ALLTOALL=1
+#             export MPJ_ALLTOALLV=1
+
+             if [[ "$LOADLBATCH" = yes ]]
+             then
+                printf "\n--- Control: OMP_NUM_THREADS = \"$OMP_NUM_THREADS\" \n"
+                if [[ "$cond1" = hpmcount  ||  "$cond2" = hpmcount ]]
+                then
+                   /opt/optibm/HPM_2_4_1/bin/hpmcount  a.out  $ROPTS  >  aout_output  2>&1
+                else
+                   poe ./a.out  $ROPTS  >  aout_output  2>&1
+                fi
+             else
+                if [[ $localhost = ibmb  ||  $localhost = ibmh  ||  $localhost = ibms ]]
+                then
+                   poe  a.out  -procs $numprocs  -nodes 1  -rmpool 0  $ROPTS  >  aout_output  2>&1
+                elif [[ $localhost = ibmy ]]
+                then
+                   if [[ -f $hostfile ]]
+                   then
+                      cp  $hostfile  hostfile
+                   else
+                      (( ii = 1 ))
+                      while (( ii <= $numprocs ))
+                      do
+                         echo  $localhost_realname  >>  hostfile
+                         (( ii = ii + 1 ))
+                      done
+                   fi
+                   export MP_HOSTFILE=hostfile
+                   ./a.out  -procs $tasks_per_node  $ROPTS  >  aout_output  2>&1
+                else
+                   if [[ "$host_file" = "" ]]
+                   then
+                      printf "\n  +++ no hostfile given in configuration file"
+                      locat=config_file
+                      exit
+                   else
+                      eval host_file=$host_file
+                   fi
+                   export MP_HOSTFILE=$host_file
+                   poe  a.out  -procs $numprocs  -tasks_per_node $numprocs  $ROPTS  >  aout_output  2>&1
+                fi
+             fi
+          elif [[ $host = nech  ||  $host = neck ]]
+          then
+             (( ii = nodes ))
+             if [[ $ii = 1 ]]
+             then
+                export F_ERRCNT=0        # acceptable number of errors before program is stopped
+                export MPIPROGINF=YES
+                echo "*** execution on single node with mpirun"
+                mpirun  -np $numprocs  ./a.out  $ROPTS  >  aout_output  2>&1
+             else
+                (( i = 0 ))
+                while (( i < ii ))
+                do
+                   echo "-h $i  -p $tasks_per_node  -e ./mpi_exec_shell"  >>  multinode_config
+                   (( i = i + 1 ))
+                done
+
+                echo "#!/bin/sh"                         >   mpi_exec_shell
+                echo " "                                 >>  mpi_exec_shell
+                echo "set -u"                            >>  mpi_exec_shell
+                echo "F_ERRCNT=0"                        >>  mpi_exec_shell
+                echo "MPIPROGINV=YES"                    >>  mpi_exec_shell
+                echo "OMP_NUM_THREADS=$threads_per_task" >>  mpi_exec_shell 
+                echo "cpurest=$cpurest"                  >>  mpi_exec_shell
+                echo "fname=$fname"                      >>  mpi_exec_shell
+                echo "localhost=$localhost"              >>  mpi_exec_shell
+                echo "return_addres=$return_addres"      >>  mpi_exec_shell
+                echo "return_username=$return_username"  >>  mpi_exec_shell
+                echo "tasks_per_node=$tasks_per_node"    >>  mpi_exec_shell
+                echo "write_binary=$write_binary"        >>  mpi_exec_shell
+                echo "use_seperate_pe_for_dvrp_output=$use_seperate_pe_for_dvrp_output"  >>  mpi_exec_shell
+                echo "  "                                >>  mpi_exec_shell
+                echo "export F_ERRCNT"                   >>  mpi_exec_shell
+                echo "export MPIPROGINV"                 >>  mpi_exec_shell
+                echo "export OMP_NUM_THREADS"            >>  mpi_exec_shell
+                echo "export cpurest"                    >>  mpi_exec_shell
+                echo "export fname"                      >>  mpi_exec_shell
+                echo "export localhost"                  >>  mpi_exec_shell
+                echo "export return_addres"              >>  mpi_exec_shell
+                echo "export return_username"            >>  mpi_exec_shell
+                echo "export tasks_per_node"             >>  mpi_exec_shell
+                echo "export write_binary"               >>  mpi_exec_shell
+                echo "export use_seperate_pe_for_dvrp_output"  >>  mpi_exec_shell
+                echo " "                                 >>  mpi_exec_shell
+                echo "exec  ./a.out > aout_output  2>&1" >>  mpi_exec_shell
+
+                chmod u+x  mpi_exec_shell
+                export MPIPROGINF=YES
+                mpirun  -f multinode_config  &
+                wait
+
+             fi
+          elif [[ $host = lcmuk ]]
+          then
+
+                # COPY HOSTFILE FROM SOURCE DIRECTORY OR CREATE IT, IF IT
+                # DOES NOT EXIST
+             if [[ -f $hostfile ]]
+             then
+                cp  $hostfile  hostfile
+             else
+                (( ii = 1 ))
+                while (( ii <= $numprocs / $threads_per_task ))
+                do
+                   echo  $localhost_realname  >>  hostfile
+                   (( ii = ii + 1 ))
+                done
+             fi
+             (( ii = $numprocs / $threads_per_task ))
+             eval zeile=\"`head -n $ii  hostfile`\"
+             printf "\n  *** running on: $zeile"
+             export OMP_NUM_THREADS=$threads_per_task
+             if [[ $threads_per_task != 1 ]]
+             then
+                printf "\n      threads per task: $threads_per_task"
+             fi
+             printf "\n\n"
+             if [[ $scirocco = true ]]
+             then
+                mpiexec  -machinefile hostfile  -n $ii  a.out  $ROPTS   >  aout_output  2>&1
+             else
+                mpirun  -machinefile hostfile  -np $ii  a.out  $ROPTS   >  aout_output  2>&1
+             fi
+          elif [[ $host = decalpha ]]
+          then
+             dmpirun  -np $numprocs  a.out  $ROPTS  >  aout_output  2>&1
+          elif [[ $host = lctit ]]
+          then
+             export runfile=runfile.$kennung
+
+             echo "cd $PWD"                                  >   $runfile
+             echo "export OMP_NUM_THREADS=$OMP_NUM_THREADS"  >>  $runfile
+             echo "export cpurest=$cpurest"                  >>  $runfile
+             echo "export fname=$fname"                      >>  $runfile
+             echo "export localhost=$localhost"              >>  $runfile
+             echo "export return_addres=$return_addres"      >>  $runfile
+             echo "export return_username=$return_username"  >>  $runfile
+             echo "export tasks_per_node=$tasks_per_node"    >>  $runfile
+             echo "export write_binary=$write_binary"        >>  $runfile
+             echo "export use_seperate_pe_for_dvrp_output=$use_seperate_pe_for_dvrp_output"  >>  $runfile
+             echo "./a.out"                                  >>  $runfile
+             chmod  u+x  $runfile
+
+             if [[ "$QUEUE" = interactive ]]
+             then
+                mpirun  -np $numprocs  $runfile  $ROPTS  >  aout_output  2>&1
+             else
+                n1ge  -fore  -mpi $numprocs  -q $queue  $runfile  $ROPTS  >  aout_output  2>&1
+             fi
+
+             rm  $runfile
+          else
+             mpprun  -n $numprocs  a.out  $ROPTS  >  aout_output  2>&1
+          fi
+          [[ $? != 0 ]]  &&  execution_error=true
+
+
+             # PERFORMANCE-AUSWERTUNG MIT APPRENTICE
+          if [[ "$cond1" = apprentice  ||  "$cond2" = apprentice ]]
+          then
+             apprentice
+          fi
+       else
+          a.out  $ROPTS  >  aout_output  2>&1
+       fi
+    fi
+    if [[ $? != 0  ||  $execution_error = true ]]
+    then
+
+          # ABBRUCH BEI LAUFZEITFEHLER
+       [[ ! ( "$cond1" = debug  ||  "$cond2" = debug ) ]]  &&  cat  aout_output
+       printf "\n  +++ runtime error occured"
+       locat=execution
+       exit
+    else
+       [[ ! ( "$cond1" = debug  ||  "$cond2" = debug ) ]]  &&  cat  aout_output
+       printf "\n$striche\n  *** execution finished \n"
+    fi
+
+
+
+       # EVENTUELLE OUTPUT-KOMMANDOS ABARBEITEN
+    (( i = 0 ))
+    while (( i < ioc ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n  *** execution of OUTPUT-commands:\n$striche"
+       fi
+       printf "\n  >>> ${out_command[$i]}"
+       eval  ${out_command[$i]}
+       if (( i == ioc ))
+       then
+          printf "\n$striche\n"
+       fi
+    done
+
+
+       # EVTL. INHALT DES AKTUELLEN VERZEICHNISSES AUSGEBEN
+    if [[ $do_trace = true ]]
+    then
+       printf "\n\n"
+       ls -al
+    fi
+
+
+
+       # OUTPUT-DATEIEN AN IHRE ZIELORTE KOPIEREN
+    (( i = 0 ))
+    while (( i < iout ))
+    do
+       (( i = i + 1 ))
+       if (( i == 1 ))
+       then
+          printf "\n\n  *** saving OUTPUT-files:\n$striche"
+       fi
+
+          # PRUEFEN, OB EINZELDATEI ODER DATEI PRO PROZESSOR
+       files_for_pes=false; filetyp=file
+       if [[ "${actionout[$i]}" = pe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; filetyp=directory
+          actionout[$i]=""
+       elif [[ "${actionout[$i]}" = pe  &&  ! -n $numprocs ]]
+       then
+          actionout[$i]=""
+       elif [[ "${actionout[$i]}" = arpe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; filetyp=directory
+          actionout[$i]="ar"
+       elif [[ "${actionout[$i]}" = arpe  &&  ! -n $numprocs ]]
+       then
+          actionout[$i]="ar"
+       elif [[ "${actionout[$i]}" = flpe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; filetyp=directory
+          actionout[$i]="fl"
+       elif [[ "${actionout[$i]}" = flpe  &&  ! -n $numprocs ]]
+       then
+          actionout[$i]="fl"
+       elif [[ "${actionout[$i]}" = trpe  &&  -n $numprocs ]]
+       then
+          files_for_pes=true; filetyp=directory
+          actionout[$i]="tr"
+       elif [[ "${actionout[$i]}" = trpe  &&  ! -n $numprocs ]]
+       then
+          actionout[$i]="tr"
+       fi
+
+       if [[ ! -f ${localout[$i]}  &&  $files_for_pes = false ]]
+       then
+          printf "\n  +++ temporary OUTPUT-file  ${localout[$i]}  does not exist\n"
+       elif [[ ! -f ${localout[$i]}/_0000  &&  $files_for_pes = true ]]
+       then
+          printf "\n  +++ temporary OUTPUT-file  ${localout[$i]}/....  does not exist\n"
+       else
+
+
+             # KOPIEREN PER FTP/SCP (IMMER IM BINAERMODUS, -M: FALLS ZIELKATALOG
+             # NICHT VORHANDEN, WIRD VERSUCHT, IHN ANZULEGEN), ABER NUR BEI
+             # REMOTE-RECHNUNGEN
+          if [[ "${actionout[$i]}" = tr ]]
+          then
+             if [[ $localhost != $fromhost ]]
+             then
+                if [[ $files_for_pes = false ]]
+                then
+                   cps=""
+                   cst=""
+                else
+                   cps=-c
+                   cst="/"
+                fi
+                if [[ $localhost = ibmh  ||  $localhost = ibmb  ||  $localhost = nech ]]
+                then
+
+                      # TRANSFER IN EIGENSTAENDIGEM JOB
+                      # ZUERST KOPIE DER DATEI INS TEMPORAERE DATENVERZEICHNIS
+                   [[ ! -d $tmp_data_catalog/TRANSFER ]]  &&  mkdir -p  $tmp_data_catalog/TRANSFER
+                   file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung
+                   if [[ $files_for_pes = false ]]
+                   then
+                      ln -f  ${localout[$i]}  $tmp_data_catalog/TRANSFER/$file_to_transfer
+                   else
+                      mkdir  $tmp_data_catalog/TRANSFER/$file_to_transfer
+                      ln  ${localout[$i]}/*  $tmp_data_catalog/TRANSFER/$file_to_transfer
+                   fi
+
+                   echo "set -x"                                    >    transfer_${localout[$i]}
+                   echo "cd  $tmp_data_catalog/TRANSFER"            >>   transfer_${localout[$i]}
+                   if [[ $filetransfer_protocol = ftp ]]
+                   then
+                      if [[ $files_for_pes = true ]]
+                      then
+                         printf "\n  +++ WARNING: no transfer of catalogs via ftpcopy\n"
+                      fi
+                      printf "\n  >>> OUTPUT: ${localout[$i]}  by FTP in seperate job to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}"
+                      printf "\n              or higher cycle\n"
+                      echo "ftpcopy -b -m $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
+                   else
+                      printf "\n  >>> OUTPUT: ${localout[$i]}$cst  by SCP in seperate job to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst"
+                      printf "\n              or higher cycle\n"
+                      echo "batch_scp $cps -b -m -u $return_username $return_addres  $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
+                   fi
+                   echo "[[ \$? = 0 ]]  &&  rm  $file_to_transfer"  >>  transfer_${localout[$i]}
+
+                   if [[ $localhost = nech ]]
+                   then
+                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 900  -f $filetransfer_protocol  transfer_${localout[$i]}
+                   else
+                      if [[ "$LOGNAME" = b323013 ]]
+                      then
+                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -f $filetransfer_protocol  transfer_${localout[$i]}
+                      else
+                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -f $filetransfer_protocol  transfer_${localout[$i]}
+                      fi
+                   fi
+
+                else
+
+                      # TRANSFER INNERHALB DIESES JOBS
+                   transfer_failed=false
+                   if [[ $filetransfer_protocol = ftp ]]
+                   then
+                      if [[ $files_for_pes = true ]]
+                      then
+                         printf "\n  +++ WARNING: no transfer of catalogs via ftpcopy\n"
+                      fi
+                      printf "\n  >>> OUTPUT: ${localout[$i]}  by FTP to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n"
+                      ftpcopy -b -m $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
+                      [[ $? != 0 ]]  &&  transfer_failed=true
+                   else
+                      printf "\n  >>> OUTPUT: ${localout[$i]}$cst  by SCP to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n"
+                      batch_scp $cps -b -m -u $return_username $return_addres  ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
+                      [[ $? != 0 ]]  &&  transfer_failed=true
+                   fi
+
+                      # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF
+                      # LOKALER MASCHINE ANLEGEN
+                   if [[ $transfer_failed = true ]]
+                   then
+                      printf "  +++ transfer failed. Trying to save a copy on the local host under:\n"
+                      printf "      ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n"
+
+                         # ERSTMAL PRUEFEN, OB VERZEICHNIS EXISTIERT. GEGEBENENFALLS
+                         # ANLEGEN.
+                      eval  local_catalog=${pathout[$i]}
+                      if [[ ! -d $local_catalog ]]
+                      then
+                         printf "  *** local directory does not exist. Trying to create:\n"
+                         printf "      $local_catalog \n"
+                         mkdir -p  $local_catalog
+                      fi
+                      eval  cp  ${localout[$i]}  ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung
+                      transfer_problems=true
+                   fi
+                fi
+             else
+
+                   # WERTZUWEISUNG, SO DASS WEITER UNTEN NUR KOPIERT WIRD
+                actionout[$i]=""
+             fi
+          fi
+
+
+             # APPEND PER FTP/SCP (IMMER IM BINAERMODUS, -M: FALLS ZIELKATALOG
+             # NICHT VORHANDEN, WIRD VERSUCHT, IHN ANZULEGEN), ABER NUR BEI
+             # REMOTE-RECHNUNGEN
+          if [[ "${actionout[$i]}" = tra ]]
+          then
+             if [[ $localhost != $fromhost ]]
+             then
+                if [[ $localhost = ibmh  ||  $localhost = ibmb  ||  $localhost = nech ]]
+                then
+
+                      # TRANSFER IN EIGENSTAENDIGEM JOB
+                      # ZUERST KOPIE DER DATEI INS TEMPORAERE DATENVERZEICHNIS
+                   [[ ! -d $tmp_data_catalog/TRANSFER ]]  &&  mkdir -p  $tmp_data_catalog/TRANSFER
+                   file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung
+                   ln -f  ${localout[$i]}  $tmp_data_catalog/TRANSFER/$file_to_transfer
+
+                   echo "set -x"                                    >    transfer_${localout[$i]}
+                   echo "cd  $tmp_data_catalog/TRANSFER"            >>   transfer_${localout[$i]}
+                   if [[ $filetransfer_protocol = ftp ]]
+                   then
+                      printf "\n  >>> OUTPUT: ${localout[$i]}  append by FTP in seperate job to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}"
+                      printf "\n              or higher cycle\n"
+                      echo "ftpcopy -A -b -m $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
+                   else
+                      printf "\n  >>> OUTPUT: ${localout[$i]}  append by SCP in seperate job to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}"
+                      printf "\n              or higher cycle\n"
+                      echo "batch_scp -A -b -m -u $return_username $return_addres  $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}"  >>  transfer_${localout[$i]}
+                   fi
+                   echo "[[ \$? = 0 ]]  &&  rm  $file_to_transfer"  >>  transfer_${localout[$i]}
+
+                   if [[ $localhost = nech ]]
+                   then
+                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 900  -f $filetransfer_protocol  transfer_${localout[$i]}
+                   else
+                      if [[ $LOGNAME = b323013 ]]
+                      then
+                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -f $filetransfer_protocol  transfer_${localout[$i]}
+                      else
+                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -f $filetransfer_protocol  transfer_${localout[$i]}
+                      fi
+                   fi
+
+                else
+
+                      # TRANSFER INNERHALB DIESES JOBS
+                   transfer_failed=false
+                   if [[ $filetransfer_protocol = ftp ]]
+                   then
+                      printf "\n  >>> OUTPUT: ${localout[$i]}  append by FTP to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n"
+                      ftpcopy -A -b -m $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
+                      [[ $? != 0 ]]  &&  transfer_failed=true
+                   else
+                      printf "\n  >>> OUTPUT: ${localout[$i]}  append by SCP to"
+                      printf "\n              ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n"
+                      batch_scp -A -b -m -u $return_username  $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]}  ${extout[$i]}
+                      [[ $? != 0 ]]  &&  transfer_failed=true
+                   fi
+
+                      # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF
+                      # LOKALER MASCHINE ANLEGEN
+                   if [[ $transfer_failed = true ]]
+                   then
+                      printf "  +++ transfer failed. Trying to save a copy on the local host under:\n"
+                      printf "      ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n"
+
+                         # ERSTMAL PRUEFEN, OB VERZEICHNIS EXISTIERT. GEGEBENENFALLS
+                         # ANLEGEN
+                      eval  local_catalog=${pathout[$i]}
+                      if [[ ! -d $local_catalog ]]
+                      then
+                         printf "  *** local directory does not exist. Trying to create:\n"
+                         printf "      $local_catalog \n"
+                         mkdir -p  $local_catalog
+                      fi
+
+                      eval  cp  ${localout[$i]}  ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung
+                      transfer_problems=true
+                   fi
+                fi
+             else
+
+                   # WERTZUWEISUNG, SO DASS WEITER UNTEN NUR APPEND AUF
+                   # LOKALER MASCHINE DURCHGEFUEHRT WIRD
+                actionout[$i]=a
+             fi
+          fi
+
+
+             # OUTPUT-DATEI FUER EINEN FORTSETZUNGSLAUF. DATEI WIRD PER
+             # LINK AUF DEN TEMPORAEREN DATENKATALOG GELEGT. OPTION -f WIRD
+             # VERWENDET, FALLS DORT NOCH EINE DATEI GLEICHEN NAMENS VORHANDEN
+             # SEIN SOLLTE. ANSCHLIESSEND WIRD SEINE ARCHIVIERUNG ANGESTOSSEN
+          if [[ "${actionout[$i]}" = fl ]]
+          then
+             [[ ! -d $tmp_data_catalog ]]  &&  mkdir -p  $tmp_data_catalog
+             chmod  g+rx  $tmp_data_catalog
+             if [[ $files_for_pes = false ]]
+             then
+                printf "\n  >>> OUTPUT: ${localout[$i]}  to"
+                printf "\n              $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n"
+                ln -f  ${localout[$i]}  $tmp_data_catalog/${frelout[$i]}
+             else
+                printf "\n  >>> OUTPUT: ${localout[$i]}/....  to"
+                printf "\n              $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n"
+                mkdir  $tmp_data_catalog/${frelout[$i]}
+                ln -f  ${localout[$i]}/*  $tmp_data_catalog/${frelout[$i]}
+             fi
+
+
+                # ARCHIVIERUNGSJOB WIRD ERZEUGT UND ABGESCHICKT
+             if [[ $store_on_archive_system = true ]]
+             then
+
+                if [[ $archive_system = asterix ]]
+                then
+                   echo "cd  $tmp_data_catalog"                      >> archive_${frelout[$i]}
+                   if [[ $files_for_pes = false ]]
+                   then
+                      echo "stageout  ${frelout[$i]}  > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]}
+                   else
+                      echo "stageout -t  ${frelout[$i]}  > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]}
+                   fi
+                   echo "cat  STAGE_OUTPUT${i}_$kennung"               >> archive_${frelout[$i]}
+                   echo "if [[ \$(grep -c \"st.msg:150\"  STAGE_OUTPUT${i}_$kennung) != 0 ]]" >> archive_${frelout[$i]}
+                   echo "then"                                       >> archive_${frelout[$i]}
+                   echo "   do_stageout=false"                       >> archive_${frelout[$i]}
+                   echo "else"                                       >> archive_${frelout[$i]}
+                   echo "   echo \"  +++ $filetyp ${frelout[$i]}  could not be stored on archive-system\" " >> archive_${frelout[$i]}
+                   echo "   cat  /dev/null  >  ~/job_queue/ARCHIVE_ERROR_$fname" >> archive_${frelout[$i]}
+                   echo "   cat  STAGE_OUTPUT${i}_$kennung  >  ~/job_queue/archive_${frelout[$i]}_error" >> archive_${frelout[$i]}
+                   echo "   echo \"  *** $filetyp ${frelout[$i]} will be copied to \$WORK as backup\" " >> archive_${frelout[$i]}
+                   if [[ $files_for_pes = false ]]
+                   then
+                      echo "   cp   ${frelout[$i]}  \$WORK"                    >> archive_${frelout[$i]}
+                   else
+                      echo "   cp -r  ${frelout[$i]}  \$WORK/${frelout[$i]}"   >> archive_${frelout[$i]}
+                   fi
+                   echo "   echo \"  *** $filetyp ${frelout[$i]} saved\" " >> archive_${frelout[$i]}
+                   echo "fi"                                         >> archive_${frelout[$i]}
+                   echo "rm  STAGE_OUTPUT${i}_$kennung"              >> archive_${frelout[$i]}
+                elif [[ $archive_system = DMF ]]
+                then
+                   echo "cd  $tmp_data_catalog"                      >> archive_${frelout[$i]}
+                   if [[ $files_for_pes = false ]]
+                   then
+                      printf "\n  +++ archiving of single files impossible with $archive_system !\n"
+                      locat=DMF
+                      exit
+                   else
+                         # FUER RECHNER IN JUELICH. DORT KOENNTEN AUCH
+                         # EINZELNE DATEIEN GESICHERT WERDEN (SPAETER KORR.)
+                      echo "rm -rf  \$ARCHIVE/${frelout[$i]}"     >> archive_${frelout[$i]}
+                      echo "cp -r  ${frelout[$i]}  \$ARCHIVE"     >> archive_${frelout[$i]}
+                   fi
+                elif [[ $archive_system = tivoli ]]
+                then
+                   echo "cd  $tmp_data_catalog"                       >> archive_${frelout[$i]}
+                   if [[ $files_for_pes = false ]]
+                   then
+                         # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN
+                      echo "set -x"                                   >> archive_${frelout[$i]}
+                      echo "rm  -rf  \$PERM/${frelout[$i]}"           >> archive_${frelout[$i]}
+                      echo "cp  ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]}
+                   else
+
+                      echo "set -x"                                   >> archive_${frelout[$i]}
+                      echo "rm  -rf  \$PERM/${frelout[$i]}/*"         >> archive_${frelout[$i]}
+                      echo "[[ ! -d \$PERM/${frelout[$i]} ]] && mkdir $PERM/${frelout[$i]}" >> archive_${frelout[$i]}
+                      cd  $tmp_data_catalog
+                      all_files=`ls -1 ${frelout[$i]}/*`
+                      cd -  > /dev/null
+                      (( inode = 0 ))
+                      (( tp1   = tasks_per_node + 1 ))
+                      while (( inode < nodes ))
+                      do
+#                         echo "*** all_files = \"$all_files\" "
+                         files=`echo $all_files | cut -d" " -f1-$tasks_per_node`
+                         all_files=`echo $all_files | cut -d" " -f$tp1-`
+#                         echo "*** tasks_per_node = \"$tasks_per_node\" "
+#                         echo "*** files = \"$files\" "
+#                         echo "*** all_files = \"$all_files\" "
+                         echo "tar  cvf \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files"   >> archive_${frelout[$i]}
+                         echo "dsmc incremental  \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar" >> archive_${frelout[$i]}
+                         echo "dsmmigrate \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar"        >> archive_${frelout[$i]}
+                         (( inode = inode + 1 ))
+                      done
+#                      echo "rm  -rf  \$PERM/${frelout[$i]}.tar"       >> archive_${frelout[$i]}
+#                      echo "tar  cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]}
+                   fi
+                elif [[ $archive_system = ut ]]
+                then
+                   echo "cd  $tmp_data_catalog"                       >> archive_${frelout[$i]}
+                   if [[ $files_for_pes = false ]]
+                   then
+                         # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN
+                      echo "set -x"                                 >> archive_${frelout[$i]}
+                      echo "rm  -rf  \$UT/${frelout[$i]}"           >> archive_${frelout[$i]}
+                      echo "cp  ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]}
+                   else
+
+                      echo "set -x"                                 >> archive_${frelout[$i]}
+                      echo "rm  -rf  \$UT/${frelout[$i]}/*"         >> archive_${frelout[$i]}
+                      echo "[[ ! -d \$UT/${frelout[$i]} ]] && mkdir $UT/${frelout[$i]}" >> archive_${frelout[$i]}
+                      cd  $tmp_data_catalog
+                      all_files=`ls -1 ${frelout[$i]}/*`
+                      cd -  > /dev/null
+                      (( inode = 0 ))
+                      (( tp1   = tasks_per_node + 1 ))
+                      while (( inode < nodes ))
+                      do
+                         files=`echo $all_files | cut -d" " -f1-$tasks_per_node`
+                         all_files=`echo $all_files | cut -d" " -f$tp1-`
+                         echo "tar  cvf \$UT/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files"   >> archive_${frelout[$i]}
+                         (( inode = inode + 1 ))
+                      done
+                   fi
+                elif [[ $archive_system = none ]]
+                then
+                   printf "              +++ archiving on $localhost not available!\n"
+                fi
+
+                if [[ $archive_system != none ]]
+                then
+                   if [[ $localhost = ibmh  ||  $localhost = ibmb ]]
+                   then
+                      subjob  -d  -v  -q cdata  -X 0  -m 1000  -t 7200  -f $filetransfer_protocol  archive_${frelout[$i]}
+                   elif [[ $localhost = nech ]]
+                   then
+                      subjob  -d  -c /pf/b/$usern/job_queue  -v  -q pp  -X 0  -m 1000  -t 7200  -f $filetransfer_protocol  archive_${frelout[$i]}
+                   fi
+                   printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
+                fi
+             else
+                printf "              +++ caution: option -A is switched on. No archiving on $archive_system!\n"
+             fi
+
+
+                # LEERDATEI IM BENUTZERVERZEICHNIS ANLEGEN, DAMIT BEKANNT IST,
+                # WIE DIE HOECHSTE ZYKLUSNUMMER AUF DEM ARCHIV-SYSTEM LAUTET
+             if [[ $files_for_pes = false ]]
+             then
+                cat  /dev/null  >  ${pathout[$i]}
+             else
+                mkdir -p  ${pathout[$i]}
+             fi
+
+          fi
+
+
+             # KOPIEREN AUF LOKALER MASCHINE ZUM ARCHIV-SYSTEM
+             # AUSSERDEM MUSS LEERDATEI ANGELEGT WERDEN, DAMIT BEKANNT IST,
+             # WIE DIE HOECHSTE ZYKLUSNUMMER AUF DEM ARCHIV-SYSTEM LAUTET
+             # FALLS IRGENDEINE (VON MEHREREN) ARCHIVIERUNGEN SCHIEF GEHT,
+             # WIRD FLAG GESETZT UND BLEIBT AUCH BEI WEITEREN ORDNUNGS-
+             # GEMAESSEN ARCHIVIERUNGEN GESETZT
+          if [[ "${actionout[$i]}" = ar ]]
+          then
+             if [[ $files_for_pes = false ]]
+             then
+                printf "\n  >>> OUTPUT: ${localout[$i]}  to"
+                printf "\n              ${pathout[$i]}"
+                printf "\n              File will be copied to archive-system ($archive_system) !\n"
+             else
+                printf "\n  >>> OUTPUT: ${localout[$i]}/_....  to"
+                printf "\n              ${pathout[$i]}"
+                printf "\n              Directory will be copied to archive-system ($archive_system) !\n"
+             fi
+             mv  ${localout[$i]}  ${frelout[$i]}
+
+             file_saved=false
+
+             if [[ $archive_system = asterix ]]
+             then
+                do_stageout=true
+                (( stageout_anz = 0 ))
+                while [[ $do_stageout = true ]]
+                do
+                   if [[ $files_for_pes = false ]]
+                   then
+                      stageout  ${frelout[$i]}  > STAGE_OUTPUT
+                   else
+                      stageout  -t  ${frelout[$i]}  > STAGE_OUTPUT
+                   fi
+                   cat  STAGE_OUTPUT
+                   if [[ $(grep -c "st.msg:150"  STAGE_OUTPUT) != 0 ]]
+                   then
+                      file_saved=true
+                      do_stageout=false
+                   else
+                      if [[ $files_for_pes = false ]]
+                      then
+                         printf "\n  +++ file ${frelout[$i]}  could not be saved on archive-system"
+                      else
+                         printf "\n  +++ directory ${frelout[$i]} could not be saved on archive-system"
+                      fi
+                      (( stageout_anz = stageout_anz + 1 ))
+                      if (( stageout_anz == 10 ))
+                      then
+                         printf "\n  +++ stoped after 10 unsuccessful tries!"
+                         archive_save=false
+                         do_stageout=false
+                      else
+                         printf "\n  *** new try to store on archive after 15 min:"
+                         sleep 900
+                      fi
+                   fi
+                done
+             elif [[ $archive_system = DMF ]]
+             then
+                if [[ $files_for_pes = false ]]
+                then
+                   printf "\n  +++ archiving of single files impossible on $archive_system!\n"
+                   locat=DMF
+                   exit
+                else
+                   rm -rf  $ARCHIVE/${frelout[$i]}
+                   cp -r  ${frelout[$i]}  $ARCHIVE
+                fi
+                file_saved=true
+             elif [[ $archive_system = tivoli ]]
+             then
+                   # ARCHIVIERUNG NUR PER BATCH-JOB MOEGLICH
+                   # DATEI MUSS ZWISCHENZEITLICH INS TEMPORAERE DATENVERZEICHNIS
+                   # GELEGT WERDEN
+                [[ ! -d $tmp_data_catalog ]]  &&  mkdir -p  $tmp_data_catalog
+                chmod  g+rx  $tmp_data_catalog
+                if [[ $files_for_pes = false ]]
+                then
+                   ln -f  ${frelout[$i]}  $tmp_data_catalog/${frelout[$i]}
+                else
+                   mkdir  $tmp_data_catalog/${frelout[$i]}
+                   ln -f  ${frelout[$i]}/*  $tmp_data_catalog/${frelout[$i]}
+                fi
+
+                   # BATCH JOB GENERIEREN UND ABSCHICKEN; DATEI MUSS WIEDER
+                   # AUS TEMPORAEREM DATENVERZEICHNIS ENTFERNT WERDEN
+                echo "cd  $tmp_data_catalog"                       >  archive_${frelout[$i]}
+                if [[ $files_for_pes = false ]]
+                then
+                      # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN
+                   echo "rm  -rf  \$PERM/${frelout[$i]}"           >> archive_${frelout[$i]}
+                   echo "cp  ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]}
+                   echo "rm  -rf  ${frelout[$i]}"                  >> archive_${frelout[$i]}
+                else
+                   echo "rm  -rf  \$PERM/${frelout[$i]}.tar"       >> archive_${frelout[$i]}
+                   echo "tar  cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]}
+                   echo "rm  -rf  ${frelout[$i]}"                  >> archive_${frelout[$i]}
+                fi
+
+                subjob  -v  -d  -q cdata  -X 0  -m 1000  -t 7200  -f $filetransfer_protocol  archive_${frelout[$i]}
+                printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
+                file_saved=true
+
+             elif [[ $archive_system = ut ]]
+             then
+                   # ARCHIVIERUNG NUR PER BATCH-JOB MOEGLICH
+                   # DATEI MUSS ZWISCHENZEITLICH INS TEMPORAERE DATENVERZEICHNIS
+                   # GELEGT WERDEN
+                [[ ! -d $tmp_data_catalog ]]  &&  mkdir -p  $tmp_data_catalog
+                chmod  g+rx  $tmp_data_catalog
+                if [[ $files_for_pes = false ]]
+                then
+                   ln -f  ${frelout[$i]}  $tmp_data_catalog/${frelout[$i]}
+                else
+                   mkdir  $tmp_data_catalog/${frelout[$i]}
+                   ln -f  ${frelout[$i]}/*  $tmp_data_catalog/${frelout[$i]}
+                fi
+
+                   # BATCH JOB GENERIEREN UND ABSCHICKEN; DATEI MUSS WIEDER
+                   # AUS TEMPORAEREM DATENVERZEICHNIS ENTFERNT WERDEN
+                echo "cd  $tmp_data_catalog"                       >  archive_${frelout[$i]}
+                if [[ $files_for_pes = false ]]
+                then
+                      # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN
+                   echo "rm  -rf  \$UT/${frelout[$i]}"           >> archive_${frelout[$i]}
+                   echo "cp  ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]}
+                   echo "rm  -rf  ${frelout[$i]}"                >> archive_${frelout[$i]}
+                else
+                   echo "rm  -rf  \$UT/${frelout[$i]}.tar"       >> archive_${frelout[$i]}
+                   echo "tar  cvf \$UT/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]}
+                   echo "rm  -rf  ${frelout[$i]}"                >> archive_${frelout[$i]}
+                fi
+
+                subjob  -v  -c /pf/b/$usern/job_queue  -d  -q pp  -X 0  -m 1000  -t 7200  -f $filetransfer_protocol  archive_${frelout[$i]}
+                printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
+                file_saved=true
+
+             else
+                printf "\n  +++ archive_system=\"$archive_system\"  archiving impossible!"
+                archive_save=false
+             fi
+             if [[ $file_saved = true ]]
+             then
+                if [[ $files_for_pes = false ]]
+                then
+                   cat  /dev/null  >  ${pathout[$i]}
+                else
+                   mkdir -p  ${pathout[$i]}
+                fi
+             fi
+          fi
+
+             # APPEND AUF LOKALER MASCHINE
+          if [[ "${actionout[$i]}" = "a" ]]
+          then
+             printf "\n  >>> OUTPUT: ${localout[$i]}  append to  ${pathout[$i]}\n"
+             cat  ${localout[$i]}  >>  ${pathout[$i]}
+          fi
+
+             # KOPIEREN AUF LOKALER MASCHINE
+             # ES MUSS KOPIERT WERDEN, DA MOVE NICHT UEBER FILESYSTEM HINAUS MOEGLICH
+          if [[ "${actionout[$i]}" = ""  &&  $files_for_pes = false ]]
+          then
+
+                # KOPIEREN AUF EINPROZESSORMASCHINE
+             if [[ "${extout[$i]}" != " " ]]
+             then
+                printf "\n  >>> OUTPUT: ${localout[$i]}  to  ${pathout[$i]}.${extout[$i]}\n"
+                cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
+             else
+                printf "\n  >>> OUTPUT: ${localout[$i]}  to  ${pathout[$i]}\n"
+                cp  ${localout[$i]}  ${pathout[$i]}
+             fi
+
+          elif [[ "${actionout[$i]}" = ""  &&  $files_for_pes = true ]]
+          then
+
+                # DIE DEN PROZESSOREN EINES PARALLELRECHNERS ZUGEHOERIGEN
+                # DATEIEN WERDEN ERST IN EINEM KATALOG GESAMMELT UND DIESER
+                # WIRD DANN KOPIERT
+                # PER MOVE UMBENANNT WERDEN
+             printf "\n  >>> OUTPUT: ${localout[$i]}/_....  to  ${pathout[$i]}\n"
+             cp -r  ${localout[$i]}  ${pathout[$i]}
+
+          fi
+       fi
+    done
+    if (( i != 0 ))
+    then
+       if [[ $transfer_problems = true ]]
+       then
+          printf "\n$striche\n  *** OUTPUT-files saved"
+          printf "\n  +++ WARNING: some data transfers failed! \n"
+       else
+          printf "\n$striche\n  *** all OUTPUT-files saved \n"
+       fi
+    fi
+
+
+       # EVENTUELL FOLGEJOB STARTEN
+       # DATEI CONTINUE_RUN MUSS VOM BENUTZERPROGRAMM AUS ERZEUGT WERDEN
+    if [[ -f CONTINUE_RUN ]]
+    then
+
+       if [[ $archive_save = true ]]
+       then
+
+             # ZUERST IN MRUN-AUFRUF OPTIONEN FUER FORTSETZUNGSLAUF, FUER
+             # STILLES ABARBEITEN (OHNE INTERAKTIVE RUECKFAGEN) UND FUER
+             # BATCH-BETRIEB (NUR WICHTIG, FALLS BATCH AUF LOKALER MASCHINE
+             # DURCHGEFUEHRT WERDEN SOLL) EINFUEGEN, FALLS NICHT BEREITS VOR-
+             # HANDEN
+          [[ $(echo $mc | grep -c "\-C") = 0 ]]  &&  mc="$mc -C"
+          [[ $(echo $mc | grep -c "\-v") = 0 ]]  &&  mc="$mc -v"
+          [[ $(echo $mc | grep -c "\-b") = 0 ]]  &&  mc="$mc -b"
+          if [[ $(echo $mc | grep -c "#") != 0 ]]
+          then
+             mc=`echo $mc | sed 's/#/f/g'`
+          fi
+
+
+             # JOB STARTEN
+          printf "\n\n  *** initiating restart-run on \"$return_addres\" using command:\n"
+          echo "      $mc"
+          printf "\n$striche\n"
+          if [[ $localhost != $fromhost ]]
+          then
+
+             if [[ $localhost = nech  ||  $localhost = ibmb  ||  $localhost = ibmh  ||  $localhost = ibms  ||  $localhost = lctit ]]
+             then
+                echo "*** ssh will be used to initiate restart-runs!"
+                echo "    return_addres=\"$return_addres\" "
+                echo "    return_username=\"$return_username\" "
+                if [[ $return_addres = 172.20.25.41 ]]
+                then
+                      # WORKAROUND AUF SCIROCCO AM TIT
+                   print  "PATH=\$PATH:$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "  |  ssh $return_addres -l $return_username 
+                else
+                   ssh $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
+                fi
+             else
+                printf "\n  +++ no restart mechanism available for host \"$localhost\" "
+                locat=restart; exit
+             fi
+
+                # WARTEN, DAMIT SICH RESTART JOB IN QUEUE EINREIHEN KANN, BEVOR
+                # DER AKTUELLE JOB ENDET
+             sleep 30
+
+          else
+
+                # BEI RECHNUNGEN AUF LOKALER MASCHINE KANN MRUN DIREKT AUFGE-
+                # RUFEN WERDEN
+             cd $LOCAL_PWD
+             eval  $mc                # ' MUESSEN AUSGEWERTET WERDEN
+             cd -  > /dev/null
+          fi
+          printf "\n$striche\n  *** restart-run initiated \n"
+
+
+             # EVENTUELL INPUT-DATEIEN, DIE VON TEMPORAEREM DATENVERZEICHNIS
+             # GEHOLT WORDEN SIND, LOESCHEN
+          (( i = 0 ))
+          while (( i < iin ))
+          do
+             (( i = i + 1 ))
+             if [[ "${got_tmp[$i]}" = true   &&  $keep_data_from_previous_run = false ]]
+             then
+                rm -r  $tmp_data_catalog/${frelin[$i]}
+             fi
+          done
+
+       else
+
+          printf "\n  +++ no restart-run possible, since errors occured"
+          printf "\n      during the archive process"
+       fi
+
+    fi
+
+
+    
+       # EVTL. EMAIL-BENACHRICHTIGUNG UEBER ABGESCHLOSSENEN LAUF
+    if [[ "$email_notification" != "" ]]
+    then
+
+       if [[ $localhost != $fromhost ]]
+       then
+          if [[ -f CONTINUE_RUN ]]
+          then
+             echo "PALM restart run necessary"        >   email_text
+             echo "description header of actual run:" >>  email_text
+             cat  CONTINUE_RUN                        >>  email_text
+             echo "mrun-command to restart:"          >>  email_text
+             echo "$mc"                               >>  email_text
+          else
+             echo "PALM run with base filename \"$fname\" on host \"$localhost\" finished"  >  email_text
+          fi
+          mail  $email_notification  <  email_text
+          printf "\n  *** email notification sent to \"$email_notification\" "
+       fi
+    fi
+
+
+
+       # ALLE ARBEITEN BEENDET. TEMPORAERER KATALOG KANN GELOESCHT WERDEN
+    cd  $HOME
+    [[ $delete_temporary_catalog = true ]]  &&  rm -rf $TEMPDIR
+
+ else
+
+
+       # FALLS AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE-
+       # CHENDE AKTIONEN DURCHGEFUEHRT
+
+       # MRUN-BEFEHL FUER REMOTE-MASCHINE ZUSAMMENSTELLEN
+    mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -f $filetransfer_protocol -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_addres -U $return_username -u $remote_username"
+    [[ "$cpp_opts" != "" ]]       &&  mrun_com=${mrun_com}" -D \"$cpp_opts\""
+    [[ $do_compile = true ]]      &&  mrun_com=${mrun_com}" -s \"$source_list\""
+    [[ "$input_list" != "" ]]     &&  mrun_com=${mrun_com}" -i \"$input_list\""
+    [[ $ignore_archive_error = true ]]  &&  mrun_com=${mrun_com}" -I"
+    [[ $keep_data_from_previous_run = true ]]  &&  mrun_com=${mrun_com}" -k"
+    [[ "$additional_conditions" != "" ]]  &&  mrun_com=${mrun_com}" -K \"$additional_conditions\""
+#    [[ "$makefile" != "$source_path/Makefile" ]]  &&  mrun_com=${mrun_com}" -M \"$makefile\""
+    [[ "$output_list" != "" ]]    &&  mrun_com=${mrun_com}" -o \"$output_list\""
+    [[ "$read_from_config" = false ]]  &&  mrun_com=${mrun_com}" -S"
+    [[ $do_trace = true ]]        &&  mrun_com=${mrun_com}" -x"
+    [[ "$numprocs" != "" ]]       &&  mrun_com=${mrun_com}" -X $numprocs"
+    if [[ $use_openmp = true ]]
+    then
+       mrun_com=${mrun_com}" -O"
+       [[ "$tasks_per_node" != "" ]] &&  mrun_com=${mrun_com}" -T $threads_per_task"
+    else
+       [[ "$tasks_per_node" != "" ]] &&  mrun_com=${mrun_com}" -T $tasks_per_node"
+    fi
+    [[ $store_on_archive_system = false ]]  &&  mrun_com=${mrun_com}" -A"
+    [[ $package_list != "" ]]     &&  mrun_com=${mrun_com}" -p \"$package_list\""
+    [[ $return_password != "" ]]  &&  mrun_com=${mrun_com}" -P $return_password"
+    [[ $delete_temporary_catalog = false ]]  &&  mrun_com=${mrun_com}" -B"
+    [[ $node_usage != default ]]  &&  mrun_com=${mrun_com}" -n $node_usage"
+    if [[ $do_remote = true ]]
+    then
+       printf "\n>>>> MRUN-command on execution host:\n>>>> $mrun_com \n"
+    fi
+
+
+       # ZUSAMMENSTELLUNG DES JOBSCRIPTS AUF DATEI jobfile
+    jobfile=jobfile.$RANDOM
+
+
+       # TEMPORAERES VERZEICHNIS GENERIEREN UND NACH DORT WECHSELN
+    echo  "mkdir  $TEMPDIR"      >>  $jobfile
+    echo  "cd  $TEMPDIR"         >>  $jobfile
+
+
+       # EVENTUELL FEHLERVERFOLGUNG AKTIVIEREN
+    if [[ $do_trace = true ]]
+    then
+       echo  "set -x"                                    >>  $jobfile
+    else
+       echo  "set +vx"                                   >>  $jobfile
+    fi
+
+
+       # ABSPEICHERN DER QUELLTEXTE (NUR FALLS UEBERSETZT WERDEN SOLL)
+       # SOWIE GEGEBENENFALLS DES MAKEFILES
+    if [[ $do_compile = true ]]
+    then
+
+       source_catalog=SOURCES_FOR_RUN_$fname
+
+           # UNTERVERZEICHNIS FUER QUELLTEXTE UND MAKEFILE ANLEGEN
+           # MRUN WIRD DIESES VRZEICHNIS UEBER ENVIRONMENT VARIABLE
+           # MITGETEILT (UEBERSTEUERT ANGABE IN KONFIGURATIONSDATEI)
+       echo  "mkdir  SOURCES_FOR_RUN_$fname"                >>  $jobfile
+       echo  "export SOURCES_COMPLETE=true"                 >>  $jobfile
+       echo  "cd     SOURCES_FOR_RUN_$fname"                >>  $jobfile
+
+       for  filename  in  $source_list
+       do
+             # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
+          echo  "cat > $filename << \"%END%\""              >>  $jobfile
+          cat   $source_catalog/$filename                   >>  $jobfile
+          echo  " "                                         >>  $jobfile
+          echo  "%END%"                                     >>  $jobfile
+          echo  " "                                         >>  $jobfile
+       done
+
+       if [[ "$use_makefile" = true ]]
+       then
+             # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
+          echo  "cat > Makefile << \"%END%\""               >>  $jobfile
+          cat   $source_catalog/Makefile                    >>  $jobfile
+          echo  " "                                         >>  $jobfile
+          echo  "%END%"                                     >>  $jobfile
+          echo  " "                                         >>  $jobfile
+       fi
+
+       echo  "cd -  > /dev/null"                         >>  $jobfile
+
+    fi
+
+
+       # ABSPEICHERN DER KONFIGURATIONSDATEI
+       # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
+    echo  "cat > $config_file << \"%END%\""      >>  $jobfile
+    cat   $config_file                           >>  $jobfile
+    echo  "%END%"                                >>  $jobfile
+    echo  " "                                    >>  $jobfile
+
+
+       # ABSPEICHERN DER AKTUELLEN MRUN-VERSION
+       # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
+    echo  "cat > $mrun_script_name <<\"%END%\""  >>  $jobfile
+    cat   ${mrun_path}/$mrun_script_name         >>  $jobfile
+    echo  "%END%"                                >>  $jobfile
+    if [[ $host = lctit ]]
+    then
+       echo "sed 's/bin\/ksh/home2\/usr5\/mkanda\/pub\/ksh/' < $mrun_script_name > mrun_new" >>  $jobfile
+       echo "mv  mrun_new  $mrun_script_name"    >>  $jobfile
+    fi
+    echo  "chmod u+x $mrun_script_name"          >>  $jobfile
+    echo  "execute_mrun=true"                    >>  $jobfile
+    echo  " "                                    >>  $jobfile
+
+       # EVTL. BENOETIGTE INPUT-DATEIEN PER FTP HOLEN ODER DEM JOB DIREKT
+       # MITGEBEN UND AUF DEM REMOTE-RECHNER IM BENUTZERVERZEICHNIS ABLEGEN
+       # FALLS DIESES NICHT EXISTIERT, WIRD VERSUCHT, DAS JEWEILS LETZTE
+       # UNTERVERZEICHNIS DES PFADNAMENS ANZULEGEN
+    if [[ $do_remote = true ]]
+    then
+       (( i = 0 ))
+       while (( i < iin ))
+       do
+          (( i = i + 1 ))
+          echo  "[[ ! -d ${pathin[$i]} ]]  &&  mkdir -p  ${pathin[$i]}"  >>  $jobfile
+          if [[ "${transin[$i]}" = job ]]
+          then
+             echo  "cat > ${remotepathin[$i]} <<\"%END%\""    >>  $jobfile
+             eval cat   ${pathin[$i]}/${frelin[$i]}           >>  $jobfile
+             echo  " "                                        >>  $jobfile
+             echo  "%END%"                                    >>  $jobfile
+          else
+             if [[ $filetransfer_protocol = ftp ]]
+             then
+                echo  "ftpcopy -b -o -g -s $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >>  $jobfile
+             else
+                echo  "batch_scp -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >>  $jobfile
+             fi
+          fi
+
+             # UEBERPRUEFEN, OB DATEI ANGELEGT WERDEN KONNTE
+          echo  "if [[ \$? = 1 ]]"                    >>  $jobfile
+          echo  "then"                                >>  $jobfile
+          echo  "   echo \" \" "                      >>  $jobfile
+          echo  "   echo \"+++ file ${remotepathin[$i]} could not be created\" "   >>  $jobfile
+          echo  "   echo \"    please check, if directory exists on $host!\" "  >>  $jobfile
+          echo  "   echo \"+++ MRUN will not be continued\" "  >>  $jobfile
+          echo  "   execute_mrun=false"               >>  $jobfile
+          echo  "fi"                                  >>  $jobfile
+       done
+    fi
+
+       # ARBEITSKATALOG AUF DER LOKALEN MASCHINE FUER EVENTUELLE 
+       # FORTSETZUNGSLAUEFE PER ENV-VARIABLE UEBERGEBEN
+    echo  "LOCAL_PWD=$working_directory"                >>  $jobfile
+    echo  "export LOCAL_PWD"                            >>  $jobfile
+
+       # EBENSO LOKALEN MRUN-KATALOG UEBERGEBEN 
+    echo  "LOCAL_MRUN_PATH=$mrun_path"                  >>  $jobfile
+    echo  "export LOCAL_MRUN_PATH"                      >>  $jobfile
+
+#    echo  "for_subjob_to_do=\"rm -rf  $TEMPDIR\" "      >>  $jobfile
+
+       # MRUN AUF ZIELRECHNER AUFRUFEN
+    echo  "set -x"                                      >>  $jobfile
+    echo  "[[ \$execute_mrun = true ]]  &&  ./$mrun_com"  >>  $jobfile
+
+    echo  'ls -al; echo `pwd`'                          >>  $jobfile
+    echo  "cd \$HOME"                                   >>  $jobfile
+    echo  "rm -rf  $TEMPDIR"                            >>  $jobfile
+
+
+
+
+       # JOB PER SUBJOB STARTEN
+    if [[ $silent = false ]]
+    then
+       printf "\n     "
+    else
+       printf "\n\n"
+    fi
+
+    subjob  $job_on_file  -h $host  -u $remote_username  -q $queue  -m $memory  -N $node_usage -t $cpumax  $XOPT  $TOPT  $OOPT  -n $fname  -f $filetransfer_protocol  -v   $jobfile
+    rm -rf  $jobfile
+
+
+ fi  # ENDE REMOTE-TEIL
+
+
+
+     # ENDE DER PROZEDUR
Index: palm/trunk/SCRIPTS/palm2doxygen.config
===================================================================
--- palm/trunk/SCRIPTS/palm2doxygen.config	(revision 4901)
+++ 	(revision )
@@ -1,2364 +1,0 @@
-#$Id: palm2doxygen.config 1683 2015-10-07 23:57:51Z knoop $
-
-# Doxyfile 1.8.9.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for palm.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME           = "PALM"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER         =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF          =
-
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
-
-PROJECT_LOGO           =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       =../../documentation/
-
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS         = NO
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES    = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF       =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES        = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE               = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES                =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST              =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN   = YES
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING      =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT       = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT       = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING            = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS  = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE        = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. If set to YES, local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO, these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES, upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES       = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC  = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES   = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING  = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
-# list will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES        = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER    =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE            =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
-
-CITE_BIB_FILES         =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS               = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong or incomplete
-# parameter documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC       = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
-# Note: If this tag is empty the current directory is searched.
-
-INPUT                  =../SOURCE/
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
-
-FILE_PATTERNS          =*.f90
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE                =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = */message.f90 */cpulog.f90  */tridia_solver.f90
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS        =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS       =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS        =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES    = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS    = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS        = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX     = YES
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER            =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET        =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET  =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES       =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE    = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT    = 255
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA  = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP         = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS  = YES
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET        = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME  = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP      = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE               =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION           =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the master .chm file (NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI           = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING     =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND             = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE               =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS  =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS  =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION           =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX          = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW      = YES
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH         = 250
-
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW    = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE       = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT    = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX            = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT         = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS     =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE       =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE           = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH    = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH        = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL       =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE        = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID     =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS  =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX         = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE             = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
-# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
-# string, for the replacement values of the other commands the user is referred
-# to HTML_HEADER.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER           =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer. See
-# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER           =
-
-# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# LaTeX style sheets that are included after the standard style sheets created
-# by doxygen. Using this option one can overrule certain style aspects. Doxygen
-# will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_STYLESHEET =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES      =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS         = YES
-
-# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES, to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX           = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE        = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES     = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE      = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE        = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE    =
-
-# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
-# with syntax highlighting in the RTF output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_SOURCE_CODE        = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION          = .3
-
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR             =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT             = xml
-
-# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK       = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT         = docbook
-
-# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
-# program listings (including syntax highlighting and cross-referencing
-# information) to the DOCBOOK output. Note that enabling this will significantly
-# increase the size of the DOCBOOK output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_PROGRAMLISTING = NO
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sf.net) file that captures the
-# structure of the code including all documentation. Note that this feature is
-# still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO, the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES, the include files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED             =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED      =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
-# the class index. If set to NO, only the inherited external classes will be
-# listed.
-# The default value is: NO.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS        = YES
-
-# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES         = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH            =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH               =
-
-# If set to YES the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS   = NO
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT               = YES
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS        = 0
-
-# When you want a differently looking font in the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME           = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH           =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK               = YES
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS   = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS     = YES
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH          = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH             = YES
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH           = YES
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif and svg.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT       = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG        = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS           =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS           =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS           =
-
-# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
-
-PLANTUML_JAR_PATH      =
-
-# When using plantuml, the specified paths are searched for files specified by
-# the !include statement in a plantuml block.
-
-PLANTUML_INCLUDE_PATH  =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES    = 100
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH    = 6
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP            = YES
Index: palm/trunk/SCRIPTS/palm_csd
===================================================================
--- palm/trunk/SCRIPTS/palm_csd	(revision 4901)
+++ 	(revision )
@@ -1,1234 +1,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Removed debug output; assign negative ids for tree patches
-#
-# 4793 2020-11-24 09:48:21Z maronga
-# Added output of tree_type (species or classification). Added tree_id for
-# vegetation patches. Allow for overlapping vegetation with buildings
-#
-# 4749 2020-10-16 11:21:27Z maronga
-# Bugfix: processing of patch height faulty for multiple domains
-#
-# 4746 2020-10-15 17:16:30Z maronga
-# Add support for backyard high vegetation, which is commonly classified as 
-# short grass
-# 
-# 4490 2020-04-10 05:32:45Z maronga
-# Bugfix: call of canopy generator was not made if tree heights were only
-# available via patch_height, but not in tree_height
-# 
-# 4481 2020-03-31 18:55:54Z maronga
-# Bugfix: green roofs were assigned to all available roofs when switched on
-# 
-# 4149 2019-08-08 14:02:18Z suehring
-# Bugfix, nbuilding_pars was 1 element to small 
-# 
-# 3955 2019-05-07 09:55:25Z maronga
-# Bugfix in preparaing of green roofs
-# Bugfix: remove LAI for bare soils
-# 
-# 3859 2019-04-03 20:30:31Z maronga
-# Bugfix: wrong variable naming for 'y'
-# 
-# 3773 2019-03-01 08:56:57Z maronga
-# Unspecificed changes
-# 
-# 3726 2019-02-07 18:22:49Z maronga
-# Removed some more bugs
-# 
-# 3688 2019-01-22 10:44:20Z maronga
-# Some unspecified bugfixes
-# 
-# 3668 2019-01-14 12:49:24Z maronga
-# Various improvements and bugfixes
-# 
-# 3629 2018-12-13 12:18:54Z maronga
-# Added canopy generator calls. Some improvements
-# 
-# 3567 2018-11-27 13:59:21Z maronga
-# Initial revisions
-#
-# Description:
-# ------------
-# Processing tool for creating PIDS conform static drivers from rastered NetCDF 
-# input
-#
-# @Author Bjoern Maronga (maronga@muk.uni-hannover.de)
-#
-# @todo Make input files optional
-# @todo Allow for ASCII input of terrain height and building height
-# @todo Modularize reading config file
-# @todo Convert to object-oriented treatment (buidings, trees)
-# @todo Automatically shift child domains so that their origin lies intersects
-#       a edge note of the parent grid
-#------------------------------------------------------------------------------#
-
-from palm_csd_files.palm_csd_netcdf_interface import *
-from palm_csd_files.palm_csd_tools import *
-from palm_csd_files.palm_csd_canopy_generator import *
-import numpy as np
-
-    
-def read_config_file():
-   
-   import configparser
-   from math import floor
-   import numpy as np
-   import os
-   import subprocess as sub
-   import sys
-
-#  Check if configuration files exists and quit otherwise
-   input_config = ".csd.config"
-   for i in range(1,len(sys.argv)): 
-      input_config = str(sys.argv[i])
-        
-   config = configparser.RawConfigParser(allow_no_value=True)
-
-   if ( os.path.isfile(input_config) == False ):
-      print ("Error. No configuration file " + input_config + " found.")
-      raise SystemExit   
-
-   config.read(input_config)
-
-
-#  Definition of settings
-
-   global settings_bridge_width
-   global settings_lai_roof_intensive
-   global settings_lai_roof_extensive
-   global settings_season
-   global settings_lai_low_default
-   global settings_lai_high_default
-   global settings_patch_height_default
-   global settings_lai_alpha
-   global settings_lai_beta
-   global settings_veg_type_below_trees
-   global ndomains
-
-#  Definition of global configuration parameters
-   global global_acronym
-   global global_angle
-   global global_author
-   global global_campaign
-   global global_comment
-   global global_contact
-   global global_data_content  
-   global global_dependencies
-   global global_institution
-   global global_keywords
-   global global_location
-   global global_palm_version
-   global global_references
-   global global_site
-   global global_source
-
-   global  path_out
-   global filename_out
-   global version_out
-
-
-#  Definition of domain parameters
-   global domain_names
-   global domain_px
-   global domain_x0
-   global domain_y0
-   global domain_x1
-   global domain_y1
-   global domain_nx
-   global domain_ny
-   global domain_dz
-   global domain_3d
-   global domain_high_vegetation
-   global domain_ip
-   global domain_za
-   global domain_parent
-   global domain_green_roofs
-   global domain_street_trees
-   global domain_canopy_patches
-   global domain_overhanging_trees
-
-#  Definition of input data parameters
-   global input_names
-   global input_px
-  
-        
-   global input_file_x
-   global input_file_y 
-   global input_file_x_UTM
-   global input_file_y_UTM   
-   global input_file_lat
-   global input_file_lon  
-   global input_file_zt
-   global input_file_buildings_2d
-   global input_file_bridges_2d 
-   global input_file_building_id
-   global input_file_bridges_id   
-   global input_file_building_type
-   global input_file_building_type
-   global input_file_lai  
-   global input_file_vegetation_type
-   global input_file_vegetation_height
-   global input_file_pavement_type
-   global input_file_water_type
-   global input_file_street_type
-   global input_file_street_crossings
-   global input_file_soil_type
-   global input_file_vegetation_on_roofs
-   global input_file_tree_crown_diameter
-   global input_file_tree_height
-   global input_file_tree_trunk_diameter
-   global input_file_tree_type
-   global input_file_patch_height
-
-   global zt_all
-   global zt_min
-
-   settings_bridge_width = 3.0
-   settings_lai_roof_intensive = 2.5
-   settings_lai_roof_extensive = 0.8
-   settings_season = "summer"
-   settings_lai_high_default = 6.0
-   settings_lai_low_default = 1.0
-   settings_patch_height_default = 10.0
-   settings_lai_alpha = 5.0
-   settings_lai_beta = 3.0
-   settings_veg_type_below_trees = 3
-   ndomains = 0
-
-   global_acronym = ""
-   global_angle = ""
-   global_author = ""
-   global_campaign = ""
-   global_comment = ""
-   global_contact = ""
-   global_data_content = ""
-   global_dependencies = ""
-   global_institution = ""
-   global_keywords = ""
-   global_location = ""
-   global_palm_version = 6.0
-   global_references = ""
-   global_site = ""
-   global_source = ""
-
-   path_out = ""
-   version_out = 1
-   filename_out = "default"
-   
-   domain_names = []
-   domain_px = []
-   domain_x0 = []
-   domain_y0 = []
-   domain_x1 = []
-   domain_y1 = []
-   domain_nx = []
-   domain_ny = []
-   domain_dz = []
-   domain_3d = []
-   domain_high_vegetation = []
-   domain_ip = []
-   domain_za = []
-   domain_parent = []
-   domain_green_roofs = []
-   domain_street_trees = []
-   domain_canopy_patches = []
-   domain_overhanging_trees = []
-
-   zt_min = 0.0
-   zt_all = []
-
-   input_names = []
-   input_px = []
-
-   input_file_x = []
-   input_file_y = []  
-   input_file_x_UTM = []
-   input_file_y_UTM = []  
-   input_file_lat = []
-   input_file_lon = []  
-   
-   input_file_zt = []
-   input_file_buildings_2d = []
-   input_file_bridges_2d = []
-   input_file_building_id = []
-   input_file_bridges_id = []   
-   input_file_building_type = []
-   input_file_lai = []
-   input_file_vegetation_type = []
-   input_file_vegetation_height = []   
-   input_file_pavement_type = []
-   input_file_water_type = []
-   input_file_street_type = []  
-   input_file_street_crossings = []     
-   input_file_soil_type = []
-   input_file_vegetation_on_roofs = []
-   input_file_tree_crown_diameter = []
-   input_file_tree_height = []
-   input_file_tree_trunk_diameter = []
-   input_file_tree_type = []
-   input_file_patch_height = []
-   
-# Load all user parameters from config file
-   for i in range(0,len(config.sections())):
-
-      read_tmp = config.sections()[i]
-      
-      if ( read_tmp == 'global' ):
-         global_acronym = config.get(read_tmp, 'acronym')
-         global_angle = float(config.get(read_tmp, 'rotation_angle'))
-         global_author = config.get(read_tmp, 'author')
-         global_campaign = config.get(read_tmp, 'campaign')
-         global_comment = config.get(read_tmp, 'comment')
-         global_contact = config.get(read_tmp, 'contact_person')
-         global_data_content = config.get(read_tmp, 'data_content')   
-         global_dependencies = config.get(read_tmp, 'dependencies')
-         global_institution = config.get(read_tmp, 'institution')
-         global_keywords = config.get(read_tmp, 'keywords')
-         global_location = config.get(read_tmp, 'location')
-         global_palm_version = float(config.get(read_tmp, 'palm_version'))
-         global_references = config.get(read_tmp, 'references')
-         global_site = config.get(read_tmp, 'site')
-         global_source = config.get(read_tmp, 'source')
-
-
-      if ( read_tmp == 'settings' ):
-         settings_lai_roof_intensive = config.get(read_tmp, 'lai_roof_intensive')
-         settings_lai_roof_extensive = config.get(read_tmp, 'lai_roof_extensive') 
-         settings_bridge_width = float(config.get(read_tmp, 'bridge_width'))   
-         settings_season = config.get(read_tmp, 'season')   
-         settings_lai_high_default = float(config.get(read_tmp, 'lai_high_vegetation_default'))
-         settings_lai_low_default = float(config.get(read_tmp, 'lai_low_vegetation_default'))         
-         settings_patch_height_default = float(config.get(read_tmp, 'patch_height_default'))  
-         settings_lai_alpha = float(config.get(read_tmp, 'lai_alpha')) 
-         settings_lai_beta = float(config.get(read_tmp, 'lai_beta')) 
-         settings_veg_type_below_trees = config.get(read_tmp, 'vegetation_type_below_trees')  
-
-      if ( read_tmp == 'output' ):
-         path_out = config.get(read_tmp, 'path')         
-         filename_out = config.get(read_tmp, 'file_out')
-         version_out = float(config.get(read_tmp, 'version'))
-
-      if ( read_tmp.split("_")[0] == 'domain' ):
-         ndomains = ndomains + 1
-         domain_names.append(read_tmp.split("_")[1])
-         domain_px.append(float(config.get(read_tmp, 'pixel_size')))
-         domain_nx.append(int(config.get(read_tmp, 'nx')))
-         domain_ny.append(int(config.get(read_tmp, 'ny')))
-         domain_dz.append(float(config.get(read_tmp, 'dz')))       
-         domain_3d.append(config.getboolean(read_tmp, 'buildings_3d'))
-         domain_high_vegetation.append(config.getboolean(read_tmp, 'allow_high_vegetation'))
-         domain_canopy_patches.append(config.getboolean(read_tmp, 'generate_vegetation_patches'))       
-         domain_ip.append(config.getboolean(read_tmp, 'interpolate_terrain'))
-         domain_za.append(config.getboolean(read_tmp, 'use_palm_z_axis')) 
-         if domain_ip[ndomains-1] and not domain_za[ndomains-1]:
-            domain_za[ndomains-1] = True
-            print("+++ Overwrite user setting for use_palm_z_axis")
-         
-         domain_parent.append(config.get(read_tmp, 'domain_parent'))
-
-         domain_x0.append(int(floor(float(config.get(read_tmp, 'origin_x'))/float(config.get(read_tmp, 'pixel_size')))))
-         domain_y0.append(int(floor(float(config.get(read_tmp, 'origin_y'))/float(config.get(read_tmp, 'pixel_size')))))       
-         domain_x1.append(int(floor(float(config.get(read_tmp, 'origin_x'))/float(config.get(read_tmp, 'pixel_size'))) + int(config.get(read_tmp, 'nx'))))
-         domain_y1.append(int(floor(float(config.get(read_tmp, 'origin_y'))/float(config.get(read_tmp, 'pixel_size'))) + int(config.get(read_tmp, 'ny'))))
-         domain_green_roofs.append(config.getboolean(read_tmp, 'vegetation_on_roofs')) 
-         domain_street_trees.append(config.getboolean(read_tmp, 'street_trees')) 
-         domain_overhanging_trees.append(config.getboolean(read_tmp, 'overhanging_trees')) 
-                 
-      if ( read_tmp.split("_")[0] == 'input' ):
-         input_names.append(read_tmp.split("_")[1])
-         input_px.append(float(config.get(read_tmp, 'pixel_size')))
-         input_file_x.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_x'))
-         input_file_y.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_y')) 
-         input_file_lat.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_lat'))
-         input_file_lon.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_lon'))   
-         input_file_x_UTM.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_x_UTM'))
-         input_file_y_UTM.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_y_UTM'))  
-         input_file_zt.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_zt'))
-         input_file_buildings_2d.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_buildings_2d'))
-         input_file_bridges_2d.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_bridges_2d'))
-         input_file_building_id.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_building_id'))  
-         input_file_bridges_id.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_bridges_id')) 
-         input_file_building_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_building_type'))
-         input_file_lai.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_lai'))         
-         input_file_vegetation_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_vegetation_type')) 
-         input_file_vegetation_height.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_vegetation_height'))          
-         input_file_pavement_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_pavement_type'))    
-         input_file_water_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_water_type'))
-         input_file_street_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_street_type'))    
-         input_file_street_crossings.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_street_crossings')) 
-         input_file_patch_height.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_patch_height')) 
-         
-         tmp = config.get(read_tmp, 'file_tree_crown_diameter')
-         if tmp is not None:
-            input_file_tree_crown_diameter.append(config.get(read_tmp, 'path') + "/" + tmp)  
-         else:
-            input_file_tree_crown_diameter.append(None)
-         input_file_tree_height.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_tree_height'))  
-         input_file_tree_trunk_diameter.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_tree_trunk_diameter'))  
-         input_file_tree_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_tree_type'))  
-         input_file_vegetation_on_roofs.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_vegetation_on_roofs'))           
-         #input_file_soil_type.append(config.get(read_tmp, 'path') + "/" + config.get(read_tmp, 'file_soil_type'))    
-   return 0
-
-
-############################################################
-
-# Start of main program
-datatypes = {
-   "x": "f4",  
-   "y": "f4", 
-   "z": "f4", 
-   "lat": "f4",  
-   "lon": "f4",   
-   "E_UTM": "f4",  
-   "N_UTM": "f4", 
-   "zt": "f4",
-   "buildings_2d": "f4",
-   "buildings_3d": "b",
-   "bridges_2d": "f4",
-   "building_id": "i",
-   "bridges_id": "i",
-   "building_type": "b",
-   "nsurface_fraction": "i",
-   "vegetation_type": "b",
-   "vegetation_height": "f4",
-   "pavement_type": "b", 
-   "water_type": "b", 
-   "street_type": "b",  
-   "street_crossings": "b",     
-   "soil_type": "b",
-   "surface_fraction": "f4",
-   "building_pars": "f4",
-   "vegetation_pars": "f4",
-   "tree_data": "f4",
-   "tree_id": "i", 
-   "tree_type": "f4",
-   "tree_types": "b",  
-   "nbuilding_pars": "i",
-   "nvegetation_pars": "i",
-   "zlad": "f4"
-   }
-
-fillvalues = {
-   "lat": float(-9999.0),
-   "lon": float(-9999.0),
-   "E_UTM": float(-9999.0),
-   "N_UTM": float(-9999.0),   
-   "zt": float(-9999.0),
-   "buildings_2d": float(-9999.0),
-   "buildings_3d": np.byte(-127),
-   "bridges_2d": float(-9999.0),
-   "building_id": int(-9999),
-   "bridges_id": int(-9999),
-   "building_type": np.byte(-127),
-   "nsurface_fraction": int(-9999),
-   "vegetation_type": np.byte(-127),
-   "vegetation_height": float(-9999.0),
-   "pavement_type": np.byte(-127),
-   "water_type": np.byte(-127),
-   "street_type": np.byte(-127), 
-   "street_crossings": np.byte(-127),   
-   "soil_type": np.byte(-127),
-   "surface_fraction": float(-9999.0),
-   "building_pars": float(-9999.0),
-   "vegetation_pars": float(-9999.0),
-   "tree_data": float(-9999.0),
-   "tree_id": int(-9999),
-   "tree_type": float(-9999.0),
-   "tree_types": np.byte(-127)
-   }
-
-defaultvalues = {
-   "lat": float(-9999.0),
-   "lon": float(-9999.0),
-   "E_UTM": float(-9999.0),
-   "N_UTM": float(-9999.0),  
-   "zt": float(0.0),
-   "buildings_2d": float(0.0),
-   "buildings_3d": 0,   
-   "bridges_2d": float(0.0),
-   "building_id": int(0),
-   "bridges_id": int(0),
-   "building_type": 1,
-   "nsurface_fraction": int(-9999),
-   "vegetation_type": 3,
-   "vegetation_height": float(-9999.0),
-   "pavement_type": 1, 
-   "water_type": 1, 
-   "street_type": 1, 
-   "street_crossings": 0,    
-   "soil_type": 1,
-   "surface_fraction": float(0.0),
-   "buildings_pars": float(-9999.0),
-   "tree_data": float(-9999.0),
-   "tree_type": np.byte(-127),
-   "vegetation_pars": float(-9999.0)   
-   }
-  
-# Read configuration file and set parameters accordingly
-read_config_file()
-
-
-filename = []
-ii = []
-ii_parent = []
-# Define indices and filenames for all domains and create netCDF files
-for i in range(0,ndomains):
-
-#  Calculate indices and input files
-   ii.append(input_px.index(domain_px[i]))
-   filename.append(path_out + "/" + filename_out + "_" + domain_names[i])
-   if domain_parent[i] is not None:
-      ii_parent.append(input_px.index(domain_px[domain_names.index(domain_parent[i])]))
-   else:
-      ii_parent.append(None)
-
-
-   x_UTM = nc_read_from_file_2d(input_file_x[ii[i]], "Band1", domain_x0[i], domain_x0[i]+1, domain_y0[i], domain_y0[i]+1)
-   y_UTM = nc_read_from_file_2d(input_file_y[ii[i]], "Band1", domain_x0[i], domain_x0[i]+1, domain_y0[i], domain_y0[i]+1)
-   lat = nc_read_from_file_2d(input_file_lat[ii[i]], "Band1", domain_x0[i], domain_x0[i]+1, domain_y0[i], domain_y0[i]+1)
-   lon = nc_read_from_file_2d(input_file_lon[ii[i]], "Band1", domain_x0[i], domain_x0[i]+1, domain_y0[i], domain_y0[i]+1)  
-   
-#  Calculate position of origin
-   x_UTM_origin = float(x_UTM[0,0]) - 0.5 * (float(x_UTM[0,1]) - float(x_UTM[0,0]))
-   y_UTM_origin = float(y_UTM[0,0]) - 0.5 * (float(y_UTM[1,0]) - float(y_UTM[0,0]))  
-   x_origin = float(lon[0,0]) - 0.5 * (float(lon[0,1]) - float(lon[0,0]))
-   y_origin = float(lat[0,0]) - 0.5 * (float(lat[1,0]) - float(lat[0,0]))   
-   
-#  Create NetCDF output file and set global attributes
-   nc_create_file(filename[i])
-   nc_write_global_attributes(filename[i],x_UTM_origin,y_UTM_origin,y_origin,x_origin,"",global_acronym,global_angle,global_author,global_campaign,global_comment,global_contact,global_data_content,global_dependencies,global_institution,global_keywords,global_location,global_palm_version,global_references,global_site,global_source,version_out)
-
-   del x_UTM, y_UTM, lat, lon
-   
-# Process terrain height
-for i in range(0,ndomains):
-
-#  Read and write terrain height (zt)
-   zt = nc_read_from_file_2d(input_file_zt[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-
-#  Final step: add zt array to the global array   
-   zt_all.append(zt)
-   del zt
- 
-#  Calculate the global (all domains) minimum of the terrain height. This value will be substracted for all
-#  data sets
-zt_min = min(zt_all[0].flatten())  
-for i in range(0,ndomains):
-   zt_min = min(zt_min,min(zt_all[i].flatten()))
-   
-del zt_all[:]
-
-print( "Shift terrain heights by -" + str(zt_min))
-for i in range(0,ndomains):
-
-#  Read and write terrain height (zt)
-   zt = nc_read_from_file_2d(input_file_zt[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-   x = nc_read_from_file_1d(input_file_x[ii[i]], "x", domain_x0[i], domain_x1[i])
-   y = nc_read_from_file_1d(input_file_y[ii[i]], "y", domain_y0[i], domain_y1[i])
-
- 
-   zt = zt - zt_min
-   
-   nc_write_global_attribute(filename[i], 'origin_z', float(zt_min))
-
-#  If necessary, interpolate parent domain terrain height on child domain grid and blend the two
-   if domain_ip[i]:
-      parent_id = domain_names.index(domain_parent[i])
-      tmp_x0 = int( domain_x0[i] * domain_px[i] / domain_px[parent_id] ) - 1
-      tmp_y0 = int( domain_y0[i] * domain_px[i] / domain_px[parent_id] ) - 1
-      tmp_x1 = int( domain_x1[i] * domain_px[i] / domain_px[parent_id] ) + 1
-      tmp_y1 = int( domain_y1[i] * domain_px[i] / domain_px[parent_id] ) + 1
-
-      tmp_x = nc_read_from_file_1d(input_file_x[ii_parent[i]], "x", tmp_x0, tmp_x1)
-      tmp_y = nc_read_from_file_1d(input_file_y[ii_parent[i]], "y", tmp_y0, tmp_y1)
-
-      zt_parent = nc_read_from_file_2d(input_file_zt[ii_parent[i]], 'Band1', tmp_x0, tmp_x1, tmp_y0, tmp_y1)
-
-      zt_parent = zt_parent - zt_min
-
-#     Interpolate array and bring to PALM grid of child domain
-      zt_ip = interpolate_2d(zt_parent,tmp_x,tmp_y,x,y)
-      zt_ip = bring_to_palm_grid(zt_ip,x,y,domain_dz[parent_id])
-      
-      
-#     Shift the child terrain height according to the parent mean terrain height 
-      print("shifting: -" + str(np.mean(zt)) + " +" + str(np.mean(zt_ip)))
-      #zt = zt - np.min(zt) + np.min(zt_ip)
-      zt = zt - np.mean(zt) + np.mean(zt_ip)
-  
-  
-#     Blend over the parent and child terrain height within a radius of 50 px  
-      zt = blend_array_2d(zt,zt_ip,50)
-     # zt = zt_ip
-   
-#  Final step: add zt array to the global array   
-
-   zt_all.append(zt)
-   del zt
- 
-
-# Read and shift x and y coordinates, shift terrain height according to its minimum value and write all data
-# to file  
-for i in range(0,ndomains):   
-#  Read horizontal grid variables from zt file and write them to output file
-   x = nc_read_from_file_1d(input_file_x[ii[i]], "x", domain_x0[i], domain_x1[i])
-   y = nc_read_from_file_1d(input_file_y[ii[i]], "y", domain_y0[i], domain_y1[i])  
-   x = x - min(x.flatten()) + domain_px[i]/2.0
-   y = y - min(y.flatten()) + domain_px[i]/2.0  
-   nc_write_dimension(filename[i], 'x', x, datatypes["x"])
-   nc_write_dimension(filename[i], 'y', y, datatypes["y"])  
-   nc_write_attribute(filename[i], 'x', 'long_name', 'x')
-   nc_write_attribute(filename[i], 'x', 'standard_name','projection_x_coordinate')   
-   nc_write_attribute(filename[i], 'x', 'units', 'm')
-   nc_write_attribute(filename[i], 'y', 'long_name', 'y')
-   nc_write_attribute(filename[i], 'y', 'standard_name', 'projection_y_coordinate')   
-   nc_write_attribute(filename[i], 'y', 'units', 'm')
-
-   lat = nc_read_from_file_2d(input_file_lat[ii[i]], "Band1", domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-   lon = nc_read_from_file_2d(input_file_lon[ii[i]], "Band1", domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])  
-
-   nc_write_to_file_2d(filename[i], 'lat', lat, datatypes["lat"],'y','x',fillvalues["lat"])
-   nc_write_to_file_2d(filename[i], 'lon', lon, datatypes["lon"],'y','x',fillvalues["lon"])  
-   
-   nc_write_attribute(filename[i], 'lat', 'long_name', 'latitude')
-   nc_write_attribute(filename[i], 'lat', 'standard_name','latitude')   
-   nc_write_attribute(filename[i], 'lat', 'units', 'degrees_north')
- 
-   nc_write_attribute(filename[i], 'lon', 'long_name', 'longitude')
-   nc_write_attribute(filename[i], 'lon', 'standard_name','longitude')   
-   nc_write_attribute(filename[i], 'lon', 'units', 'degrees_east')  
-   
-   x_UTM = nc_read_from_file_2d(input_file_x_UTM[ii[i]], "Band1", domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-   y_UTM = nc_read_from_file_2d(input_file_y_UTM[ii[i]], "Band1", domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])  
-
-   
-   nc_write_to_file_2d(filename[i], 'E_UTM', x_UTM, datatypes["E_UTM"],'y','x',fillvalues["E_UTM"])
-   nc_write_to_file_2d(filename[i], 'N_UTM', y_UTM, datatypes["N_UTM"],'y','x',fillvalues["N_UTM"])  
-   
-   nc_write_attribute(filename[i], 'E_UTM', 'long_name', 'easting')
-   nc_write_attribute(filename[i], 'E_UTM', 'standard_name','projection_x_coorindate')   
-   nc_write_attribute(filename[i], 'E_UTM', 'units', 'm')
- 
-   nc_write_attribute(filename[i], 'N_UTM', 'long_name', 'northing')
-   nc_write_attribute(filename[i], 'N_UTM', 'standard_name','projection_y_coorindate')   
-   nc_write_attribute(filename[i], 'N_UTM', 'units', 'm')  
-  
-   nc_write_crs(filename[i])
-   
-  
-  
-#  If necessary, bring terrain height to PALM's vertical grid. This is either forced by the user or implicitly
-#  by using interpolation for a child domain        
-   if domain_za[i]:
-      zt_all[i] = bring_to_palm_grid(zt_all[i],x,y,domain_dz[i])
-
-   nc_write_to_file_2d(filename[i], 'zt', zt_all[i], datatypes["zt"],'y','x',fillvalues["zt"])
-   nc_write_attribute(filename[i], 'zt', 'long_name', 'orography')
-   nc_write_attribute(filename[i], 'zt', 'units', 'm')
-   nc_write_attribute(filename[i], 'zt', 'res_orig', domain_px[i]) 
-   nc_write_attribute(filename[i], 'zt', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'zt', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-
-del zt_all
-
-
-#  Process building height, id, and type
-for i in range(0,ndomains):  
-   buildings_2d = nc_read_from_file_2d(input_file_buildings_2d[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-
-   building_id = nc_read_from_file_2d(input_file_building_id[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])  
- 
-   building_type = nc_read_from_file_2d(input_file_building_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])  
-   building_type[building_type >= 254] = fillvalues["building_type"]
-   building_type = np.where(building_type < 1,defaultvalues["building_type"],building_type)
- 
-   check = check_arrays_2(buildings_2d,building_id,fillvalues["buildings_2d"],fillvalues["building_id"])
-   if not check:
-      buildings_2d = np.where(building_id != fillvalues["building_id"],buildings_2d,fillvalues["buildings_2d"])
-      building_id = np.where(buildings_2d == fillvalues["buildings_2d"],fillvalues["building_id"],building_id)
-      print("Data check #1 " + str(check_arrays_2(buildings_2d,building_id,fillvalues["buildings_2d"],fillvalues["building_id"])))
-
-   check = check_arrays_2(buildings_2d,building_type,fillvalues["buildings_2d"],fillvalues["building_type"])
-   if not check:
-      building_type = np.where(buildings_2d == fillvalues["buildings_2d"],fillvalues["building_type"],building_type)
-      building_type = np.where((building_type == fillvalues["building_type"]) & (buildings_2d != fillvalues["buildings_2d"]),defaultvalues["building_type"],building_type)
-      print("Data check #2 " + str(check_arrays_2(buildings_2d,building_type,fillvalues["buildings_2d"],fillvalues["building_type"])))
- 
-
-   nc_write_to_file_2d(filename[i], 'buildings_2d', buildings_2d, datatypes["buildings_2d"],'y','x',fillvalues["buildings_2d"])
-   nc_write_attribute(filename[i], 'buildings_2d', 'long_name', 'buildings')
-   nc_write_attribute(filename[i], 'buildings_2d', 'units', 'm')
-   nc_write_attribute(filename[i], 'buildings_2d', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'buildings_2d', 'lod', 1) 
-   nc_write_attribute(filename[i], 'buildings_2d', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'buildings_2d', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   
-   nc_write_to_file_2d(filename[i], 'building_id', building_id, datatypes["building_id"],'y','x',fillvalues["building_id"])
-   nc_write_attribute(filename[i], 'building_id', 'long_name', 'building id')
-   nc_write_attribute(filename[i], 'building_id', 'units', '')
-   nc_write_attribute(filename[i], 'building_id', 'res _orig', domain_px[i]) 
-   nc_write_attribute(filename[i], 'building_id', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'building_id', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   
-   nc_write_to_file_2d(filename[i], 'building_type', building_type, datatypes["building_type"],'y','x',fillvalues["building_type"])
-   nc_write_attribute(filename[i], 'building_type', 'long_name', 'building type')
-   nc_write_attribute(filename[i], 'building_type', 'units', '')
-   nc_write_attribute(filename[i], 'building_type', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'building_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'building_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
- 
-del buildings_2d
-del building_id
-del building_type
-
-# Create 3d buildings if necessary. In that course, read bridge objects and add them to building layer
-for i in range(0,ndomains): 
-   
-   if domain_3d[i]:
-      x = nc_read_from_file_2d_all(filename[i], 'x')
-      y = nc_read_from_file_2d_all(filename[i], 'y')  
-      buildings_2d = nc_read_from_file_2d_all(filename[i], 'buildings_2d') 
-      building_id = nc_read_from_file_2d_all(filename[i], 'building_id') 
-      
-      bridges_2d = nc_read_from_file_2d(input_file_bridges_2d[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-      bridges_id = nc_read_from_file_2d(input_file_bridges_id[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])
-      
-      bridges_2d = np.where(bridges_2d == 0.0,fillvalues["bridges_2d"],bridges_2d)
-      building_id = np.where(bridges_2d == fillvalues["bridges_2d"],building_id,bridges_id)
-      
-      if np.any(buildings_2d != fillvalues["buildings_2d"]):
-         buildings_3d, z = make_3d_from_2d(buildings_2d,x,y,domain_dz[i])
-         if np.any(bridges_2d != fillvalues["bridges_2d"]):
-            buildings_3d = make_3d_from_bridges_2d(buildings_3d,bridges_2d,x,y,domain_dz[i],settings_bridge_width,fillvalues["bridges_2d"])
-         else:
-            print("Skipping creation of 3D bridges (no bridges in domain)")
-            
-            
-         nc_write_dimension(filename[i], 'z', z, datatypes["z"])  
-         nc_write_attribute(filename[i], 'z', 'long_name', 'z')  
-         nc_write_attribute(filename[i], 'z', 'units', 'm')
-         
-         nc_overwrite_to_file_2d(filename[i], 'building_id', building_id)  
- 
-         nc_write_to_file_3d(filename[i], 'buildings_3d', buildings_3d, datatypes["buildings_3d"],'z','y','x',fillvalues["buildings_3d"])    
-         nc_write_attribute(filename[i], 'buildings_3d', 'long_name', 'buildings 3d')
-         nc_write_attribute(filename[i], 'buildings_3d', 'units', '')
-         nc_write_attribute(filename[i], 'buildings_3d', 'res_orig', domain_px[i])  
-         nc_write_attribute(filename[i], 'buildings_3d', 'lod', 2)  
-         
-         del buildings_3d
-         
-      else:
-         print("Skipping creation of 3D buildings (no buildings in domain)")
-
-
-      del bridges_2d, bridges_id, building_id, buildings_2d
-
-
-
-# Read vegetation type, water_type, pavement_type, soil_type and make fields consistent
-for i in range(0,ndomains):  
-
-   building_type = nc_read_from_file_2d_all(filename[i], 'building_type') 
-   
-   vegetation_type = nc_read_from_file_2d(input_file_vegetation_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-   vegetation_type[vegetation_type == 255] = fillvalues["vegetation_type"]
-   vegetation_type = np.where((vegetation_type < 1) & (vegetation_type != fillvalues["vegetation_type"]),defaultvalues["vegetation_type"],vegetation_type)
-   
-   pavement_type = nc_read_from_file_2d(input_file_pavement_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-   pavement_type[pavement_type == 255] = fillvalues["pavement_type"]
-   pavement_type = np.where((pavement_type < 1) & (pavement_type != fillvalues["pavement_type"]),defaultvalues["pavement_type"],pavement_type)
-
-   water_type = nc_read_from_file_2d(input_file_water_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-   water_type[water_type == 255] = fillvalues["water_type"]
-   water_type = np.where((water_type < 1) & (water_type != fillvalues["water_type"]),defaultvalues["water_type"],water_type)
-  
-#  to do: replace by real soil input data
-   soil_type = nc_read_from_file_2d(input_file_vegetation_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])  
-   soil_type[soil_type == 255] = fillvalues["soil_type"]
-   soil_type = np.where((soil_type < 1) & (soil_type != fillvalues["soil_type"]),defaultvalues["soil_type"],soil_type)
-
-#  Make arrays consistent
-#  #1 Set vegetation type to missing for pixel where a pavement type is set
-   vegetation_type = np.where((vegetation_type != fillvalues["vegetation_type"]) & (pavement_type != fillvalues["pavement_type"]),fillvalues["vegetation_type"],vegetation_type)
-
-#  #2 Set vegetation type to missing for pixel where a building type is set
-   vegetation_type = np.where((vegetation_type != fillvalues["vegetation_type"]) & (building_type != fillvalues["building_type"]) ,fillvalues["vegetation_type"],vegetation_type)
-
-#  #3 Set vegetation type to missing for pixel where a building type is set
-   vegetation_type = np.where((vegetation_type != fillvalues["vegetation_type"]) & (water_type != fillvalues["water_type"]),fillvalues["vegetation_type"],vegetation_type)   
-
-#  #4 Remove pavement for pixels with buildings 
-   pavement_type = np.where((pavement_type != fillvalues["pavement_type"]) & (building_type != fillvalues["building_type"]),fillvalues["pavement_type"],pavement_type)  
-
-#  #5 Remove pavement for pixels with water.
-   pavement_type = np.where((pavement_type != fillvalues["pavement_type"]) & (water_type != fillvalues["water_type"]),fillvalues["pavement_type"],pavement_type) 
-   
-#  #6 Remove water for pixels with buildings
-   water_type = np.where((water_type != fillvalues["water_type"]) & (building_type != fillvalues["building_type"]),fillvalues["water_type"],water_type) 
-
-#  Correct vegetation_type when a vegetation height is available and is indicative of low vegeetation
-   vegetation_height = nc_read_from_file_2d(input_file_vegetation_height[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-         
-   vegetation_type = np.where((vegetation_height != fillvalues["vegetation_height"]) & (vegetation_height == 0.0) & ((vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18)), 3, vegetation_type)
-   vegetation_height = np.where((vegetation_height != fillvalues["vegetation_height"]) & (vegetation_height == 0.0) & ((vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18)), fillvalues["vegetation_height"],vegetation_height)
-  
-#  Check for consistency and fill empty fields with default vegetation type
-   consistency_array, test = check_consistency_4(vegetation_type,building_type,pavement_type,water_type,fillvalues["vegetation_type"],fillvalues["building_type"],fillvalues["pavement_type"],fillvalues["water_type"])
-   
-   if test:
-      vegetation_type = np.where(consistency_array == 0,defaultvalues["vegetation_type"],vegetation_type)
-      consistency_array, test = check_consistency_4(vegetation_type,building_type,pavement_type,water_type,fillvalues["vegetation_type"],fillvalues["building_type"],fillvalues["pavement_type"],fillvalues["water_type"])
-
-#  #7 to be removed: set default soil type everywhere
-   soil_type = np.where((vegetation_type != fillvalues["vegetation_type"]) | (pavement_type != fillvalues["pavement_type"]),defaultvalues["soil_type"],fillvalues["soil_type"]) 
-        
-   
-#  Check for consistency and fill empty fields with default vegetation type
-   consistency_array, test = check_consistency_3(vegetation_type,pavement_type,soil_type,fillvalues["vegetation_type"],fillvalues["pavement_type"],fillvalues["soil_type"])
-       
-#  Create surface_fraction array
-   x = nc_read_from_file_2d_all(filename[i], 'x')
-   y = nc_read_from_file_2d_all(filename[i], 'y')  
-   nsurface_fraction = np.arange(0,3)
-   surface_fraction = np.ones((len(nsurface_fraction),len(y),len(x)))
-   
-   surface_fraction[0,:,:] = np.where(vegetation_type != fillvalues["vegetation_type"], 1.0, 0.0)
-   surface_fraction[1,:,:] = np.where(pavement_type != fillvalues["pavement_type"], 1.0, 0.0)
-   surface_fraction[2,:,:] = np.where(water_type != fillvalues["water_type"], 1.0, 0.0)
-   
-   nc_write_dimension(filename[i], 'nsurface_fraction', nsurface_fraction, datatypes["nsurface_fraction"]) 
-   nc_write_to_file_3d(filename[i], 'surface_fraction', surface_fraction, datatypes["surface_fraction"],'nsurface_fraction','y','x',fillvalues["surface_fraction"])     
-   nc_write_attribute(filename[i], 'surface_fraction', 'long_name', 'surface fraction')
-   nc_write_attribute(filename[i], 'surface_fraction', 'units', '')
-   nc_write_attribute(filename[i], 'surface_fraction', 'res_orig', domain_px[i])     
-   del surface_fraction   
-
-   nc_write_to_file_2d(filename[i], 'vegetation_type', vegetation_type, datatypes["vegetation_type"],'y','x',fillvalues["vegetation_type"])     
-   nc_write_attribute(filename[i], 'vegetation_type', 'long_name', 'vegetation type')
-   nc_write_attribute(filename[i], 'vegetation_type', 'units', '')
-   nc_write_attribute(filename[i], 'vegetation_type', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'vegetation_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'vegetation_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   del vegetation_type
-
-   nc_write_to_file_2d(filename[i], 'pavement_type', pavement_type, datatypes["pavement_type"],'y','x',fillvalues["pavement_type"])    
-   nc_write_attribute(filename[i], 'pavement_type', 'long_name', 'pavement type')
-   nc_write_attribute(filename[i], 'pavement_type', 'units', '')
-   nc_write_attribute(filename[i], 'pavement_type', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'pavement_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'pavement_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   del pavement_type
-
-   nc_write_to_file_2d(filename[i], 'water_type', water_type, datatypes["water_type"],'y','x',fillvalues["water_type"]) 
-   nc_write_attribute(filename[i], 'water_type', 'long_name', 'water type')
-   nc_write_attribute(filename[i], 'water_type', 'units', '')
-   nc_write_attribute(filename[i], 'water_type', 'res_orig', domain_px[i]) 
-   nc_write_attribute(filename[i], 'water_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'water_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   del water_type
-
-   nc_write_to_file_2d(filename[i], 'soil_type', soil_type, datatypes["soil_type"],'y','x',fillvalues["soil_type"])  
-   nc_write_attribute(filename[i], 'soil_type', 'long_name', 'soil type')
-   nc_write_attribute(filename[i], 'soil_type', 'units', '')
-   nc_write_attribute(filename[i], 'soil_type', 'res_orig', domain_px[i])   
-   nc_write_attribute(filename[i], 'soil_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'soil_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   del soil_type
-
-   del x
-   del y
-
-#  pixels with bridges get building_type = 7 = bridge. This does not change the _type setting for the under-bridge
-#  area NOTE: when bridges are present the consistency check will fail at the moment
-   if domain_3d[i]:
-      if np.any(building_type != fillvalues["building_type"]):
- 
-         bridges_2d = nc_read_from_file_2d(input_file_bridges_2d[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])         
-         bridges_2d = np.where(bridges_2d == 0.0,fillvalues["bridges_2d"],bridges_2d)
-         building_type = np.where(bridges_2d != fillvalues["bridges_2d"],7,building_type)
-         nc_overwrite_to_file_2d(filename[i], 'building_type', building_type)  
- 
-         del building_type  
-         del bridges_2d
-
-# Read/write street type and street crossings
-for i in range(0,ndomains):  
-
-   street_type = nc_read_from_file_2d(input_file_street_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-   street_type[street_type == 255] = fillvalues["street_type"]
-   street_type = np.where((street_type < 1) & (street_type != fillvalues["street_type"]),defaultvalues["street_type"],street_type)
-
-   pavement_type = nc_read_from_file_2d_all(filename[i], 'pavement_type') 
-   street_type = np.where((pavement_type == fillvalues["pavement_type"]),fillvalues["street_type"],street_type) 
-
-   nc_write_to_file_2d(filename[i], 'street_type', street_type, datatypes["street_type"],'y','x',fillvalues["street_type"]) 
-   nc_write_attribute(filename[i], 'street_type', 'long_name', 'street type')
-   nc_write_attribute(filename[i], 'street_type', 'units', '')
-   nc_write_attribute(filename[i], 'street_type', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'street_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'street_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   del street_type
-   
-   street_crossings = nc_read_from_file_2d(input_file_street_crossings[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-   street_crossings[street_crossings == 255] = fillvalues["street_crossings"]
-   street_crossings = np.where((street_crossings < 1) & (street_crossings != fillvalues["street_crossings"]),defaultvalues["street_crossings"],street_crossings)
-   
-   nc_write_to_file_2d(filename[i], 'street_crossing', street_crossings, datatypes["street_crossings"],'y','x',fillvalues["street_crossings"]) 
-   nc_write_attribute(filename[i], 'street_crossing', 'long_name', 'street crossings')
-   nc_write_attribute(filename[i], 'street_crossing', 'units', '')
-   nc_write_attribute(filename[i], 'street_crossing', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'street_crossing', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'street_crossing', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-   del street_crossings
-
-
-# Read/write vegetation on roofs
-for i in range(0,ndomains):  
-   if domain_green_roofs[i]: 
-      green_roofs = nc_read_from_file_2d(input_file_vegetation_on_roofs[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-      buildings_2d = nc_read_from_file_2d_all(filename[i], 'buildings_2d') 
-
-
-      x = nc_read_from_file_2d_all(filename[i], 'x')
-      y = nc_read_from_file_2d_all(filename[i], 'y')  
-      nbuilding_pars = np.arange(0,47)
-      building_pars = np.ones((len(nbuilding_pars),len(y),len(x)))
-      building_pars[:,:,:] = fillvalues["building_pars"]
-
-#     assign green fraction on roofs
-      building_pars[3,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs != fillvalues["building_pars"] ) & ( green_roofs != 0.0 ),1,fillvalues["building_pars"] )
-
-#     assign leaf area index for vegetation on roofs
-      building_pars[4,:,:] = np.where( ( building_pars[3,:,:] != fillvalues["building_pars"] ) & ( green_roofs >= 0.5 ),settings_lai_roof_intensive,fillvalues["building_pars"])
-      building_pars[4,:,:] = np.where( ( building_pars[3,:,:] != fillvalues["building_pars"] ) & ( green_roofs < 0.5 ),settings_lai_roof_extensive,building_pars[4,:,:])
-   
-   
-      nc_write_dimension(filename[i], 'nbuilding_pars', nbuilding_pars, datatypes["nbuilding_pars"]) 
-      nc_write_to_file_3d(filename[i], 'building_pars', building_pars, datatypes["building_pars"],'nbuilding_pars','y','x',fillvalues["building_pars"]) 
-      nc_write_attribute(filename[i], 'building_pars', 'long_name', 'building_pars')
-      nc_write_attribute(filename[i], 'building_pars', 'units', '')
-      nc_write_attribute(filename[i], 'building_pars', 'res_orig', domain_px[i])  
-      nc_write_attribute(filename[i], 'building_pars', 'coordinates', 'E_UTM N_UTM lon lat') 
-      nc_write_attribute(filename[i], 'building_pars', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-         
-      del building_pars, buildings_2d, x, y
-
-
-# Read tree data and create LAD and BAD arrays using the canopy generator
-for i in range(0,ndomains):  
-   lai = nc_read_from_file_2d(input_file_lai[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-     
-   vegetation_type = nc_read_from_file_2d_all(filename[i], 'vegetation_type')
-     
-   lai = np.where(vegetation_type == fillvalues["vegetation_type"],fillvalues["vegetation_pars"],lai)
-
-      
-   x = nc_read_from_file_2d_all(filename[i], 'x')
-   y = nc_read_from_file_2d_all(filename[i], 'y')  
-   nvegetation_pars = np.arange(0,12)
-   vegetation_pars = np.ones((len(nvegetation_pars),len(y),len(x)))
-   vegetation_pars[:,:,:] = fillvalues["vegetation_pars"]  
-      
-   vegetation_pars[1,:,:] = lai
-      
-
-#  Write out first version of LAI. Will later be overwritten.
-   nc_write_dimension(filename[i], 'nvegetation_pars', nvegetation_pars, datatypes["nvegetation_pars"]) 
-   nc_write_to_file_3d(filename[i], 'vegetation_pars', vegetation_pars, datatypes["vegetation_pars"],'nvegetation_pars','y','x',fillvalues["vegetation_pars"]) 
-   nc_write_attribute(filename[i], 'vegetation_pars', 'long_name', 'vegetation_pars')
-   nc_write_attribute(filename[i], 'vegetation_pars', 'units', '')
-   nc_write_attribute(filename[i], 'vegetation_pars', 'res_orig', domain_px[i])  
-   nc_write_attribute(filename[i], 'vegetation_pars', 'coordinates', 'E_UTM N_UTM lon lat') 
-   nc_write_attribute(filename[i], 'vegetation_pars', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-
-   del lai, vegetation_pars, vegetation_type
-
-# Read tree data and create LAD and BAD arrays using the canopy generator
-for i in range(0,ndomains):  
-   if domain_street_trees[i]: 
-
-      vegetation_pars =  nc_read_from_file_2d_all(filename[i], 'vegetation_pars')
-
-      lai = nc_read_from_file_2d(input_file_lai[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-
-      x = nc_read_from_file_2d_all(filename[i], 'x')
-      y = nc_read_from_file_2d_all(filename[i], 'y')  
-
-#     Save lai data as default for low and high vegetation
-      lai_low = lai
-      lai_high = lai
-   
-#     Read all tree parameters from file
-      tree_height = nc_read_from_file_2d(input_file_tree_height[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-
-      if (input_file_tree_crown_diameter[ii[i]] is not None):
-         tree_crown_diameter = nc_read_from_file_2d(input_file_tree_crown_diameter[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-         tree_crown_diameter = np.where( (tree_crown_diameter == 0.0) | (tree_crown_diameter == -1.0) ,fillvalues["tree_data"],tree_crown_diameter)
-      else:
-         tree_crown_diameter = np.ones((len(y),len(x)))
-         tree_crown_diameter[:,:] = fillvalues["tree_data"]
-
-
-      tree_trunk_diameter = nc_read_from_file_2d(input_file_tree_trunk_diameter[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])         
-      tree_type = nc_read_from_file_2d(input_file_tree_type[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i]) 
-      patch_height = nc_read_from_file_2d(input_file_patch_height[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i]) 
-      
-#     Remove missing values from the data. Reasonable values will be set by the tree generator    
-      tree_height = np.where( (tree_height == 0.0) | (tree_height == -1.0) ,fillvalues["tree_data"],tree_height)
-      tree_trunk_diameter = np.where( (tree_trunk_diameter == 0.0) | (tree_trunk_diameter == -1.0) ,fillvalues["tree_data"],tree_trunk_diameter)
-      tree_type = np.where( (tree_type == 0.0) | (tree_type == -1.0) ,fillvalues["tree_data"],tree_type)
-      
-#     For vegetation pixel with missing height information (-1), set default patch height   
-      patch_height = np.where( patch_height == -1.0 ,settings_patch_height_default,patch_height)     
-
-#     Convert trunk diameter from cm to m
-      tree_trunk_diameter = np.where(tree_trunk_diameter != fillvalues["tree_data"], tree_trunk_diameter * 0.01,tree_trunk_diameter)
-
-
-#     Temporarily change missing value for tree_type
-      tree_type = np.where( (tree_type == fillvalues["tree_type"]),fillvalues["tree_data"],tree_type)    
-
-#     Compare patch height array with vegetation type and correct accordingly
-      vegetation_type = nc_read_from_file_2d_all(filename[i], 'vegetation_type') 
-
-
-#     For zero-height patches, set vegetation_type to short grass and remove these pixels from the patch height array
-      vegetation_type = np.where( (patch_height == 0.0) & ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ),3,vegetation_type) 
-      patch_height = np.where( (patch_height == 0.0) & ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ),fillvalues["tree_data"],patch_height)       
-
-      max_tree_height = max(tree_height.flatten())
-      max_patch_height = max(patch_height.flatten())
-      
-#     Call canopy generator for single trees only if there is any tree height available in the domain.
-#     This does not guarantee that there are street trees that can be processed. This is checked in the
-#     canopy generator.
-      if ( (max_tree_height != fillvalues["tree_data"]) | (max_patch_height != fillvalues["tree_data"]) ):
-
-         lad, bad, tree_ids, tree_types, zlad = generate_single_tree_lad(x,y,domain_dz[i],max_tree_height,max_patch_height,tree_type,tree_height,tree_crown_diameter,tree_trunk_diameter,lai,settings_season,fillvalues["tree_data"])
-  
-#        Remove LAD volumes that are inside buildings
-         if not domain_overhanging_trees[i]:
-            buildings_2d = nc_read_from_file_2d_all(filename[i], 'buildings_2d') 
-            for k in range(0,len(zlad)-1):
-  
-               lad[k,:,:] = np.where(buildings_2d == fillvalues["buildings_2d"],lad[k,:,:],fillvalues["tree_data"])
-               bad[k,:,:] = np.where(buildings_2d == fillvalues["buildings_2d"],bad[k,:,:],fillvalues["tree_data"])
-               tree_ids[k,:,:] = np.where(buildings_2d == fillvalues["buildings_2d"],tree_ids[k,:,:],fillvalues["tree_id"])      
-
-            del buildings_2d
-  
- 
-         nc_write_dimension(filename[i], 'zlad', zlad, datatypes["tree_data"]) 
-
-         nc_write_to_file_3d(filename[i], 'lad', lad, datatypes["tree_data"],'zlad','y','x',fillvalues["tree_data"]) 
-         nc_write_attribute(filename[i], 'lad', 'long_name', 'leaf area density')
-         nc_write_attribute(filename[i], 'lad', 'units', '')
-         nc_write_attribute(filename[i], 'lad', 'res_orig', domain_px[i])  
-         nc_write_attribute(filename[i], 'lad', 'coordinates', 'E_UTM N_UTM lon lat') 
-         nc_write_attribute(filename[i], 'lad', 'grid_mapping', 'E_UTM N_UTM lon lat') 
- 
-         nc_write_to_file_3d(filename[i], 'bad', bad, datatypes["tree_data"],'zlad','y','x',fillvalues["tree_data"]) 
-         nc_write_attribute(filename[i], 'bad', 'long_name', 'basal area density')
-         nc_write_attribute(filename[i], 'bad', 'units', '')
-         nc_write_attribute(filename[i], 'bad', 'res_orig', domain_px[i])  
-         nc_write_attribute(filename[i], 'bad', 'coordinates', 'E_UTM N_UTM lon lat') 
-         nc_write_attribute(filename[i], 'bad', 'grid_mapping', 'E_UTM N_UTM lon lat')
-            
-         nc_write_to_file_3d(filename[i], 'tree_id', tree_ids, datatypes["tree_id"],'zlad','y','x',fillvalues["tree_id"]) 
-         nc_write_attribute(filename[i], 'tree_id', 'long_name', 'tree id')
-         nc_write_attribute(filename[i], 'tree_id', 'units', '')
-         nc_write_attribute(filename[i], 'tree_id', 'res_orig', domain_px[i])  
-         nc_write_attribute(filename[i], 'tree_id', 'coordinates', 'E_UTM N_UTM lon lat') 
-         nc_write_attribute(filename[i], 'tree_id', 'grid_mapping', 'E_UTM N_UTM lon lat')           
-
-         nc_write_to_file_3d(filename[i], 'tree_type', tree_types, datatypes["tree_types"],'zlad','y','x',fillvalues["tree_types"]) 
-         nc_write_attribute(filename[i], 'tree_type', 'long_name', 'tree type')
-         nc_write_attribute(filename[i], 'tree_type', 'units', '')
-         nc_write_attribute(filename[i], 'tree_type', 'res_orig', domain_px[i])  
-         nc_write_attribute(filename[i], 'tree_type', 'coordinates', 'E_UTM N_UTM lon lat') 
-         nc_write_attribute(filename[i], 'tree_type', 'grid_mapping', 'E_UTM N_UTM lon lat')   
-            
-         del lai, lad, bad, tree_ids, tree_types, zlad
-
-      else:
-         print('No street trees generated in domain ' + str(i))
-         
-      del vegetation_pars, tree_height, tree_crown_diameter, tree_trunk_diameter, tree_type, patch_height, x, y
-
-
-# Create vegetation patches for locations with high vegetation type
-for i in range(0,ndomains):  
-   if domain_canopy_patches[i]: 
-
-      patch_height = nc_read_from_file_2d(input_file_patch_height[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i]) 
-
-#     For vegetation pixel with missing height information (-1), set default patch height      
-      patch_height = np.where( patch_height == -1.0 ,settings_patch_height_default,patch_height)
-      
-      max_patch_height = max(patch_height.flatten())
-      if ( max_patch_height != fillvalues["tree_data"] ):
-#        Call canopy generator for single trees only if there is any tree height available in the domain.
-#        This does not guarantee that there are street trees that can be processed. This is checked in the
-#        canopy generator.
-
-#        Load vegetation_type and lad array (at level z = 0) for re-processing
-         vegetation_type = nc_read_from_file_2d_all(filename[i], 'vegetation_type') 
-         lad = nc_read_from_file_3d_all(filename[i], 'lad') 
-         tree_id = nc_read_from_file_3d_all(filename[i], 'tree_id') 
-         tree_types = nc_read_from_file_3d_all(filename[i], 'tree_type') 
-         zlad = nc_read_from_file_1d_all(filename[i], 'zlad') 
-         vegetation_pars = nc_read_from_file_3d_all(filename[i], 'vegetation_pars') 
-         lai = nc_read_from_file_2d(input_file_lai[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i])   
-    
-
-#        Determine all pixels that do not already have an LAD but which are high vegetation to a dummy value of 1.0 and remove all other pixels
-         lai_high = np.where( (lad[0,:,:] == fillvalues["tree_data"]) & ( ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ) & ( (patch_height == fillvalues["tree_data"]) | (patch_height >= domain_dz[i])) ),1.0,fillvalues["tree_data"])
-
-
-#        Treat all pixels where short grass is defined, but where a patch_height >= dz is found, as high vegetation (often the case in backyards)
-         lai_high = np.where( (lai_high == fillvalues["tree_data"]) & (patch_height >= domain_dz[i]) & (vegetation_type == 3), 1.0, lai_high)
-                          
-#        If overhanging trees are allowed, assign pixels with patch_height > dz that are not included in vegetation_type to high
-         if domain_overhanging_trees[i]:
-            lai_high = np.where( (lai_high == fillvalues["tree_data"]) & (patch_height >= domain_dz[i]), 1.0, lai_high)
-
-#        Now, assign either the default LAI for high vegetation or keep 1.0 from the lai_high array.
-         lai_high = np.where( (lai_high != fillvalues["tree_data"]) & (lai == fillvalues["tree_data"]), settings_lai_high_default, lai_high)
-
-#        If LAI values are available in the LAI array, write them on the lai_high array
-         lai_high = np.where( (lai_high != fillvalues["tree_data"]) & (lai != fillvalues["tree_data"]), lai, lai_high)
-
-
-#        Define a patch height wherever it is missing, but where a high vegetation LAI was set
-         patch_height = np.where ( (lai_high != fillvalues["tree_data"]) & (patch_height == fillvalues["tree_data"]), settings_patch_height_default, patch_height)
-
-
-#        Remove pixels where street trees were already se
-         patch_height = np.where ( (lad[0,:,:] != fillvalues["tree_data"]), fillvalues["tree_data"], patch_height)
-
-#        Remove patch heights that have no lai_high value
-         patch_height = np.where ( (lai_high == fillvalues["tree_data"]), fillvalues["tree_data"], patch_height)
-
-
-
-
-#        For missing LAI values, set either the high vegetation default or the low vegetation default    
-         lai_high = np.where( (patch_height > 2.0) & (patch_height != fillvalues["tree_data"]) & (lai_high == fillvalues["tree_data"]),settings_lai_high_default,lai_high)
-         lai_high = np.where( (patch_height <= 2.0) & (patch_height != fillvalues["tree_data"]) & (lai_high == fillvalues["tree_data"]),settings_lai_low_default,lai_high)
-         
-         if ( max(patch_height.flatten()) >= (2.0 * domain_dz[i]) ):
-            print("    start calculating LAD (this might take some time)")       
-
-         
-            lad_patch, patch_id, patch_types, patch_nz, status = process_patch(domain_dz[i],patch_height,vegetation_type,max(zlad),lai_high,settings_lai_alpha,settings_lai_beta)
-
-#           Set negative ids for patches
-            patch_id = np.where( patch_id != fillvalues["tree_id"], -patch_id, patch_id)
-
-#           2D loop in order to avoid memory problems with large arrays
-            for iii in range(0,domain_nx[i]):
-               for jj in range(0,domain_ny[i]):            
-
-                  tree_id[0:patch_nz+1,jj,iii] = np.where( (lad[0:patch_nz+1,jj,iii] == fillvalues["tree_data"]),patch_id[0:patch_nz+1,jj,iii], tree_id[0:patch_nz+1,jj,iii] )
-                  tree_types[0:patch_nz+1,jj,iii] = np.where( (lad[0:patch_nz+1,jj,iii] == fillvalues["tree_data"]),patch_types[0:patch_nz+1,jj,iii], tree_types[0:patch_nz+1,jj,iii] )                  
-                  lad[0:patch_nz+1,jj,iii]     = np.where( (lad[0:patch_nz+1,jj,iii] == fillvalues["tree_data"]),lad_patch[0:patch_nz+1,jj,iii], lad[0:patch_nz+1,jj,iii] )
-
-#        Remove high vegetation wherever it is replaced by a leaf area density. This should effectively remove all high vegetation pixels
-         vegetation_type = np.where((lad[0,:,:] != fillvalues["tree_data"]) & (vegetation_type != fillvalues["vegetation_type"]),settings_veg_type_below_trees,vegetation_type)
-              
-#        If desired, remove all high vegetation. TODO: check if this is still necessary
-         if not domain_high_vegetation[i]:
-            vegetation_type = np.where((vegetation_type != fillvalues["vegetation_type"]) & ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ),3,vegetation_type)   
-
-  
-#        Set default low LAI for pixels with an LAD (short grass below trees)
-         lai_low = np.where( (lad[0,:,:] == fillvalues["tree_data"]), lai, settings_lai_low_default)
-    
-#        Fill low vegetation pixels without LAI set or with LAI = 0 with default value
-         lai_low = np.where( ( (lai_low == fillvalues["tree_data"]) | (lai_low == 0.0) ) & (vegetation_type != fillvalues["vegetation_type"] ), settings_lai_low_default, lai_low)
-
-#        Remove lai for pixels that have no vegetation_type
-         lai_low = np.where( ( (vegetation_type != fillvalues["vegetation_type"]) & (vegetation_type != 1) ), lai_low, fillvalues["tree_data"])
-        
-#        Overwrite lai in vegetation_parameters  
-         vegetation_pars[1,:,:] = np.copy(lai_low)
-         nc_overwrite_to_file_3d(filename[i], 'vegetation_pars', vegetation_pars) 
-
-#        Overwrite lad and id arrays
-         nc_overwrite_to_file_3d(filename[i], 'lad', lad) 
-         nc_overwrite_to_file_3d(filename[i], 'tree_id', tree_id) 
-         nc_overwrite_to_file_3d(filename[i], 'tree_type', tree_types) 
-
-         nc_overwrite_to_file_2d(filename[i], 'vegetation_type', vegetation_type)  
-
-
-         del vegetation_type, lad, lai, patch_height, vegetation_pars, zlad
-      else:
-         print('No tree patches found in domain ' + str(i))
-
-# Final adjustment of vegetation parameters: remove LAI where a bare soil was set
-for i in range(0,ndomains): 
-   
-      vegetation_type = nc_read_from_file_2d_all(filename[i], 'vegetation_type') 
-      vegetation_pars = nc_read_from_file_3d_all(filename[i], 'vegetation_pars') 
-      lai = vegetation_pars[1,:,:]   
-      
-      
-#     Remove lai for pixels that have no vegetation_type
-      lai = np.where( ( (vegetation_type != fillvalues["vegetation_type"]) & (vegetation_type != 1) ), lai, fillvalues["tree_data"])
-        
-#     Overwrite lai in vegetation_parameters  
-      vegetation_pars[1,:,:] = np.copy(lai)
-      nc_overwrite_to_file_3d(filename[i], 'vegetation_pars', vegetation_pars) 
-      
-      del vegetation_type, lai, vegetation_pars
-
-
-# Final consistency check
-for i in range(0,ndomains): 
-   vegetation_type = nc_read_from_file_2d_all(filename[i], 'vegetation_type')  
-   pavement_type = nc_read_from_file_2d_all(filename[i], 'pavement_type')  
-   building_type = nc_read_from_file_2d_all(filename[i], 'building_type')  
-   water_type = nc_read_from_file_2d_all(filename[i], 'water_type')     
-   soil_type = nc_read_from_file_2d_all(filename[i], 'soil_type')  
-
-#  Check for consistency and fill empty fields with default vegetation type
-   consistency_array, test = check_consistency_4(vegetation_type,building_type,pavement_type,water_type,fillvalues["vegetation_type"],fillvalues["building_type"],fillvalues["pavement_type"],fillvalues["water_type"])
-
-#  Check for consistency and fill empty fields with default vegetation type
-   consistency_array, test = check_consistency_3(vegetation_type,pavement_type,soil_type,fillvalues["vegetation_type"],fillvalues["pavement_type"],fillvalues["soil_type"])
-
-   surface_fraction = nc_read_from_file_3d_all(filename[i], 'surface_fraction')       
-   surface_fraction[0,:,:] = np.where(vegetation_type != fillvalues["vegetation_type"], 1.0, 0.0)
-   surface_fraction[1,:,:] = np.where(pavement_type != fillvalues["pavement_type"], 1.0, 0.0)
-   surface_fraction[2,:,:] = np.where(water_type != fillvalues["water_type"], 1.0, 0.0)
-   nc_overwrite_to_file_3d(filename[i], 'surface_fraction', surface_fraction) 
-       
-   del vegetation_type, pavement_type, building_type, water_type, soil_type
Index: palm/trunk/SCRIPTS/palm_cvd
===================================================================
--- palm/trunk/SCRIPTS/palm_cvd	(revision 4901)
+++ 	(revision )
@@ -1,750 +1,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# - Check automatically for data organization (stored in subdirectories or not)
-# - Convert trajectory and timeseriesProfile coordinates into 1-D coordinates
-#   equivalent to timeseries coordiates. This simplifies processing in PALM and
-#   makes the virtual-measurement module also applicable to other campaigns.
-#
-# 4758 2020-10-26 13:03:52Z suehring
-# In order to do not omit observations that are on the same site but have different
-# coordinates or feature-types, process all files rather than only one and omit 
-# the rest.
-#
-# 4663 2020-09-02 14:54:09Z gronemeier
-# bugfix in non_measurable_vars; ignore station_h if featureType is trajectory
-#
-# 4400 2020-02-10 20:32:41Z suehring
-# Initial revision
-#
-# Description:
-# ------------
-# Processing tool for creating PIDS conform virtual measurement setup file
-# from UC2 data-standard conform observational data or from prescribed input
-# coordinates.
-#
-# @Authors Matthias Suehring (suehring@muk.uni-hannover.de)
-#          Tobias Gronemeier (gronemeier@muk.uni-hannover.de)
-#
-# @todo Add further feature tpyes for customized observations. At the moment only
-#       timeSeries is possible.
-#--------------------------------------------------------------------------------#
-
-
-import netCDF4
-from netCDF4 import Dataset, stringtochar
-import os
-import numpy as np
-import time
-
-
-# Function to read the config file
-def read_config_file():
-
-   import configparser
-   import os
-   import sys
-   import json
-
-   # Definition of global configuration parameters
-   global global_acronym
-   global global_author
-   global global_campaign
-   global global_comment
-   global global_contact
-   global global_data_content
-   global global_dependencies
-   global global_institution
-   global global_keywords
-   global global_location
-   global global_references
-   global global_site
-   global global_source
-   global global_palm_version
-   global data_path
-   global output_path
-   global output_filename
-   global number_positions
-   global input_from_observations
-   global coordinates
-   global vars_to_be_measured
-   global custom_coordinates
-
-   global_acronym          = " "
-   global_author           = " "
-   global_campaign         = " "
-   global_comment          = " "
-   global_contact          = " "
-   global_data_content     = " "
-   global_dependencies     = " "
-   global_institution      = " "
-   global_keywords         = " "
-   global_location         = " "
-   global_references       = " "
-   global_site             = " "
-   global_source           = " "
-   global_palm_version     = 6.0
-   data_path               = " "
-   output_path             = " "
-   output_filename         = "none"
-   number_positions        = -999
-   input_from_observations = False
-   coordinates             = []
-   vars_to_be_measured     = []
-   custom_coordinates      = False
-
-   # Check if configuration files exists and quit otherwise
-   input_config = ".cvd.config.default"
-   for i in range(1,len(sys.argv)):
-      input_config = str(sys.argv[i])
-
-   # Allow empty settings
-   config = configparser.RawConfigParser(allow_no_value=True)
-
-   # Check if a config file exists.
-   if ( os.path.isfile(input_config) == False ):
-      print ("Error. No configuration file " + input_config + " found.")
-      quit()
-
-   config.read(input_config)
-
-   for section in range( 0, len( config.sections() ) ):
-
-      current_section = config.sections()[section]
-
-      # read global attributes which are written into the output file header
-      if ( current_section == 'global' ):
-
-         global_acronym      = config.get( current_section, 'acronym'        )
-         global_author       = config.get( current_section, 'author'         )
-         global_campaign     = config.get( current_section, 'campaign'       )
-         global_comment      = config.get( current_section, 'comment'        )
-         global_contact      = config.get( current_section, 'contact_person' )
-         global_data_content = config.get( current_section, 'data_content'   )
-         global_dependencies = config.get( current_section, 'dependencies'   )
-         global_institution  = config.get( current_section, 'institution'    )
-         global_keywords     = config.get( current_section, 'keywords'       )
-         global_location     = config.get( current_section, 'location'       )
-         global_references   = config.get( current_section, 'references'     )
-         global_site         = config.get( current_section, 'site'           )
-         global_source       = config.get( current_section, 'source'         )
-         global_palm_version = float( config.get( current_section, 'palm_version' ) )
-
-      # Read data input path for observational data
-      elif ( current_section == 'input' ):
-
-         data_path = config.get( current_section, 'data_path' )
-         input_from_observations = True
-
-      # Read output path and filename for the VM driver
-      elif ( current_section == 'output' ):
-
-         output_path     = config.get( current_section, 'output_path' )
-         output_filename = config.get( current_section, 'output_filename' )
-
-      # Read customized coordinates where virtual measurements shall be taken,
-      # as well as the variables that should be sampled.
-      elif ( current_section == 'custom_positions' ):
-
-         number_positions = config.get( current_section, 'number_positions' )
-
-         for count in range( 0, int( number_positions ) ):
-            coordinates.append( json.loads( config.get( current_section, \
-                                                        "coordinates" + str( count + 1 ) ) ) )
-            # If coordinates are given, set a global flag.
-            custom_coordinates = True
-
-         for count in range( 0, int( number_positions ) ):
-            vars_to_be_measured.append( json.loads( config.get( current_section, \
-                                                    "vars_to_be_measured" + str( count + 1 ) ) ) )
-
-
-   return 0
-
-#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-# Main program:
-#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
-# Define strings
-name_featuretype   = "featureType"
-name_ts            = "timeSeries"
-name_tspr          = "timeSeriesProfile"
-name_traj          = "trajectory"
-name_ntime         = "ntime"
-name_time          = "time"
-name_station       = "station"
-name_traj_dim      = "traj"
-name_nz            = "nz"
-name_datacontent   = "data_content"
-name_eutm          = "E_UTM"
-name_nutm          = "N_UTM"
-name_hao           = "height"
-name_station_h     = "station_h"
-name_z             = "z"
-name_soil_sampling = "soil_sample"
-name_num_stat      = "number_of_stations"
-name_fill          = "_FillValue"
-name_site          = "site"
-name_acro          = "acronym"
-name_content       = "data_content"
-name_orig_x        = "origin_x"
-name_orig_y        = "origin_y"
-name_orig_z        = "origin_z"
-
-max_string_len     = 50
-
-name_measvars      = "measured_variables"
-
-non_measurable_vars = ['station_name', 'time', 'time_bounds', 'crs', \
-                       'vrs', 'x', 'y', 'z', 'lon', 'lat', 'ntime', 'station', 'traj', \
-                       'E_UTM', 'N_UTM', 'height_above_origin', 'station_h', \
-                       'traj_name', 'height', 'band_pm_size', 'bands_pm', 'bands_pm_size_bounds', \
-                       'bands_pm_size', 'ancillary_detected_layer' ]
-
-soil_vars            = [ 't_soil', 'm_soil', 'lwc', 'lwcs', 'smp' ]
-
-dims_out             = [ name_eutm, name_nutm, name_hao, name_z, name_station_h ]
-
-# Define list of attributes which need to be of type float. In the data set this is not
-# necessarily guranteed.
-atts_float           = [ 'origin_x', 'origin_y', 'origin_z', 'origin_lon', 'origin_lat', 'rotation_angle' ]
-
-# Define list of default variables that shall be measured at each site
-vars_default         = [ 'u', 'v', 'w', 'theta', 'hus' ]
-
-
-#Read config file
-read_config_file()
-
-# Initialize counter variable for the number of sites
-num_sites = 0
-
-# Set the output path for the data
-output_filename = output_path + output_filename
-
-# Open output file
-ncfile_out = Dataset( output_filename, "w", format="NETCDF4" )
-
-# First, add global attributes
-ncfile_out.setncattr( 'acronym',        global_acronym      )
-ncfile_out.setncattr( 'author',         global_author       )
-ncfile_out.setncattr( 'campaign',       global_campaign     )
-ncfile_out.setncattr( 'comment',        global_comment      )
-ncfile_out.setncattr( 'contact_person', global_contact      )
-ncfile_out.setncattr( 'data_content',   global_data_content )
-ncfile_out.setncattr( 'dependencies',   global_dependencies )
-ncfile_out.setncattr( 'institution',    global_institution  )
-ncfile_out.setncattr( 'keywords',       global_keywords     )
-ncfile_out.setncattr( 'location',       global_location     )
-ncfile_out.setncattr( 'references',     global_references   )
-ncfile_out.setncattr( 'site',           global_site         )
-ncfile_out.setncattr( 'source',         global_source       )
-ncfile_out.setncattr( 'palm_version',   global_palm_version )
-
-# Create universal dimension for the string length.
-ncfile_out.createDimension("string_len", max_string_len)
-
-
-# Check if observational data is available. This case,
-# obtain an alphabetically sorted list of input data. List is sorted
-# just for the sake of clarity in the resulting setup file.
-if ( input_from_observations == True ):
-   list_input_data = sorted( os.listdir( data_path ) )
-
-if ( input_from_observations ):
-
-   # Run loop over all listed input data. Depending on the data set, this could be
-   # a list of files or a list of subdirectories.
-   # This is done to reduce the number of virtual measurements in the model. Each
-   # virtual measurement has an overhead and consumes memory.
-   sites = []
-   input_files = []
-   input_files_orig = []
-   for dirname in list_input_data:
-       data_file = data_path + dirname
-
-       if ( os.path.isdir(data_file) == True ):
-          # Directory may contain various file versions.
-          # Take the one with highest cycle number.
-          highest_cycle_nr = 0
-          for filename in os.listdir(data_file):
-             start_seq = len( filename ) - 6
-             end_seq   = len( filename ) - 3
-             if int( filename[start_seq:end_seq] ) > highest_cycle_nr:
-                highest_cycle_nr = int(filename[start_seq:end_seq])
-                latest_file      = filename
-          input_file = data_file + "/" + latest_file
-          input_file_orig = latest_file
-       else:
-          input_file = data_file
-          input_file_orig = dirname
-
-       # Open the NetCDF file
-       ncfile_in = Dataset( input_file, "r", format="NETCDF4", encoding='ascii')
-       input_files.append(input_file)
-       input_files_orig.append(input_file_orig)
-
-#  Gather all files according to their feature type and all sites for the respective feature type
-   files_traj  = []
-   files_ts    = []
-   files_tspr  = []
-   sites_traj  = []
-   sites_ts    = []
-   sites_tspr  = []
-   for input_file in input_files:
-      ncfile_in = Dataset( input_file, "r", format="NETCDF4", encoding='ascii' )
-
-      for att in ncfile_in.ncattrs():
-         if ( att == name_featuretype ):
-            feature = ncfile_in.getncattr(att)
-         if ( att == name_site ):
-            site = ncfile_in.getncattr(att)
-
-      if ( feature == name_traj ):
-         files_traj.append(input_file)
-      elif ( feature == name_ts ):
-         files_ts.append(input_file)
-      else:
-         files_tspr.append(input_file)
-
-      if ( feature == name_traj  and  site not in sites_traj ):
-         sites_traj.append(site)
-      if ( feature == name_ts  and  site not in sites_ts ):
-         sites_ts.append(site)
-      if ( feature == name_tspr  and  site not in sites_tspr ):
-         sites_tspr.append(site)
-
-      ncfile_in.close()
-
-   for input_file in files_traj:
-      print( "traj", input_file )
-   for site in sites_traj:
-      print( "traj", site )
-
-   for site in sites_ts:
-      print( "ts", site )
-   for site in sites_tspr:
-      print( "tspr", site )
-      
-   for file in files_tspr:
-      print( "tspr", file )
-   counter_id = 1
-   for site_traj in sites_traj:
-      # For the given site already define the featureTpye and site
-      ncfile_out.setncattr( name_featuretype + str(counter_id), name_traj )
-      ncfile_out.setncattr( name_site + str(counter_id), site_traj )
-
-      # Define the number of coordinates for the site
-      num_coords = 0
-
-      e_utm_traj = np.array([])
-      n_utm_traj = np.array([])
-      h_traj     = np.array([])
-      measured_variables = ['u', 'v', 'w', 'theta', 'hus']
-      for input_file in files_traj:
-         ncfile_in = Dataset( input_file, "r", format="NETCDF4", encoding='ascii' )
-         for att in ncfile_in.ncattrs():
-            if ( att == name_site ):
-               site = ncfile_in.getncattr(att)
-
-         if ( site == site_traj ):
-
-            for att in ncfile_in.ncattrs():
-               if ( att == name_orig_x ):
-                  orig_x = ncfile_in.getncattr(att)
-               if ( att == name_orig_y ):
-                  orig_y = ncfile_in.getncattr(att)
-               if ( att == name_orig_z ):
-                  orig_z = ncfile_in.getncattr(att)
-
-            ntime = len( ncfile_in.dimensions[name_ntime]    )
-            ntraj = len( ncfile_in.dimensions[name_traj_dim] )
-
-            num_coords += ntime * ntraj
-#           Gather UTM and height coordinates and merge them into one array. Further, gather
-#           the variables that shall be sampled. Coordinates are checked to for NaN values and
-#           are tranformed to arithmetric numbers. Further, 2D input array is transformed into
-#           a 1D array.
-            for var in ncfile_in.variables.keys():
-               if ( var in dims_out  and  var == name_eutm ):
-                  e_utm_traj = np.append(e_utm_traj, np.nan_to_num( ncfile_in.variables[var][:,:] ).flatten())
-                  #e_utm_traj.append( np.nan_to_num( ncfile_in.variables[var][:,:] ).flatten() )
-               if ( var in dims_out  and  var == name_nutm ):
-                  n_utm_traj = np.append(n_utm_traj, np.nan_to_num( ncfile_in.variables[var][:,:] ).flatten())
-               if ( var in dims_out  and  var == name_hao ):
-                  h_traj = np.append(h_traj, np.nan_to_num( ncfile_in.variables[var][:,:] ).flatten())
-
-               if ( var not in non_measurable_vars  and  \
-                    var not in vars_default         and  \
-                    var not in measured_variables ):
-                  measured_variables.append(var)
-
-         ncfile_in.close()
-
-#     After all files for the current site are processed, write the origin-coordinates for x,y,z
-      ncfile_out.setncattr( name_orig_x + str(counter_id), orig_x )
-      ncfile_out.setncattr( name_orig_y + str(counter_id), orig_y )
-      ncfile_out.setncattr( name_orig_z + str(counter_id), orig_z )
-#     Create the dimensions
-      ncfile_out.createDimension( name_station + str(counter_id), num_coords )
-
-      temp_traj = ncfile_out.createVariable( name_eutm + str(counter_id), float, name_station + str(counter_id) )
-      temp_traj[:] = e_utm_traj
-
-      temp_traj = ncfile_out.createVariable( name_nutm + str(counter_id), float, name_station + str(counter_id) )
-      temp_traj[:] = n_utm_traj
-
-      temp_traj = ncfile_out.createVariable( name_hao  + str(counter_id), float, name_station + str(counter_id) )
-      temp_traj[:] = h_traj
-
-#     Check if any of the measured variables is a soil variable. Set flag accordingly.
-      soil = False
-      for var in measured_variables:
-         if ( var in soil_vars ):
-            soil = True
-#     Write soil flag
-      ncfile_out.setncattr( name_soil_sampling + str( counter_id), np.int8(soil) )
-
-#     Create dimension for sample-variable string
-      ncfile_out.createDimension( "nvar"+ str(counter_id), len( measured_variables ) )
-
-      measured_var = ncfile_out.createVariable( 'measured_variables' + str(counter_id), 'S1', \
-                                                ("nvar" + str(counter_id), "string_len") ) # must be NC_CHAR
-
-      # Write the variables to the file
-      for counter, meas in enumerate( measured_variables ):
-         measured_var[counter] = stringtochar( np.array( meas,"S%s"%(max_string_len) ) )
-
-#     Increment the counter
-      counter_id += 1
-   
-   
-   for site_tspr in sites_tspr:
-      # For the given site already define the featureTpye and site
-      ncfile_out.setncattr( name_featuretype + str(counter_id), name_tspr )
-      ncfile_out.setncattr( name_site + str(counter_id), site_tspr )
-
-      # Define the number of coordinates for the site
-      num_coords = 0
-      e_utm_tspr     = np.array([])
-      n_utm_tspr     = np.array([])
-      station_h_tspr = np.array([])
-      z_tspr         = np.array([])
-
-      measured_variables = ['u', 'v', 'w', 'theta', 'hus']
-      for input_file in files_tspr:
-         ncfile_in = Dataset( input_file, "r", format="NETCDF4", encoding='ascii' )
-         for att in ncfile_in.ncattrs():
-            if ( att == name_site ):
-               site = ncfile_in.getncattr(att)
-
-         if ( site == site_tspr ):
-            for att in ncfile_in.ncattrs():
-               if ( att == name_orig_x ):
-                  orig_x = ncfile_in.getncattr(att)
-               if ( att == name_orig_y ):
-                  orig_y = ncfile_in.getncattr(att)
-               if ( att == name_orig_z ):
-                  orig_z = ncfile_in.getncattr(att)
-
-            nstation = len( ncfile_in.dimensions[name_station] )
-            ntime    = len( ncfile_in.dimensions[name_ntime]   )
-            nz       = len( ncfile_in.dimensions[name_nz]   )
-
-            num_coords += nstation * ntime * nz
-#           Gather UTM and height coordinates and merge them into one array. Further, gather
-#           the variables that shall be sampled. Coordinates are checked to for NaN values and
-#           are tranformed to arithmetric numbers. Further, 2D input array is transformed into
-#           a 1D array.
-            for var in ncfile_in.variables.keys():
-               tspr_tmp1 = np.zeros((nstation))
-               tspr_tmp2 = np.zeros((ntime*nz))
-               if ( var in dims_out  and  var == name_eutm ):
-                  tspr_tmp1 = np.nan_to_num( ncfile_in.variables[var][:] )
-                  for ns in range(0,int(nstation)):
-                     tspr_tmp2[:] = tspr_tmp1[ns]
-                     e_utm_tspr = np.append(e_utm_tspr, tspr_tmp2)
-               if ( var in dims_out  and  var == name_nutm ):
-                  tspr_tmp1 = np.nan_to_num( ncfile_in.variables[var][:] )
-                  for ns in range(0,int(nstation)):
-                     tspr_tmp2[:] = tspr_tmp1[ns]
-                     n_utm_tspr = np.append(n_utm_tspr, tspr_tmp2)
-               if ( var in dims_out  and  var == name_z ):
-                  z_tspr_tmp = np.nan_to_num( ncfile_in.variables[var][:,:,:] )
-                  z_tspr = np.append(z_tspr, np.concatenate( z_tspr_tmp ))
-               if ( var in dims_out  and  var == name_station_h ):
-                  tspr_tmp1 = np.nan_to_num( ncfile_in.variables[var][:] )
-                  for ns in range(0,int(nstation)):
-                     tspr_tmp2[:] = tspr_tmp1[ns]
-                     station_h_tspr = np.append(station_h_tspr, tspr_tmp2)
-
-               if ( var not in non_measurable_vars  and  \
-                    var not in vars_default         and  \
-                    var not in measured_variables ):
-                  measured_variables.append(var)
-
-         ncfile_in.close()
-
-#     After all files for the current site are processed, write the origin-coordinates for x,y,z
-      ncfile_out.setncattr( name_orig_x + str(counter_id), orig_x )
-      ncfile_out.setncattr( name_orig_y + str(counter_id), orig_y )
-      ncfile_out.setncattr( name_orig_z + str(counter_id), orig_z )
-#     Create the dimensions
-      ncfile_out.createDimension( name_station + str(counter_id), num_coords )
-
-      temp_tspr = ncfile_out.createVariable( name_eutm      + str(counter_id), float, name_station + str(counter_id) )
-      temp_tspr[:] = e_utm_tspr
-
-      temp_tspr = ncfile_out.createVariable( name_nutm      + str(counter_id), float, name_station + str(counter_id) )
-      temp_tspr[:] = n_utm_tspr
-
-      temp_tspr = ncfile_out.createVariable( name_z         + str(counter_id), float, name_station + str(counter_id) )
-      temp_tspr[:] = z_tspr
-
-      temp_tspr = ncfile_out.createVariable( name_station_h + str(counter_id), float, name_station + str(counter_id) )
-      temp_tspr[:] = station_h_tspr
-
-#     Check if any of the measured variables is a soil variable. Set flag accordingly.
-      soil = False
-      for var in measured_variables:
-         if ( var in soil_vars ):
-            soil = True
-#     Write soil flag
-      ncfile_out.setncattr( name_soil_sampling + str( counter_id), np.int8(soil) )
-
-#     Create dimension for sample-variable string
-      ncfile_out.createDimension( "nvar"+ str(counter_id), len( measured_variables ) )
-
-      measured_var = ncfile_out.createVariable( 'measured_variables' + str(counter_id), 'S1', \
-                                                ("nvar" + str(counter_id), "string_len") ) # must be NC_CHAR
-
-      # Write the variables to the file
-      for counter, meas in enumerate( measured_variables ):
-         measured_var[counter] = stringtochar( np.array( meas,"S%s"%(max_string_len) ) )
-
-#     Increment the counter
-      counter_id += 1
-   
-   
-   for site_ts in sites_ts:
-      # For the given site already define the featureTpye and site
-      ncfile_out.setncattr( name_featuretype + str(counter_id), name_ts )
-      ncfile_out.setncattr( name_site + str(counter_id), site_ts )
-
-      # Define the number of coordinates for the site
-      num_coords = 0
-      e_utm_ts     = np.array([])
-      n_utm_ts     = np.array([])
-      station_h_ts = np.array([])
-      z_ts         = np.array([])
-      
-      measured_variables = ['u', 'v', 'w', 'theta', 'hus']
-      for input_file in files_ts:
-         ncfile_in = Dataset( input_file, "r", format="NETCDF4", encoding='ascii' )
-         for att in ncfile_in.ncattrs():
-            if ( att == name_site ):
-               site = ncfile_in.getncattr(att)
-
-         if ( site == site_ts ):
-
-            for att in ncfile_in.ncattrs():
-               if ( att == name_orig_x ):
-                  orig_x = ncfile_in.getncattr(att)
-               if ( att == name_orig_y ):
-                  orig_y = ncfile_in.getncattr(att)
-               if ( att == name_orig_z ):
-                  orig_z = ncfile_in.getncattr(att)
-
-            nstation = len( ncfile_in.dimensions[name_station]    )
-            num_coords += nstation
-#           Gather UTM and height coordinates and merge them into one array. Further, gather
-#           the variables that shall be sampled. Coordinates are checked to for NaN values and
-#           are tranformed to arithmetric numbers.
-            for var in ncfile_in.variables.keys():
-               if ( var in dims_out  and  var == name_eutm ):
-                  e_utm_ts = np.append(e_utm_ts, np.nan_to_num( ncfile_in.variables[var][:] ))
-               if ( var in dims_out  and  var == name_nutm ):
-                  n_utm_ts = np.append(n_utm_ts, np.nan_to_num( ncfile_in.variables[var][:] ))
-               if ( var in dims_out  and  var == name_z ):
-                  z_ts = np.append(z_ts, np.nan_to_num( ncfile_in.variables[var][:] ))
-               if ( var in dims_out  and  var == name_station_h ):
-                  station_h_ts = np.append(station_h_ts, np.nan_to_num( ncfile_in.variables[var][:] ))
-
-               if ( var not in non_measurable_vars  and  \
-                    var not in vars_default         and  \
-                    var not in measured_variables ):
-                  measured_variables.append(var)
-
-         ncfile_in.close()
-
-#     After all files for the current site are processed, write the origin-coordinates for x,y,z
-      ncfile_out.setncattr( name_orig_x + str(counter_id), orig_x )
-      ncfile_out.setncattr( name_orig_y + str(counter_id), orig_y )
-      ncfile_out.setncattr( name_orig_z + str(counter_id), orig_z )
-#     Create the dimensions
-      ncfile_out.createDimension( name_station + str(counter_id), num_coords )
-
-      temp_ts = ncfile_out.createVariable( name_eutm      + str(counter_id), float, name_station + str(counter_id) )
-      temp_ts[:] = e_utm_ts
-
-      temp_ts = ncfile_out.createVariable( name_nutm      + str(counter_id), float, name_station + str(counter_id) )
-      temp_ts[:] = n_utm_ts
-
-      temp_ts = ncfile_out.createVariable( name_z         + str(counter_id), float, name_station + str(counter_id) )
-      temp_ts[:] = z_ts
-
-      temp_ts = ncfile_out.createVariable( name_station_h + str(counter_id), float, name_station + str(counter_id) )
-      temp_ts[:] = station_h_ts
-
-#     Check if any of the measured variables is a soil variable. Set flag accordingly.
-      soil = False
-      for var in measured_variables:
-         if ( var in soil_vars ):
-            soil = True
-#     Write soil flag
-      ncfile_out.setncattr( name_soil_sampling + str( counter_id), np.int8(soil) )
-
-#     Create dimension for sample-variable string
-      ncfile_out.createDimension( "nvar"+ str(counter_id), len( measured_variables ) )
-
-      measured_var = ncfile_out.createVariable( 'measured_variables' + str(counter_id), 'S1', \
-                                                ("nvar" + str(counter_id), "string_len") ) # must be NC_CHAR
-
-      # Write the variables to the file
-      for counter, meas in enumerate( measured_variables ):
-         measured_var[counter] = stringtochar( np.array( meas,"S%s"%(max_string_len) ) )
-
-#     Increment the counter
-      counter_id += 1
-
-# Store the number of observational sites
-   num_sites = len( sites_traj ) + len( sites_ts ) + len( sites_tspr )
-
-
-#  Now process the customized input data. Please note, at the moment only timeseries are
-# are possible.
-if ( custom_coordinates ):
-   num_sites = counter_id - 1
-   for coord in coordinates:
-      # Define mandatory attributes
-      ncfile_out.setncattr( name_featuretype + str(counter_id),  \
-                            name_ts )
-      ncfile_out.setncattr( name_site        + str(counter_id),  \
-                            "custom"         + str(counter_id - num_sites) )
-      ncfile_out.setncattr( name_orig_x      + str(counter_id),  \
-                            coord[0] )
-      ncfile_out.setncattr( name_orig_y      + str(counter_id),  \
-                            coord[1] )
-      ncfile_out.setncattr( name_orig_z      + str(counter_id),  \
-                            0.0 )
-
-      # Define dimensions
-      ntime = 1
-      nstat = 1
-      ncfile_out.createDimension( name_ntime   + str(counter_id), ntime )
-      ncfile_out.createDimension( name_station + str(counter_id), nstat )
-
-      # Define coordinate variables
-      temp_ts = ncfile_out.createVariable( name_eutm      + str(counter_id), \
-                                           float,                            \
-                                           name_station   + str(counter_id) )
-      temp_ts[:] = np.array( coord[0] )
-
-      temp_ts = ncfile_out.createVariable( name_nutm      + str(counter_id), \
-                                           float,                            \
-                                           name_station   + str(counter_id) )
-      temp_ts[:] = np.array( coord[1] )
-
-      temp_ts = ncfile_out.createVariable( name_z         + str(counter_id), \
-                                           float,                            \
-                                           name_station   + str(counter_id) )
-      temp_ts[:] = np.array( coord[2] )
-
-      temp_ts = ncfile_out.createVariable( name_station_h + str(counter_id), \
-                                           float,                            \
-                                           name_station   + str(counter_id) )
-      temp_ts[:] = np.array( 0.0 )
-
-
-      counter_id += 1
-
-   # Reset counter variable
-   counter_id = num_sites + 1
-
-   # check if variables are prescribed. If so, prepare final output string
-   # stored in measured_variables.
-   if ( vars_to_be_measured ):
-
-      for custom_vars in vars_to_be_measured:
-
-         measured_variables = []
-         for var in vars_default:
-            measured_variables.append(var)
-
-         # Check if given variables are already in the default variables.
-         # If not, extend.
-         for var in custom_vars:
-             if ( var  not in  measured_variables ):
-
-                measured_variables.append(var)
-
-         ncfile_out.createDimension( "nvar"+ str(counter_id), \
-                                     len( measured_variables ) )
-
-         measured_var = ncfile_out.createVariable( 'measured_variables' + str(counter_id), 'S1', \
-                                                  ("nvar" + str(counter_id), "string_len") ) # must be NC_CHAR
-
-         # Write the variables to the file
-         for counter, meas in enumerate( measured_variables ):
-            measured_var[counter] = stringtochar( np.array( meas,"S%s"%(max_string_len) ) )
-
-         # Add soil attribute for the current measurement.
-         soil = False
-         if ( any( var == soil_vars for var in measured_variables) ):
-            soil = True
-
-         # Write soil flag
-         ncfile_out.setncattr( name_soil_sampling + str( counter_id), np.int8(soil) )
-
-         # Increment counter variable
-         counter_id += 1
-
-         del ( measured_variables[:] )
-
-   # Add the number of customized sites.
-   num_sites = counter_id - 1
-
-
-# Finally, write the total number of sites to the output file
-ncfile_out.setncattr( name_num_stat, num_sites )
-
-
-print( "*** palm_cvd has been finished. You can find the output file under: " )
-print( "    " + output_filename )
-
-quit()
Index: palm/trunk/SCRIPTS/palm_find_lowest_available_error_number
===================================================================
--- palm/trunk/SCRIPTS/palm_find_lowest_available_error_number	(revision 4901)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#!/usr/bin/env bash
-#------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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 2018-2021  Leibniz Universitaet Hannover
-#------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Initial revision
-#
-#------------------------------------------------------------------------------#
-# palm_find_lowest_available_error_number does what its name indicates
-#------------------------------------------------------------------------------#
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
-  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-  SOURCE="$(readlink "$SOURCE")"
-  # if $SOURCE was a relative symlink, we need to resolve it
-  # relative to the path where the symlink file was located
-  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
-done
-SCRIPT_LOCATION="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-working_dir=$(readlink -f "${SCRIPT_LOCATION}/../../")
-trunk_dir=$(readlink -f "${SCRIPT_LOCATION}/../")
-source_dir=${trunk_dir}/SOURCE
-
-contains() {
-    [[ ${1} =~ (^|[[:space:]])${2}($|[[:space:]]) ]] && return 0 || return 1
-}
-
-error_code_prefix="PA"
-
-all_found_error_codes=$(grep -A10 -P "CALL message\( " ${source_dir}/*.f90 \
-      | sed -e ':a;N;$!ba;s/ *& *\n */ /g' \
-      | grep -P "CALL message\( " \
-      | grep -oP "${error_code_prefix}(?<!\d)\d{4}(?!\d)" | sort | uniq -c  \
-      | grep -oP "${error_code_prefix}(?<!\d)\d{4}(?!\d)")
-
-for n in {1..9999} ; do
-   current_code=$(printf "${error_code_prefix}%04d" $((10#${n})))
-   if ! contains "$all_found_error_codes" "$current_code"; then
-     echo $current_code
-     break
-   fi
-done
Index: palm/trunk/SCRIPTS/palm_find_lowest_available_log_point_index
===================================================================
--- palm/trunk/SCRIPTS/palm_find_lowest_available_log_point_index	(revision 4901)
+++ 	(revision )
@@ -1,85 +1,0 @@
-#!/usr/bin/env bash
-#------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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 2018-2021  Leibniz Universitaet Hannover
-#------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Initial revision
-#
-#------------------------------------------------------------------------------#
-# palm_find_lowest_available_log_point_index does what its name indicates
-#------------------------------------------------------------------------------#
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
-  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-  SOURCE="$(readlink "$SOURCE")"
-  # if $SOURCE was a relative symlink, we need to resolve it
-  # relative to the path where the symlink file was located
-  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
-done
-SCRIPT_LOCATION="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-working_dir=$(readlink -f "${SCRIPT_LOCATION}/../../")
-trunk_dir=$(readlink -f "${SCRIPT_LOCATION}/../")
-
-contains() {
-    [[ ${1} =~ (^|[[:space:]])${2}($|[[:space:]]) ]] && return 0 || return 1
-}
-
-all_found_log_point=$(grep -P "CALL +cpu_log\( +log_point\(" ${trunk_dir}/SOURCE/* \
-      | grep -oP "(?<!\d)\d+(?!\d)" | sort -n | uniq \
-      | grep -oP "(?<!\d)\d+(?!\d)")
-
-log_point_size=$(grep -oP "TYPE\(logpoint\), DIMENSION\(\d+\) ::  log_point =" \
-      ${trunk_dir}/SOURCE/cpulog_mod.f90 \
-      | grep -oP "(?<!\d)\d+(?!\d)")
-
-for n in $(seq 1 ${log_point_size}) ; do
-   if ! contains "$all_found_log_point" "$n"; then
-     echo "log_point($n)   is the lowest available log_point   index."
-     break
-   fi
-   if [[ ${n} -ge ${log_point_size} ]]; then
-      echo "ERROR: array log_point (size: ${log_point_size}) is full. " \
-           "Please increase its size in file \"cpulog_mod.f90\"."
-   fi
-done
-
-
-all_found_log_point_s=$(grep -P "CALL +cpu_log\( +log_point_s\(" ${trunk_dir}/SOURCE/* \
-      | grep -oP "(?<!\d)\d+(?!\d)" | sort -n | uniq \
-      | grep -oP "(?<!\d)\d+(?!\d)")
-
-log_point_s_size=$(grep -oP "TYPE\(logpoint\), DIMENSION\(\d+\) ::  log_point_s =" \
-      ${trunk_dir}/SOURCE/cpulog_mod.f90 \
-      | grep -oP "(?<!\d)\d+(?!\d)")
-
-for n in $(seq 1 ${log_point_s_size}) ; do
-   if ! contains "$all_found_log_point_s" "$n"; then
-     echo "log_point_s($n) is the lowest available log_point_s index."
-     break
-   fi
-   if [[ ${n} -ge ${log_point_s_size} ]]; then
-      echo "ERROR: array log_point_s (size: ${log_point_s_size}) is full. " \
-           "Please increase its size in file \"cpulog_mod.f90\"."
-   fi
-done
Index: palm/trunk/SCRIPTS/palm_gf
===================================================================
--- palm/trunk/SCRIPTS/palm_gf	(revision 4901)
+++ 	(revision )
@@ -1,292 +1,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Modified palm_gf using python3 (edited by JR and RM)
-#
-# 4843 2021-01-15 15:22:11Z schwenkel
-# Removed PALM_BIN dependency
-#
-# 2825 2018-02-20 21:48:27Z maronga
-# Modified header
-#
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2309 2017-07-10 15:55:55Z gronemeier
-# some further bugfixes for palm_gf
-#
-# 2308 2017-07-10 12:15:43Z gronemeier
-# new version of palm_gf (bugfixes, changes and new options)
-#
-# 2116 2017-01-16 16:15:24Z maronga
-# Initial revision
-#
-#
-#
-# Description:
-# ------------
-#
-#
-# Instructions:
-# -------------
-#
-#------------------------------------------------------------------------------!
-
-from PyQt5 import QtWidgets, uic
-from PyQt5.QtWidgets import QDesktopWidget
-from palm_gf_files.palm_gf_conf import cfg_write, cfg_read
-import sys
-import os
-from palm_gf_files.palm_gf_exec import MyThread
-from palm_gf_files.palm_gf_tools import MyTable
-
-try:
-   devnull = open(os.devnull, 'w')
-   palm_dir = os.getcwd()
-   palm_bin = palm_dir + '/trunk/SCRIPTS'
-   job_dir = palm_dir + '/JOBS'
-   user_dir = palm_dir + '/USER_CODE'
-   with open(palm_bin + '/palmrungui', 'r') as fh:
-      # file found
-      out = None
-except:
-   print ('Error. palm_gf probably called in wrong directory.')
-   raise SystemExit
-
-class AppMain(QtWidgets.QMainWindow):
-    def __init__(self):
-        super(AppMain, self).__init__()
-        uic.loadUi(palm_bin + '/palm_gf_files/palm_gf.ui', self)
-        self.center_window()
-        
-        
-        # initial hiding of results ui elements
-        self.result_visibility(False)
-        # dis/enable ui elements when un/checked
-        self.strict_matching_check.stateChanged.connect(self.strict_matching_able)
-        self.npex_npey_ratio_check.stateChanged.connect(self.npex_npey_ratio_able)
-        self.nx_ny_ratio_check.stateChanged.connect(self.nx_ny_ratio_able)
-        self.psolver_combo_box.currentIndexChanged.connect(self.fft_method_able)
-        # loading last used values into ui
-        self.startup_values()
-        # making sure max is not less than min
-        self.nx_min_box.valueChanged.connect(self.input_min_max_check)
-        self.ny_min_box.valueChanged.connect(self.input_min_max_check)
-        self.nz_min_box.valueChanged.connect(self.input_min_max_check)
-        self.proc_min_box.valueChanged.connect(self.input_min_max_check)
-        # connects main buttons to subroutines
-        self.start_button.clicked.connect(self.initialize)
-        self.view_button.clicked.connect(self.load_table)
-        self.reset_button.clicked.connect(self.reset_values)
-
-    def load_table(self):
-        # opens table Ui
-        self.table = MyTable()
-        self.table.show()
-
-    def initialize(self):
-        # translating Ui input into checks used during calculation
-        if self.psolver_combo_box.currentIndex() != 0:
-            if self.psolver_combo_box.currentIndex() == 1:
-                poisfft = True
-                switch = True
-                if self.fft_combo_box.currentIndex() == 2:
-                    temperton = True
-                else:
-                    temperton = False
-            else:
-                poisfft = False
-                temperton = False
-                switch = False
-
-            if self.psolver_combo_box.currentIndex() == 2:
-                multigrid = True
-            else:
-                multigrid = False
-
-            if self.spectra_box.checkState() == 2:
-                spectra = True
-                poisfft = True
-            else:
-                spectra = False
-
-            if self.nx_ny_ratio_check.checkState() == 2:
-                dnxny = self.nx_ny_ratio_box.value()
-            else:
-                dnxny = 0
-
-            if self.npex_npey_ratio_check.checkState() == 2:
-                dpxpy = self.npex_npey_ratio_box.value()
-                dpxpy_dev = self.npex_npey_deviation_box.value()
-            else:
-                dpxpy = 0
-                dpxpy_dev = 0
-
-            if self.strict_matching_check.checkState() == 2:
-                tpn = self.strict_matching_box.value()
-            else:
-                tpn = 0
-
-            # writing the config
-            cfg_write(self.nx_min_box.value(), self.nx_max_box.value(), self.ny_min_box.value(),
-                      self.ny_max_box.value(), self.nz_min_box.value(), self.nz_max_box.value(),
-                      self.proc_min_box.value(), self.proc_max_box.value(), tpn,
-                      poisfft, switch, temperton, multigrid, spectra, dnxny, dpxpy, dpxpy_dev)
-
-            self.progressbar.setVisible(True)
-            self.progressbar.setValue(0)
-            # connects PyQtsignals to subroutines
-            self.thread = MyThread()
-            self.thread.change_value.connect(self.setprogressval)
-            self.thread.completed.connect(self.result_label_update)
-            self.thread.busy.connect(self.info_label_update)
-            # starts thread to calculate
-            self.thread.start()
-
-    def info_label_update(self):
-        # standby information during search of the limits of all results
-        self.results_information_label.setText('Standby please.')
-        self.results_information_label.setVisible(True)
-
-    def result_label_update(self, counter, timer):
-        self.result_visibility(True)
-        self.progressbar.setVisible(False)
-        if int(timer) == 0:
-            self.results_information_label.setText('Success! Gridfinder found ' + str(counter) +
-                                                   ' results in less than 1 second.')
-        else:
-            self.results_information_label.setText('Success! Gridfinder found ' + str(counter) +
-                                                   ' results in ' + str(timer) + ' seconds.')
-
-    def setprogressval(self, val):
-        # updates the value of the progressbar, data received from PyQtsignal
-        self.progressbar.setValue(val)
-
-    def startup_values(self):
-        # reads the .ini and updates default values to last used values
-        if os.path.exists('./palm_gf_config.ini') is False:
-            pass
-        else:
-            value_list = cfg_read()
-            self.nx_min_box.setValue(int(value_list[0]))
-            self.nx_max_box.setValue(int(value_list[1]))
-            self.ny_min_box.setValue(int(value_list[2]))
-            self.ny_max_box.setValue(int(value_list[3]))
-            self.nz_min_box.setValue(int(value_list[4]))
-            self.nz_max_box.setValue(int(value_list[5]))
-            self.proc_min_box.setValue(int(value_list[6]))
-            self.proc_max_box.setValue(int(value_list[7]))
-            if int(value_list[8]) != 0:
-                self.strict_matching_check.setCheckState(2)
-                self.strict_matching_box.setValue(int(value_list[8]))
-            if float(value_list[9]) != 0:
-                self.nx_ny_ratio_check.setCheckState(2)
-                self.nx_ny_ratio_box.setValue(float(value_list[9]))
-            if float(value_list[10]) != 0:
-                self.npex_npey_ratio_check.setCheckState(2)
-                self.npex_npey_ratio_box.setValue(float(value_list[10]))
-                self.npex_npey_deviation_box.setValue(float(value_list[11]))
-
-    def reset_values(self):
-        # resets values to default, does not update .ini
-        self.nx_min_box.setValue(0)
-        self.nx_max_box.setValue(1)
-        self.ny_min_box.setValue(0)
-        self.ny_max_box.setValue(1)
-        self.nz_min_box.setValue(0)
-        self.nz_max_box.setValue(1)
-        self.proc_min_box.setValue(0)
-        self.proc_max_box.setValue(1)
-        self.strict_matching_check.setCheckState(0)
-        self.nx_ny_ratio_check.setCheckState(0)
-        self.nx_ny_ratio_box.setValue(1.00)
-        self.npex_npey_ratio_check.setCheckState(0)
-        self.npex_npey_ratio_box.setValue(1.00)
-        self.npex_npey_deviation_box.setValue(1)
-
-    def input_min_max_check(self):
-        # setting chosen min values as minimum of maxima
-        self.nx_max_box.setMinimum(self.nx_min_box.value())
-        self.ny_max_box.setMinimum(self.ny_min_box.value())
-        self.nz_max_box.setMinimum(self.nz_min_box.value())
-        self.proc_max_box.setMinimum(self.proc_min_box.value())
-
-    def center_window(self):
-        # moving window to middle of the screen
-        frame = self.frameGeometry()
-        center = QDesktopWidget().availableGeometry().center()
-        frame.moveCenter(center)
-        self.move(frame.topLeft())
-
-    def fft_method_able(self):
-        # enable/disable QComboBox of fft method
-        if self.psolver_combo_box.currentIndex() == 1:
-            self.fft_combo_box.setEnabled(True)
-        else:
-            self.fft_combo_box.setEnabled(False)
-            self.fft_combo_box.setCurrentIndex(0)
-
-    def nx_ny_ratio_able(self):
-        # enable/disable QSpinBox of nx/ny-ratio
-        if int(self.nx_ny_ratio_check.checkState()) == 0:
-            self.nx_ny_ratio_box.setEnabled(False)
-        else:
-            self.nx_ny_ratio_box.setEnabled(True)
-
-    def strict_matching_able(self):
-        # enable/disable QSpinBox of strict matching
-        if int(self.strict_matching_check.checkState()) == 0:
-            self.strict_matching_box.setEnabled(False)
-        else:
-            self.strict_matching_box.setEnabled(True)
-
-    def npex_npey_ratio_able(self):
-        # enable/disable UI elements of npex/npey-ratio
-        if int(self.npex_npey_ratio_check.checkState()) == 0:
-            self.npex_npey_ratio_box.setEnabled(False)
-            self.npex_npey_deviation_slider.setEnabled(False)
-            self.npex_npey_deviation_box.setEnabled(False)
-        else:
-            self.npex_npey_ratio_box.setEnabled(True)
-            self.npex_npey_deviation_slider.setEnabled(True)
-            self.npex_npey_deviation_box.setEnabled(True)
-
-    def result_visibility(self, boolean):
-        # making certain ui elements in/visible
-        self.progressbar.setVisible(boolean)
-        self.results_information_label.setVisible(boolean)
-        self.view_button.setVisible(boolean)
-
-
-if __name__ == "__main__":
-    app = QtWidgets.QApplication(sys.argv)
-    window = AppMain()
-    window.setWindowTitle('palm_gf')
-    window.show()
-    sys.exit(app.exec_())
Index: palm/trunk/SCRIPTS/palm_simple_build
===================================================================
--- palm/trunk/SCRIPTS/palm_simple_build	(revision 4901)
+++ 	(revision )
@@ -1,165 +1,0 @@
-#!/usr/bin/env bash
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# added file update functionality
-# 
-# 2868 2018-03-09 13:25:09Z hellstea
-# Bugfix: adjusted name of build_dir
-# 
-# 2852 2018-03-05 14:43:22Z knoop
-# Refactoring of the palm_simple_ build and run scripts
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2225 2017-05-16 11:36:20Z raasch
-# shell changed to bash
-#
-# 1310 2014-03-14 08:01:56Z raasch
-# update GPL copyright
-#
-# 1046 2012-11-09 14:38:45Z maronga
-# code put under GPL (PALM 3.9)
-#
-# palm_simple_install - a script for simple installation and compilation of
-#                       the palm code without using mbuild
-# This script creates (from the working copy of the palm repository)
-# a subdirectory MAKE_DEPOSITORY_simple which contains a copy of the
-# palm source code and  a modified makefile which loads required compiler
-# and preprocessor settings via "include MAKE.inc"
-
-# Options: -i <include file>
-#          one of the include files in ~/palm/current_version/trunk/INSTALL
-
-# Last changes:
-# 25/01/10 - Siggi - Generating the first version
-# 18/03/10 - Siggi - switch to palm/current_version removed: working
-#                    copy can be in any directory
-#------------------------------------------------------------------------------#
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
-  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-  SOURCE="$(readlink "$SOURCE")"
-  # if $SOURCE was a relative symlink, we need to resolve it
-  # relative to the path where the symlink file was located
-  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
-done
-SCRIPT_LOCATION="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-working_dir=$(readlink -f "${SCRIPT_LOCATION}/../../")
-trunk_dir=$(readlink -f "${SCRIPT_LOCATION}/../")
-
-
-get_number_of_cpu_cores() {
-   {
-      n=$(sysctl -n machdep.cpu.core_count 2> /dev/null)
-   } || {
-      n=$(grep -c ^processor /proc/cpuinfo 2> /dev/null)
-   } || {
-   if ! [[ $n =~ ^-?[0-9]+$ ]]; then
-      n=1
-   fi
-   }
-   echo $n
-}
-
-print_help() {
-   echo "Usage: palm_simple_run -b <build-config> [-x]"
-   echo ""
-   echo "List of allowed option:"
-   echo ""
-   echo "   -b <build-config>   Suffix of any MAKE.inc.<build-config> file in the trunk/INSTALL dir."
-   echo "   -x                  Clean the build directory from last build attempts"
-   echo ""
-}
-
-build_config=unknown
-clean="false"
-
-# Read shellscript options
-while  getopts  :b:xh  option
-do
-  case  $option  in
-      (b)   build_config=$OPTARG;;
-      (x)   clean="true";;
-      (h)   print_help
-            exit 0;;
-      (\?)  echo "Unknown option -$OPTARG"
-            print_help
-            exit 1;;
-  esac
-done
-
-if [[ ${build_config} == "unknown" ]]; then
-   echo "Missing option -b <build-config>"
-   print_help
-   exit 1
-fi
-
-
-build_dir=${working_dir}/BUILD_$build_config
-
-
-# Check, if include file exists
-build_config_file=${trunk_dir}/INSTALL/MAKE.inc.$build_config
-if [[ ! -f ${build_config_file} ]]; then
-   echo "+++ ERROR: no such make include file:"
-   echo "    \"${build_config_file}\""
-   exit 1
-fi
-
-
-# Create the make depository
-if [[ ! -d ${build_dir} ]]; then
-   mkdir -p ${build_dir}
-else
-   if [[ ${clean} == "true" ]]; then
-      echo "Cleaning the build directory..."
-      rm -rf ${build_dir}/*
-   fi
-fi
-
-
-# Copy makefile and all source code files to make depository
-cp -u ${trunk_dir}/SOURCE/Makefile  ${build_dir}/Makefile_in
-cp -u ${build_config_file}          ${build_dir}/MAKE.inc
-cp -u ${trunk_dir}/SOURCE/*.f90     ${build_dir}
-
-
-# Replace comment in makefile by include statement
-sed  's/#to_be_replaced_by_include/include MAKE.inc/g'  ${build_dir}/Makefile_in  >  ${build_dir}/Makefile
-rm  ${build_dir}/Makefile_in
-
-cd ${build_dir}
-make -j $(get_number_of_cpu_cores)
-cd ../
-
-
-echo "*** PALM build finished. Executable can be found in:"
-echo "    \"${build_dir}\""
-exit 0
Index: palm/trunk/SCRIPTS/palm_simple_run
===================================================================
--- palm/trunk/SCRIPTS/palm_simple_run	(revision 4901)
+++ 	(revision )
@@ -1,261 +1,0 @@
-#!/usr/bin/env bash
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# bugfix: envpar namelist adjusted to current PALM revision
-# 
-# 2875 2018-03-13 11:00:25Z knoop
-# made RUN dirs unique with timestamp again
-# 
-# 2850 2018-03-05 14:24:40Z knoop
-# Refactoring of the palm_simple_ build and run scripts
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2225 2017-05-16 11:36:20Z raasch
-# shell changed to bash
-#
-# 1310 2014-03-14 08:01:56Z raasch
-# update GPL copyright
-#
-# 1221 2013-09-10 08:59:13Z raasch
-# setting of PGI_ACC_SYNCHRONOUS=1 for running with pgi-openacc
-#
-# 1172 2013-05-30 11:46:00Z raasch
-# for performance reasons set PGI_ACC_SYNCHRONOUS=1 for pgi/openacc execution
-#
-# 1171 2013-05-30 11:27:45Z raasch
-# new option -e which defines the execution command to be used to run PALM
-#
-# 1046 2012-11-09 14:38:45Z maronga
-# code put under GPL (PALM 3.9)
-#
-# 29/08/11 - BjornW - Adapted for lcflow (ForWind cluster in Oldenburg)
-# 18/03/10 - Siggi  - Some comments changed
-# 25/01/10 - Siggi  - Generating the first version
-
-
-#--------------------------------------------------------------------------------#
-# palm_simple_run - a simple method for running the palm code without
-#                   using the mrun script
-#
-# This script runs the palm code in a unique subdirectory (OUTPUT...,
-# current time/date and number of processors are part of the subdirectory
-# name).
-# It requires that palm has been installed with command
-# palm_simple_install and that the executable palm has been created
-# with make in directory  ...../MAKE_DEPOSITORY_simple
-#--------------------------------------------------------------------------------#
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
-  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-  SOURCE="$(readlink "$SOURCE")"
-  # if $SOURCE was a relative symlink, we need to resolve it
-  # relative to the path where the symlink file was located
-  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
-done
-SCRIPT_LOCATION="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-working_dir=$(readlink -f "${SCRIPT_LOCATION}/../../")
-trunk_dir=$(readlink -f "${SCRIPT_LOCATION}/../")
-
-# Variable declarations + default values
-build_config=unknown
-run_config=unknown
-test_case=unknown
-mpi_ranks=1
-mpi_ranks_per_node=1
-openmp_threads=1
-localhost_realname=$(hostname)
-cpumax=999999
-
-print_help() {
-   echo "Usage: palm_simple_run -b <build-config> -c <run-config> -s <test-case>"
-   echo "                       [-n <mpi-ranks-per-node>] [-p <mpi-ranks>]"
-   echo "                       [-t <openmp-threads>]"
-   echo ""
-   echo "List of allowed option:"
-   echo ""
-   echo "   -b <build-config>        Suffix of any MAKE.inc.<build-config> file in the trunk/INSTALL dir."
-   echo "   -c <run-config>          Suffix of any RUN.cmd.<run-config> file in the trunk/INSTALL dir."
-   echo "   -n <mpi-ranks-per-node>  Number of MPI ranks per compute node."
-   echo "   -p <mpi-ranks>           Number of MPI ranks in total."
-   echo "   -s <test-case>           Prefix of any <test-case>_p3d file in the trunk/INSTALL dir."
-   echo "   -t <openmp-threads>      Number of OpenMP threads"
-   echo ""
-   echo ""
-}
-
-
-   # Read shellscript options
-while  getopts  :b:c:n:p:s:t:h  option
-do
-  case  $option  in
-      (b)   build_config=$OPTARG;;
-      (c)   run_config=$OPTARG;;
-      (n)   mpi_ranks_per_node=$OPTARG;;
-      (p)   mpi_ranks=$OPTARG;;
-      (s)   test_case=$OPTARG;;
-      (t)   openmp_threads=$OPTARG;;
-      (h)   print_help
-            exit 0;;
-      (\?)  echo "Unknown option -$OPTARG"
-            print_help
-            exit 1;;
-  esac
-done
-
-if [[ ${build_config} == "unknown" ]]
-then
-   echo "Missing option -b <build-config>"
-   print_help
-   exit 1
-fi
-
-if [[ ${run_config} == "unknown" ]]
-then
-   echo "Missing option -c <run-config>"
-   print_help
-   exit 1
-fi
-
-if [[ ${test_case} == "unknown" ]]
-then
-   echo "Missing option -s <test-case>"
-   print_help
-   exit 1
-fi
-
-build_dir=${working_dir}/BUILD_${build_config}
-
-if [[ ! -d ${build_dir} ]]
-then
-   echo "+++ ERROR: No build for configuration ${build_config} exists! "
-   echo "           Please run \"palm_simple_install -b ${build_config}\""
-   echo "           or specify a different build that this run should be based on"
-   exit 1
-fi
-
-   # Check, if include file exists
-run_config_file=${trunk_dir}/INSTALL/RUN.cmd.${run_config}
-if [[ ! -f ${run_config_file} ]]
-then
-   echo "+++ ERROR: no such run command file:"
-   echo "    \"${run_config_file}\""
-   exit 1
-fi
-
-   # Find out the global svn revision number
-global_revision=$(svnversion ${trunk_dir}  2>/dev/null)
-global_revision="Rev: $global_revision"
-
-
-   # Generate unique directory/files for this run
-timedate="$(date +%F_%H:%M:%S)"
-suffix=${build_config}_${run_config}_${test_case}_${mpi_ranks}_${mpi_ranks_per_node}_${openmp_threads}_${timedate}
-execution_dir=${working_dir}/RUN_${suffix}
-
-if [[ ! -d ${execution_dir} ]]
-then
-   mkdir -p ${execution_dir}
-   echo "*** PALM running in directory ${execution_dir}"
-else
-   echo "+++ ERROR: ${execution_dir} exists\!   Must be unique.  Exiting."
-   exit 1
-fi
-
-
-# Check if palm has been installed and copy executable into the run
-# directory
-if [[ ! -f ${build_dir}/palm ]]
-then
-   echo "+++ ERROR: palm executable does not exist."
-   echo "           Please run \"palm_simple_install\"."
-   exit 1
-else
-   cp  ${build_dir}/palm  ${execution_dir}/palm
-fi
-
-
-# Check, if parameter file exists and copy into the run directory
-if [[ ! -f ${trunk_dir}/INSTALL/${test_case}_p3d ]]
-then
-   echo "+++ ERROR: parameter file"
-   echo "           \"${trunk_dir}/INSTALL/${test_case}_p3d\""
-   echo "           does not exist."
-   exit 1
-else
-   cp  ${trunk_dir}/INSTALL/${test_case}_p3d  ${execution_dir}/PARIN
-fi
-
-
-
-
-# Create NAMELIST file containing environment values needed by palm
-cat  >  ${execution_dir}/ENVPAR  <<  EOF
-&envpar  run_identifier = '${test_case}',
-         host = 'localhost',
-         revision = '${global_revision}',
-         tasks_per_node = ${mpi_ranks_per_node},
-         maximum_parallel_io_streams = ${mpi_ranks_per_node},
-         progress_bar_disabled = .TRUE.,
-         write_binary = .FALSE.,
-         maximum_cpu_time_allowed = ${cpumax}.,
-         local_dvrserver_running = .FALSE.,
-/
-EOF
-
-
-# Coupled runs cannot be carried out with this simple run script
-echo "no_coupling"  >  ${execution_dir}/runfile_atmos
-
-
-# Generate hostfile (if neccessary)
-(( ii = 1 ))
-while (( ii <= $mpi_ranks ))
-do
-   echo  $localhost_realname  >>  ${execution_dir}/hostfile
-   (( ii = ii + 1 ))
-done
-
-
-# Switch to run directory
-cd  ${execution_dir}
-
-# Start palm run
-echo "*** PALM will be executed with configuration: ${run_config}"
-echo "       MPI ranks in total: $mpi_ranks"
-echo "       MPI ranks per node: $mpi_ranks_per_node"
-echo "       OpenMP threads:     $openmp_threads"
-
-# execute according to the run command file
-source ${run_config_file}
-
-echo "*** PALM execution finished. Results can be found in:"
-echo "    \"${execution_dir}\""
-exit 0
Index: palm/trunk/SCRIPTS/palm_wd
===================================================================
--- palm/trunk/SCRIPTS/palm_wd	(revision 4901)
+++ 	(revision )
@@ -1,985 +1,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Removed PALM_BIN dependency
-# 
-# 3943 2019-05-02 09:50:41Z maronga
-# Adjustments and bugfixes 
-#
-# 
-# 2825 2018-02-20 21:48:27Z maronga
-# Modified header
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-# 
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2416 2017-09-06 14:28:14Z maronga
-# Adapted for palmrun
-# 
-# 1754 2016-02-22 13:50:22Z maronga
-#
-# 1753 2016-02-22 13:49:49Z maronga
-# Bugfix: use of global variables is required after updating configuration file
-# 
-# 1751 2016-02-15 07:44:16Z maronga
-# Bugfixes: runs on multiple hosts caused crash of the watchdog. Progress bar
-# occasionally showed wrong progress.
-# New: Hosts can be switched on/off and update_frequency can be modified via 
-# File->Options. Security check for cancelation of jobs.
-# 
-# 1618 2015-07-13 06:52:15Z maronga
-# Added steering via configuration file .wd.config, to be place in the local
-# palm directory. Watchdog save files are automatically created upon first start.
-# 
-# 1613 2015-07-08 14:53:29Z maronga
-# Bugfix: tooltip for queuing name did not show up on first update.
-# New: added contect menu for showing the parameter file and the run control
-# output
-# 
-# 1611 2015-07-07 12:23:22Z maronga
-# Initial revision
-# 
-#
-# Description:
-# ------------
-# PALM watchdog client for monitoring batch jobs on a variety of hosts specified
-# by the user
-# 
-# Instructions:
-# -------------
-# 1) Modify the header section of palm_wd
-# 2) Move .wd.olddata and .wd.newdata to your palm directory 
-#    (e.g. /home/user/current_version/.wd.newdata etc.)
-# 3) Modify a copy of palm_wdd for each host to be monitored and move it to the
-#    respective hosts
-# 4) Start the client either from mrungui or from shell by "nohup palm_wd&"
-
-# To do:
-# ------
-# 1) Add "Options", "Help" and "Manual"
-# 2) Move user settings to a configuration file
-#------------------------------------------------------------------------------!
-
-import ConfigParser as configparser
-import datetime
-import os
-from PyQt4 import QtGui, QtCore, uic
-from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT
-import shutil
-import subprocess as sub
-import sys
-import time
-
-# Determine PALM directories
-#  Check if configuration files exists and quit otherwise
-input_config = ".wd.config"
-
-for i in range(0,len(sys.argv)): 
-   input_config = str(sys.argv[i])
-   palm_dir = os.getcwd()
-   palm_bin = palm_dir + '/trunk/SCRIPTS'
-        
-config = configparser.RawConfigParser(allow_no_value=True)
-
-if ( os.path.isfile(input_config) == False ):
-   print ("Error. No configuration file " + input_config + " found.")
-   raise SystemExit   
-else:
-   print(os.path.isfile(input_config))
-
-print(input_config)
-
-config.read(input_config)  
-
-config = ConfigParser.RawConfigParser()
-config.read(palm_dir + '/.wd.config')
-
-description = []
-hostname = []
-username = []
-pycall = []
-
-
-for i in range(0,len(config.sections())):
-
-    description_tmp = config.sections()[i]
- 
-    if ( description_tmp != 'Settings' ):
-      
-       if ( config.get(description_tmp, 'enabled') == 'true' ):
-          description.append(description_tmp)
-          hostname.append(config.get(description_tmp, 'hostname'))
-          username.append(config.get(description_tmp, 'username')) 
-          pycall.append(config.get(description_tmp, 'pycall'))
-    else:
-       update_frequency = int(config.get(description_tmp, 'update_frequency'))*60000
-
-# Check if .wd.olddata and .wd.newdata exist. Otherwise create the files
-if ( os.path.exists(palm_dir + '/.wd.olddata') == False ):
-   print "No .wd.olddata found. Creating..."
-   file1 = open(palm_dir + '/.wd.olddata', 'a')
-   file1.close()
-   
-
-if ( os.path.exists(palm_dir + '/.wd.newdata') == False ):
-   print "No .wd.newdata found. Creating..."  
-   file1 = open(palm_dir + '/.wd.newdata', 'a')
-   file1.close()
-
-# Dummy variables for the jobname and the progressbars
-jobname = ""
-timestamp = ""
-pbars = []
-job_data_list = []
-
-# Message box for showing RUN_CONTROL output
-class MessageBoxScroll(QtGui.QMessageBox):
-    def __init__(self):
-        QtGui.QMessageBox.__init__(self)
-        self.setSizeGripEnabled(True)
-
-    def event(self, e):
-        result = QtGui.QMessageBox.event(self, e)
-
-        self.setMinimumHeight(100)
-        self.setMaximumHeight(16777215)
-        self.setMinimumWidth(400)
-        self.setMaximumWidth(16777215)
-        self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
-
-        textEdit = self.findChild(QtGui.QTextEdit)
-        if textEdit != None :
-            textEdit.setMinimumHeight(800)
-            textEdit.setMaximumHeight(16777215)
-            textEdit.setMinimumWidth(1000)
-            textEdit.setMaximumWidth(16777215)
-            textEdit.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
-            f = QtGui.QFont('not_a_font') # 
-            f.setStyleHint(f.TypeWriter, f.PreferDefault)
-            textEdit.setFont(f)
-
-        return result
-
-
-# Message box for showing RUN_CONTROL output
-class OptionBox(QtGui.QDialog):
-    def __init__(self):
-      
-        super(OptionBox, self).__init__()
-      
-        uic.loadUi(palm_bin + '/palm_wd_files/wdoptions.ui', self)
-        
-        hostname = []
-        self.checkbox = []
-        j = -1
-        ypos = 0
-   
-        self.vbox = QtGui.QVBoxLayout(self)
-        self.vbox.setSpacing(0)
-        self.vbox.setMargin(0)       
-    
-        config.read(palm_dir + '/.wd.config')
-    
-        for i in range(0,len(config.sections())):
-
-           description_tmp = config.sections()[i]
- 
-           if ( description_tmp != 'Settings' ):
-              description.append(description_tmp)
-              hostname.append(config.get(description_tmp, 'hostname'))
-              
-              j = j + 1
-              self.checkbox.append(j)
-              self.checkbox[j] = QtGui.QCheckBox(description_tmp, self)   
-              ypos = ypos + 20
-              self.checkbox[j].move(10,0)
-              if ( config.get(description_tmp, 'enabled') == 'true' ):
-                 self.checkbox[j].toggle()
-                       
-              self.vbox.addWidget(self.checkbox[j])
-           else:
-	      self.update_spin.setValue(int(config.get(description_tmp, 'update_frequency')))
-     
-        self.hostBox.setLayout(self.vbox)
-        self.hostBox.setGeometry(0, 0, 272, 50+ypos)
-        self.settingBox.setGeometry(281, 0, 214, 50+ypos)
-        self.ok.setGeometry(385, 50+ypos, 111, 24)
-        self.cancel.setGeometry(270, 50+ypos, 111, 24)
-        
-        self.setGeometry(0, 0, 500, 80+ypos)
-        self.show()
-        
-        return
-
-#   save updtes to file
-    def SaveAndClose(self):
-      
-       for i in range(0,len(self.checkbox)):
-          
-          if ( self.checkbox[i].checkState() == 0 ):
-	     config.set(str(self.checkbox[i].text()),'enabled','false')
-	  else:
-	     config.set(str(self.checkbox[i].text()),'enabled','true')       
-       
-       config.set('Settings','update_frequency',self.update_spin.text())  
-
-       with open(palm_dir + '/.wd.config', 'wb') as configfile:
-          config.write(configfile)
-
-
-       self.close()
-     
-       return
-
-
-
-# MainWindow class
-class Watchdog(QtGui.QMainWindow):
-    
-    def __init__(self):
-        super(Watchdog, self).__init__()
-        
-        self.InitUi()   
-        
-   
-    # Initialized MainWindow UI
-    def InitUi(self):
-
-        # Load predefined mainwindow
-        uic.loadUi(palm_bin + '/palm_wd_files/wd.ui', self)
-
-        # Resize columns and set number of rows to zero. Column 6 is hidden and
-        # contains the remote jobname (e.g. hannover.174610)
-        self.table.setColumnWidth(0,230)
-        self.table.setColumnWidth(1,80)
-        self.table.setColumnWidth(2,50)
-        self.table.setColumnWidth(3,80)     
-        self.table.setColumnWidth(4,180)
-        self.table.setColumnWidth(5,115)   
-        self.table.setColumnHidden(6, True)
-        self.table.setRowCount(0) 
-    
-        # Display MainWindow
-        self.show()
-        QtGui.QApplication.processEvents()
-
-        # Start refresh timer. On timeout perform update
-        self.timer = QtCore.QTimer(self)
-        self.timer.timeout.connect(self.Refresh)
-        self.timer.setSingleShot(False)
-        self.timer.start(update_frequency)
-
-        # The timetimer counts the time since last update
-        self.timetimer= QtCore.QElapsedTimer()
-        self.timetimer.start()
-
-        # The labeltimer induces the update of the remaining time in the UI
-        self.labeltimer = QtCore.QTimer(self)
-        self.labeltimer.timeout.connect(self.UpdateLabel)
-        self.labeltimer.setSingleShot(False)
-
-        # Update in the UI will be performed at each 1/10 of the update interval
-        self.labeltimer.start(update_frequency/10)   
-        self.label.setText("Next update in " + str(update_frequency/1000/60) + "min")
-
-        # Update the list now
-        self.Refresh()
-        
-
-    # Add a custom context menu
-    def OpenContextMenu(self, position):
-        menu = QtGui.QMenu()
-       
-        # "Show details" -> fetch details for the selected job
-        detailsjobAction = menu.addAction('Show job details')     
-        detailsjobAction.setStatusTip('Display detailed info for job')
-        detailsjobAction.triggered.connect(self.ShowDetails)
-
-        # "Show parameter file" -> show the contents of PARIN
-        parinAction = menu.addAction('Show parameter file')     
-        parinAction.setStatusTip('Display the parameter file of the job (e.g. PARIN / _p3d)')
-        parinAction.triggered.connect(self.ShowPARIN)
-        
-        rcAction = menu.addAction('Show run control file')     
-        rcAction.setStatusTip('Display the current run control file (e.g. RUN_CONTROL / _rc)')
-        rcAction.triggered.connect(self.ShowRC)
-        
-        # "Cancel job" -> remove job from queuing system
-        canceljobAction = menu.addAction('Cancel job')
-        canceljobAction.setStatusTip('Remove job from queueing system')
-        canceljobAction.triggered.connect(self.CancelJob)
-        
-        # "Force stop" -> force termination of job
-        stopjobAction = menu.addAction('Force stop')
-        stopjobAction.setStatusTip('Terminate job properly')
-        stopjobAction.triggered.connect(self.DoStop)
-   
-        # "Force restart" -> force rermination and restart of job
-        restartjobAction = menu.addAction('Force restart')
-        restartjobAction.setStatusTip('Terminate job properly and initiate restart')
-        restartjobAction.triggered.connect(self.DoRestart)
-  
-        # "Remove from list" -> remove a completed job from the list
-        removefromlistAction = menu.addAction('Remove from list')     
-        removefromlistAction.setStatusTip('Remove finished job')
-        removefromlistAction.triggered.connect(lambda: self.RemoveFromList(-1))     
-
-        
-        # Activate/deactive contect menu items based on the status of the runs
-        state = self.table.item(self.table.currentRow(),3).text()
-        if (state == "Canceled" or state == "Completed" or state == "Terminated"):
-            detailsjobAction.setEnabled(False)
-            canceljobAction.setEnabled(False)  
-            removefromlistAction.setEnabled(True)  
-        else:
-            detailsjobAction.setEnabled(True)
-            canceljobAction.setEnabled(True)  
-            removefromlistAction.setEnabled(False)   
- 
-        if ( state == "Running" ):
-	    stopjobAction.setEnabled(True) 
-            restartjobAction.setEnabled(True)   
-            parinAction.setEnabled(True)
-            rcAction.setEnabled(True)          
-        else:
-	    stopjobAction.setEnabled(False) 
-            restartjobAction.setEnabled(False)   
-            parinAction.setEnabled(False)
-            rcAction.setEnabled(False)  
-            
-        # Show the context menu
-        action = menu.exec_(self.table.mapToGlobal(position))
-
-
-    # Collecting watchdog data and display in the UI
-    def Refresh(self):
-      
-        # Use global variables
-        global pbars
-        global update_frequency
-
-        # Deactivate timer processes until update is finished
-        # QtGui.QApplication.processEvents() updates the UI whenever needed
-        self.labeltimer.stop() 
-        self.label.setText("Updating...") 
-        QtGui.QApplication.processEvents()
-        self.setEnabled(False)
-        QtGui.QApplication.processEvents()
-
-        # Get current timestamp
-        timestamp = datetime.datetime.now().strftime("%d/%m/%Y %H:%M")
-        
-        # Open an empty file for the watchdog data        
-        file = open(palm_dir + '/.wd.newdata', 'w')
-        
- 
-        # Set all required variables to their initial values. Sorting must be
-        # disabled.
-        self.table.setRowCount(0) 
-        self.table.setSortingEnabled(False)
-        i = -1
-        job_data_list = []
-        pbars = []
-        
-        # Scan all hosts in the variable hostname. For each host perform the
-        # update loop
-        for h in range(0,len(hostname)):
-	  
-	    # Perform ssh command
-            host    = username[h] + "@" + hostname[h]
-            ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd queue " + username[h]],
-                           shell=False,
-                           stdout=sub.PIPE,
-                           stderr=sub.PIPE)
-            result = ssh.stdout.readlines()
-            result = filter(None, result)
- 
- 
-     	    # Delete all job data
-	    job_data_tmp = []
-            job_data = []
-            job_data_n = []    
-	    job_progress = 0
-
-            # In case of errors display error message
-            if ( len(result) < 1 ):
-                error = ssh.stderr.readlines()
-                if ( error != [] ):
-                    notify = QtGui.QMessageBox.warning(self,'Collect data',"Error. An error occured during read of job data for user " + username[h] +" for host " + description[h] + ".\n\nError message:\n" + ''.join(error))
-
-            # No error -> save job data
-            else:        
-
-                # Successively write to job_data
-                for j in range(0,len(result)):
-   
-  		    job_data_tmp.append(j)
-                    job_data_tmp[j] = result[j].split(" ")
-                    job_data_tmp[j] = filter(None, job_data_tmp[j])
-  
-                    job_data.append(j)   
-                    job_data[j] = [job_data_tmp[j][0], description[h], job_data_tmp[j][2],                  
-				   job_data_tmp[j][3], int(float(job_data_tmp[j][4])*100), job_data_tmp[j][5], 
-				   job_data_tmp[j][1], job_data_tmp[j][6].rstrip()]
-                    job_data_n.append(j)
-                    job_data_n[j] = job_data_tmp[j][1]
-
-            del(result)
-
-
-
-            # Now read the data from the last update from file. These data are
-            # already in the prefered format
-            file2 = open(palm_dir + '/.wd.olddata', 'r')
-	    result = file2.readlines()
-	    file2.close()
-
-	    job_data_old = []
-	    job_data_old_n = []
-            k = -1
-            for j in range(0,len(result)):
-	        if ( result[j].split()[1] == description[h] ):
-		    k = k + 1
-		    job_data_old.append(k)
-                    job_data_old[k] = result[j].split(" ")
-                    job_data_old[k] = filter(None, job_data_old[k])
-                    job_data_old[k] = [line.rstrip('\n') for line in job_data_old[k]]
-                    job_data_old_n.append(k)
-                    job_data_old_n[k] = job_data_old[k][6]
-
-            # Merge the job_data and job_data_old to find completed, new and
-            # still queued jobs     
-            if ( len(job_data_n) > 0 and len(job_data_old_n) > 0 ):
-               jobs_full  = list(set(job_data_old_n) | set(job_data_n))
-               jobs_known    = list(set(job_data_old_n) & set(job_data_n))
-               jobs_complete = set(job_data_old_n) - set(job_data_n)
-               jobs_new      = set(job_data_n) - set(job_data_old_n)
-            elif ( len(job_data_n) > 0 ):
-	       jobs_full  = job_data_n
-	       jobs_known    = []
-	       jobs_new = job_data_n
-	       jobs_complete = []
-	    elif ( len(job_data_old_n) > 0 ):
-	       jobs_full  = job_data_old_n
-	       jobs_known    = []
-	       jobs_new = []
-	       jobs_complete = job_data_old_n   
-	    else:
-	       jobs_full  = []
-	       jobs_known    = []         
-	       jobs_new = []
-	       jobs_complete = []
-
-            # Display all known jobs
-            to_display = [list(job_data_n).index(item) for item in list(jobs_known) if list(jobs_known) and list(job_data_n)]
-            for j in range(0,len(to_display)):
-	        i = i + 1
-                self.table.insertRow(i)
-                item = QtGui.QTableWidgetItem(job_data[to_display[j]][0])
-                item.setToolTip("Queuing name: " + job_data[to_display[j]][6])
-                self.table.setItem(i, 0, item)            
-                self.table.setItem(i, 1, QtGui.QTableWidgetItem(job_data[to_display[j]][1])) 
-                self.table.setItem(i, 2, QtGui.QTableWidgetItem(job_data[to_display[j]][2]))   
-                self.table.setItem(i, 3, QtGui.QTableWidgetItem(job_data[to_display[j]][3]))
-                item = QtGui.QTableWidgetItem(job_data[to_display[j]][5])
-                item.setToolTip("Estimated job start: " + job_data[to_display[j]][7])               
-                self.table.setItem(i, 5, item)  
-                self.table.setItem(i, 6, QtGui.QTableWidgetItem(job_data[to_display[j]][6]))  
-                self.table.item(i,2).setTextAlignment(QtCore.Qt.AlignRight)
-                self.table.item(i,5).setTextAlignment(QtCore.Qt.AlignRight)
-                pbars.append(i)
-                pbars[i] = QtGui.QProgressBar(self)
-                pbars[i].setValue(int(job_data[to_display[j]][4])) 
- 
-                # Apply a color depending on the status of the job
-                if ( job_data[to_display[j]][3] == "Running" ):
-                    self.table.setCellWidget(i,4,pbars[i]) 
-		    self.table.item(i,0).setBackground(QtGui.QColor(255, 251, 168))
-		    self.table.item(i,1).setBackground(QtGui.QColor(255, 251, 168))
-		    self.table.item(i,2).setBackground(QtGui.QColor(255, 251, 168))
-                    self.table.item(i,3).setBackground(QtGui.QColor(255, 251, 168))
-                    self.table.item(i,5).setBackground(QtGui.QColor(255, 251, 168))
-                    self.table.item(i,6).setBackground(QtGui.QColor(255, 251, 168))
-                else:
-		    pbars[j].setEnabled(False)
-		    self.table.setCellWidget(i,4,pbars[i])
-                    self.table.item(i,0).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,1).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,2).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,3).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,5).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,6).setBackground(QtGui.QColor(255, 112, 118))
-                
-                # Save the job data to file
-                job_data_list.append(i)
-                job_data_list[i] = job_data[to_display[j]][0]
-                
-                printstring = str(job_data[to_display[j]][0]) + " " + \
-                              str(job_data[to_display[j]][1]) + " " + \
-                              str(job_data[to_display[j]][2]) + " " + \
-                              str(job_data[to_display[j]][3]) + " " + \
-                              str(job_data[to_display[j]][4]) + " " + \
-                              str(job_data[to_display[j]][5]) + " " + \
-                              str(job_data[to_display[j]][6]) + " " + \
-                              str(job_data[to_display[j]][7]) + "\n"
-                file.write(printstring)
-
-
-            # Display all new jobs
-            to_display = [list(job_data_n).index(item) for item in list(jobs_new) if list(jobs_new) and list(job_data_n)]
-            for j in range(0,len(to_display)):
-	        i = i + 1
-                self.table.insertRow(i)
-                item = QtGui.QTableWidgetItem(job_data[to_display[j]][0])
-                item.setToolTip("Queuing name: " + job_data[to_display[j]][6])
-                self.table.setItem(i, 0, item)   
-                self.table.setItem(i, 1, QtGui.QTableWidgetItem(job_data[to_display[j]][1])) 
-                self.table.setItem(i, 2, QtGui.QTableWidgetItem(job_data[to_display[j]][2]))   
-                self.table.setItem(i, 3, QtGui.QTableWidgetItem(job_data[to_display[j]][3])) 
-                item = QtGui.QTableWidgetItem(job_data[to_display[j]][5])
-                item.setToolTip("Estimated job start: " + job_data[to_display[j]][7])               
-                self.table.setItem(i, 5, item)  
-                self.table.setItem(i, 6, QtGui.QTableWidgetItem(job_data[to_display[j]][6]))  
-                self.table.item(i,2).setTextAlignment(QtCore.Qt.AlignRight)
-                self.table.item(i,5).setTextAlignment(QtCore.Qt.AlignRight)
-                
-                pbars.append(i)
-                pbars[i] = QtGui.QProgressBar(self)
-                pbars[i].setValue(int(job_data[to_display[j]][4]))   
-
-                # Apply a color depending on the status of the job
-                if ( job_data[to_display[j]][3] == "Running" ):
-		    self.table.setCellWidget(i,4,pbars[i])           
-		    self.table.item(i,0).setBackground(QtGui.QColor(255, 251, 168))
-		    self.table.item(i,1).setBackground(QtGui.QColor(255, 251, 168))
-		    self.table.item(i,2).setBackground(QtGui.QColor(255, 251, 168))
-                    self.table.item(i,3).setBackground(QtGui.QColor(255, 251, 168))
-                    self.table.item(i,5).setBackground(QtGui.QColor(255, 251, 168))
-                    self.table.item(i,6).setBackground(QtGui.QColor(255, 251, 168))
-                else:
-		    pbars[j].setEnabled(False)
-		    self.table.setCellWidget(i,4,pbars[i])
-                    self.table.item(i,0).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,1).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,2).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,3).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,5).setBackground(QtGui.QColor(255, 112, 118))
-                    self.table.item(i,6).setBackground(QtGui.QColor(255, 112, 118))
-          
-                # Save job data to file
-                job_data_list.append(i)
-                job_data_list[i] = job_data[to_display[j]][0]
-                
-                printstring = str(job_data[to_display[j]][0]) + " " + \
-                              str(job_data[to_display[j]][1]) + " " + \
-                              str(job_data[to_display[j]][2]) + " " + \
-                              str(job_data[to_display[j]][3]) + " " + \
-                              str(job_data[to_display[j]][4]) + " " + \
-                              str(job_data[to_display[j]][5]) + " " + \
-                              str(job_data[to_display[j]][6]) + " " + \
-                              str(job_data[to_display[j]][7]) + "\n"
-                file.write(printstring)
-
-
-            # Display all completed/canceled/aborted jobs. The watchdog cannot
-            # distinguish why the job has been finished
-            to_display = [list(job_data_old_n).index(item) for item in list(jobs_complete) if list(jobs_complete) and list(job_data_old_n)]
-            for j in range(0,len(to_display)):
-	        i = i + 1
-                self.table.insertRow(i)
-                item = QtGui.QTableWidgetItem(job_data_old[to_display[j]][0])
-                item.setToolTip("Queuing name: " + job_data_old[to_display[j]][6])
-                self.table.setItem(i, 0, item)          
-                self.table.setItem(i, 1, QtGui.QTableWidgetItem(job_data_old[to_display[j]][1])) 
-                self.table.setItem(i, 2, QtGui.QTableWidgetItem(job_data_old[to_display[j]][2]))   
-                self.table.setItem(i, 3, QtGui.QTableWidgetItem(job_data_old[to_display[j]][3]))  
-                pbars.append(i)
-                pbars[j] = QtGui.QProgressBar(self)
-                pbars[j].setValue(int(job_data_old[to_display[j]][4]))  
-                pbars[j].setEnabled(False)
-                self.table.setCellWidget(i,4,pbars[j]) 
-                item = QtGui.QTableWidgetItem(job_data_old[to_display[j]][5])
-                item.setToolTip("Estimated job start: " + job_data_old[to_display[j]][7])               
-                self.table.setItem(i, 5, item)  
-                self.table.setItem(i, 6, QtGui.QTableWidgetItem(job_data_old[to_display[j]][6]))  
-                self.table.item(i,2).setTextAlignment(QtCore.Qt.AlignRight)
-                self.table.item(i,5).setTextAlignment(QtCore.Qt.AlignRight)
-                self.table.setItem(i, 3, QtGui.QTableWidgetItem("Completed"))
-                
-                # Apply a color depending on the status of the job
-                self.table.item(i,0).setBackground(QtGui.QColor(172, 252, 175))
-                self.table.item(i,1).setBackground(QtGui.QColor(172, 252, 175))
-                self.table.item(i,2).setBackground(QtGui.QColor(172, 252, 175))
-                self.table.item(i,3).setBackground(QtGui.QColor(172, 252, 175))
-                self.table.item(i,5).setBackground(QtGui.QColor(172, 252, 175))
-                self.table.item(i,6).setBackground(QtGui.QColor(172, 252, 175))
-
-          
-                # Save job data to file
-                job_data_list.append(i)
-                job_data_list[i] = job_data_old[to_display[j]][0]
-
-                printstring = str(job_data_old[to_display[j]][0]) + " " + \
-                              str(job_data_old[to_display[j]][1]) + " " + \
-                              str(job_data_old[to_display[j]][2]) + " " + \
-                              str(job_data_old[to_display[j]][3]) + " " + \
-                              str(job_data_old[to_display[j]][4]) + " " + \
-                              str(job_data_old[to_display[j]][5]) + " " + \
-	                      str(job_data_old[to_display[j]][6]) + " " + \
-                              str(job_data_old[to_display[j]][7]) + "\n"
-                file.write(printstring)
-
-            del(jobs_complete)
-            del(jobs_new)
-            del(result)
-            del(job_data_old)
-            del(job_data_old_n)
-            
-        file.close()
-
-        
-        # Update is complete, sorting can thus be re-enabled                
-        self.table.setSortingEnabled(True) 
-
-        # Update the logfile
-        if ( os.path.isfile(palm_dir + '/.wd.newdata') ):
-            shutil.copy(palm_dir + '/.wd.newdata',palm_dir + '/.wd.olddata')
-
-        # Re-enable timer processes             
-        self.setEnabled(True)
-        self.label2.setText("Last update: " + timestamp)
-        self.label.setText("Update complete.")
-        self.timetimer.start()
-        self.timer.start(update_frequency)
-        self.labeltimer.start(update_frequency/10)
-        self.UpdateLabel()
-        QtGui.QApplication.processEvents()
-       
-    # Canceling selected job from table
-    def CancelJob(self):
-
-        # Return internal jobname
-        jobname = self.table.item(self.table.currentRow(),6).text()
-        jobrealname = self.table.item(self.table.currentRow(),0).text()     
- 
-        # Check description of job in order to login on the correct host
-        descr = self.table.item(self.table.currentRow(),1).text()
-        
-        querybox = QtGui.QMessageBox()
-        querybox.setText("Attention!\nYou are trying to cancel a job. It will not be able to terminate properly.")
-        querybox.setInformativeText("Do you really want to cancel " + jobname + " on host " + descr + "?")
-        querybox.setStandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-        querybox.setDefaultButton(QtGui.QMessageBox.No)
-        returnvalue = querybox.exec_()
-       
-        if ( returnvalue == QtGui.QMessageBox.Yes ):
-        
-           for h in range(0,len(description)):
-	       if ( descr == description[h] ):
-                  host = username[h] + "@" + hostname[h]
-
-           ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd cancel " + jobname],
-                              shell=False,
-                              stdout=sub.PIPE,
-                              stderr=sub.PIPE)
-           result = ssh.stdout.readlines()
-           result = filter(None, result)
-        
-           # In case of error display a warning message
-           if ( len(result) == 0 ):
-               error = ssh.stderr.readlines()
-               notify = QtGui.QMessageBox.warning(self,'Cancel job',"Error. Could not cancel job " + jobname + ".\n\nError message:\n" + ''.join(error))
-
-           # Otherwise inform the user and mark the job in the table
-           else:
-	       self.table.setItem(self.table.currentRow(),3,QtGui.QTableWidgetItem("Canceled"))
-               notify = QtGui.QMessageBox.information(self,'Cancel job',"Job" + jobname + " canceled!\n\nServer message:\n" + ''.join(result))
-
-
-    # Show detailed information on job. For documentation see above
-    def ShowDetails(self):
-
-        jobname = self.table.item(self.table.currentRow(),6).text()  
-        descr   = self.table.item(self.table.currentRow(),1).text()
-        for h in range(0,len(description)):
-	    if ( descr == description[h] ):
-                host = username[h] + "@" + hostname[h]
-
-        ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd check " + jobname],
-                           shell=False,
-                           stdout=sub.PIPE,
-                           stderr=sub.PIPE)
-        result = ssh.stdout.readlines()
-        result = filter(None, result)
-
-        if ( len(result) == 0 ):
-            error = ssh.stderr.readlines()
-            notify = QtGui.QMessageBox.warning(self,'Show job details',"Error. Could not fetch job details for " + jobname + ".\n\nError message:\n" + ''.join(error))
-        else:
-            notify = QtGui.QMessageBox.information(self,'Job details',"Details for job " + jobname + ":\n\n" + ''.join(result))
-
-
-    # Perform a forced stop on the job
-    def DoStop(self):
-
-        # Return internal jobname
-        jobname = self.table.item(self.table.currentRow(),6).text()
-        jobrealname = self.table.item(self.table.currentRow(),0).text()   
-        # Check description of job in order to login on the correct host
-        descr = self.table.item(self.table.currentRow(),1).text()
-        for h in range(0,len(description)):
-	    if ( descr == description[h] ):
-                host = username[h] + "@" + hostname[h]
-                user = username[h]
-
-        ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd stop " + jobrealname],
-                           shell=False,
-                           stdout=sub.PIPE,
-                           stderr=sub.PIPE)
-        result = ssh.stdout.readlines()
-        result = filter(None, result) 
-        
-        # In case of error display a warning message
-        if ( len(result) == 0 ):
-            error = ssh.stderr.readlines()
-            notify = QtGui.QMessageBox.warning(self,'Proper termination of job',"Error. Could not stop job " + jobname + ".\n\nError message:\n" + ''.join(error))
-
-        # Otherwise inform the user and mark the job in the table
-        else:
-	    self.table.setItem(self.table.currentRow(),3,QtGui.QTableWidgetItem("Terminated"))
-            notify = QtGui.QMessageBox.information(self,'Terminate job',"Termination of job " + jobname + " was initiated!\n\nServer message:\n" + ''.join(result))
-
-
-    # Perform a forced stop on the job
-    def DoRestart(self):
-
-        # Return internal jobname
-        jobname = self.table.item(self.table.currentRow(),6).text()
-        jobrealname = self.table.item(self.table.currentRow(),0).text()   
-         
-        # Check description of job in order to login on the correct host
-        descr = self.table.item(self.table.currentRow(),1).text()
-        for h in range(0,len(description)):
-	    if ( descr == description[h] ):
-                host = username[h] + "@" + hostname[h]
-                user = username[h]
-
-        ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd restart " + jobrealname],
-                           shell=False,
-                           stdout=sub.PIPE,
-                           stderr=sub.PIPE)
-        result = ssh.stdout.readlines()
-        result = filter(None, result)
-        
-        # In case of error display a warning message
-        if ( len(result) == 0 ):
-            error = ssh.stderr.readlines()
-            notify = QtGui.QMessageBox.warning(self,'Proper termination of job',"Error. Could not stop job " + jobname + ".\n\nError message:\n" + ''.join(error))
-
-        # Otherwise inform the user and mark the job in the table
-        else:
-	    self.table.setItem(self.table.currentRow(),3,QtGui.QTableWidgetItem("Terminated"))
-            notify = QtGui.QMessageBox.information(self,'Terminate job for restart',"Restart for job" + jobname + " was initiated!\n\nServer message:\n" + ''.join(result))
-            
-
-    # Read the PARIN file of the job
-    def ShowPARIN(self):
-
-        # Return internal jobname
-        jobname = self.table.item(self.table.currentRow(),6).text()
-        jobrealname = self.table.item(self.table.currentRow(),0).text()     
- 
-        # Check description of job in order to login on the correct host
-        descr = self.table.item(self.table.currentRow(),1).text()
-        for h in range(0,len(description)):
-	    if ( descr == description[h] ):
-                host = username[h] + "@" + hostname[h]
-                user = username[h]
-
-        ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd parin " + jobrealname],
-                           shell=False,
-                           stdout=sub.PIPE,
-                           stderr=sub.PIPE)
-        result = ssh.stdout.readlines()
-        result = filter(None, result)
-        
-        # In case of error display a warning message
-        if ( len(result) == 0 ):
-            error = ssh.stderr.readlines()
-            notify = QtGui.QMessageBox.warning(self,'Showing parameter file',"Error. Could not fetch parameter file for job " + jobrealname + " (" + jobname + ").\n\nError message:\n" + ''.join(error))
-
-        # Otherwise inform the user and mark the job in the table
-        else:
-	   mb = MessageBoxScroll()
-           mb.setText("Parameter file for job: " + jobrealname + "")
-           mb.setDetailedText(''.join(result))
-           mb.exec_()
-
-    # Read the PARIN file of the job
-    def ShowRC(self):
-
-        # Return internal jobname and real job name
-        jobname = self.table.item(self.table.currentRow(),6).text()
-        jobrealname = self.table.item(self.table.currentRow(),0).text()      
- 
-        # Check description of job in order to login on the correct host
-        descr = self.table.item(self.table.currentRow(),1).text()
-        for h in range(0,len(description)):
-	    if ( descr == description[h] ):
-                host = username[h] + "@" + hostname[h]
-                user = username[h]
-
-        ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd rc " + jobrealname],
-                           shell=False,
-                           stdout=sub.PIPE,
-                           stderr=sub.PIPE)
-        result = ssh.stdout.readlines()
-        result = filter(None, result)
-        
-        # In case of error display a warning message
-        if ( len(result) == 0 ):
-            error = ssh.stderr.readlines()
-            notify = QtGui.QMessageBox.warning(self,'Showing run control',"Error. Could not fetch run control file for job " + jobrealname + "(" + jobname + ").\n\nError message:\n" + ''.join(error))
-
-        # Otherwise inform the user and mark the job in the table
-        else:
-	   mb = MessageBoxScroll()
-	   lastline = result[len(result)-2].split()[2]
-           mb.setText("Simulated time for job " + jobrealname + " is currently: " + lastline)
-           mb.setDetailedText(''.join(result))
-           mb.exec_()
-
-    # Remove a job from list - removes the current row from the table and from
-    # save file
-    def RemoveFromList(self, row):
-        if ( row == -1 ):
-	    row = self.table.currentRow()
-
-        # Read data from save file
-        job_to_delete = self.table.item(row,6).text()
-        self.table.removeRow(row)
-        file = open(palm_dir + '/.wd.olddata', 'r')
-        result = file.readlines()
-        result = filter(None, result)
-	file.close()
-        file = open(palm_dir + '/.wd.olddata', 'w')
-	
-	job_data_old = []
-	
-        if ( len(result) == 0 ):
-            notify = QtGui.QMessageBox.warning(self,'Read from .wd.olddata',"Error message:\n\nCould not read from file. I/O error.")
-	else: 
-	    # Save data in array job_data_old
-	    for j in range(0,len(result)):
-                job_data_old.append(j)
-                job_data_old[j] = result[j].split(" ")
-                job_data_old[j] = filter(None, job_data_old[j])
-                job_data_old[j] = [line.rstrip('\n') for line in job_data_old[j]]
-                
-                # Check if line j is the selected job, if not -> save to file
-                if ( job_data_old[j][6] != job_to_delete ):
-                    printstring = str(job_data_old[j][0]) + " " + \
-                                  str(job_data_old[j][1]) + " " + \
-                                  str(job_data_old[j][2]) + " " + \
-                                  str(job_data_old[j][3]) + " " + \
-                                  str(job_data_old[j][4]) + " " + \
-                                  str(job_data_old[j][5]) + " " + \
-                                  str(job_data_old[j][6]) + " " + \
-                                  str(job_data_old[j][7]) + "\n"
-                    file.write(printstring)
-           
-        file.close() 
-
-    # Remove all completed jobs from list
-    def ClearList(self):
-      
-       num_of_lines = self.table.rowCount()
-       
-       # Delete all lines with completed/canceled jobs from list. The counter
-       # must decrease as the line numbers would be messed up otherwise
-       for j in range(num_of_lines-1,-1,-1): 
-           state = self.table.item(j,3).text()
-           if ( state == "Completed" or state == "Canceled" or state == "Terminated"):
-              self.RemoveFromList(j)
-         
-    # Update the label
-    def UpdateLabel(self):
-        remaining_time = (update_frequency - self.timetimer.elapsed()) / 1000 / 60
-        self.label.setText("Next update in " + str(remaining_time) + " min")
-        
-
-    # Enter Options menu
-    def Options(self):
-  
-#       disable mainwindow  
-        self.setEnabled(False)
-      
-#       show Options Dialog      
-        opt = OptionBox()
-        opt.exec_()
-
-        self.UpdateHosts()
-        self.setEnabled(True)
-
-# Update settings
-    def UpdateHosts(self):
-
-       global update_frequency
-       global description
-       global hostname
-       global username
-       
-       description = []
-       hostname = []
-       username = []
-
-       for i in range(0,len(config.sections())):
-
-          description_tmp = config.sections()[i]
- 
-          if ( description_tmp != 'Settings' ):
-      
-             if ( config.get(description_tmp, 'enabled') == 'true' ):
-                description.append(description_tmp)
-                hostname.append(config.get(description_tmp, 'hostname'))
-                username.append(config.get(description_tmp, 'username')) 
-          else:
-             update_frequency = int(config.get(description_tmp, 'update_frequency'))*60000
-
-
-# Main loop       
-def main():
-    
-    app = QtGui.QApplication(sys.argv)
-    res = Watchdog() 
-    sys.exit(app.exec_())
-
-
-if __name__ == '__main__':
-    main()   
Index: palm/trunk/SCRIPTS/palm_wdd
===================================================================
--- palm/trunk/SCRIPTS/palm_wdd	(revision 4901)
+++ 	(revision )
@@ -1,275 +1,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Modified header
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-# 
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2421 2017-09-07 10:36:34Z maronga
-# Fixed display of job progress.
-# 
-# 2416 2017-09-06 14:28:14Z maronga
-# Adapted for palmrun
-# 
-# 1619 2015-07-13 06:53:19Z maronga
-#
-# 1618 2015-07-13 06:52:15Z maronga
-# Added steering via configuration file, to be placed in the home directory of the
-# remote host to be monitored.
-# 
-# 1613 2015-07-08 14:53:29Z maronga
-# Bugfix: tooltip for queuing name did not show up on first update.
-# New: added contect menu for showing the parameter file and the run control
-# output
-# 
-# 1611 2015-07-07 12:23:22Z maronga
-# Initial revision
-# 
-#
-# Description:
-# ------------
-# PALM watchdog client for monitoring batch jobs on a variety of hosts specified
-# by the user. The watchdog server requires python 2.7 or higher installed on
-# host to be monitored.
-# 
-# Instructions:
-# -------------
-# 1) Modify the header section of palm_wd
-# 2) Move .wd.olddata and .wd.newdata to your palm directory 
-#    (e.g. /home/user/current_version/.wd.newdata etc.)
-# 3) Modify a copy of palm_wdd for each host to be monitored and move it to the
-#    respective hosts
-# 4) Start the client either from mrungui or from shell by "nohup palm_wd&"
-#
-# To do:
-# ------
-# 1) Add "Options", "Help" and "Manual"
-# 2) Move user settings to a configuration file
-#------------------------------------------------------------------------------!
-
-import ConfigParser
-import os
-import pwd
-from subprocess import check_output
-import sys
-
-
-# Read configuration file
-# First check if the configuration file exists
-if ( os.path.exists('.wdd.config') == False ):
-    print "Error. No configuration file .wdd.config found."
-    raise SystemExit     
-
-config = ConfigParser.RawConfigParser()
-config.read('.wdd.config')
-
-cmd_readqueue      = config.get('Settings', 'readqueue').strip('"')
-cmd_tmpdir         = config.get('Settings', 'tmpdir').strip('"')
-cmd_canceljob      = config.get('Settings', 'canceljob').strip('"')
-cmd_checkjob       = config.get('Settings', 'checkjob').strip('"')
-cmd_realname_grep  = config.get('Settings', 'realname_grep').strip('"')
-cmd_starttime      = config.get('Settings', 'starttime').strip('"')
-cmd_starttime_grep = config.get('Settings', 'starttime_grep').strip('"')
-
-
-action   = str(sys.argv[1])
-data     = str(sys.argv[2])
-
-cmd_readqueue = cmd_readqueue + " " + pwd.getpwuid( os.getuid() )[ 0 ]
-cmd_tmpdir    = cmd_tmpdir + pwd.getpwuid( os.getuid() )[ 0 ]
-
-# reading queuing system
-def ReadQueue(username):
-  
-#  collect queuing information
-   try:
-      out = check_output(cmd_readqueue, shell=True)
-      job_list = out.splitlines()
-      out = None
-#  do nothing for empty results list
-   except:
-      job_list = []
-  
- 
-   job_data_tmp = []
-   for j in range(0,len(job_list)):
-
-      # Write temporary data array containing the job information.
-      job_data_tmp.append(j)
-      job_data_tmp[j] = job_list[j].split(" ")
-      job_data_tmp[j] = filter(None, job_data_tmp[j])
-
-      cmd_realname = cmd_checkjob + " " + job_data_tmp[j][0] + "|grep " + cmd_realname_grep 
-
-      # retrieve real job name for all jobs
-      try:  
-         out = check_output(cmd_realname, shell=True)
-         job_realname = out.split(" ")[1].rstrip()
-      except:
-         job_realname = "error"
-
-
-      # for running jobs, determine progress                  
-      if ( job_data_tmp[j][2] == "Running" ):
-  
-         # collect progress information
-         cmd_progress = "cat " + cmd_tmpdir + "/" + job_realname + "/PROGRESS"
-         try: 
-
-            devnull = open(os.devnull, 'w')
-            out = check_output(cmd_progress, shell=True, stderr=devnull)
-            progress_lines = out.splitlines()
-            job_progress = progress_lines[1].split(" ")[3]
-            out = None
-         except:
-            job_progress = "0" 
-
-      else:
-         job_progress = "0" 
-
-      # return the job data
-      job_starttime = GetStartTime(job_data_tmp[j][0])
-      print job_realname + " " + job_data_tmp[j][0] + " " + job_data_tmp[j][3] + " " + job_data_tmp[j][2] + " " + job_progress + " "  + job_data_tmp[j][4] + " " + job_starttime
-
-
-# check details of specific job
-def CheckJob(jobid):
-
-   cmd_checkjob_tmp = cmd_checkjob + " " + jobid
-
-   try:  
-      out = check_output(cmd_checkjob_tmp, shell=True)
-      job_details = out
-   except:
-      job_details = "No details available." 
-
-   return job_details
-
-
-# cancel a specific job
-def CancelJob(jobid):
-
-   cmd_canceljob_tmp = cmd_canceljob + " " + jobid
-
-   try:  
-      out = check_output(cmd_canceljob_tmp, shell=True)
-      job_canceled = out
-   except:
-      job_canceled = "Action failed." 
-
-   return job_canceled
-
-
-# retrieve estimated start time of job
-def GetStartTime(jobid):
-
-   cmd_starttime_tmp = cmd_starttime + " " + jobid + "|grep \"" + cmd_starttime_grep + "\"" 
-
-   try:  
-      out = check_output(cmd_starttime_tmp, shell=True)
-      job_starttime = out.split()[5]
-   except:
-      job_starttime = "Action failed." 
-
-   return job_starttime
-
-
-def DoStopNow(jobid):
-
-   # collect progress information
-   cmd_dostop = "touch " + cmd_tmpdir + "/" + jobid + "/DO_STOP_NOW"
-   try: 
-      devnull = open(os.devnull, 'w')
-      out = check_output(cmd_dostop, shell=True, stderr=devnull)
-      out = None
-   except:
-      return_message = "Action failed."  
-      return return_message
-
-def DoRestartNow(jobid):
-
-   # collect progress information
-   cmd_dorestart = "touch " + cmd_tmpdir + "/" + jobid + "/DO_RESTART_NOW"
-   try: 
-      devnull = open(os.devnull, 'w')
-      out = check_output(cmd_dorestart, shell=True, stderr=devnull)
-      out = None
-   except:
-      return_message = "Action failed."  
-      return return_message
-
-def GetPARIN(jobid):
-
-   # collect progress information
-   cmd_dorestart = "cat " + cmd_tmpdir + "/" + jobid + "/PARIN"
-   try: 
-      devnull = open(os.devnull, 'w')
-      out = check_output(cmd_dorestart, shell=True, stderr=devnull)
-      return_message = out
-      out = None
-   except:
-      return_message = "Action failed."   + "cat " + cmd_tmpdir + "/" + jobid + "/PARIN" 
-      
-   return return_message
-
-def GetRC(jobid):
-
-   # collect progress information
-   cmd_dorestart = "cat " + cmd_tmpdir + "/" + jobid + "/RUN_CONTROL"
-   try: 
-      devnull = open(os.devnull, 'w')
-      out = check_output(cmd_dorestart, shell=True, stderr=devnull)
-      return_message = out
-      out = None
-   except:
-      return_message = "Action failed."
-      
-   return return_message
-
-# START OF MAIN
-if ( action == "queue" ):
-   ReadQueue(data)
-elif ( action == "check"):
-   print CheckJob(data)
-elif ( action == "cancel"):
-   print CancelJob(data)
-elif ( action == "start"):
-   print GetStartTime(data)
-elif ( action == "stop"):
-   print DoStopNow(data)
-elif ( action == "restart"):
-   print DoRestartNow(data)
-elif ( action == "parin"):
-   print GetPARIN(data)
-elif ( action == "rc"):
-   print GetRC(data)  
-else:
-   print "Error. Action " + action + " unknown."
-
Index: palm/trunk/SCRIPTS/palmbuild
===================================================================
--- palm/trunk/SCRIPTS/palmbuild	(revision 4901)
+++ 	(revision )
@@ -1,1018 +1,0 @@
-#!/bin/bash
-
-# palmbuild - script for compiling the PALM code and its utility programs
-
-#------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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 2017-2021  Leibniz Universitaet Hannover
-#------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Bugfix: do not treat empty module_commands as error
-#
-# 4809 2020-12-03 16:37:20Z gronemeier
-# Abort if the execution of the module commands raise an error
-#
-# 4556 2020-06-08 06:29:28Z raasch
-# bugfix for determining the ssh-key givn in the configuration file
-#
-# 4481 2020-03-31 18:55:54Z maronga
-# Abort if SOURCES_FOR_RUN catalog cannot be created
-#
-# 4082 2019-07-10 14:42:00Z raasch
-# bugfix for executing module commands and for interpreting linker options
-# on local machines
-#
-# 3756 2019-02-20 11:24:32Z suehring
-# Disable compilation of postprocessing tool for surface output, until
-# crashes with unexpected segmentation faults with intel compiler are solved.
-#
-# 3725 2019-02-07 10:11:02Z raasch
-# ssh-calls for compilations on remote systems modified to avoid output
-# of login messages on specific systems changed again (reverted as before r3549)
-#
-# 3549 2018-11-21 15:44:44Z raasch
-# ssh-calls for compilations on remote systems modified to avoid output
-# of login messages on specific systems
-#
-# 3534 2018-11-19 15:35:16Z raasch
-# build of inifor added,
-# ssh-calls rearranged to avoid output of system/user-profile messages
-#
-# 3523 2018-11-13 16:09:31Z suehring
-# Enable compilation of post-processing tool for surface output - interface
-# for posix conform sytemcalls is implemented.
-#
-# 3499 2018-11-07 10:55:15Z suehring
-# Temporarily avoid compilation of post-processing tool for surface output
-# until a workaround for compiler-specific intrinsic functions is found.
-#
-# 3494 2018-11-06 14:51:27Z suehring
-# Add tool for surface-output post-processing
-#
-# 3455 2018-10-30 14:12:31Z raasch
-# options -h and -d renamed -c and -r, respectively
-#
-# 3312 2018-10-06 14:15:46Z knoop
-# "host identifier" in header output renamed "config. identifier",
-# host_configuration renamed configuration_identifier,
-# jobname renamed run_identifier
-# header output of PALM code revision,
-# options -m, -s, and -S removed
-#
-# 3210 2018-08-28 07:31:13Z sward
-# Bugfix: agent_preprocessing stays in MAKE_DEPOSITORY after compilation
-#
-# 3208 2018-08-27 13:10:50Z sward
-# Added building of agent_preprocessing
-#
-# 3033 2018-05-23 15:26:19Z raasch
-# "fname" renamed to "jobname"
-#
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2566 2017-10-20 08:50:47Z raasch
-# informative messages switched of almost completely in silent mode
-# two header blocks merged into one
-#
-# 2506 2017-09-29 08:30:37Z raasch
-# option -V added to check for an existing SOURCES_FOR_RUN_... folder
-# host configuration added to SOURCES_FOR_RUN_... folder name
-# SOURCES_FOR_RUN_... folder is deleted in case of compilation errors
-# host_identifier renamed host_configuration
-#
-# 2500 2017-09-25 11:10:03Z raasch
-# bugfix for r2492
-#
-# 2492 2017-09-21 14:18:48Z raasch
-# ask for compilation, if SOURCES_FOR_RUN_... exists
-#
-# 2487 2017-09-21 11:30:10Z raasch
-# bugfix: abort in case of compiling/linking errors in silent mode
-#
-# 2422 2017-09-08 08:25:41Z raasch
-# initial revision
-#
-#------------------------------------------------------------------------------#
-# palmbuild - 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.
-#
-# @note This script does not work on MAC OS
-#------------------------------------------------------------------------------#
-
-
-    # VARIABLE DECLARATIONS + DEFAULT VALUES
- calltime=""
- column1=""
- column2=""
- configuration_identifier=default
- global_revision=""
- locat=normal
- makefile=""
- make_options=""
- module_commands=""
- program_name=palm
- remote_ip=""
- silent=false
- ssh_key=""
- suf=f90
- use_existing_sources_folder=false
- version="palmbuild  1.0  Rev$Rev$"
- working_directory=`pwd`
-
-
-    # ERROR HANDLING IN CASE OF EXIT
- trap 'rm -rf  ${source_path}/${configuration_identifier}_last_make_protocol
-       if [[ $locat != normal  &&  $locat != control_c ]]
-       then
-          printf "\n\n+++ palmbuild crashed \n\n"
-          exit 1
-       elif [[ $locat != normal ]]
-       then
-          printf "\n+++ palmbuild killed by \"^C\" \n\n"
-          exit 2
-       else
-          if [[ $silent = false ]]
-          then
-            printf "\n --> palmbuild finished\n\n"
-          fi
-          exit 0
-       fi' exit
-
-
-    # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C):
- trap 'locat=control_c
-       exit 1
-      ' 2
-
-
-
-    # READ SHELLSCRIPT-OPTIONS
- while  getopts  :c:r:uvV  option
- do
-   case  $option  in
-       (c)   configuration_identifier=$OPTARG;;
-       (r)   run_identifier=$OPTARG;;
-       (v)   silent=true;;
-       (V)   use_existing_sources_folder=true;;
-       (\?)  printf "\n  +++ unknown option $OPTARG \n";
-             locat=parameter; exit;;
-   esac
- done
-
-
-    # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME
- config_file=.palm.config.$configuration_identifier
- sources_for_run_catalog=SOURCES_FOR_RUN_${configuration_identifier}_$run_identifier
-
-
-    # CHECK, IF CONFIGURATION-FILE EXISTS
- if [[ ! -f $config_file ]]
- then
-    printf "\n  +++ configuration file: "
-    printf "\n           $config_file"
-    printf "\n      does not exist"
-    locat=configuration; exit
- fi
-
-
-    # ### is this really required?
- config_file=$PWD/$config_file
-
-
-    # READ VARIABLE SETTINGS FROM CONFIG FILE LINE BY LINE
- while  read line
- do
-
-       # FIRST REPLACE ENVIRONMENT-VARIABLES BY THEIR RESPECTIVE VALUES
-    eval  line=\"$line\"
-
-
-       # INTERPRET THE LINE
-    if [[ "$(echo $line)" = "" ]]
-    then
-
-          # EMPTY LINE, NO ACTION
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "#" ]]
-    then
-
-          # LINE IS A COMMENT LINE
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "%" ]]
-    then
-
-          # LINE DEFINES AN ENVIRONMENT-VARIABLE
-       var=`echo $line | cut -d" " -s -f1 | cut -c2-`
-       value=`echo $line | cut -d" " -s -f2-`
-
-          # REPLACE ":" BY " " IN COMPILER- CPP- OR LINKER-OPTIONS,
-          # "::" IS REPLACED BY ":".
-       #value=`echo $value | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'`
-
-
-          # VALUE FROM THE CONFIGURATION-FILE IS ASSIGNED TO THE
-          # ENVIRONMENT-VARIABLE, BUT ONLY IF NO VALUE HAS BEEN ALREADY
-          # ASSIGNED WITHIN THIS SCRIPT (E.G. BY SCRIPT-OPTIONS).
-          # NON-ASSIGNED VARIABLES HAVE VALUE "" OR 0 (IN CASE OF INTEGER).
-          # HENCE THE GENERAL RULE IS: SCRIPT-OPTION OVERWRITES THE
-          # CONFIGURATION-FILE.
-       if [[ "$(eval echo \$$var)" = ""  ||  "$(eval echo \$$var)" = "0" ]]
-       then
-          eval  export  $var="\$value"
-
-             # TERMINAL OUTPUT OF ENVIRONMENT-VARIABLES, IF TRACEBACK IS SWITCHED on
-          if [[ $do_trace = true ]]
-          then
-             printf "\n*** ENVIRONMENT-VARIABLE $var = $value"
-          fi
-       fi
-
-    else
-
-          # SKIP ALL OTHER LINES
-       continue
-
-    fi
-
- done < $config_file
-
-
-    # CHECK, IF THE BASE DIRECTORY PATH HAS BEEN GIVEN
- if [[ "$base_directory" = "" ]]
- then
-    printf "\n  +++ no base directory found in configuration file"
-    locat=config_file; exit
- else
-    if [[ ! -d $base_directory ]]
-    then
-       printf "\n\n  +++ base directory \"$base_directory\" "
-       printf "\n      does not exist"
-       locat=source_path; exit
-    fi
- fi
-
-
-    # CHECK SOURCE-CODE PATH
- if [[ "$source_path" = "" ]]
- then
-    printf "\n  +++ no source path found in configuration file"
-    locat=config_file; exit
- else
-    if [[ ! -d $source_path ]]
-    then
-       printf "\n\n  +++ source path \"$source_path\" "
-       printf "\n      does not exist"
-       locat=source_path; exit
-    fi
- fi
-
-
-    # CHECK MAKEFILE
- makefile=$source_path/Makefile
- if [[ ! -f $makefile ]]
- then
-    printf "\n  +++ makefile: "
-    printf "\n           $makefile"
-    printf "\n      does not exist"
-    locat=makefile; exit
- fi
-
-
-    # CHECK COMPILERNAME
- if [[ "$compiler_name" = "" ]]
- then
-    printf "\n  +++ no compiler name found in configuration file"
-    locat=config_file; exit
- fi
-
-
-    # CHECK SERIAL COMPILERNAME
- if [[ "$compiler_name_ser" = "" ]]
- then
-    printf "\n  +++ no compiler name for serial compilation in configuration file"
-    locat=config_file; exit
- fi
-
-
-    # DETERMINE THE SSH-OPTION IN CASE THAT AN SSH-KEY IS EXPLICITLY GIVEN IN THE
-    # CONFIG-FILE
- if [[ "$ssh_key" != "" ]]
- then
-    ssh_key="-i $HOME/.ssh/$ssh_key"
- fi
-
-
-    #CHECK CPP-OPTIONS
- if [[ "$cpp_options" = "" ]]
- then
-    printf "\n  +++ WARNING: no cpp-options found in configuration file"
- fi
-
-
-    # CHECK SETTINGS IN CASE OF COMPILING ON REMOTE MACHINE
- if [[ "$remote_ip" != "" ]]
- then
-
-    if [[ "$remote_username" = "" ]]
-    then
-       printf "\n  +++ no user name given in configuration file"
-       locat=config_file; exit
-    fi
-
-       # GET SOURCE AND DEPOSITORY PATH ON THE REMOTE MACHINE WITHOUT EVALUATING
-       # THE $
-       # IF NOT GIVEN, USE THE LOCAL SOURCE AND DEPOSITORY PATH
-    line=`grep %remote_source_path $config_file`
-    if [[ "$line" != "" ]]
-    then
-       remote_source_path=`echo $line | cut -d" " -s -f2`
-    else
-       line=`grep %source_path $config_file`
-       remote_source_path=`echo $line | cut -d" " -s -f2`
-    fi
-
-    line=`grep %base_directory $config_file`
-    make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${configuration_identifier}
-
- else
-
-    make_depository=${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}
-
- fi
-
-
-    # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY
- global_revision=`svnversion $source_path  2>/dev/null`
- global_revision="Rev: $global_revision"
-
-
-    # HEADER-OUTPUT (PART1: MESSAGES CONCERNING THE LOCAL HOST)
- if [[ $silent = false ]]
- then
-    calltime=$(date)
-    printf "\n"
-    printf "#------------------------------------------------------------------------# \n"
-    printf "| %-40s%30s | \n" "$version" "$calltime"
-    printf "| %-40s%30s | \n" "PALM code       $global_revision" " "
-    printf "|                                                                        | \n"
-    printf "| %-13s%-57s | \n" "called on:" "$(hostname) (IP:$local_ip)"
-    column2=$(echo $config_file | cut -c1-57 )
-    printf "| %-13s%-57s | \n" "config file:" "$column2"
-    line=$(echo "$config_file" | cut -c58-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo $line | cut -c1-57 )
-       printf "| %-13s%-57s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c58-)
-    done
-    column2=$(echo $makefile | cut -c1-57 )
-    printf "| %-13s%-57s | \n" "makefile:" "$column2"
-    line=$(echo "$makefile" | cut -c58-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo $line | cut -c1-57 )
-       printf "| %-13s%-57s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c58-)
-    done
-    column2=$(echo $source_path | cut -c1-57 )
-    printf "| %-13s%-57s | \n" "source path:" "$column2"
-    line=$(echo "$source_path" | cut -c58-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo $line | cut -c1-57 )
-       printf "| %-13s%-57s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c58-)
-    done
-    printf "|                                                                        | \n"
-
-    if [[ "$remote_ip" != "" ]]
-    then
-       column2="$configuration_identifier"
-       printf "| %-20s%-50s | \n" "config. identifier:" "$column2"
-       column2=$(echo "$make_depository" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "remote depository:" "$column2"
-    else
-       column2="$configuration_identifier"
-       printf "| %-20s%-50s | \n" "config. identifier:" "$column2"
-       column2=$(echo "$make_depository" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "local depository:" "$column2"
-    fi
-    line=$(echo "$make_depository" | cut -c51-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c51-)
-    done
-
-    if [[ "$remote_ip" != "" ]]
-    then
-       printf "| %-20s%-50s | \n" "remote username:" "$remote_username"
-       printf "| %-20s%-50s | \n" "remote address:" "$remote_ip"
-    else
-       printf "| %-20s%-50s | \n" "username:" "$local_username"
-       printf "| %-20s%-50s | \n" "address:" "$local_ip"
-    fi
-
-    printf "| %-20s%-50s | \n" "compiler:" "$compiler_name"
-    printf "| %-20s%-50s | \n" "serial compiler:" "$compiler_name_ser"
-
-    if [[ "$make_options" != "" ]]
-    then
-       printf "| %-20s%-50s | \n" "make options:" "$make_options"
-    fi
-    column2=$(echo "$cpp_options" | cut -c1-50 )
-    printf "| %-20s%-50s | \n" "cpp options:" "$column2"
-    line=$(echo "$cpp_options" | cut -c51-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c51-)
-    done
-    column2=$(echo "$compiler_options" | cut -c1-50 )
-    printf "| %-20s%-50s | \n" "compiler options:" "$column2"
-    line=$(echo "$compiler_options" | cut -c51-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c51-)
-    done
-    column2=$(echo "$linker_options" | cut -c1-50 )
-    printf "| %-20s%-50s | \n" "linker options:" "$column2"
-    line=$(echo "$linker_options" | cut -c51-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c51-)
-    done
-    if [[ "$login_init_cmd" != "" ]]
-    then
-       column2=$(echo "$login_init_cmd" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "login init command:" "$column2"
-       line=$(echo "$login_init_cmd" | cut -c51-)
-       while [[ "$line" != "" ]]
-       do
-          column1=""
-          column2=$(echo "$line" | cut -c1-50 )
-          printf "| %-20s%-50s | \n" "$column1" "$column2"
-          line=$(echo "$line" | cut -c51-)
-       done
-    fi
-    if [[ "$module_commands" != "" ]]
-    then
-       column2=$(echo "$module_commands" | cut -c1-50 )
-       printf "| %-20s%-50s | \n" "module command(s):" "$column2"
-       line=$(echo "$module_commands" | cut -c51-)
-       while [[ "$line" != "" ]]
-       do
-          column1=""
-          column2=$(echo "$line" | cut -c1-50 )
-          printf "| %-20s%-50s | \n" "$column1" "$column2"
-          line=$(echo "$line" | cut -c51-)
-       done
-    fi
-    printf "#------------------------------------------------------------------------# \n"
-
-    answer=dummy
-    printf "\n"
-    while [[ "$answer" != y  &&  "$answer" != Y  && "$answer" != s  &&  "$answer" != S  &&  "$answer" != a  &&  "$answer" != A ]]
-    do
-       printf " >>> continue (y(es)/a(bort)) ?  "
-       read  answer
-    done
-    if [[ $answer = a  ||  $answer = A ]]
-    then
-       locat=user_abort; exit
-    fi
- fi
-
-
-    # TAR THE SOURCES AND MAKEFILES
-    # UTILITIES ARE TEMPORARILY COPIED TO THE SOURCE DIRECTORY IN ORDER TO TAR
-    # THEM TOO
- if [[ $silent = false ]]
- then
-    printf "\n\n  *** tar of makefile and source files in"
-    printf "\n      $source_path\n"
- fi
- cd  $source_path
- cp -p  ../UTIL/combine_plot_fields.f90  .
- cp -p  ../UTIL/compare_palm_logs.f90  .
- cp -p  ../UTIL/agent_preprocessing/agent_preprocessing.f90  .
- #cp -p  ../UTIL/surface_output_processing/surface_output_to_vtk.f90  .
- cp -p  ../UTIL/inifor/src/inifor*f90  .
- cp -p  ../UTIL/Makefile_utilities  .
- tar -cf  ${program_name}_sources.tar  Makefile*  *.$suf
- rm  combine_plot_fields.f90  compare_palm_logs.f90 agent_preprocessing.f90 Makefile_utilities inifor*f90 #surface_output_to_vtk.f90
-
-
-    # MAKE ON REMOTE HOST
- if [[ "$remote_ip" != "" ]]
- then
-
-       # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_...
-    if [[ "$run_identifier" = "" ]]
-    then
-
-          # COPY CURRENT SOURCE CODE TO SOURCE-CODE DIRECTORY ON THE REMOTE HOST
-          # CREATE THIS DIRECTORY, IF IT DOES NOT EXIST
-       if [[ $silent = false ]]
-       then
-          echo " "
-          echo "  *** copying \"${program_name}_sources.tar\" to \"${remote_ip}:${make_depository}/\" "
-          ssh  -q  $ssh_key ${remote_username}@${remote_ip}  "[[ ! -d ${make_depository} ]]  &&  (echo \"  *** ${make_depository} will be created\"; mkdir -p  ${make_depository})"  2>&1
-          scp  $ssh_key ${source_path}/${program_name}_sources.tar  ${remote_username}@${remote_ip}:${make_depository}/${program_name}_sources.tar
-       else
-          ssh  -q  $ssh_key ${remote_username}@${remote_ip}  "[[ ! -d ${make_depository} ]]  &&  mkdir -p  ${make_depository}"  2>&1
-          scp  $ssh_key ${source_path}/${program_name}_sources.tar  ${remote_username}@${remote_ip}:${make_depository}/${program_name}_sources.tar  >  /dev/null
-       fi
-
-
-
-
-          # UNTAR PREVIOUS UPDATE ON REMOTE HOST, IF EXISTING
-       if [[ $silent = false ]]
-       then
-          echo "  *** untar previous update on remote host, if existing"
-       fi
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "cd ${make_depository}; [[ -f ${program_name}_current_version.tar ]]  &&  tar -xf  ${program_name}_current_version.tar"  2>&1
-
-
-          # UNTAR CURRENT SOURCES ON REMOTE HOST
-       if [[ $silent = false ]]
-       then
-          echo "  *** untar current sources on remote host"
-       fi
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "cd ${make_depository}; tar -xf  ${program_name}_sources.tar"  2>&1
-
-
-          # CREATE INIT AND MODULE COAMMNDS
-       [[ "$login_init_cmd" != "" ]]   &&  login_init_cmd=${login_init_cmd}";"
-       [[ "$module_commands" != "" ]]  &&  module_commands=${module_commands}";"
-
-
-          # FIRST CREATE EXECUTABLES FOR THE UTILITY ROUTINES
-       if [[ $silent = false ]]
-       then
-          echo " "
-          echo "  *** creating utilities on remote host"
-       fi
-       make_call_string="make  -f Makefile_utilities  $make_options  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$linker_options\" "
-###       echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>/dev/null | tee ${configuration_identifier}_last_make_protocol
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR"  2>&1 | tee ${configuration_identifier}_last_make_protocol
-
-       if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]]
-       then
-          printf "\a\n  +++ error(s) occurred during compiling or linking of utilities"
-          printf "\n      for host configuration \"$configuration_identifier\" "
-          if [[ $silent = false ]]
-          then
-             answer=dummy
-             printf "\n"
-             while [[ "$answer" != c  &&  "$answer" != k ]]
-             do
-                printf "  >>> continue / list errors / kill palmbuild (c/l/k) ? "
-                read  answer
-                if [[ "$answer" = l ]]
-                then
-                   more ${configuration_identifier}_last_make_protocol
-                fi
-             done
-             if [[ $answer = k ]]
-             then
-                locat=user_abort; exit
-             fi
-          else
-                # ABORT ANYWAY
-             locat=user_abort; exit
-          fi
-       fi
-
-          # NOW COMPILE THE PALM CODE
-          # COMMANDS WILL BE COMMUNICATED TO SSH VIA PIPE, SINCE THIS WAY THE SYSTEM- AND
-          # USER-PROFILES OF THE SHELL ARE COMPLETELY EXECUTED (OTHERWISE, MAKE
-          # MAY E.G. MISS THE COMPILER-PATHS)
-       if [[ $silent = false ]]
-       then
-          echo " "
-          echo "  *** compile PALM sources on remote host"
-       fi
-       make_call_string="make  $make_options  PROG=$program_name  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$linker_options\" "
-###       echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${configuration_identifier}_last_make_protocol
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR"  2>&1 | tee ${configuration_identifier}_last_make_protocol
-
-       if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]]
-       then
-          printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
-          if [[ $silent = false ]]
-          then
-             answer=dummy
-             printf "\n"
-             while [[ "$answer" != c  &&  "$answer" != k ]]
-             do
-                printf "  >>> continue / list errors / kill palmbuild (c/l/k) ? "
-                read  answer
-                if [[ "$answer" = l ]]
-                then
-                   more ${configuration_identifier}_last_make_protocol
-                fi
-             done
-             if [[ $answer = k ]]
-             then
-                locat=user_abort; exit
-             fi
-          else
-                # ABORT ANYWAY
-             locat=user_abort; exit
-          fi
-       fi
-
-          # TAR UPDATED VERSION ON THE REMOTE HOST
-       if [[ $silent = false ]]
-       then
-          printf "\n  *** tar update on remote host ..."
-       fi
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "cd ${make_depository}; chmod u+w *; tar -cf  ${program_name}_current_version.tar  ${program_name}  *.f90 *.o *.mod *.x"  2>&1
-
-
-       # NOW COMES THE BRANCH FOR CREATING THE EXECUTABLE FOR THE CURRENT RUN
-       # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS
-       # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_...
-    elif [[ "$run_identifier" != "" ]]
-    then
-
-          # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS
-          # AND ASK, IF THEY SHALL BE USED
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]]  &&  echo sources for run found"  2>&1  >  ${configuration_identifier}_last_make_protocol
-       if [[ $(grep -c "sources for run found" ${configuration_identifier}_last_make_protocol) != 0  &&  $use_existing_sources_folder = true ]]
-       then
-          printf "\a\n  *** compiled sources for run \"$run_identifier\" found on remote host in folder"
-          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog}"
-          printf "\n      will be used!"
-          exit
-       fi
-
-          # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_...
-       if [[ $silent = false ]]
-       then
-          printf "\n  *** copy MAKE_DEPOSITORY_${configuration_identifier} on remote host to $sources_for_run_catalog \n"
-       fi
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}; mkdir -p ${fast_io_catalog}/${sources_for_run_catalog}; [[ \$? != 0 ]] && exit 1; cp ${make_depository}/${program_name}_current_version.tar  ${fast_io_catalog}/${sources_for_run_catalog}; cd ${fast_io_catalog}/${sources_for_run_catalog}; tar xf ${program_name}_current_version.tar"  2>&1
-       if [[ $? != 0 ]]
-       then
-          printf "\n  +++ SOURCES_FOR_RUN catalog cannot be created."
-          printf "\n      Check setting of variable fast_io_catalog in your config file."
-          locat=temporary_working_directory
-          exit
-       fi
-
-
-          # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... ON THE REMOTE MACHINE
-       if [[ $silent = false ]]
-       then
-          printf "\n  *** copy ${base_directory}/${sources_for_run_catalog}"
-          printf "\n      to $sources_for_run_catalog on remote host \n"
-       fi
-       scp  -q  $ssh_key  ${base_directory}/${sources_for_run_catalog}/{*,.[!.]*}  ${remote_username}@${remote_ip}:${fast_io_catalog}/${sources_for_run_catalog}
-
-
-          # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY
-       if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]]
-       then
-
-          make_call_string="make  $make_options  PROG=$program_name  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$linker_options\" "
-          [[ "$login_init_cmd" != "" ]]   &&  login_init_cmd=${login_init_cmd}";"
-          [[ "$module_commands" != "" ]]  &&  module_commands=${module_commands}";"
-          if [[ $silent = false ]]
-          then
-             echo "  *** execute \"make\" on remote host"
-          fi
-          ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR"  2>&1 | tee ${configuration_identifier}_last_make_protocol
-
-          if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]]
-          then
-             printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
-             if [[ $silent = false ]]
-             then
-                answer=dummy
-                printf "\n"
-                while [[ "$answer" != c  &&  "$answer" != k ]]
-                do
-                   printf "  >>> continue / list errors / kill palmbuild (c/l/k) ? "
-                   read  answer
-                   if [[ "$answer" = l ]]
-                   then
-                      more ${configuration_identifier}_last_make_protocol
-                   fi
-                done
-                if [[ $answer = k ]]
-                then
-                   ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}"  2>&1
-                   locat=user_abort; exit
-                fi
-             else
-                   # ABORT ANYWAY
-                ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}"  2>&1
-                locat=user_abort; exit
-             fi
-          fi
-
-       else
-
-          echo "  *** nothing to compile for this run"
-
-       fi
-
-    fi
-
-    rm -rf  ${source_path}/${configuration_identifier}_last_make_protocol
-
-
-    # MAKE ON LOCAL HOST
- else
-
-
-       # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... ON THE
-       # LOCAL HOST
-    if [[ "$run_identifier" = "" ]]
-    then
-
-          # SET THE ENVIRONMENT (EXECUTE INIT AND MODULE COMMANDS)
-       if [[ "$login_init_cmd" != "" ]]
-       then
-          eval $login_init_cmd
-       fi
-
-       if [[ "$module_commands" != "" ]]
-       then
-          eval $module_commands || {
-            printf "\n  +++ Module command(s) failed."
-            printf "\n      Check the above output of the command(s)."
-            locat=module_command_error; exit
-          }
-       fi
-
-          # next is required to evaluate environment variables or commands used in the linker option
-       eval linker_options=\"$linker_options\"
-
-          # CREATE MAKE-DEPOSITORY, IF IT DOES NOT EXIST
-       eval make_depository=$make_depository
-       if [[ ! -d $make_depository ]]
-       then
-          if  mkdir -p $make_depository
-          then
-             if [[ $silent = false ]]
-             then
-                printf "\n\n  *** directory for local make depository:"
-                printf "\n           $make_depository"
-                printf "\n      was created\n"
-             fi
-          else
-             printf "\n  +++ directory for local make depository:"
-             printf "\n           $make_depository"
-             printf "\n      cannot be created"
-             locat=local_depository; exit
-          fi
-       fi
-
-          # COPY SOURCE-CODE FROM REPOSITORY TO MAKE-DEPOSITORY
-       if [[ $silent = false ]]
-       then
-          echo " "
-          echo "  *** untar current source sources on local host in"
-          echo "      $make_depository"
-       fi
-       cd  $make_depository
-       cp  $source_path/${program_name}_sources.tar  .
-       tar xf  ${program_name}_sources.tar
-
-
-          # FIRST CREATE EXECUTABLES FOR THE UTILITY ROUTINES
-       if [[ $silent = false ]]
-       then
-          echo " "
-          echo "  *** creating utilities on local host"
-       fi
-       make  -f Makefile_utilities  $make_options  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$linker_options" | tee ${configuration_identifier}_last_make_protocol
-
-       if [[ ${PIPESTATUS[0]} != 0 ]]
-       then
-          printf "\a\n  +++ error(s) occurred during compiling of the utilities for host configuration \"$configuration_identifier\" "
-          if [[ $silent = false ]]
-          then
-             answer=dummy
-             printf "\n"
-             while [[ "$answer" != c  &&  "$answer" != k ]]
-             do
-                printf "  >>> continue / list errors / kill palmbuild (c/l/k) ? "
-                read  answer
-                if [[ "$answer" = l ]]
-                then
-                   more ${configuration_identifier}_last_make_protocol
-                fi
-             done
-             if [[ $answer = k ]]
-             then
-                locat=user_abort; exit
-             fi
-          else
-             # ABORT ANYWAY
-             locat=user_abort; exit
-          fi
-       else
-          cp agent_preprocessing $source_path/../SCRIPTS/.
-          cp inifor $source_path/../SCRIPTS/.
-       fi
-
-
-          # CALL MAKE ON LOCAL HOST USING THE  OPTIONS DETERMINED FURTHER ABOVE
-       if [[ $silent = false ]]
-       then
-          echo " "
-          echo "  *** compile PALM sources on local host"
-       fi
-
-       make  $make_options  PROG=$program_name  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$linker_options"  2>&1 | tee ${configuration_identifier}_last_make_protocol
-
-       if [[ ${PIPESTATUS[0]} != 0 ]]
-       then
-          printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
-          if [[ $silent = false ]]
-          then
-             answer=dummy
-             printf "\n"
-             while [[ "$answer" != c  &&  "$answer" != k ]]
-             do
-                printf "  >>> continue / list errors / kill palmbuild (c/l/k) ? "
-                read  answer
-                if [[ "$answer" = l ]]
-                then
-                   more ${configuration_identifier}_last_make_protocol
-                fi
-             done
-             if [[ $answer = k ]]
-             then
-                locat=user_abort; exit
-             fi
-          else
-                # ABORT ANYWAY
-             locat=user_abort; exit
-          fi
-       fi
-
-
-          # TAR NEW VERSION ON LOCAL HOST
-       if [[ $silent = false ]]
-       then
-          printf "\n  *** tar update on local host ..."
-       fi
-       tar -cf  ${program_name}_current_version.tar  ${program_name} *.$suf *.o *.mod *.x
-
-    else
-
-          # NOW COMES THE BRANCH FOR CREATING THE EXECUTABLE FOR THE CURRENT RUN
-          # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS
-          # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_...
-
-          # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS
-          # AND ASK, IF THEY SHALL BE USED
-       if [[ -d ${fast_io_catalog}/${sources_for_run_catalog}  &&  $use_existing_sources_folder = true ]]
-       then
-          printf "\a\n  *** compiled sources for run \"$run_identifier\" found on local host in folder"
-          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog}"
-          printf "\n      will be used!"
-          exit
-       fi
-
-          # SECOND CHECK, IF A DEPOSITORY EXISTS ON THE LOCAL MACHINE
-       if [[ ! -d ${make_depository} ]]
-       then
-          printf "\n  +++ directory for local make depository:"
-          printf "\n           $make_depository"
-          printf "\n      not found. Please run \"palmbuild -c $configuration_identifier\" "
-          locat=make_depository; exit
-       fi
-
-
-          # COPY MAKE DEPOSITORY ON LOCAL MACHINE TO SOURCES_FOR_RUN_...
-       if [[ $silent = false ]]
-       then
-          printf "\n  *** copy MAKE_DEPOSITORY_${configuration_identifier} on local host to "
-          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog} \n"
-       fi
-       rm -rf ${fast_io_catalog}/${sources_for_run_catalog}
-       mkdir -p ${fast_io_catalog}/${sources_for_run_catalog}
-       if [[ $? != 0 ]]
-       then
-          printf "\n  +++ SOURCES_FOR_RUN catalog cannot be created."
-          printf "\n      Check setting of variable fast_io_catalog in your config file."
-          locat=execution
-          exit
-       fi
-       cp ${make_depository}/${program_name}_current_version.tar  ${fast_io_catalog}/${sources_for_run_catalog}
-       cd $fast_io_catalog/${sources_for_run_catalog}
-       tar xf ${program_name}_current_version.tar
-
-
-          # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_...
-          # IN THE FAST_IO_CATALOG ON THE LOCAL MACHINE
-       if [[ $silent = false ]]
-       then
-          printf "\n  *** copy ${base_directory}/${sources_for_run_catalog} to"
-          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog} on local host \n"
-       fi
-       cp  ${base_directory}/${sources_for_run_catalog}/{*,.[!.]*}  ${fast_io_catalog}/${sources_for_run_catalog}
-
-
-          # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY
-       if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]]
-       then
-
-          if [[ $silent = false ]]
-          then
-             echo "  *** execute \"make\" on local host"
-          fi
-          [[ "$login_init_cmd" != "" ]]   &&  eval $login_init_cmd
-          [[ "$module_commands" != "" ]]  &&  {
-             eval $module_commands || {
-               printf "\n  +++ Module command(s) failed."
-               printf "\n      Check the above output of the command(s)."
-               locat=module_command_error; exit
-             }
-          }
-
-             # next is required to evaluate environment variables or commands used in the linker option
-          eval linker_options=\"$linker_options\"
-
-          make  $make_options  PROG=$program_name  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$linker_options"
-
-          if [[ ${PIPESTATUS[0]} != 0 ]]
-          then
-
-             printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
-             if [[ $silent = false ]]
-             then
-                answer=dummy
-                printf "\n"
-                while [[ "$answer" != c  &&  "$answer" != k ]]
-                do
-                   printf "  >>> continue / kill palmbuild (c/k) ? "
-                   read  answer
-                done
-                if [[ $answer = k ]]
-                then
-                   rm -rf ${fast_io_catalog}/${sources_for_run_catalog}
-                   locat=user_abort; exit
-                fi
-             else
-                   # ABORT ANYWAY
-                rm -rf ${fast_io_catalog}/${sources_for_run_catalog}
-                locat=user_abort; exit
-             fi
-          fi
-
-       else
-
-          echo "  *** nothing to compile for this run"
-
-       fi
-
-    fi
- fi
Index: palm/trunk/SCRIPTS/palmplot
===================================================================
--- palm/trunk/SCRIPTS/palmplot	(revision 4901)
+++ 	(revision )
@@ -1,230 +1,0 @@
-#!/bin/bash
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Unix-Shell has been changed to bash 
-# 
-# 2885 2018-03-14 11:02:46Z Giersch
-# assign configuration file within palmplot call
-# 
-# 2837 2018-02-26 14:04:53Z gronemeier
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 1310 2014-03-14 08:01:56Z raasch
-# update GPL copyright
-#
-# 1046 2012-11-09 14:38:45Z maronga
-# code put under GPL (PALM 3.9)
-#
-# palmplot - script for running the NCL scripts
-    # Using the available NCL scripts via the shell script palmplot
-
-    # Last changes
-    # 16/03/10 - Rieke - initial revision
-    # 30/03/10 - Rieke - substituting double quotes (") with a character 
-    #                    variable (dq) containing double quotes 
-    # 31/03/10 - Rieke - list of variable names can be specified using 
-    #                    blank separated lists instead of comma 
-    #                    separated lists
-    # 01/04/10 - Rieke - bugfix - treatment of special character *
-    #                    in NCL variables containing lists corrected
-    # 23/08/10 - Rieke - bugfix - "" had to be added in if-queries 
-    # 30/09/10 - Rieke - Link to new online documentation of PALM NCL scripts
-    # 31/10/11 - Rieke - Adjustement so that palmplot also works on 
-    #                    DKRZ (ibmh)
-
-
- # SHORT INTRODUCTION FOR USING THIS SCRIPT
- if [[ "$1" = "?"  || "$1" = "--help" || "$1" = "-h" ]]
-  then
-    (printf "\n   palmplot is designed to run the NCL scripts of PALM \n"
-     printf "\n   palmplot can be called as follows:"
-     printf "\n   palmplot script_identifier file_1=OUTPUT/test.nc file_out=test format_out=pdf var='pt w\"pt\" w*pt* u' no_rows=2 ...\n"
-     printf "\n   script_identifier has to be one of the following:"
-     printf "\n    xy, xz, yz, pr, ts, sp"
-     printf "\n   in dependence on the data that wants to be plotted\n"
-     printf "\n   the further arguments control the plot"
-     printf "\n   they can also be set in the configuration file .ncl.config"
-     printf "\n   a documentation is available at"
-     printf "\n   http://palm.muk.uni-hannover.de/wiki/doc/app/ncl \n\n")
-     exit
- fi
-
-
- # DEFINITION OF VARIABLES
- a=""
- arg=""
- b=""
- key=""
- script=""
- value=""
- CMDLINE=""
- STRINGPARAMS=""
- STRINGPARAMS_CO=""
- STRINGPARAMS_CS=""
- STRINGPARAMS_PR="" 
- STRINGPARAMS_SP=""
- STRINGPARAMS_TS=""
- STRINGPARAMS_VA=""
-
-
- # LIST OF THE PARAMETERS OF THE NCL SCRIPTS WHICH NCL EXPECTED TO BE STRINGS
- # CO: PARAMETERS WHICH ARE COMMON FOR ALL NCL SCRIPTS
- # CS: cross_sections.ncl PR: profiles.ncl SP: spectra.ncl TS: timeseries.ncl
- # VA: PARAMETERS WHICH CONTAIN LISTS OF VARIABLE NAMES
- STRINGPARAMS_CO="file_1 format_out file_out var file_config "
- STRINGPARAMS_CS="sort mode fill_mode unit_x unit_y unit_z vec1 vec2 plotvec"
- STRINGPARAMS_PR="file_2 file_3 file_4 file_5 file_6 name_legend_1 name_legend_2 name_legend_3 name_legend_4 name_legend_5 name_legend_6 c_var"
- STRINGPARAMS_SP="sort unit_x unit_y"
- STRINGPARAMS_TS="unit_t"
- STRINGPARAMS_VA="var c_var vec1 vec2 plotvec"
-
-
- # CHOICE OF THE PARTICULAR NCL SCRIPT
- if [[ "$1" == "xy" ]]
-  then 
-    script="cross_sections.ncl"
-    STRINGPARAMS=$STRINGPARAMS_CO$STRINGPARAMS_CS
-    CMDLINE="xyc=1 "
-  elif [[ "$1" == "xz" ]]
-    then 
-    script="cross_sections.ncl"
-    STRINGPARAMS=$STRINGPARAMS_CO$STRINGPARAMS_CS
-    CMDLINE="xzc=1 "
-  elif [[ "$1" == "yz" ]]
-    then 
-    script="cross_sections.ncl"
-    STRINGPARAMS=$STRINGPARAMS_CO$STRINGPARAMS_CS
-    CMDLINE="yzc=1 "
-  elif [[ "$1" == "pr" ]]
-    then 
-    script="profiles.ncl"
-    STRINGPARAMS=$STRINGPARAMS_CO$STRINGPARAMS_PR
-  elif [[ "$1" == "ts" ]]
-    then 
-    script="timeseries.ncl"
-    STRINGPARAMS=$STRINGPARAMS_CO$STRINGPARAMS_TS
-  elif [[ "$1" == "sp" ]]
-    then 
-    script="spectra.ncl"
-    STRINGPARAMS=$STRINGPARAMS_CO$STRINGPARAMS_SP
-   else
-     (printf "\n  first argument has to be one of the following:"
-      printf "\n   xy, xz, yz, pr, ts or sp \n" 
-      printf "\n  type \"palmplot ?\" for information about the usage of this script\n")
-     exit
- fi
-
- # SHIFTING THE FIRST COMMAND LINE ARGUMENT
- shift 
-
- # PROCESSING THE COMMAND LINE ARGUMENTS
- while [ $# -gt 0 ] 
- do
-    arg=$1
-    key=${arg%%=*}
-    value=${arg#*=}
-
-    # ALLOWING RELATIVE AND ABSOLUTE FILE PATHS 
-    if [[ "$key" ==  @(file_*) && "$value" != @(~/*|/*) ]]
-    then
-       value=$PWD/$value
-    fi
-
-    # USE CONFIG FILE SPECIFIED BY USER
-    if [ "$key" = "file_config" ]
-    then
-       if [ -f $value ]
-       then
-          use_user_config=true
-       else
-          printf "\n  configuration file \"$value\" not found."
-          printf "\n  trying to use one of the standard configuraion files...\n"
-       fi
-    fi
-
-    # PROCESSING STRINGS
-    for a in $STRINGPARAMS
-    do
-      if [ "$key" = "$a" ]
-      then
-
-         # PROCESSING STRINGS CONTAINING LISTS OF VARIABLES
-         for b in $STRINGPARAMS_VA
-         do
-           if [ "$key" = "$b" ]
-           then
-              if [[ "$value" != "all" ]]
-              then
-                 # SUBSTITUTING BLANKS WITH COMMAS IN 
-                 # PARAMETERS CONTAINING LISTS OF VARIABLES
-                 value=`echo $value | sed 's/ /,/g'`   
-                 # ALLOWING THE USAGE OF COMMA SEPARATED LIST AS WELL    
-            
-                 if [[ "$value" == "${value#,}" ]]
-                 then
-                    value=,$value
-                 fi
-                 if [[ "$value" == "${value%,}" ]]
-                 then
-                    value=$value,
-                 fi          
-                 value=${value/%\*,,/\*,}                 
-                 break
-              fi
-           fi
-         done
-
-         # SUBSTITUTING DOUBLE QUOTES - REQUIRED BY NCL
-         value=`echo $value | sed 's/\"/\"+dq+\"/g'`
-         # SETTING ENTIRE STRING IN DOUBLE QUOTES - REQUIRED BY NCL
-         value=\"$value\"
-      fi
-    done
-
-    CMDLINE=$CMDLINE"$key=$value "
-    shift
- done
-
- # SET CONFIGURATION FILE TO ONE OF THE DEFAULT FILES IF NOT SPECIFIED BY USER
- if [ "$use_user_config" != true ]
- then
-    key="file_config"
-
-    if [ -f $PALM_BIN/../../.ncl.config ]
-    then
-       value="\"$PALM_BIN/../../.ncl.config\""
-    else
-       value="\"$PALM_BIN/NCL/.ncl.config.default\""
-    fi
-
-    CMDLINE=$CMDLINE"$key=$value "
- fi
-
- # EXECUTING THE PARTICULAR NCL SCRIPT
- cd $PALM_BIN/NCL
- ncl 'dq=str_get_dq()' $script $CMDLINE 
Index: palm/trunk/SCRIPTS/palmrun
===================================================================
--- palm/trunk/SCRIPTS/palmrun	(revision 4901)
+++ 	(revision )
@@ -1,3147 +1,0 @@
-#!/bin/bash
-
-# palmrun - script for running PALM jobs
-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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 2017-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# check for usernames added
-# 
-# 4843 2021-01-15 15:22:11Z raasch
-# handling of single restart files (created with MPI-I/O) added
-# 
-# 4481 2020-03-31 18:55:54Z maronga
-# add cycle number to initial files too (000),
-# remove compatibility for cycle numbers which are less than three digits wide
-# 
-# 4425 2020-02-26 15:35:00Z raasch
-# hard coded path to the fileconnection file replaced by a path that is based on
-# the source path which has been given in the configuration file
-# 
-# 4303 2019-11-25 08:55:18Z raasch
-# Abort if temporary working catalog cannot be created
-# 
-# 3982 2019-05-16 11:07:31Z raasch
-# bugfix: -b is not added in automatically generated batch jobs for remote hosts
-# 
-# 3917 2019-04-18 11:46:37Z raasch
-# in case of batch jobs on remote machines, copying files from SOURCES_FOR_RUN folder has
-# been rearranged to avoid that input files with original names (e.g. ..._p3d) are copied
-# into the temporary working catalog
-# 
-# 3860 2019-04-04 06:23:27Z raasch
-# check added, that it is not allowed to set option -b if the configuration file has been setup
-# for running batch jobs on remote hosts,
-# local time added to terminal output before and after saving output files
-# 
-# 3725 2019-02-07 10:11:02Z raasch
-# error messages for failed restarts extended
-# 
-# 3682 2019-01-18 17:01:54Z knoop
-# ssh-call for submitting batch jobs on remote systems modified again to avoid output
-# of login messages on specific systems
-# 
-# 3574 2018-11-28 13:14:39Z raasch
-# syntax-error in last commit fixed
-# 
-# 3573 2018-11-28 13:03:44Z raasch
-# bugfixes: don't check the .palm.iofiles in restart runs + wrong cd-command
-# removed,
-# r3570 reverted
-# 
-# 3570 2018-11-27 17:44:21Z kanani
-# Rename job-id by run_id
-# 
-# 3555 2018-11-22 13:50:37Z raasch
-# sed-command to remove repeated space-characters replaced by tr-command, to
-# guarantee mac compatible
-# 
-# 3549 2018-11-21 15:44:44Z raasch
-# ssh-call for submitting batch jobs on remote systems modified to avoid output
-# of login messages on specific systems
-# 
-# 3534 2018-11-19 15:35:16Z raasch
-# batch_scp for sending back the job protocol file is called via login-node if
-# a login-node has been set in the config-file
-# ssh-calls rearranged to avoid output of system/user-profile messages
-# 
-# 3505 2018-11-08 09:14:30Z raasch
-# job folders are created in case that they do not exist
-# 
-# 3455 2018-10-30 14:12:31Z raasch
-# options -h and -d renamed -c and -r, respectively
-# 
-# 3402 2018-10-23 11:49:24Z knoop
-# job_id is set for compatibility reasons with older versions of config files
-# 
-# 3313 2018-10-06 15:22:48Z knoop
-# more detailed error message for outdated fileconnection file
-# 
-# 3236 2018-09-10 09:07:06Z raasch
-# warning issued in case of file connection file version mismatch,
-# host_configuration renamed configuration_identifier,
-# "host identifier" in header output renamed "config. identifier",
-# jobname renamed run_identifier,
-# run_id renamed run_id_number
-# job_id renamed run_id
-# option -r renamed -i
-# 
-# 3151 2018-07-19 08:45:38Z raasch
-# removed additional listing of files to be compiled, print PALM code revision
-# in header
-# 
-# 3132 2018-07-16 11:44:58Z raasch
-# create consistent error messages in case of failed restarts,
-# check existence of remote job catalog
-# 
-# 3043 2018-05-25 10:47:54Z raasch
-# check for setting of fast_io_catalog
-# 
-# 3033 2018-05-23 15:26:19Z raasch
-# -T option not required for interactive runs (tasks per node =
-# total number of cores is assumed as default, if option is not given),
-# reformatting of a few messages,
-# bugfix: destination output directory is created if attribute "pe" is set in
-# .palm.iofiles
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# bugfix of r2990
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# bugfix: temporary SOURCES_FOR_RUN_CATALOG now created in base_directory and
-#         not in the working directory from where palmrun is called
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# svfout in the activation string will be replaced now by svfin in case of 
-# automatic restarts
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Introduction of new ENVIRONMENT variables read_svf and write_svf to consider
-# the possible output or input of sky view factors
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# "fname" renamed to "jobname"
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# parameters are allowed in output commands (OC:)
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# bugfix: exit if no queue has been given neither with option -q nor in the
-# configuration file 
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# file connection file from trunk/SCRIPTS is taken by default
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-# 
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2693 2017-12-13 12:33:49Z raasch
-# replacement of variables given by {{<variable>}} in configuration file is now
-# done in a more general way, variable names are written in small letters
-# 
-# 2670 2017-12-06 16:32:19Z raasch
-# test printouts removed
-# 
-# 2669 2017-12-06 16:03:27Z raasch
-# file attributes in .palm.iofiles restructured, "loc" attribute completely
-# removed,
-# wildcard (*) allowed in .palm.iofiles as file activation string for output
-# files,
-# informative messages in case of missing optional input files shortened
-# bugfix: variable cycle explicitly interpreted with 10 as the number base
-# 
-# 2638 2017-11-23 12:44:23Z raasch
-# use of wildcards in file connection statements enabled
-# 
-# 2605 2017-11-09 15:31:46Z raasch
-# in case of remote jobs, input files with "job" or "jobopt" (new) attribute
-# will not be sent with the job file any more, but copied into the
-# SOURCES_FOR_RUN... folder on the remote host, before the job is submitted
-# 
-# 2600 2017-11-01 14:11:20Z raasch
-# cycle numbers are made three digits wide
-# 
-# 2566 2017-10-20 08:50:47Z raasch
-# execute command for combine_plot_fields added
-# "TEMPDIR" renamed "tempdir"
-# temporary working directory for local batch jobs is created immediately within
-# the user's palmrun call, due to a requirement of the "grid engine" batch
-# system, where the working directory is given with batch directive -wd and must
-# already exist when the job is submitted,
-# informative messages in non-trace mode reduced and partly reformatted
-# 
-# 2551 2017-10-18 07:25:11Z raasch
-# TEMPDIR added as replacement string to be used in batch directives
-# 
-# 2512 2017-10-04 08:26:59Z raasch
-# bugfix for determining cycle numbers of NetCDF input files
-# 
-# 2506 2017-09-29 08:30:37Z raasch
-# option -V added to check for an existing SOURCES_FOR_RUN_... folder
-# host configuration added to SOURCES_FOR_RUN_... folder name
-# host_identifier renamed host_configuration
-# option -W added to allow for job dependencies
-# 
-# 2501 2017-09-26 11:41:55Z raasch
-# default value for number of cores (option -X) set to 1
-# bugfix for mechanism which overwrites configuration file settings with values
-# provided by palmrun options
-# 
-# 2499 2017-09-22 16:47:58Z kanani
-# option -h named configuration identifier
-# 
-# 2480 2017-09-19 06:24:14Z maronga
-# bugfix for last revision
-# 
-# 2479 2017-09-19 06:12:16Z raasch
-# option -A (project account number) added
-# 
-# 2422 2017-09-08 08:25:41Z raasch
-# initial revision
-# 
-#--------------------------------------------------------------------------------#
-# palmrun - script for running PALM jobs on local and remote hosts
-#--------------------------------------------------------------------------------#
-
-
- 
-    # DECLARATION OF VARIABLES AND THEIR DEFAULT VALUES
-
- set +o allexport    # SUPPRESS EXPORT OF ALL VARIABLES, SINCE IN THE PAST THIS
-                     # LEAD TO PROBLEMS IN ROUTINES CALLED BY PALMRUN
-                     # (TOO MANY ARGUMENTS - PROBLEM)
- set +o noclobber    # EXISTING FILES ARE ALLOWED TO BE OVERWRITTEN
-
- typeset -i  ibd=0 ibdt=0 iec=0 iic=0 iin=0 ioc=0 iout=0 nr_of_input_files=0
- typeset -i  nr_of_output_files=0
- typeset -x -i  memory=0   # HAS TO BE EXPORTED HERE, OTHERWISE AN UNKNOWN SIDE
-                           # SIDE EFFECT MAY CAUSE DATA LOSS WHEN GETOPTS IS READING THE
-                           # SCRIPT-OPTION ARGUMENTS
- typeset -i  cores cputime cpu_hours cpu_minutes cpu_seconds i ii iia iii iio
- typeset -i  icycle inode ival maxcycle mpi_tasks
- typeset -i  nodes remaining_cores run_number tasks_per_node threads_per_task
-
- activation_string_list=""
- AddFilenames=""
- combine_plot_fields=true
- compiler_name=""
- compiler_name_ser=""
- compiler_options=""
- configuration_identifier="default"
- cores=1
- cores_atmos=0
- cores_ocean=0
- coupled_dist=""
- cpp_options=""
- cpumax=0
- create_batch_job=false
- create_jobfile_only=false
- create_remote_batch_job=false
- dashes="  ----------------------------------------------------------------------------"
- defaultqueue=""
- delete_temporary_catalog=true
- do_compile=true
- do_trace=false
- executable=""
- execute_command=""
- execution_error=false
- fileconnection_file=""
- global_revision=""
- hostfile=""
- hp=""
- keep_data_from_previous_run=false
- link_local_input=false
- link_local_output=false
- linker_options=""
- local_jobcatalog=""
- locat=normal
- makefile=""
- max_par_io_str=""
- prc=$0
- while [[ $(echo $prc | grep -c "/") != 0 ]]
- do
-    prc=`echo $prc | cut -f2- -d"/"`
- done
- module_calls=""
- palmrun_memory=""
- palmrun_script_name=$prc
- openmp=false
- previous_job=""
- project_account=""
- queue=none
- read_svf=""
- restart_run=false
- return_address=""
- remote_jobcatalog=""
- remote_username=""
- running_in_batch_mode=false
- running_in_test_mode=false
- run_coupled_model=false
- run_id=""
- run_id_number=""
- run_identifier=test
- silent=false
- source_list=""
- source_path=""
- tasks_per_node=0
- threads_per_task=1
- transfer_problems=false
- user_source_path=""
- use_existing_sources_folder=""
- use_openmp=false
- version="palmrun  1.0 Rev$Rev$"
- working_directory=`pwd`
- write_binary=""
- write_svf=""
-
-
-    # ERROR HANDLING IN CASE OF EXIT
- trap 'if [[ $locat != normal  &&  $locat != control_c ]]
-       then
-
-              # CARRY OUT ERROR-COMMANDS GIVEN IN THE CONFIGURATION FILE (EC:)
-          (( i = 0 ))
-          while (( i < iec ))
-          do
-             (( i = i + 1 ))
-             printf "\n  *** Execution of ERROR-command:\n"
-             printf "  >>> ${err_command[$i]}\n"
-             eval  ${err_command[$i]}
-          done
-          [[ $delete_temporary_catalog = true ]]  &&  (cd; rm -rf $tempdir)
-          printf "\n\n+++ palmrun crashed \n\n"
-          exit 1
-       elif [[ $locat != normal ]]
-       then
-          [[ $delete_temporary_catalog = true ]]  &&  (cd; rm -rf $tempdir)
-          printf "\n+++ palmrun killed by \"^C\" \n\n"
-          exit 2
-       else
-          printf "\n --> palmrun finished\n\n"
-          exit 0
-       fi' exit
-
-
-    # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C):
- trap 'locat=control_c
-       exit 1
-      ' 2
-
-
-    # READ SHELLSCRIPT-OPTIONS AND REBUILD THE PALMRUN-COMMAND STRING (prc),
-    # WHICH WILL BE USED TO START RESTART-JOBS
- while  getopts  :a:A:bBc:CFG:i:jkm:M:O:q:r:R:s:t:T:u:U:vVw:W:xX:yY:zZ option
- do
-   case  $option  in
-       (a)   activation_string_list=$OPTARG; prc="$prc -a'$OPTARG'";;
-       (A)   project_account=$OPTARG; prc="$prc -A'$OPTARG'";;
-       (b)   create_batch_job=true; prc="$prc -b";;
-       (B)   delete_temporary_catalog=false; prc="$prc -B";;
-       (c)   configuration_identifier=$OPTARG; prc="$prc -c$OPTARG";;
-       (C)   restart_run=true; prc="$prc -C";;
-       (F)   create_jobfile_only=true;;
-       (G)   global_revision=$OPTARG; prc="$prc -G'$OPTARG'";;
-       (i)   run_id_number=$OPTARG;;
-       (j)   running_in_batch_mode=true;;
-       (k)   keep_data_from_previous_run=true; prc="$prc -k";;
-       (m)   palmrun_memory=$OPTARG; prc="$prc -m$OPTARG";;
-       (M)   makefile=$OPTARG; prc="$prc -M$OPTARG";;
-       (O)   use_openmp=true; threads_per_task=$OPTARG; prc="$prc -O$OPTARG";;
-       (q)   queue=$OPTARG; prc="$prc -q$OPTARG";;
-       (r)   run_identifier=$OPTARG; prc="$prc -r$OPTARG";;
-       (R)   return_address=$OPTARG;;
-       (s)   source_list=$OPTARG;;
-       (t)   palmrun_cpumax=$OPTARG; prc="$prc -t$OPTARG";;
-       (T)   palmrun_tasks_per_node=$OPTARG; prc="$prc -T$OPTARG";;
-       (u)   remote_username=$OPTARG; prc="$prc -u$OPTARG";;
-       (U)   return_username=$OPTARG; prc="$prc -U$OPTARG";;
-       (v)   silent=true; prc="$prc -v";;
-       (V)   use_existing_sources_folder="-V";;
-       (w)   max_par_io_str=$OPTARG; prc="$prc -w$OPTARG";;
-       (W)   previous_job=$OPTARG;;
-       (x)   do_trace=true;set -x; prc="$prc -x";;
-       (X)   palmrun_cores=$OPTARG; prc="$prc -X$OPTARG";;
-       (y)   ocean_file_appendix=true; prc="$prc -y";;
-       (Y)   run_coupled_model=true; coupled_dist=$OPTARG; prc="$prc -Y'$OPTARG'";;
-       (z)   running_in_test_mode=true;;
-       (Z)   combine_plot_fields=false; prc="$prc -Z";;
-       (\?)  printf "\n  +++ unknown option $OPTARG \n"
-             printf "\n  --> type \"$0 ?\" for available options \n"
-             locat=parameter;exit;;
-   esac
- done
-
-
-    # SKIP GIVEN OPTIONS TO READ POSITIONAL PARAMETER, IF GIVEN
-    # CURRENTLY ONLY PARAMETER ? (TO OUTPUT A SHORT COMMAND INFO) IS ALLOWED
- (( to_shift = $OPTIND - 1 ))
- shift $to_shift
-
-    # PRINT SHORT DESCRIPTION OF PALMRUN OPTIONS
- if [[ "$1" = "?" ]]
- then
-   (printf "\n  *** Description of available palmrun options:\n"
-    printf "\n      Option  Description                              Default-Value"
-    printf "\n        -a    activation string list                   \"\" "
-    printf "\n        -A    project account number                   ---"
-    printf "\n        -b    batch-job on local machine               ---"
-    printf "\n        -B    do not delete temporary directory at end ---"
-    printf "\n        -c    configuration identifier                 \"default\" "
-    printf "\n        -F    create batch job file only               ---"
-    printf "\n        -k    keep data from previous run"
-    printf "\n        -m    memory demand in MB (batch-jobs)         0 MB"
-    printf "\n        -M    Makefile name                            Makefile"
-    printf "\n        -O    threads per openMP task                  ---"
-    printf "\n        -q    queue                                    \"$queue\" "
-    printf "\n        -r    run identifier                           test"
-    printf "\n        -s    filenames of routines to be compiled     \"\" "
-    printf "\n              must end with .f, .f90, .F, or .c !"
-    printf "\n              use \"..\" for more than one file and wildcards"
-    printf "\n              -s LM compiles all locally modified files"
-    printf "\n        -t    allowed cpu-time in seconds (batch)      0"
-    printf "\n        -T    tasks per node                           ---"
-    printf "\n        -u    username on remote machine               \"\" "
-    printf "\n        -v    no prompt for confirmation               ---"
-    printf "\n        -V    check if SOURCES_FOR_RUN_... exists      ---"
-    printf "\n        -w    maximum parallel io streams              as given by -X"
-    printf "\n        -W    name of job to wait for                  ---"
-    printf "\n        -x    tracing of palmrun for debug purposes    ---"
-    printf "\n        -X    # of processors (on parallel machines)   1"
-    printf "\n        -y    add appendix \"_O\" to all local output"
-    printf "\n              files (ocean precursor runs followed by"
-    printf "\n              coupled atmosphere-ocean runs)           ---"
-    printf "\n        -Y    run coupled model, \"#1 #2\" with" 
-    printf "\n              #1 atmosphere and #2 ocean processors    \"#/2 #/2\" depending on -X"
-    printf "\n        -Z    skip combine_plot_fields at the end of      "
-    printf "\n              the simulation                           ---"
-    printf "\n "
-    printf "\n      Possible values of positional parameter <modus>:"
-    printf "\n        \"?\"       -  this outline \n\n") | more
-    exit
- elif [[ "$1" != "" ]]
- then
-    printf "\n  +++ positional parameter $1 unknown \n"
-    locat=parameter; exit
- fi
-
-
-
-    # SHORT STARTING MESSAGE
- printf "\n*** $version "
- printf "\n    will be executed.     Please wait ..."
-
-
-    # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME
- config_file=.palm.config.$configuration_identifier
- sources_for_run_catalog=SOURCES_FOR_RUN_${configuration_identifier}_$run_identifier
-
-
-    # CHECK, IF CONFIGURATION FILE EXISTS
- if [[ ! -f $config_file ]]
- then
-    printf "\n\n  +++ configuration file: "
-    printf "\n           $config_file"
-    printf "\n      does not exist"
-    locat=connect; exit  
- fi
-
-
-    # CHECK, IF THE ACTIVATION_STRING_LIST HAS BEEN GIVEN
- if [[ "$activation_string_list" = "" ]]
- then
-    printf "\n\n  +++ no activation string list given: "
-    printf "\n        please set palmrun option \"-a\" "
-    locat=palmrun_option; exit  
- fi
-
-
-    # SET VARIABLE TO ACTIVATE PALM BINARY OUTPUT FOR RESTARTS
- if [[ $(echo $activation_string_list | grep -c "restart") != 0 ]]
- then
-    write_binary=true
- else
-    write_binary=false
- fi
-
-    # SET VARIABLE TO ACTIVATE WRITING OF SVF DATA
- if [[ $(echo $activation_string_list | grep -c "svfout") != 0 ]]
- then
-    write_svf=true
- else
-    write_svf=false
- fi
-
-    # SET VARIABLE TO ACTIVATE READING OF SVF DATA 
- if [[ $(echo $activation_string_list | grep -c "svfin") != 0 ]]
- then
-    read_svf=true
- else
-    read_svf=false
- fi
-
-
-    # READ AND EVALUATE THE CONFIGURATION-FILE
- [[ $silent = false ]]  &&  printf "\n\n    Reading the configuration file... "
-
-    # READ VARIABLE SETTINGS FROM CONFIG FILE LINE BY LINE
- while  read line
- do
-
-       # FIRST REPLACE ENVIRONMENT-VARIABLES BY THEIR RESPECTIVE VALUES
-    eval  line=\"$line\"
-
-
-       # INTERPRET THE LINE
-    if [[ "$(echo $line)" = "" ]]
-    then
-
-          # EMPTY LINE, NO ACTION
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "#" ]]
-    then
-
-          # LINE IS A COMMENT LINE
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "%" ]]
-    then
-
-          # LINE DEFINES AN ENVIRONMENT-VARIABLE
-       var=`echo $line | cut -d" " -s -f1 | cut -c2-`
-       value=`echo $line | cut -d" " -s -f2-`
-
-
-          # VALUE FROM THE CONFIGURATION-FILE IS ASSIGNED TO THE
-          # ENVIRONMENT-VARIABLE, BUT ONLY IF NO VALUE HAS BEEN ALREADY
-          # ASSIGNED WITHIN THIS SCRIPT (E.G. BY SCRIPT-OPTIONS).
-          # NON-ASSIGNED VARIABLES HAVE VALUE "" OR 0 (IN CASE OF INTEGER).
-          # HENCE THE GENERAL RULE IS: SCRIPT-OPTION OVERWRITES THE
-          # CONFIGURATION-FILE.
-       if [[ "$(eval echo \$$var)" = ""  ||  "$(eval echo \$$var)" = "0" ]]
-       then
-          eval  export  $var="\$value"
-
-             # TERMINAL OUTPUT OF ENVIRONMENT-VARIABLES, IF TRACEBACK IS SWITCHED on
-          if [[ $do_trace = true ]]
-          then
-             printf "\n*** ENVIRONMENT-VARIABLE $var = $value"
-          fi
-       fi
-
-    elif [[ "$(echo $line | cut -c1-3)" = "BD:" ]]
-    then
-
-          # LINE DEFINES BATCH-DIRECTIVE
-       (( ibd = ibd + 1 ))
-       line=$(echo $line | cut -c4-)
-       batch_directive[$ibd]="$line"
-
-    elif [[ "$(echo $line | cut -c1-4)" = "BDT:" ]]
-    then
-
-          # LINE DEFINES BATCH-DIRECTIVE FOR SENDING BACK THE JOBFILE FROM A
-          # REMOTE TO A LOCAL HOST
-       (( ibdt = ibdt + 1 ))
-       line=$(echo $line | cut -c5-)
-       batch_directive_transfer[$ibdt]="$line"
-
-    elif [[ "$(echo $line | cut -c1-3)" = "EC:" ]]
-    then
-
-          # LINE DEFINES ERROR-COMMAND
-       (( iec = iec + 1 ))
-       line=$(echo $line | cut -c4-)
-       err_command[$iec]="$line"
-
-    elif [[ "$(echo $line | cut -c1-3)" = "IC:" ]]
-    then
-
-          # LINE DEFINES INPUT-COMMAND
-       (( iic = iic + 1 ))
-       line=$(echo $line | cut -c4-)
-       in_command[$iic]="$line"
-
-    elif [[ "$(echo $line | cut -c1-3)" = "OC:" ]]
-    then
-
-          # LINE DEFINES OUTPUT-COMMAND
-       (( ioc = ioc + 1 ))
-       line=$(echo $line | cut -c4-)
-       out_command[$ioc]="$line"
-
-    else
-
-          # SKIP ALL OTHER LINES
-       continue
-
-    fi
-
- done < $config_file
-
-
-    # CHECK SETTING OF REQUIRED PARAMETERS
- if [[ "$fast_io_catalog" = "" ]]
- then
-    printf "\n\n  +++ no fast_io_catalog found in $config_file"
-    printf "\n      Please add line \"fast_io_catalog ...\" to that file."
-    locat=config_file; exit
- fi
- if [[ "$compiler_name" = "" ]]
- then
-    printf "\n\n  +++ no compiler name found in $config_file"
-    printf "\n      Please add line \"compiler_name ...\" to that file."
-    locat=config_file; exit
- fi
- if [[ "$compiler_name_ser" = "" ]]
- then
-    printf "\n\n  +++ no compiler name for non-paralle compilation found in $config_file"
-    printf "\n      Please add line \"compiler_name_ser ...\" to that file."
-    locat=config_file; exit
- fi
- if [[ "$compiler_options" = "" ]]
- then
-    printf "\n\n  +++ no compiler options found in $config_file"
-    printf "\n      Please add line \"compiler_options ...\" to that file."
-    locat=config_file; exit
- fi
- if [[ "$execute_command" = "" ]]
- then
-    printf "\n\n  +++ no execute command found in $config_file"
-    printf "\n      Please add line \"execute_command ...\" to that file."
-    locat=config_file; exit
- fi
-
- if [[ "$hostfile" != "" ]]
- then
-    if [[ $hostfile != auto  &&  ! -f $hostfile ]]
-    then
-       printf "\n\n  +++ no hostfile \"$hostfile\" found"
-       printf "\n      Please check line \"hostfile ...\" in $config_file"
-       locat=config_file; exit    
-    fi
- fi
-
-
-    # DETERMINE THE CALL STATUS
- if [[ "$return_address" != "" ]]
- then
- 
-       # I AM RUNNING ON A REMOTE HOST, WHICH ALSO MEANS THAT I AM RUNNING IN
-       # BATCH MODE AND ...
-    running_on_remote=true
- 
- else
-
-       # I HAVE BEEN CALLED INTERACTIVELY ON THIS HOST
-     if [[ "$remote_ip" != "" ]]
-     then
-
-           # I HAVE TO CREATE A BATCH JOB TO RUN PALM ON THE REMOTE HOST
-        create_remote_batch_job=true
-
-           # CHECK THAT THE REMOTE JOBCATALOG HAS BEEN SET
-        if [[ "$remote_jobcatalog" = "" ]]
-        then
-           printf "\n\n  +++ no remote jobcatalog found in $config_file"
-           printf "\n      Please add line \"remote_jobcatalog ...\" to that file."
-           locat=config_file; exit
-        fi
-
-           # CHECK THAT OPTION -b (SUBMITTING BATCH JOB ON LOCAL HOST) HASN'T BEEN SET 
-        if [[ $create_batch_job = true ]]
-        then
-           printf "\n\n  +++ option -b must not be set because configuration file has been setup"
-           printf "\n      for running jobs on a remote host"
-           locat=config_file; exit
-        fi
-
-           # CHECK IF A REMOTE USER NAME HAS BEEN SET
-        if [[ "$remote_username" = "" ]]
-        then
-           printf "\n\n  +++ no remote_username has been set in the configuration file"
-           printf "\n"
-           locat=config_file; exit
-        fi
-     fi
-     running_on_remote=false
- fi
-
-
-           # CHECK IF A REMOTE USER NAME HAS BEEN SET
- if [[ $create_batch_job = true  &&  "$local_username" = "" ]]
- then
-    printf "\n\n  +++ no local_username has been set in the configuration file"
-    printf "\n"
-    locat=config_file; exit
- fi
-
-    # SET THE DEFAULT FILE CONNECTION FILE (WHICH IS IN THE REPOSITORY)
- fileconnection_file=${source_path}/../SCRIPTS/.palm.iofiles
-
-    # CHECK, IF USER PROVIDES OWN FILE CONNECTION FILE
- if [[ -f .palm.iofiles ]]
- then
-
-       # CHECK VERSION MISMATCH
-       # RESTART RUNS DON'T REQUIRE A CHECK, BECAUSE THEY USE A COPY OF THAT
-       # FILE WHICH HAS ALREADY BEEN CHECKED WITHIN THE INITAL PALMRUN CALL
-    if [[ $running_in_batch_mode != true  &&  $restart_run != true ]]
-    then
-       if [[ $(head -n1 $fileconnection_file) != $(head -n1 .palm.iofiles) ]]
-       then
-          printf "\n\n  +++ WARNING: A file connection file has been found in your"
-          printf "\n               working directory, but its revision does not match"
-          printf "\n               the revision of the default (trunk) version."
-          printf "\n               You may need to update your connection file"
-          printf "\n               \"${working_directory}/.palm.iofiles\" !"
-       fi
-    fi
-
-    fileconnection_file=.palm.iofiles
-
- fi
-
-
-    # CHECK, IF FILE CONNECTION FILE EXISTS
- if [[ ! -f $fileconnection_file ]]
- then
-    printf "\n\n  +++ file connection file: "
-    printf "\n           $fileconnection_file"
-    printf "\n      does not exist"
-    locat=connect; exit  
- fi
-
-
-    # READ AND EVALUATE THE I/O-FILE LIST
- [[ $silent = false ]]  &&  printf "\n    Reading the I/O files... "
-
-    # READ THE FILE CONNECTION FILE LINE BY LINE
- while  read line
- do
-
-       # REPLACE REPEATING SPACES BETWEEN THE COLUMNS BY A SINGLE SPACE
-       # HERE, TR IS USED INSTEAD OF SED TO GUARANTEE MAC COMPATIBILITY
-    line=`echo "$line" | tr -s " "`
-
-       # INTERPRET THE LINE
-    if [[ "$(echo $line)" = "" ]]
-    then
-          # EMPTY LINE, NO ACTION
-       continue
-
-    elif [[ "$(echo $line | cut -c1)"  =  "#" ]]
-    then
-
-          # LINE IS A COMMENT LINE
-       true
-
-    else
-
-          # LINE DEFINES FILE CONNECTION. READ THE FILE ATTRIBUTES.
-          # s2a: in/out - field
-          # s2b: action - field (optional)
-       s1=`echo "$line" | cut -d" " -f1`
-       s2=`echo "$line" | cut -d" " -s -f2`
-       if [[ $(echo $s2 | grep -c ":") = 0 ]]
-       then
-          s2a=$s2
-          s2b=""
-       else
-          s2a=`echo $s2 | cut -d":" -f1`
-          s2b=`echo $s2 | cut -d":" -f2`
-       fi
-       s3=`echo "$line" | cut -d" " -f3 | sed 's/*/wildcard /g'`
-       s4=`echo "$line" | cut -d" " -s -f4`
-       eval s4=\"$s4\"    # REPLACE ENVIRONMENT-VARIABLES IN PATH BY THEIR RESPECTIVE VALUES
-       s5=`echo "$line" | cut -d" " -s -f5`
-       s6=`echo "$line" | cut -d" " -s -f6`
-
-       
-          # STORE FILE CONNECTION, IF ACTIVATED BY ACTIVATION-STRING FROM
-          # INPUT- OR OUTPUT-LIST.
-          # VARIABLE S3 MAY CONTAIN A LIST OF ACTIVATION STRINGS (FIELD-SEPERATOR ":").
-          # IF EXECUTION IS SCHEDULED FOR A REMOTE-MACHINE AND THE FILE IS ONLY
-          # LOCALLY REQUIRED ON THAT MACHINE (I.E. s2b != tr), THE FILE CONNECTION
-          # IS NOT CHECKED AND STORED.
-       IFSALT="$IFS"; IFS="$IFS:"      # ADD ":" AS FIELD SEPARATOR
-       if [[ ( "$s2a" = in  || "$s2a" = inopt )  &&  ! ( $create_remote_batch_job = true  &&  "$s2b" != tr ) ]]
-       then
-          found=false
-          for  actual  in  $activation_string_list
-          do
-             for  formal  in  $s3
-             do
-                [[ $actual = $formal  ||  "$formal" = "-" ]]  &&  found=true
-             done
-          done
-          if [[ $found = true ]]
-          then
-             (( iin = iin + 1 ))
-             localin_pre[$iin]=$s1; actionin_pre[$iin]=$s2b;
-             pathin_pre[$iin]=$s4; endin_pre[$iin]=$s5; extin_pre[$iin]=$s6
-             if [[ "$s2a" = inopt ]]
-             then
-                optin_pre[$iin]=yes
-             else
-                optin_pre[$iin]=no
-             fi 
-
-                # FILES WITH JOB-ATTRIBUTE ARE STORED IN THE SOURCES_FOR_RUN
-                # FOLDER IF THE JOB IS RUNNING ON A REMOTE HOST
-             if [[ $running_on_remote = true  &&  "$s2b" = tr ]]
-             then
-                pathin_pre[$iin]=${fast_io_catalog}/${sources_for_run_catalog}
-             fi
-
-                # CHECK FOR MULTIPLE FILES, SET A RESPECTIVE FLAG AND REMOVE
-                # THE WILDCARD FROM THE ENDING
-             if [[ "${s5: -1}" = "*" ]]
-             then
-                if [[ "$s2b" = "di" ]]
-                then
-                   printf "\n    +++ wildcards (*) not allowed with \"di\" file attribute."
-                   printf "\n        see file \"$fileconnection_file\", line"
-                   printf "\n$line"
-                   locat=iofiles_file; exit
-                fi
-                multin[$iin]=true
-                string=${endin_pre[$iin]}
-                endin_pre[$iin]="${string%?}"
-             else
-                multin[$iin]=false
-             fi
-          fi
-       elif [[ "$s2a" = out  &&  ! ( $create_remote_batch_job = true ) ]]
-       then
-          found=false
-          for  actual  in  $activation_string_list
-          do
-             for  formal  in  $s3  
-             do
-                [[ $actual = $formal  ||  $formal = wildcard  ]]  &&  found=true
-             done
-          done
-          if [[ $found = true ]]
-          then
-             (( iout = iout + 1 ))
-             localout_pre[$iout]=$s1; actionout_pre[$iout]=$s2b
-             pathout_pre[$iout]=$s4; endout_pre[$iout]=$s5; extout_pre[$iout]=$s6
-
-                # CHECK IF WILDCARD IS USED AS ACTIVATION STRING
-                # IN SUCH CASES, NO WARNING WILL LATER BE OUTPUT IF LOCAL FILES DO NOT EXIST
-             if [[ $formal = wildcard  ]]
-             then
-                warnout_pre[$iout]=false
-             else
-                warnout_pre[$iout]=true
-             fi
-
-                # CHECK FOR MULTIPLE FILES, SET A RESPECTIVE FLAG AND REMOVE
-                # THE WILDCARD FROM THE LOCAL FILENAME
-             if [[ "${s1: -1}" = "*" ]]
-             then
-                if [[ "$s2b" = "di" ]]
-                then
-                   printf "\n    +++ wildcards (*) not allowed with \"di\" file attribute."
-                   printf "\n        see file \"$fileconnection_file\", line"
-                   printf "\n$line"
-                   locat=iofiles_file; exit
-                fi
-                multout[$iout]=true
-                string=${localout_pre[$iout]}
-                localout_pre[$iout]="${string%?}"
-             else
-                multout[$iout]=false
-             fi
-          fi
-       elif [[ "$s2a" != in  &&  "$s2a" != inopt  &&  "$s2a" != out ]]
-       then
-          printf "\n  +++ I/O-attribute in file $fileconnection_file has invalid"
-          printf "\n      value \"$s2\". Only \"in\", \"inopt\", and \"out\" are allowed!"
-          locat=connect; exit
-       fi
-       IFS="$IFSALT"
-    fi
-
- done < $fileconnection_file
-
-
-
-    # VALUES OF PALMRUN-OPTIONS OVERWRITE THOSE FROM THE CONFIGURATION-FILE
- [[ "$palmrun_memory" != "" ]]  &&  memory=$palmrun_memory
- [[ "$palmrun_cpumax" != "" ]]  &&  cpumax=$palmrun_cpumax
- [[ "$palmrun_cores"  != "" ]]  &&  cores=$palmrun_cores
- [[ "$max_par_io_str" != "" ]]  &&  maximum_parallel_io_streams=$max_par_io_str
- [[ "$palmrun_tasks_per_node" != "" ]]  &&  tasks_per_node=$palmrun_tasks_per_node
-
-
-
-      # EVALUATE MODEL COUPLING FEATURES (OPTION -Y)
- if [[ $run_coupled_model = true ]] 
- then
-
-    cores_atmos=`echo $coupled_dist | cut -d" " -s -f1`
-    cores_ocean=`echo $coupled_dist | cut -d" " -s -f2`
-
-    if (( $cores_ocean + $cores_atmos != $cores ))
-    then
-
-       printf "\n  +++ number of processors does not fit to specification by \"-Y\"."
-       printf "\n      PEs (total)     : $cores"
-       printf "\n      PEs (atmosphere): $cores_atmos"
-       printf "\n      PEs (ocean)     : $cores_ocean"
-       locat=coupling; exit
-
-    fi
-
- fi
-
-
-    # IF I AM IN BATCH MODE, CHECK IF EXECUTABLE AND OTHER REQUIRED FILES
-    # HAVE BEEN GENERATED BY PALMBUILD AND STORED IN THE SOURCES_FOR_RUN_...
-    # FOLDER
- if [[ $running_in_batch_mode = true ]]
- then
- 
-    if [[ ! -d ${fast_io_catalog}/${sources_for_run_catalog} ]]
-    then
-       printf "\n  +++ directory ${fast_io_catalog}/${sources_for_run_catalog} is missing"
-       printf "\n      Please check the output of the palmrun-call"
-       printf "\n      that you did on your local host."
-       locat=SOURCES_FOR_RUN; exit
-    fi
-
- else
-
-       # CREATE THE SOURCES_FOR_RUN_... FOLDER, BUT NOT IF I AM PART OF AN
-       # AUTOMATIC RESTART RUN
-       # AUTOMATIC RESTART RUNS JUST ACCESS THE DIRECTORY CREATED BY THE INITIAL RUN
-    if [[ $restart_run = false ]]
-    then
-
-          # COLLECT FILES TO BE COMPILED IN THE SOURCES_FOR_RUN_... FOLDER ON
-          # THE LOCAL HOST
-       if [[ ! -d $source_path ]]
-       then
-          printf "\n\n  +++ source path \"$source_path\" on local host"
-          printf "\n      \"$(hostname)\" does not exist"
-          locat=source_path; exit
-       fi
-
-       rm -rf   ${base_directory}/${sources_for_run_catalog}
-       mkdir -p ${base_directory}/${sources_for_run_catalog}
-
-       if [[ "$source_list" = LM ]]
-       then
-
-             # DETERMINE MODIFIED FILES OF THE SVN WORKING COPY
-          source_list=""
-          cd  $source_path
-
-
-             # CHECK, IF TRUNK-DIRECTORY IS UNDER SVN CONTROL
-          if [[ ! -d ../.svn ]]
-          then
-             printf "\n\n  +++ source directory"
-             printf "\n         \"$source_path\" "
-             printf "\n         is not under control of \"subversion\"."
-             printf "\n         Please do not use palmrun-option \"-s LM\"\n"
-          fi
-
-
-             # LIST ALL MODIFIED SOURCE CODE FILES
-          Filenames=""
-          svn status  >  tmp_svnstatus
-          while  read line
-          do
-             firstc=`echo $line | cut -c1`
-             if [[ $firstc = M  ||  $firstc = "?" ]]
-             then
-                Name=`echo "$line" | cut -c8-`
-                extension=`echo $Name | cut -d. -f2`
-                if [[ "$extension" = f90 || "$extension" = F90 || "$extension" = f || "$extension" = F || "$extension" = c ]]
-                then
-                   Filenames="$Filenames "$Name
-                fi
-             fi
-          done < tmp_svnstatus
-          rm -rf  tmp_svnstatus
-
-
-             # COPY FILES TO SOURCES_FOR_RUN_...
-          for  filename  in  $Filenames
-          do
-             cp  $filename  ${base_directory}/${sources_for_run_catalog}
-             source_list=$source_list"$filename "
-          done
-
-          cd -  > /dev/null
-
-
-          # COPY FILES GIVEN BY OPTION -s TO DIRECTORY SOURCES_FOR_RUN_...
-       elif [[ "$source_list" != "" ]]
-       then
-
-          cd  $source_path
-
-          for  filename  in  $source_list
-          do
-
-                # SOURCE CODE FILE IS NOT ALLOWED TO INCLUDE PATH
-             if [[ $(echo $filename | grep -c "/") != 0 ]]
-             then
-                printf "\n  +++ source code file:  $filename"
-                printf "\n      must not contain (\"/\") "
-                locat=source; exit
-             fi
-
-             if [[ ! -f $filename ]]
-             then
-                printf "\n  +++ source code file:  $filename"
-                printf "\n      does not exist"
-                locat=source; exit
-             else
-                cp  $filename  ${base_directory}/${sources_for_run_catalog}
-             fi
-
-          done
-
-          cd -  > /dev/null
-
-       fi
-
-          # CHECK, IF MAKEFILE EXISTS AND COPY IT TO THE SOURCES_FOR_RUN... DIRECTORY
-       [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
-       if [[ ! -f $makefile ]]
-       then
-          printf "\n  +++ file \"$makefile\" does not exist"
-          locat=make; exit
-       else
-          cp  $makefile  ${base_directory}/${sources_for_run_catalog}/Makefile 
-       fi
-
-
-          # COPY FILES FROM OPTIONAL SOURCE PATH GIVEN IN THE CONFIGURATION FILE
-       if [[ "$user_source_path" != "" ]]
-       then
-
-             # DOES THE DIRECTORY EXIST?
-          if [[ ! -d $user_source_path ]]
-          then
-
-             printf "\n\n  *** INFORMATIVE: additional source code directory"
-             printf "\n      \"$user_source_path\" "
-             printf "\n      does not exist or is not a directory."
-             printf "\n      No source code will be used from this directory!\n"
-             user_source_path=""
-             if [[ $silent == false ]]
-             then
-                sleep 2
-             fi
-
-          else
-
-             cd $user_source_path
-
-             Names=$(ls -1 *.f90 2>&1)
-             [[ $(echo $Names | grep -c '*.f90') = 0 ]]  &&  AddFilenames="$Names"
-             Names=$(ls -1 *.F90 2>&1)
-             [[ $(echo $Names | grep -c '*.F90') = 0 ]]  &&  AddFilenames="$AddFilenames $Names"
-             Names=$(ls -1 *.F 2>&1)
-             [[ $(echo $Names | grep -c '*.F') = 0   ]]  &&  AddFilenames="$AddFilenames $Names"
-             Names=$(ls -1 *.f 2>&1)
-             [[ $(echo $Names | grep -c '*.f') = 0   ]]  &&  AddFilenames="$AddFilenames $Names"
-             Names=$(ls -1 *.c 2>&1)
-             [[ $(echo $Names | grep -c '*.c') = 0   ]]  &&  AddFilenames="$AddFilenames $Names"
-
-             cd -  > /dev/null
-             cd  ${base_directory}/${sources_for_run_catalog}
-
-                # COPY MAKEFILE IF EXISTING
-             if [[ -f $user_source_path/Makefile ]]
-             then
-                printf "\n\n  *** user Makefile from directory"
-                printf "\n      \"$user_source_path\" is used \n"
-                if [[ $silent == false ]]
-                then
-                   sleep 1
-                fi
-                cp  $user_source_path/Makefile  .
-             fi
-
-             for  filename  in  $AddFilenames
-             do
-                if [[ -f $filename ]]
-                then
-                   printf "\n  +++ source code file \"$filename\" found in additional"
-                   printf "\n      source code directory \"$user_source_path\" "
-                   printf "\n      but was also given with option \"-s\" which means that it should be taken"
-                   printf "\n      from directory \"$source_path\"."
-                   locat=source; exit
-                fi
-
-                cp  $user_source_path/$filename  .
-                source_list="$source_list $filename"
-
-                   # CHECK IF FILE IS CONTAINED IN MAKEFILE
-                if [[ $(grep -c $filename Makefile) = 0 ]]
-                then
-                   printf "\n\n  +++ user file \"$filename\" "
-                   printf "\n      is not listed in Makefile \n"
-                   locat=source; exit
-                fi
-             done
-             cd -  > /dev/null
-          fi
-       fi
-
-          # COPY CONFIGURATION FILES
-       cp  $config_file  ${base_directory}/${sources_for_run_catalog}
-       cp  $fileconnection_file  ${base_directory}/${sources_for_run_catalog}
-
-          # COPY SHELLSCRIPTS
-       cp  ${source_path}/../SCRIPTS/palmrun    ${base_directory}/${sources_for_run_catalog}
-       cp  ${source_path}/../SCRIPTS/batch_scp  ${base_directory}/${sources_for_run_catalog}
-
-    fi
-
- fi
-
-
-    # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY
-    # (HANDED OVER TO RESTART-RUNS USING OPTION -G)
- if [[ "$global_revision" = "" ]]
- then
-    global_revision=`svnversion $source_path  2>/dev/null`
-    global_revision="Rev: $global_revision"
- fi
-
-
-    # IN CASE OF PARALLEL EXECUTION, CHECK SOME SPECIFICATIONS CONCERNING PROCESSOR NUMBERS
- if [[ -n $cores ]]
- then
-
-       # CHECK, IF THE NUMBER OF CORES PER NODE HAS BEEN GIVEN UND IF IT IS AN
-       # INTEGRAL DIVISOR OF THE TOTAL NUMBER OF CORES GIVEN BY OPTION -X
-    if [[ $tasks_per_node = 0 ]]
-    then
-       if [[ $create_batch_job = true  ||  $create_remote_batch_job = true ]]
-       then
-          printf "\n"
-          printf "\n  +++ option \"-T\" (tasks per node) is missing"
-          printf "\n      set -T option or define tasks_per_node in the config file"
-          locat=tasks_per_node; (( iec = 0 )); exit
-       else
-             # DEFAULT FOR INTERACTIVE RUN
-          tasks_per_node=$cores
-       fi
-    fi
-
-    if (( cores < tasks_per_node ))
-    then
-       printf "\n"
-       printf "\n  +++ tasks per node (-T) cannot exceed total number of cores (-X)"
-       printf "\n      given values: -T $tasks_per_node  -X $cores"
-       locat=tasks_per_node; (( iec = 0 )); exit 
-    fi
-
-    (( nodes = cores / ( tasks_per_node * threads_per_task ) ))
-    (( mpi_tasks = cores / threads_per_task ))
-    [[ $mpi_tasks = 0 ]]  &&  (( mpi_tasks = 1 ))
-    (( ii = cores / tasks_per_node ))
-    (( remaining_cores =  cores - ii * tasks_per_node ))
-    if (( remaining_cores > 0 ))
-    then
-       printf "\n"
-       printf "\n  +++ WARNING: tasks per node (option \"-T\") is not an integral"
-       printf "\n      divisor of the total number of cores (option \"-X\")"
-       printf "\n      values of this palmrun-call: \"-T $tasks_per_node\" \"-X $cores\""
-       printf "\n      One of the nodes is filled with $remaining_cores instead of $tasks_per_node tasks"
-       (( nodes = nodes + 1 ))
-    fi
-
- fi
-
-
-    # SET DEFAULT VALUE FOR THE MAXIMUM NUMBER OF PARALLEL IO STREAMS
- if [[ "$maximum_parallel_io_streams" = "" ]]
- then
-    maximum_parallel_io_streams=$cores
- fi
-
-
-    # SET PORT NUMBER OPTION FOR CALLS OF SSH/SCP AND batch_scp SCRIPT
- if [[ "$scp_port" != "" ]]
- then
-    PORTOPT="-P $scp_port"
-    SSH_PORTOPT="-p $scp_port"
- fi
-
-
-    # DETERMINE THE SSH-OPTION IN CASE THAT AN SSH-KEY IS EXPLICITLY GIVEN IN THE
-    # CONFIG-FILE
- if [[ "$ssh_key" != "" ]]
- then
-    ssh_key="-i $HOME/.ssh/$ssh_key"
- fi
-
-
-    # SET QUEUE, IF NOT GIVEN
- if [[ $create_batch_job = true  ||  $create_remote_batch_job = true ]]
- then
-
-    if [[ $queue = none  &&  "$defaultqueue" = "" ]]
-    then
-       printf "\n"
-       printf "\n  +++ no default queue given in configuration file and no queue"
-       printf "\n      given with option -q"
-       locat=queue; exit
-    fi
-    if [[ $queue = none ]]
-    then
-       queue=$defaultqueue
-    fi
-
- fi
-
-
-    # GENERATE FULL FILENAMES OF INPUT-FILES, INCLUDING THEIR PATH
-    # CHECK, IF INPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST)
- (( i = 0 ))
- (( nr_of_input_files = 0 ))
- while (( i < iin ))
- do
-    (( i = i + 1 ))
-
-       # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE
-       # FILE IDENTIFIER IS NOT PART OF THE FILENAME))
-    if [[ "${actionin_pre[$i]}" = di ]]
-    then
-       eval filename=${pathin_pre[$i]}/${endin_pre[$i]}
-    else
-       eval filename=${pathin_pre[$i]}/${run_identifier}${endin_pre[$i]}
-    fi
-
-
-       # CHECK IF FILE EXISTS
-    if ! ls $filename* 1>/dev/null 2>&1
-    then
-
-          # FILES WITH ATTRIBUTE opt ARE OPTIONAL. NO ABORT, IF THEY DO NOT EXIST.
-       if [[ "${optin_pre[$i]}" != "yes" ]]
-       then
-          printf "\n\n  +++ INPUT-file: "
-          if [[ "${extin_pre[$i]}" = ""  ||  "${extin_pre[$i]}" = " " ]]
-          then
-             printf "\n           $filename"
-          else
-             printf "\n           $filename.${extin_pre[$i]}"
-          fi
-          printf "\n      does not exist\n"
-          locat=input; exit
-       else
-          (( nr_of_input_files = nr_of_input_files + 1 ))
-          localin[$nr_of_input_files]="${localin_pre[$i]}"
-          optin[$nr_of_input_files]="${optin_pre[$i]}"
-          actionin[$nr_of_input_files]="unavailable"
-          pathin[$nr_of_input_files]="${pathin_pre[$i]}"
-          endin[$nr_of_input_files]="${endin_pre[$i]}"
-          extin[$nr_of_input_files]="${extin_pre[$i]}"
-       fi
-
-    else
-
-          # FIRST CHECK FOR MULTIPLE NAMES WITH THE SAME BASENAME
-          # ($run_identifier) AND CREATE A LIST FOR THE DETECTED BASENAME
-          # ENDINGS
-       if [[ "${multin[$i]}" = true ]]
-       then
-             # DETERMINE THE EXISTING EXTENSIONS FROM THE LIST OF FILES
-          ls -1 -d ${filename}    >   filelist  2>/dev/null
-          ls -1 -d ${filename}.*  >>  filelist  2>/dev/null
-          ls -1 -d ${filename}_*  >>  filelist  2>/dev/null
-
-          endings=""
-          while  read line
-          do
-                 # filename without path (i.e. after the last "/")
-              basefilename=$(basename ${line})
-
-                 # check if there is an extension and remove it
-              ext=${basefilename##*.}
-              if [[ "$ext" = "${extin_pre[$i]}" ]]
-              then
-                 basefilename=${basefilename%.*}
-              fi
-
-                 # check for an existing cycle number and remove it
-              cycle=${basefilename##*.}
-              if [[ $cycle =~ ^-?[0-9]+$ ]]
-              then
-                 basefilename=${basefilename%.*}
-              fi
-
-                 # remove the run_identifier from the beginning
-              length_run_identifier=${#run_identifier}
-              ending=${basefilename:${length_run_identifier}}
-
-                 # remove the ending given in the .iofiles from the beginning
-              endingstring="${endin_pre[$i]}"
-              length_ending=${#endingstring}
-              ending=${ending:${length_ending}}
-
-              if [[ "$ending" = "" ]]
-              then
-                    # standard ending as given in the .iofiles
-                 if [[ $(echo $endings | grep -c DEFAULT) = 0 ]]
-                 then
-                    endings="$endings DEFAULT"
-                 fi
-              else
-                    # ending must start with "_", otherwise its a different file
-                 if [[ "${ending:0:1}" = "_" ]]
-                 then
-                    if [[ $(echo $endings | grep -c "$ending") = 0 ]]
-                    then
-                       endings="$endings $ending"
-                    fi
-                 fi
-              fi
- 
-          done <filelist
-
-          rm filelist
-
-       else
-
-             # SINGLE NAME
-          endings=DEFAULT
-
-       fi
-
-          # FOR EACH BASENAME ENDING CREATE AN ENTRY IN THE FINAL INPUT FILE LIST
-       for  ending  in  $endings
-       do
-
-             # DEFAULT MEANS THAT THE ENDING GIVEN IN .iofiles SHALL BE USED
-          if [[ $ending = DEFAULT ]]
-          then
-             ending=""
-          fi
-
-             # NEW ENTRY (ENDING IS ALSO ADDED TO LOCAL FILENAME READ BY PALM!)
-          (( nr_of_input_files = nr_of_input_files + 1 ))
-          localin[$nr_of_input_files]="${localin_pre[$i]}"$ending
-          optin[$nr_of_input_files]="${optin_pre[$i]}"
-          actionin[$nr_of_input_files]="${actionin_pre[$i]}"
-          pathin[$nr_of_input_files]="${pathin_pre[$i]}"
-          endin[$nr_of_input_files]="${endin_pre[$i]}"$ending
-          extin[$nr_of_input_files]="${extin_pre[$i]}"
-
-
-             # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE
-             # FILE IDENTIFIER IS NOT PART OF THE FILENAME))
-          if [[ "${actionin[$nr_of_input_files]}" = di ]]
-          then
-             eval filename=${pathin[$nr_of_input_files]}/${endin[$nr_of_input_files]}
-          else
-             eval filename=${pathin[$nr_of_input_files]}/${run_identifier}${endin[$nr_of_input_files]}
-          fi
-
-             # DETERMINE THE FILE'S CYCLE NUMBER
-          (( maxcycle = 0 ))
-          ls -1 -d $filename    >   filelist  2>/dev/null
-          ls -1 -d $filename.*  >>  filelist  2>/dev/null
-          while  read line
-          do
-                # filename without path (i.e. after the last "/")
-             basefilename=$(basename ${line})
-   
-                # check if there is an extension
-             extension=${basefilename##*.}
-             if [[ "$extension" = "${extin[$nr_of_input_files]}" ]]
-             then
-                basefilename=${basefilename%.*}
-             fi
-   
-                # check for an existing cycle number
-             cycle=${basefilename##*.}
-             if [[ $cycle =~ ^-?[0-9]+$ ]]
-             then
-                   # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS
-                   # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10
-                (( icycle = $((10#$cycle)) ))
-                explicit_cycle_number=true
-             else
-                (( icycle = 0 ))
-                explicit_cycle_number=false
-             fi
-   
-             if (( icycle > maxcycle ))
-             then
-                (( maxcycle = icycle ))
-             fi
-   
-          done <filelist
-          rm filelist
-
-   
-             # MAKE CYCLE NUMBER THREE DIGITS WIDE
-          cyclestring=`printf "%03d" $maxcycle`
-
-   
-             # APPEND CYCLE NUMBER TO FILENAME
-          if [[ $explicit_cycle_number = true ]]
-          then
-             if [[ "${extin[$nr_of_input_files]}" != " "  &&   "${extin[$nr_of_input_files]}" != "" ]]
-             then
-                filename=${filename}.$cyclestring.${extin[$nr_of_input_files]}
-             else
-                filename=${filename}.$cyclestring
-             fi
-          else
-             if [[ "${extin[$nr_of_input_files]}" != " "  &&   "${extin[$nr_of_input_files]}" != "" ]]
-             then
-                filename=${filename}.${extin[$nr_of_input_files]}
-             fi
-          fi
-          
-             # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER,
-             # IS LATER USED FOR TRANSFERRING FILES WIHIN THE JOB (SEE END OF FILE)
-          absnamein[$nr_of_input_files]=$filename
-          if [[ $explicit_cycle_number = true ]]
-          then
-             if [[ "${actionin[$nr_of_input_files]}" = di ]]
-             then
-                frelin[$nr_of_input_files]=${endin[$nr_of_input_files]}.$cyclestring
-             else
-                frelin[$nr_of_input_files]=${run_identifier}${endin[$nr_of_input_files]}.$cyclestring
-             fi
-          else
-             if [[ "${actionin[$nr_of_input_files]}" = di ]]
-             then
-                frelin[$nr_of_input_files]=${endin[$nr_of_input_files]}
-             else
-                frelin[$nr_of_input_files]=${run_identifier}${endin[$nr_of_input_files]}
-             fi
-          fi
-
-       done
-
-    fi
-
- done
-
-
-    # GENERATE FULL FILENAMES OF OUTPUT-FILES (WITHOUT $ OR ~),
-    # CHECK, IF OUTPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST),
-    # OR, IN CASE THAT FILE DOES NOT EXIST, CHECK, IF IT CAN BE CREATED  
-    # THESE ACTIONS ARE NOT CARRIED OUT, IF FILES SHALL BE TRANSFERRED FROM THE REMOTE TO
-    # THE LOCAL HOST (BECAUSE THEIR IS NO DIRECT ACCESS TO THE LOCAL DIRECTORIES FROM THE
-    # REMOTE HOST)
- (( i = 0 ))
- while (( i < iout ))
- do
-    (( i = i + 1 ))
-    if [[ ! ( $running_on_remote = true  &&  ( "${actionout_pre[$i]}" = tr || "${actionout_pre[$i]}" = tra || "${actionout_pre[$i]}" = trpe ) ) ]]
-    then
-       if [[ "${actionout_pre[$i]}" = tr ]]
-       then
-          actionout_pre[$i]=""
-       elif [[ "${actionout_pre[$i]}" = trpe ]]
-       then
-          actionout_pre[$i]=pe
-       elif [[ "${actionout_pre[$i]}" = tra ]]
-       then
-          actionout_pre[$i]=a
-       fi
-       (( maxcycle = 0 ))
-       eval filename=${pathout_pre[$i]}/${run_identifier}${endout_pre[$i]}
-       eval catalogname=${pathout_pre[$i]}
-       if ! ls $filename* 1>/dev/null 2>&1
-       then
-      
-             # IF OUTPUT-FILE DOES NOT EXIST CHECK, IF IT CAN BE CREATED
-          if  cat /dev/null > $filename  
-          then
-             rm  $filename
-          else
-
-                # CHECK, IF THE DIRECTORY WHERE FILE SHALL BE COPIED TO EXISTS
-                # IF IT DOES NOT EXIST, TRY TO CREATE IT
-             if [[ ! -d $catalogname ]]
-             then
-                if  mkdir -p  $catalogname
-                then
-                   printf "\n\n  *** directory:"
-                   printf "\n           $catalogname"
-                   printf "\n      was created\n"
-                else
-                   printf "\n\n  +++ OUTPUT-file:"
-                   printf "\n           $filename"
-                   printf "\n      cannot be created, because directory does not exist"
-                   printf "\n      and cannot be created either"
-                   printf "\n"
-                   locat=output  ; exit
-                fi 2>/dev/null 
-             else
-                printf "\n\n  +++ OUTPUT-file:"
-                printf "\n           $filename"
-                printf "\n      cannot be created, although directory exists"
-                printf "\n"
-                locat=output  ; exit
-             fi
-          fi 2>/dev/null
-
-       fi
-
-    fi
- done
-
-
-    # DETERMINE THE NAME OF PALMRUN'S TEMPORARY WORKING DIRECTORY
- if [[ $running_in_batch_mode = false ]]
- then
-    run_id_number=$RANDOM
-    run_id=${run_identifier}.$run_id_number
-
-    tempdir=$fast_io_catalog/$run_id
-
-       # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS SET JOB_ID
-    export job_id=$run_id
-
- fi
-
-
-    # CHECK SETTINGS REQUIRED FOR BATCH JOBS
- if [[ $create_batch_job = true  ||  $create_remote_batch_job = true ]]
- then
-
-       # CHECK, IF JOB DIRECTIVES HAVE BEEN GIVEN IN CONFIGURATION FILE
-    if [[ $ibd = 0 ]]
-    then
-       printf "\n"
-       printf "\n  +++ no batch directives found in configuration file"
-       locat=config_file_batch_directives; (( iec = 0 )); exit 
-    fi
-
-       # CHECK IF CPUTIME IS GIVEN FOR JOB
-    done=false
-    cputime=$cpumax
-    while [[ $done = false ]]
-    do
-       if (( cputime == 0 ))
-       then
-          printf "\n  +++ cpu-time is undefined"
-          printf "\n  >>> Please type CPU-time in seconds as INTEGER:"
-          printf "\n  >>> "
-          read  cputime   1>/dev/null  2>&1
-       else
-          done=true
-       fi
-    done
-    cpumax=$cputime
-
-       # CHECK THE MEMORY DEMAND
-    done=false
-    while [[ $done = false ]]
-    do
-       if (( memory == 0 ))
-       then
-          printf "\n  +++ memory demand is undefined"
-          printf "\n  >>> Please type memory in  MByte per process  as INTEGER:"
-          printf "\n  >>> "
-          read  memory  1>/dev/null  2>&1
-       else
-          done=true
-       fi
-    done
-
-       # IN CASE OF REMOTE-JOBS CHECK, IF A USERNAME FOR THE REMOTE HOST IS GIVEN
-    if [[ $create_remote_batch_job = true  &&  -z $remote_username ]]
-    then
-       while [[ -z $remote_username ]]
-       do
-          printf "\n  +++ username on remote host with IP \"$remote_ip\" is undefined"
-          printf "\n  >>> Please type username:"
-          printf "\n  >>> "
-          read  remote_username
-       done
-    fi
-
- else
-
-    if [[ $running_in_batch_mode = false ]]
-    then
-       cputime=10000000  # NO LIMT FOR INTERACTIVE RUNS
-       cpumax=$cputime
-    else
-       cputime=$cpumax
-    fi
-
- fi
-
-
-    # CALCULATE HOURS/MINUTES/SECONDS, E.G. FOR BATCH-DIRECTIVES
- (( cpu_hours  = cputime / 3600 ))
- (( resttime = cputime - cpu_hours * 3600 ))
- (( cpu_minutes  = resttime / 60 ))
- (( cpu_seconds = resttime - cpu_minutes * 60 ))
- timestring=${cpu_hours}:${cpu_minutes}:${cpu_seconds}
-
-
-    # OUTPUT OF THE PALMRUN-HEADER
- calltime=$(date)
- printf "\n"
- printf "#------------------------------------------------------------------------# \n"
- printf "| %-35s%35s | \n" "$version" "$calltime"
- printf "| %-35s%35s | \n" "PALM code    $global_revision" " "
- printf "|                                                                        | \n"
- column1="called on:"; column2=$(hostname)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- if [[ $create_remote_batch_job = true ]]
- then
-    column1="execution on:"; column2="$configuration_identifier (username: $remote_username)"
- else
-    if [[ $running_on_remote = true ]]
-    then
-       column1="config. identifier:"; column2="$configuration_identifier (execute on IP: $remote_ip)"
-    else
-       column1="config. identifier:"; column2="$configuration_identifier (execute on IP: $local_ip)"
-    fi
- fi
- printf "| %-25s%-45s | \n" "$column1" "$column2"
-
- column1="running in:"
- if [[ $running_in_batch_mode = true ]]
- then
-    column2="batch job mode"
- else
-    if [[ $create_batch_job = true  ||  $create_remote_batch_job = true ]]
-    then
-       column2="job creation mode"
-    else
-       column2="interactive run mode"
-    fi
- fi
- printf "| %-25s%-45s | \n" "$column1" "$column2"
-
- if  [[ $running_in_batch_mode = true  ||  $create_batch_job = true  ||  $create_remote_batch_job = true ]]
- then
-    if [[ "$project_account" != "" ]]
-    then
-       column1="project account number:"
-       column2="$project_account"
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-    fi
- fi
-
- if [[ -n $cores ]]
- then
-    if [[ $run_coupled_model = false ]]
-    then
-       column1="number of cores:"; column2=$cores
-    else
-       column1="number of cores:"; column2="$cores  (atmosphere: $cores_atmos, ocean: $cores_ocean)"
-    fi
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
- fi
- if [[ -n $tasks_per_node ]]
- then
-    column1="tasks per node:"; column2="$tasks_per_node (number of nodes: $nodes)"
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    if (( remaining_cores > 0 ))
-    then
-       column1=" "; column2="one of the nodes only filled with $remaining_cores tasks"
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-    fi
- fi
- if [[ $maximum_parallel_io_streams != $cores ]]
- then
-    column1="max par io streams:"; column2="$maximum_parallel_io_streams"
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
- fi
- if [[ $use_openmp = true ]]
- then
-    column1="threads per task:"; column2="$threads_per_task"
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
- fi
- if [[ $create_batch_job = true  ||  $create_remote_batch_job = true  ||  $running_in_batch_mode = true ]]
- then
-    column1="memory demand / PE":; column2="$memory MB"
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    column1="job cpu time (h:m:s):"; column2="$timestring"
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
- fi
- printf "|                                                                        | \n"
- if [[ "$source_list" != "" ]]
- then
-    if [[ "$make_options" != "" ]]
-    then
-       column1="make options:"; column2=$(echo "$make_options" | cut -c-45)
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-       line=$(echo "$make_options" | cut -c46-)
-       while [[ "$line" != "" ]]
-       do
-          column1=""
-          column2=$(echo "$line" | cut -c-45)
-          printf "| %-25s%-45s | \n" "$column1" "$column2"
-          line=$(echo "$line" | cut -c46-)
-       done
-    fi
- fi
-
- column1="cpp directives:"; column2=$(echo "$cpp_options" | cut -c-45)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- line=$(echo "$cpp_options" | cut -c46-)
- while [[ "$line" != "" ]]
- do
-    column1=""
-    column2=$(echo "$line" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$line" | cut -c46-)
- done
-
- column1="compiler options:"; column2=$(echo "$compiler_options" | cut -c-45)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- line=$(echo "$compiler_options" | cut -c46-)
- while [[ "$line" != "" ]]
- do
-    column1=""
-    column2=$(echo "$line" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$line" | cut -c46-)
- done
-
- column1="linker options:"; column2=$(echo "$linker_options" | cut -c-45)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- line=$(echo "$linker_options" | cut -c46-)
- while [[ "$line" != "" ]]
- do
-    column1=""
-    column2=$(echo "$line" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$line" | cut -c46-)
- done
-
- if [[ "$login_init_cmd" != "" ]]
- then
-    column1="login init commands:"; column2=$(echo "$login_init_cmd" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$login_init_cmd" | cut -c46-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c-45)
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c46-)
-    done
- fi
-
- if [[ "$module_commands" != "" ]]
- then
-    column1="module commands:"; column2=$(echo "$module_commands" | cut -c-45)
-    printf "| %-25s%-45s | \n" "$column1" "$column2"
-    line=$(echo "$module_commands" | cut -c46-)
-    while [[ "$line" != "" ]]
-    do
-       column1=""
-       column2=$(echo "$line" | cut -c-45)
-       printf "| %-25s%-45s | \n" "$column1" "$column2"
-       line=$(echo "$line" | cut -c46-)
-    done
- fi
- printf "|                                                                        | \n"
- column1="run identifier:"; column2=$run_identifier
- printf "| %-25s%-45s | \n" "$column1" "$column2"
- column1="activation string list:"; column2=$(echo $activation_string_list)
- printf "| %-25s%-45s | \n" "$column1" "$column2"
-
- if [[ "$ocean_file_appendix" = true ]]
- then
-    printf "| %-35s%-35s | \n" "suffix \"_O\" is added to local files" " "
- fi
-
- if [[ "$source_list" != "" ]]
- then
-    printf "|                                                                        | \n"
-    printf "| Files to be compiled:                                                  | \n"
-    line=$source_list
-    while [[ "$line" != "" ]]
-    do
-       linestart=$(echo $line | cut -c-70)
-       printf "| %-70s | \n" "$linestart"
-       line=$(echo "$line" | cut -c71-)
-    done
- fi
- printf "#------------------------------------------------------------------------#"
-
-
-
-    # OUTPUT OF FILE CONNECTIONS IN CASE OF TRACEBACK
- if [[ $do_trace = true ]]
- then
-    (( i = 0 ))
-    while (( i < nr_of_input_files ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n >>> INPUT-file assignments:\n"
-       fi
-       printf "\n     ${localin[$i]} :  ${absnamein[$i]}"
-    done
-    (( i = 0 ))
-    while (( i < iout ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n >>> OUTPUT-file assignments:\n"
-       fi
-       printf "\n     ${localout[$i]} :  ${pathout[$i]}"
-    done
-    (( i = 0 ))
-    while (( i < iic ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n >>> INPUT-commands:\n"
-       fi
-       printf "\n     ${in_command[$i]}" 
-    done
-    (( i = 0 ))
-    while (( i < ioc ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n >>> OUTPUT-commands:\n"
-       fi
-       printf "\n     ${out_command[$i]}" 
-    done
- fi
-
-    # QUERY FOR CONTINUE
- if [[ $silent = false  &&  $running_in_batch_mode = false ]]
- then
-    antwort=dummy
-    printf "\n\n"
-    printf " >>> everything o.k. (y/n) ?  "
-    while  read antwort
-    do
-       if [[ "$antwort" != y  &&  "$antwort" != Y  &&  "$antwort" != n  &&  "$antwort" != N ]]
-       then
-          printf " >>> everything o.k. (y/n) ?  "
-       else
-          break
-       fi
-    done
-    if [[ $antwort = n  ||  $antwort = N ]]
-    then
-       locat=user_abort; (( iec = 0 )); exit
-    fi
-    if [[ $create_batch_job = true  ||  $create_remote_batch_job = true ]]
-    then
-       printf "\n ***  batch-job will be created and submitted"
-    else
-       printf "\n ***  PALMRUN will now continue to execute on this machine"
-    fi
- fi
-
- 
-
-    # PROVIDE FILES TO EXECUTE PALM AND CREATE THE EXECUTABLE
- if [[ $restart_run = false  &&  $running_in_batch_mode = false ]]
- then
-
-    if [[ $create_batch_job = true  ||  $create_remote_batch_job  = true ]]
-    then
-       printf "\n\n  *** creating executable and other sources for the remote host\n"
-    else
-       printf "\n\n  *** creating executable and other sources for the local host\n"
-    fi
-
-       # FIRST CHECK, IF A MAKE DEPOSITORY EXISTS, AND IF NOT, ASK THE USER IF
-       # IT SHALL BE CREATED
-    ask_for_make_depository=false
-    if [[ $create_remote_batch_job = true ]]
-    then
-
-       line=`grep %base_directory $config_file`
-       make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${configuration_identifier}
-       ssh  -q  $ssh_key  ${remote_username}@${remote_ip} "[[ ! -d ${make_depository} ]]  &&  echo depository not found" 2>&1  | tee ${configuration_identifier}_last_make_protokoll
-
-       if [[ $(grep -c "depository not found" ${configuration_identifier}_last_make_protokoll) != 0 ]]
-       then
-          printf "\n\n  +++ make depository \"${make_depository}\""
-          printf "\n      on remote host not found!"
-          ask_for_make_depository=true
-       fi
-       rm ${configuration_identifier}_last_make_protokoll
-
-    else
-
-          # CHECK FOR MAKE_DEPOSITORY ON THE LOCAL HOST
-       make_depository=${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}
-       if [[ ! -d ${make_depository} ]]
-       then
-          printf "\n\n  +++ make depository \"${make_depository}\""
-          printf "\n      on local host not found!"
-          ask_for_make_depository=true
-       fi
-
-    fi
-
-    if [[ $ask_for_make_depository = true ]]
-    then
-
-       antwort=dummy
-       printf "\n\n"
-       printf "  >>> Create a new one (y/n) ?  "
-       while  read antwort
-       do
-          if [[ "$antwort" != y  &&  "$antwort" != Y  &&  "$antwort" != n  &&  "$antwort" != N ]]
-          then
-             printf "  >>> Create a new one (y/n) ?  "
-          else
-             break
-          fi
-       done
-       if [[ $antwort = n  ||  $antwort = N ]]
-       then
-          locat=user_abort; (( iec = 0 )); exit
-       fi
-
-       if [[ $do_trace = true ]]
-       then
-          palmbuild  -c $configuration_identifier
-       else
-          palmbuild  -v  -c $configuration_identifier
-       fi
-
-       if [[ ${PIPESTATUS[0]} != 0 ]]
-       then
-   
-              # ABORT IN CASE OF COMPILATION PROBLEMS
-          printf "\n  +++ error while compiling for the MAKE_DEPOSITORY"
-          locat=make_depository
-          exit
-       else
-          echo "  *** now continue with creating executable and other sources"
-       fi
-
-    fi
-
-       # NOW CREATE THE SOURCES_FOR_RUN FOLDER
-    palmbuild  -v  $use_existing_sources_folder  -c $configuration_identifier  -r $run_identifier
-
-    if [[ ${PIPESTATUS[0]} != 0 ]]
-    then
-
-           # ABORT IN CASE OF COMPILATION PROBLEMS
-       printf "\n  +++ error while creating executable and/or other sources"
-       locat=execution
-       rm -rf  ${base_directory}/${sources_for_run_catalog}
-       exit
-
-    else
-
-       printf "  *** executable and other sources created\n"
-       rm -rf  ${base_directory}/${sources_for_run_catalog}
-
-    fi
-
- fi
-
-
-    # WHEN CREATING A REMOTE BATCH JOB, THOSE INPUT FILES WITH TRANSFER-ATTRIBUT
-    # WILL BE COPIED TO THE REMOTE HOST
- if [[ $create_remote_batch_job = true ]]
- then
-    (( i = 0 ))
-    while (( i < nr_of_input_files ))
-    do
-       (( i = i + 1 ))
-       if [[ "${actionin[$i]}" = tr ]]
-       then
-          eval inputfile=${pathin[$i]}/${frelin[$i]}
-          scp  -q $ssh_key  $PORTOPT  $inputfile  ${remote_username}@${remote_ip}:${fast_io_catalog}/${sources_for_run_catalog}/${frelin[$i]}
-       fi
-    done
-    if (( i > 0 ))
-    then
-       printf "\n\n  *** input files have been copied to the remote host\n"
-    fi
- fi
- 
-
-    # NOW PERFORM THOSE ACTIONS REQUIRED TO EXECUTE THE PROGRAM (PALM) ON THIS MACHINE
-    # (COMPILING/LINKING, EXECUTING, COPYING I/O FILES)
- if [[ $create_batch_job = false  &&  $create_remote_batch_job = false ]]
- then
-
-       # CHANGE TO THE TEMPORARY WORKING DIRECTORY
-    if [[ $running_in_batch_mode = false ]]
-    then
-
-          # CREATE THE DIRECTORY
-       mkdir -p  $tempdir
-       if [[ $? != 0 ]]
-       then
-          printf "\n  +++ temporary working directory cannot be created."
-          printf "\n      Check setting of variable fast_io_catalog in your config file."
-          locat=execution
-          exit
-       fi
-       chmod  go+rx  $tempdir
-       cd  $tempdir
-       printf "\n  *** changed to temporary directory: $tempdir"
-
-    else
-
-          # IN BATCH MODE PALMRUN IS CALLED FROM TEMPDIR
-       printf "\n  *** running in temporary directory: $tempdir"
-
-    fi
-
-
-       # PROVIDE THE INPUT FILES
-       # LOOP OVER ALL ACTIVATED FILES (LISTED IN THE CONFIGURATION FILE)
-    optional_files_missing=false
-    (( i = 0 ))
-    while (( i < nr_of_input_files ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n  *** providing INPUT-files:\n$dashes"
-       fi
-
-
-          # SKIP OPTIONAL FILES, IF THEY DO NOT EXIST
-       if [[ "${actionin[$i]}" = unavailable ]]
-       then
-          optional_files_missing=true
-          continue
-       fi
-
-          # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION)
-       files_for_cores=false; filetype=file
-       if [[ "${actionin[$i]}" = pe  &&  -n $cores ]]
-       then
-          files_for_cores=true; filetype=files
-          actionin[$i]=""
-       elif [[ "${actionin[$i]}" = pe  &&  ! -n $cores ]]
-       then
-          actionin[$i]=""
-       elif [[ "${actionin[$i]}" = lnpe  &&  -n $cores ]]
-       then
-          files_for_cores=true; filetype=files
-          actionin[$i]="ln"
-             # FILE HAS BEEN FOUND INSTEAD OF DIRECTORY
-          if [[ -f "${absnamein[$i]}" ]]
-          then
-             files_for_cores=false; filetype=file
-          fi
-       elif [[ "${actionin[$i]}" = lnpe  &&  ! -n $cores ]]
-       then
-          actionin[$i]="ln"
-       fi
-
-       if [[ $files_for_cores = true ]]
-       then
-          printf "\n  >>> INPUT: ${absnamein[$i]}/....  to  ${localin[$i]}"
-       else
-          printf "\n  >>> INPUT: ${absnamein[$i]}  to  ${localin[$i]}"
-       fi
-
-          # INPUT-FILES TO BE LINKED
-       if [[ "${actionin[$i]}" = ln ]]
-       then
-
-          printf "\n      $filetype will be linked"
-          if [[ $files_for_cores = false ]]
-          then
-             if [[ -f "${absnamein[$i]}" ]]
-             then
-                ln  ${absnamein[$i]}  ${localin[$i]}
-                got_tmp[$i]=true
-             fi
-          else
-             if [[ -d "${absnamein[$i]}" ]]
-             then
-                mkdir -p ${localin[$i]}
-                cd ${absnamein[$i]}
-                for file in $(ls *)
-                do
-                   ln $file $tempdir/${localin[$i]}
-                done >|/dev/null 2>&1
-                cd $tempdir
-             fi
-
-                # IF "ln -f" HAS FAILED DO A NORMAL COPY "cp -r"
-             if [[ ! -f "${localin[$i]}/_000000" ]]
-             then
-                printf "\n  --- WARNING: ln failed, using cp instead (might be time consuming...)"
-                cp -r  ${absnamein[$i]}/*  ${localin[$i]}
-             fi
-
-             got_tmp[$i]=true
-          fi
-       fi
-
-          # FILE IS STORED IN THE RESPECTIVE DIRECTORY GIVEN IN THE CONFIGURATION FILE
-       if [[ "${actionin[$i]}" = ""  ||  "${actionin[$i]}" = "di"  ||  "${actionin[$i]}" = "tr"  ||  "${actionin[$i]}" = "npe" ]]
-       then
-
-          if [[ "${actionin[$i]}" = "npe"  &&  -n $cores ]]
-          then
-
-                # FILE COPIES ARE PROVIDED FOR ALL CORES
-                # EACH FILE GETS A UNIQUE FILENAME WITH A FOUR DIGIT NUMBER
-             printf "\n      file will be provided for $cores processors"
-             mkdir -p ${localin[$i]}
-             ival=$cores
-             (( ii = 0 ))
-             while (( ii <= ival-1 ))
-             do
-                if (( ii < 10 ))
-                then
-                   cp  ${absnamein[$i]}  ${localin[$i]}/_000$ii
-                elif (( ii < 100 ))
-                then
-                   cp  ${absnamein[$i]}  ${localin[$i]}/_00$ii
-                elif (( ii < 1000 ))
-                then
-                   cp  ${absnamein[$i]}  ${localin[$i]}/_0$ii
-                else
-                   cp  ${absnamein[$i]}  ${localin[$i]}/_$ii
-                fi
-                (( ii = ii + 1 ))
-             done
-
-          else
-
-             if [[ $files_for_cores = true ]]
-             then
-
-                   # PROVIDE FILES FOR EACH CORE
-                   # FIRST CREATE THE LOCAL DIRECTORY, THEN COPY FILES
-                   # FROM THE PERMANENT DIRECTORY BY LINKING THEM TO THE LOCAL ONE
-                printf "\n      providing $cores files for the respective cores"
-                mkdir -p ${localin[$i]}
-	              	if [[ $link_local_input = true ]]
-		              then
-		                 printf "      files will be linked\n"
-		                 cd ${absnamein[$i]}
-		                 for file in $(ls *)
-		                 do
-		                    ln -f $file  ${localin[$i]}
-		                 done
-		                 cd $tempdir
-		              fi
-
-                   # IF "ln -f" FAILED OR IF "$link_local_input = false" DO A NORMAL "cp -r"
-		              if [[ ! -f "${localin[$i]}/_000000" ]]
-		              then
-		                 if [[ $link_local_input = true ]]
-		                	then
-	                   		printf "\n  --- WARNING: ln failed, using cp instead (might be time consuming...)"
-		                 fi
-		                 cp -r  ${absnamein[$i]}/*  ${localin[$i]}
-		              fi
-
-             else
-
-                   # PROVIDE FILE FOR RUNS ON A SINGLE CORE
-              		if [[ $link_local_input = true ]]
-	              	then
-		                 printf "      file will be linked\n"
-		                 ln -f  ${absnamein[$i]}  ${localin[$i]}
-	              	fi
-	                 	# IF "ln -f" FAILS OR IF "$link_local_input = false" DO A NORMAL "cp"
-	              	if [[ ! -f "${localin[$i]}" ]]
-                then
-		                 if [[ $link_local_input = true ]]
-	                  then
-                      printf "\n  --- WARNING: ln failed, using cp instead (might be time consuming...)"
-		                 fi
-                   if [[ $running_on_remote = true  &&  "${actionin[$i]}" = tr ]]
-                   then
-                      mv  ${absnamein[$i]}  ${localin[$i]}
-                   else
-   		                 cp  ${absnamein[$i]}  ${localin[$i]}
-                   fi
-                fi
-             fi
-          fi
-       fi
-
-    done
-    if (( i != 0 ))
-    then
-       if [[ $optional_files_missing = true ]]
-       then
-          printf "\n  *** INFORMATIVE: some optional INPUT-files are not present"
-       fi
-       printf "\n$dashes\n  *** all INPUT-files provided \n"
-    fi
-
-       # NOW COPY FILES (*.f90, *.o, config files, etc.) FROM SOURCES_FOR_RUN_... TO THE TEMPORARY
-       # WORKING DIRECTORY
-    cp  ${fast_io_catalog}/${sources_for_run_catalog}/{*,.[!.]*}  $tempdir
-
-
-       # EXECUTE INPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE
-    (( i = 0 ))
-    while (( i < iic ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n  *** execution of INPUT-commands:\n$dashes"
-       fi
-       printf "\n  >>> ${in_command[$i]}"
-       eval  ${in_command[$i]}
-       if (( i == iic ))
-       then
-          printf "\n$dashes\n"
-       fi
-    done
-
-
-    # CHECK IF THE PROGRESS BAR NEEDS TO BE DISABLED
-    if [[ $running_in_batch_mode = true  ||  $running_in_test_mode = true ]]
-    then
-       progress_bar_disabled=true
-    else
-       progress_bar_disabled=false
-    fi
-
-
-       # CREATE THE NAMELIST-FILE WITH VALUES OF ENVIRONMENT-VARIABLES REQUIRED BY PALM
-       # (FILE ENVPAR WILL BE READ BY PALM)
-    cat  >  ENVPAR  <<  EOF
- &envpar  run_identifier = '$run_identifier', host = '$configuration_identifier',
-          write_svf = .${write_svf}., write_binary = .${write_binary}., 
-          read_svf = .${read_svf}., tasks_per_node = $tasks_per_node,
-          maximum_parallel_io_streams = $maximum_parallel_io_streams,
-          maximum_cpu_time_allowed = ${cpumax}.,
-          revision = '$global_revision',
-          progress_bar_disabled = .${progress_bar_disabled}. /
-
-EOF
-
-
-       # STARTING THE EXECUTABLE
-    printf "\n\n  *** execution starts in directory\n      \"`pwd`\"\n$dashes\n"
-    PATH=$PATH:$tempdir
-
-
-       # REPLACE PARAMETERS IN THE EXECUTION COMMAND WITH REAL VALUES
-    line=`echo  "${execute_command}" | sed 's/{{/$/g' | sed 's/}}//g'`
-    line2=`echo  "${execute_command}" | sed 's/{{mpi_tasks}}/1/g' | sed 's/{{tasks_per_node}}/1/g' | sed 's/palm/combine_plot_fields.x/g'`
-    eval line=\"$line\"
-    execute_command="$line"
-
-
-       # EXECUTION COMMAND FOR COMBINE_PLOT_FIELDS
-    if [[ "$execute_command_for_combine" = "" ]]
-    then
-       eval line2=\"$line2\"
-       execute_command_for_combine="$line2"
-    fi
-    
-
-
-       # PROVIDE A HOSTFILE, IF REQUIRED
-    if [[ "$hostfile" != "" ]]
-    then
-
-       if [[ $hostfile = auto ]]
-       then
-             # CREATE A NEW HOSTFILE
-          (( ii = 1 ))
-          while (( ii <= cores / threads_per_task ))
-          do
-             echo  $(hostname)  >>  hostfile
-             (( ii = ii + 1 ))
-          done
-          if (( cores / threads_per_task == 0 ))
-          then
-             echo  $(hostname)  >>  hostfile
-          fi
-       
-       else
-          cp  $hostfile  hostfile
-       fi
-       eval line=\"`head -n $ii  hostfile`\"
-       printf "\n  *** running on: $line"
-    fi
-
-
-
-       # SET THE NUMBER OF OPENMP-THREADS
-    if [[ $use_openmp = true ]]
-    then
-       export OMP_NUM_THREADS=$threads_per_task
-       printf "\n  *** number of OpenMP threads per MPI-task: $OMP_NUM_THREADS"
-    else
-       export OMP_NUM_THREADS=1
-    fi
-
-
-       # PROVIDE DATA FOR ATMOSPHERE OCEAN COUPLING
-    if [[ $run_coupled_model = false ]]
-    then
-       if [[ "$ocean_file_appendix" = true ]]
-       then
-          echo "precursor_ocean"  >  coupling_steering
-       else
-          echo "precursor_atmos"  >  coupling_steering
-      fi
-    else
-       (( iia = $cores_atmos / $threads_per_task ))
-       (( iio = $cores_ocean / $threads_per_task ))
-       printf "\n      coupled run ($iia atmosphere, $iio ocean)"
-       printf "\n\n"
-       echo "coupled_run $iia $iio"  >  coupling_steering
-    fi
-
-    printf "\n  *** execute command:"
-    printf "\n      \"$execute_command\" \n\n"
-
-
-    if [[ $progress_bar_disabled = true ]]
-    then
-       $execute_command  <  coupling_steering  &> >(grep -v --line-buffered -e '^STOP 1$' -e '^1$' &> >(tee STDOUT) )
-       exit_code=${PIPESTATUS[0]}
-    else
-       $execute_command  <  coupling_steering  &> >(tee STDOUT)
-       exit_code=${PIPESTATUS[0]}
-    fi
-
-    if [[ ${exit_code} != 0 ]]
-    then
-
-           # ABORT IN CASE OF RUNTIME ERRORS
-       printf "\n  +++ runtime error occured"
-       locat=execution
-       exit
-
-    else
-
-       printf "\n$dashes\n  *** execution finished \n"
-
-    fi
-
-
-       # CALL OF combine_plot_fields IN ORDER TO MERGE SINGLE FILES WRITTEN
-       # BY EACH CORE INTO ONE FILE
-   if [[ ! -f combine_plot_fields.x ]]
-   then
-
-      printf "\n\n\n  +++ WARNING: no combine_plot_fields found"
-      printf "\n      2d- and/or 3d-data may be incomplete!"
-      printf "\n      Your previous palmbuild may have failed. Please check.\n"
-
-   elif [[ "$combine_plot_fields" == true ]]
-   then
-
-      printf "\n\n\n *** post-processing: now executing \"$execute_command_for_combine\" ..."
-      $execute_command_for_combine
-
-   else
-
-         # TEMPORARY SOLUTION TO SKIP combine_plot_fields. THIS IS REQUIRED IN CASE OF HUGE AMOUNT OF
-         # DATA OUTPUT
-      printf "\n\n\n *** post-processing: skipping combine_plot_fields (-Z option set) ..."
-   fi
-
-
-
-       # EXECUTE OUTPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE
-    (( i = 0 ))
-    while (( i < ioc ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          printf "\n\n  *** execution of OUTPUT-commands:\n$dashes"
-       fi
-
-          # REPLACE PARAMETERS IN THE OUTPUT COMMAND WITH REAL VALUES
-       out_command[$i]=`echo  "${out_command[$i]}" | sed 's/{{/$/g' | sed 's/}}//g'`
-
-       printf "\n  >>> ${out_command[$i]}"
-       eval  ${out_command[$i]}
-       if (( i == ioc ))
-       then
-          printf "\n$dashes\n"
-       fi
-    done
-
-
-       # IN A FIRST PASS, ADD ADDITIONAL OUTPUT FILE CONNECTIONS IN CASE OF
-       # WILDCARDS
-    (( i = 0 ))
-    (( nr_of_output_files = 0 ))
-
-    while (( i < iout ))
-    do
-
-       (( i = i + 1 ))
-
-          # FIRST CHECK FOR MULTIPLE NAMES WITH THE SAME LOCAL NAME AND
-          # CREATE A LIST FOR THE DETECTED ENDINGS
-       if [[ "${multout[$i]}" = true ]]
-       then
-             # DETERMINE THE EXISTING EXTENSIONS FROM THE LIST OF FILES
-          ls -1 -d ${localout_pre[$i]}    >   filelist  2>/dev/null
-          ls -1 -d ${localout_pre[$i]}_*  >>  filelist  2>/dev/null
-
-          endings="DEFAULT"
-          while  read line
-          do
-                 # remove the local name from the beginning
-              localnamestring="${localout_pre[$i]}"
-              length_localname=${#localnamestring}
-              ending=${line:${length_localname}}
-
-              if [[ "$ending" != "" ]]
-              then
-                 endings="$endings $ending"
-              fi
- 
-          done <filelist
-
-          rm filelist
-
-       else
-
-             # SINGLE NAME
-          endings=DEFAULT
-
-       fi
-
-          # FOR EACH BASENAME ENDING CREATE AN ENTRY IN THE FINAL OUTPUT FILE LIST
-       for  ending  in  $endings
-       do
-
-             # DEFAULT MEANS THAT THE ENDING GIVEN IN .iofiles SHALL BE USED
-          if [[ $ending = DEFAULT ]]
-          then
-             ending=""
-          fi
-
-             # NEW ENTRY (ENDING IS ALSO ADDED TO LOCAL FILENAME READ BY PALM!)
-          (( nr_of_output_files = nr_of_output_files + 1 ))
-          localout[$nr_of_output_files]="${localout_pre[$i]}"$ending
-          transout[$nr_of_output_files]="${transout_pre[$i]}"
-          actionout[$nr_of_output_files]="${actionout_pre[$i]}"
-          pathout[$nr_of_output_files]="${pathout_pre[$i]}"
-          endout[$nr_of_output_files]="${endout_pre[$i]}"$ending
-          extout[$nr_of_output_files]="${extout_pre[$i]}"
-          warnout[$nr_of_output_files]="${warnout_pre[$i]}"
-
-       done
-
-    done
-
-
-
-
-       # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS
-    (( i = 0 ))
-    while (( i < nr_of_output_files ))
-    do
-       (( i = i + 1 ))
-       if (( i == 1 ))
-       then
-          timestring=`date +%H:%M:%S`
-          printf "\n\n  *** saving OUTPUT-files:     local time: $timestring"
-
-             # GET RUN NUMBER ASSIGNED BY PALM
-          if [[ -f RUN_NUMBER ]]
-          then
-              read  run_number  <  RUN_NUMBER
-              printf "\n  *** PALM generated run_number = "$run_number" will be used as unified cycle number for all output files"
-              usecycle_option="-U $run_number"
-          else
-              run_number=0
-              usecycle_option=""
-          fi
-          if [[ $running_on_remote = true  &&  "$remote_loginnode" != "" ]]
-          then
-             printf "\n  *** in case of SCP transfers to local host"
-             printf "\n      they will be done via remote login-node \"$remote_loginnode\" "
-          fi
-          printf "\n$dashes"
-       fi
-
-       if [[ ! ( $running_on_remote = true  &&  ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]]
-       then
-
-          eval filename=${pathout[$i]}/${run_identifier}${endout[$i]}
-
-             # DETERMINE THE CYCLE NUMBER
-          ls -1 -d $filename    >   filelist  2>/dev/null
-          ls -1 -d $filename.*  >>  filelist  2>/dev/null
-          (( maxcycle = 0 ))
-          while  read line
-          do
-   
-                # filename without path (i.e. after the last "/")
-             basefilename=$(basename ${line})
-   
-                # check if there is an extension
-             extension=${basefilename##*.}
-             if [[ "$extension" = "${extout[$i]}" ]]
-             then
-                basefilename=${basefilename%.*}
-             fi
-   
-                # check for an existing cycle number
-             cycle=${basefilename##*.}
-             if [[ $cycle =~ ^-?[0-9]+$ ]]
-             then
-                   # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS
-                   # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10
-                (( icycle = $((10#$cycle)) + 1 ))
-             else
-                (( icycle = 1 ))
-             fi
-   
-             if (( icycle > maxcycle ))
-             then
-                (( maxcycle = icycle ))
-             fi
-   
-          done <filelist
-          rm filelist
-
-   
-             # SET THE CYCLE NUMBER
-             # IN CASE OF FILE-APPEND, IT MUST BE THE HIGHEST EXISTING CYCLE NUMBER
-          if [[ "${actionout[$i]}" = a ]]
-          then
-             if (( maxcycle > 0 ))
-             then
-                (( maxcycle = maxcycle - 1 ))
-             fi
-          fi
-          
-          (( cycnum[$i] = maxcycle ))
-          pathout[$i]=$filename
-
-
-             # ADD CYCLE NUMBER TO FILENAME
-             # IN APPEND MODE, FILES KEEP THEIR CURRENT CYCLE NUMBER
-          if [[ "${actionout[$i]}" != "a" ]]
-          then
-                # SET RUN NUMBER AS CYCLE NUMBER, IF THERE IS NOT A CONFLICT
-                # WITH AN EXISTING CYCLE NUMBER
-             if (( run_number >= cycnum[$i] ))
-             then
-                (( cycnum[$i] = run_number ))
-             else
-                if (( run_number > 0 ))
-                then
-                   printf "\n  --- INFORMATIVE: The following file cannot get a unified cycle number"
-                fi
-             fi
-          fi
-          cyclestring=`printf "%03d" ${cycnum[$i]}`
-          pathout[$i]=${pathout[$i]}.$cyclestring
-       fi
-
-          # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION)
-       files_for_cores=false; filetype=file
-       link_local_output=false
-       if [[ "${actionout[$i]}" = pe  &&  -n $cores ]]
-       then
-          files_for_cores=true; filetype=directory
-          actionout[$i]=""
-       elif [[ "${actionout[$i]}" = pe  &&  ! -n $cores ]]
-       then
-          actionout[$i]=""
-       elif [[ "${actionout[$i]}" = lnpe  &&  -n $cores ]]
-       then
-          files_for_cores=true; filetype=directory
-          link_local_output=true
-          actionout[$i]=""
-             # FILE HAS BEEN FOUND INSTEAD OF DIRECTORY
-          if [[ -f ${localout[$i]} ]]
-          then
-             files_for_cores=false; filetype=file
-          fi
-       elif [[ "${actionout[$i]}" = lnpe  &&  ! -n $cores ]]
-       then
-          link_local_output=true
-          actionout[$i]=""
-       elif [[ "${actionout[$i]}" = trpe  &&  -n $cores ]]
-       then
-          files_for_cores=true; filetype=directory
-          actionout[$i]="tr"
-       elif [[ "${actionout[$i]}" = trpe  &&  ! -n $cores ]]
-       then
-          actionout[$i]="tr"
-       fi
-
-       if [[ ! -f ${localout[$i]}  &&  $files_for_cores = false ]]
-       then
-          if [[ ${warnout[$i]} = true ]]
-          then
-             printf "\n  +++ temporary OUTPUT-file  ${localout[$i]}  does not exist\n"
-          fi
-       elif [[ ! -d ${localout[$i]}  &&  $files_for_cores = true ]]
-       then
-          if [[ ${warnout[$i]} = true ]]
-          then
-             printf "\n  +++ temporary OUTPUT-file  ${localout[$i]}/....  does not exist\n"
-          fi
-       else
-
-
-             # COPY VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m)
-             # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT
-          if [[ "${actionout[$i]}" = tr  ||  "${actionout[$i]}" = tra ]]
-          then
-             if [[ $running_on_remote = true ]]
-             then
-
-                   # SET OPTIONS FOR TRANSFER
-                if [[ "${actionout[$i]}" = tr ]]
-                then
-                   if [[ $files_for_cores = false ]]
-                   then
-                      catalog_option=""
-                      catalog_string=""
-                   else
-                      catalog_option="-c"
-                      catalog_string="/"
-                   fi
-                   append_option=""
-                   append_string=""
-                else
-                   append_option="-A"
-                   append_string="append"
-                fi
-
-                transfer_failed=false
-                printf "\n  >>> OUTPUT: ${localout[$i]}$catalog_string  $append_string by SCP to"
-                printf "\n              ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}$catalog_string\n"
-
-                   # TRANSFER VIA SCP
-                if [[ "$remote_loginnode" != "" ]]
-                then
-                   ssh -q $remote_username@$remote_loginnode  "cd $tempdir; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} \"${pathout[$i]}\" ${configuration_identifier}_${run_identifier}${endout[$i]}  ${extout[$i]}"
-                else
-                   batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} "${pathout[$i]}" ${configuration_identifier}_${run_identifier}${endout[$i]}  ${extout[$i]}
-                fi
-                [[ ${PIPESTATUS[0]} != 0 ]]  &&  transfer_failed=true
-
-
-                   # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE
-                if [[ $transfer_failed = true ]]
-                then
-                   printf "  +++ transfer failed. Trying to save a copy on this host under:\n"
-                   printf "      ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}_$run_id_number\n"
-
-                      # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY
-                   eval  local_catalog=${pathout[$i]}
-                   if [[ ! -d $local_catalog ]]
-                   then
-                      printf "  *** local directory does not exist. Trying to create:\n"
-                      printf "      $local_catalog \n"
-                      mkdir -p  $local_catalog
-                   fi
-                   eval  cp  ${localout[$i]}  ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}_$run_id_number
-                   transfer_problems=true
-                fi
-
-             else
-
-                   # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST
-                   # BE COPIED OR APPENDED ON THIS MACHINE
-                if [[ "${actionout[$i]}" = tr ]]
-                then
-                   actionout[$i]=""
-                else
-                   actionout[$i]="a"
-                fi
-             fi
-          fi
-
-
-             # APPEND ON THIS MACHINE
-          if [[ "${actionout[$i]}" = "a" ]]
-          then
-             if [[ "${extout[$i]}" != " "  &&  "${extout[$i]}" != "" ]]
-             then
-                printf "\n  >>> OUTPUT: ${localout[$i]}  append to"
-                printf "\n              ${pathout[$i]}.${extout[$i]}\n"
-                cat  ${localout[$i]}  >>  ${pathout[$i]}.${extout[$i]}
-             else
-                printf "\n  >>> OUTPUT: ${localout[$i]}  append to"
-                printf "\n              ${pathout[$i]}\n"
-                cat  ${localout[$i]}  >>  ${pathout[$i]}
-             fi
-          fi
-
-             # COPY ON THIS MACHINE
-             # COPY HAS TO BE USED, BECAUSE MOVE DOES NOT WORK IF FILE-ORIGIN AND TARGET ARE
-             # ON DIFFERENT FILE-SYSTEMS
-          if [[ "${actionout[$i]}" = ""  &&  $files_for_cores = false ]]
-          then
-
-                # COPY IN CASE OF RUNS ON SINGLE CORES
-             if [[ "${extout[$i]}" != " "  &&  "${extout[$i]}" != "" ]]
-             then
-                printf "\n  >>> OUTPUT: ${localout[$i]}  to"
-                printf "\n              ${pathout[$i]}.${extout[$i]}\n"
-                if [[ $link_local_output = true ]]
-                then
-                   printf "      file will be linked\n"
-                   ln -f  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
-                fi
-                   # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
-                if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]]
-                then
-                   if [[ $link_local_output = true ]]
-                   then
-                      printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-                   fi
-                   cp  ${localout[$i]}  ${pathout[$i]}.${extout[$i]}
-                fi
-             else
-                printf "\n  >>> OUTPUT: ${localout[$i]}  to"
-                printf "\n              ${pathout[$i]}\n"
-                if [[ $link_local_output = true ]]
-                then
-                   printf "      file will be linked\n"
-                   ln -f  ${localout[$i]}  ${pathout[$i]}
-                fi
-                   # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"
-             	if [[ ! -f "${pathout[$i]}" ]]
-                then
-                   if [[ $link_local_output = true ]]
-                   then
-                      printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-                   fi
-                   cp  ${localout[$i]}  ${pathout[$i]}
-                fi
-             fi
-
-          elif [[ "${actionout[$i]}" = ""  &&  $files_for_cores = true ]]
-          then
-
-                # FILES FROM THE DIFFERENT CORES ARE MOVED WITH ln-COMMAND TO THE PERMANENT DIRECTORY
-                # AS A FIRST STEP, THE PERMANENT DIRECTORY IS CREATED
-             printf "\n  >>> OUTPUT: ${localout[$i]}/_....  to"
-             printf "\n              ${pathout[$i]}\n"
-             if [[ $link_local_output = true ]]
-             then
-                printf "      files will be linked\n"
-                mkdir -p ${pathout[$i]}
-                cd ${localout[$i]}
-                for file in $(ls *)
-                do
-                   ln -f $file  ${pathout[$i]}
-                done >|/dev/null 2>&1
-                cd $tempdir
-             fi
-
-                # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r"
-             if [[ ! -f "${pathout[$i]}/_000000" ]]
-             then
-                if [[ $link_local_output = true ]]
-                then
-                   printf "  --- WARNING: ln failed, using cp instead (might be time consuming...)\n"
-                fi
-                [[ ! -d "${pathout[$i]}" ]]  &&  mkdir  ${pathout[$i]}
-                cp -r  ${localout[$i]}/*  ${pathout[$i]}
-       	     fi
-
-          fi
-       fi
-    done
-
-    if (( i != 0 ))
-    then
-       timestring=`date +%H:%M:%S`
-       if [[ $transfer_problems = true ]]
-       then
-          printf "\n$dashes\n  *** OUTPUT-files saved       local time: $timestring"
-          printf "\n  +++ WARNING: some data transfers failed! \n"
-       else
-          printf "\n$dashes\n  *** all OUTPUT-files saved       local time: $timestring \n"
-       fi
-    fi
-
-
-       # IF REQUIRED, START A RESTART-JOB
-       # FILE CONTINUE_RUN MUST HAVE BEEN CREATED BY THE EXECUTABLE (PALM)
-    if [[ -f CONTINUE_RUN ]]
-    then
-
-          # ADD RESTART-OPTIONS TO THE PALMRUN-CALL (IF THEY ARE NOT USED ALREADY):
-          # -C TELLS PALMRUN THAT IT IS A RESTART-RUN
-          # -v SILENT MODE WITHOUT INTERACTIVE QUERIES
-          # -b START A BATCH JOB
-       [[ $(echo $prc | grep -c "\-C") = 0 ]]  &&  prc="$prc -C"
-       [[ $(echo $prc | grep -c "\-v") = 0 ]]  &&  prc="$prc -v"
-       [[ $(echo $prc | grep -c "\-b") = 0  &&  $running_on_remote = false ]]  &&  prc="$prc -b"
-
-          # REPLACE SVFOUT IN THE ACTIVATION STRINGS (GIVEN WITH OPTION -a)
-          # SO THAT RESTARTS USE SVF DATA CREATED BY THE INITIAL RUN
-       if [[ $(echo $prc | grep -c "svfout") != 0 ]]
-       then
-          prc=`echo $prc | sed 's/svfout/svfin/g'`
-       fi
-
-          # REPLACE THE HASH IN THE ACTIVATION STRINGS (GIVEN WITH OPTION -a)
-          # SO THAT RESTARTS ACCESS DIFFERENT FILES THAN THE INITIAL RUN
-       if [[ $(echo $prc | grep -c "#") != 0 ]]
-       then
-          prc=`echo $prc | sed 's/#/r/g'`
-       fi
-
-
-          # START THE RESTART-JOB
-       printf "\n\n  *** initiating restart-run on \"$local_ip\" using command:\n"
-       echo "      $prc"
-       printf "\n$dashes\n"
-       if [[ $running_on_remote = true ]]
-       then
-
-          echo "*** ssh will be used to initiate restart-runs!"
-          echo "    return_address=\"$return_address\" "
-          echo "    return_username=\"$local_username\" "
-
-          if [[ "$remote_loginnode" != "" ]]
-          then
-             ssh -q $remote_username@$remote_loginnode  "ssh -q $SSH_PORTOPT  $local_username@$return_address \" PATH=\\\$PATH:$LOCAL_PALMRUN_PATH; cd $LOCAL_PWD; $prc\" " |  tee palmrun_restart.log
-          else
-             ssh -q $SSH_PORTOPT  $local_username@$return_address  " PATH=\\\$PATH:$LOCAL_PALMRUN_PATH; cd $LOCAL_PWD; $prc" |  tee palmrun_restart.log
-          fi
-
-             # WAIT TO ALLOW THE RESTART-JOB TO BE QUEUED, BEFORE THE CURRENT JOB IS FINISHED
-          sleep 30
-
-       else
-
-             # START THE RESTART JOB ON THE LOCAL HOST
-          eval  $prc  |  tee palmrun_restart.log              # THE ' MUST BE EVALUATED
-
-       fi
-
-          # CHECK, IF RESTART JOB HAS BEEN STARTED
-       if [[ $( grep -c "+++ palmrun crashed"  palmrun_restart.log ) != 0 ]]
-       then
-          printf "\n$dashes\n  +++ creating restart run failed \n"
-          locat=create_restart
-          rm  palmrun_restart.log
-          exit
-       elif [[ $( grep -c "*** palmrun finished"  palmrun_restart.log ) != 1 ]]
-       then
-          printf "\n$dashes\n  +++ creating restart run failed, probably due to network problems\n"
-          locat=create_restart
-          rm  palmrun_restart.log
-          exit       
-       else
-          printf "\n$dashes\n  *** restart run initiated \n"
-          rm  palmrun_restart.log
-       fi
-
-
-          # DELETE INPUT-(RESTART)FILES, WHICH HAVE BEEN FETCHED FROM THE TEMPORARY DATA
-          # DIRECTORY, BACAUSE THEY ARE NOT REQUIRED BY THE RESTART-JOB.
-          # THIS IS DONE IN ORDER TO AVOID EXCEEDING DISC QUOTAS OR DISC SPACE (RESTART-FILES
-          # MAY BE VERY HUGE)
-       (( i = 0 ))
-       while (( i < nr_of_input_files ))
-       do
-          (( i = i + 1 ))
-          if [[ "${got_tmp[$i]}" = true   &&  $keep_data_from_previous_run = false ]]
-          then
-             rm -r  ${absnamein[$i]}
-          fi
-       done
-
-    fi
-
-
-       # ALL ACTIONS FINISHED, TEMPORARY WORKING-DIRECTORY CAN BE DELETED
-    cd  $HOME
-    [[ $delete_temporary_catalog = true ]]  &&  rm -rf $tempdir
-
-
- else
-
-
-       # PREPARING ACTIONS,
-       # IF A BATCH-JOB IS TO BE GENERATED AND TO BE STARTED ON A LOCAL OR REMOTE-MACHINE
-
-       # BUILD THE PALMRUN-COMMAND TO BE CALLED IN THE BATCH-JOB
-    palmrun_com="$palmrun_script_name -r $run_identifier -c $configuration_identifier -m $memory -t $cpumax -q $queue -i $run_id_number -U $local_username"
-    [[ "$activation_string_list" != "" ]]  &&  palmrun_com=${palmrun_com}" -a \"$activation_string_list\""
-    [[ "$global_revision" != "" ]]  &&  palmrun_com=${palmrun_com}" -G \"$global_revision\""
-    [[ $keep_data_from_previous_run = true ]]  &&  palmrun_com=${palmrun_com}" -k"
-    [[ $do_trace = true ]]        &&  palmrun_com=${palmrun_com}" -x"
-    [[ "$cores" != "" ]]       &&  palmrun_com=${palmrun_com}" -X $cores"
-    [[ $use_openmp = true ]]  &&  palmrun_com=${palmrun_com}" -O $threads_per_task"
-    [[ $tasks_per_node != 0 ]]  &&  palmrun_com=${palmrun_com}" -T $tasks_per_node"
-    [[ $delete_temporary_catalog = false ]]  &&  palmrun_com=${palmrun_com}" -B"
-    [[ "$ocean_file_appendix" = true ]]  &&  palmrun_com=${palmrun_com}" -y"
-    [[ $run_coupled_model = true ]]  &&  palmrun_com=${palmrun_com}" -Y \"$coupled_dist\""
-    [[ "$combine_plot_fields" = false ]]  &&  palmrun_com=${palmrun_com}" -Z"
-    [[ "$max_par_io_str" != "" ]]  &&  palmrun_com=${palmrun_com}" -w $max_par_io_str"
-    [[ "$project_account" != "" ]]  &&  palmrun_com=${palmrun_com}" -A $project_account"
-    if [[ $create_remote_batch_job = true ]]
-    then
-       palmrun_com=${palmrun_com}" -j -u $remote_username -R $local_ip"
-       if [[ $do_trace = true ]]
-       then
-          printf "\n *** PALMRUN-command on remote host:\n     $palmrun_com \n"
-       fi
-    elif [[ $create_batch_job = true ]]
-    then
-       palmrun_com=${palmrun_com}" -j"
-       if [[ $do_trace = true ]]
-       then
-          printf "\n *** PALMRUN-command on local host:\n     $palmrun_com \n"
-       fi
-    fi
-
-
-       # DETERMINE THE FULL PATHS FOR THE JOB PROTOCOL FILES ON THE LOCAL AND
-       # REMOTE HOST
-    job_protocol_file_local=${local_jobcatalog}/${configuration_identifier}_${run_id}
-    job_protocol_file=$job_protocol_file_local
-    if [[ $create_remote_batch_job = true ]]
-    then
-       job_protocol_file_remote=${remote_jobcatalog}/${configuration_identifier}_${run_id}
-       job_protocol_file=$job_protocol_file_remote
-       job_transfer_protocol_file=${remote_jobcatalog}/last_job_transfer_protocol
-       scpjob_file=${remote_jobcatalog}/scpjob.$run_id_number
-    fi
-
-
-       # BUILD THE JOB-SCRIPTS ON FILE jobfile
-    jobfile=jobfile.$run_id_number
-
-
-       # FIRST CREATE THE BATCH DIRECTIVES
-    (( i = 0 ))
-    while (( i < ibd ))
-    do
-       (( i = i + 1 ))
-       line=`echo  "${batch_directive[$i]}" | sed 's/{{/$/g' | sed 's/}}//g'`
-       eval line=\"$line\"
-       echo  "$line"                               >>  $jobfile
-    done
-    echo " "                                       >>  $jobfile
-
-
-       # FOR BATCH JOBS ON REMOTE HOSTS, ADD THE JOBFILE TO SEND BACK THE JOB
-       # PROTOCOL
-    if [[ $create_remote_batch_job = true ]]
-    then
-       echo "set +vx"                                   >>  $jobfile
-       echo "trap '"                                    >>  $jobfile
-       echo "set +vx"                                   >>  $jobfile
-       echo "cd ${remote_jobcatalog}"                   >>  $jobfile
-       echo "cat >  scpjob.$run_id_number << %%END%%"   >>  $jobfile
-
-          # ADD THE BATCH DIRECTIVES
-       (( i = 0 ))
-       while (( i < ibdt ))
-       do
-          (( i = i + 1 ))
-          line=`echo  "${batch_directive_transfer[$i]}" | sed 's/{{/$/g' | sed 's/}}//g'`
-          eval line=\"$line\"
-          echo  "$line"                            >>  $jobfile
-       done
-       echo " "                                    >>  $jobfile
-
-       echo "set -x"                               >>  $jobfile
-       if [[ "$remote_loginnode" != "" ]]
-       then
-          echo "ssh -q $remote_username@$remote_loginnode  \"cd ${remote_jobcatalog}; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp  $PORTOPT  -d  -w 10  -u $local_username $local_ip  $job_protocol_file_remote \\\"$local_jobcatalog\\\"  ${configuration_identifier}_${run_identifier}\" "  >> $jobfile
-       else
-          echo "${fast_io_catalog}/${sources_for_run_catalog}/batch_scp  $PORTOPT  -d  -w 10  -u $local_username $local_ip  $job_protocol_file_remote  \"$local_jobcatalog\"  ${configuration_identifier}_${run_identifier}"  >>  $jobfile
-       fi
-       echo "%%END%%"                              >>  $jobfile
-       echo "echo \" *** submitting job for transfering the job protocol file to $local_ip\" "  >>  $jobfile
-       echo "$submit_command  $scpjob_file"     >>  $jobfile
-       echo "rm $scpjob_file"                      >>  $jobfile
-       echo "rm -rf $job_transfer_protocol_file"   >>  $jobfile
-       echo "set -x"                               >>  $jobfile
-       echo "     ' exit"                          >>  $jobfile
-    fi
-
-
-       # ACTIVATE ERROR-TRACEBACK
-    if [[ $do_trace = true ]]
-    then
-       echo  "set -x"                                    >>  $jobfile
-    else
-       echo  "set +vx"                                   >>  $jobfile
-    fi
-
-
-       # INITIALIZE THE ENVIRONMENT AND LOAD MODULES
-    if [[ "$login_init_cmd" != "" ]]
-    then
-       echo  "$login_init_cmd"        >>  $jobfile
-    fi
-    if [[ "$module_commands" != "" ]]
-    then
-       echo  "$module_commands"     >>  $jobfile
-    fi
-
-
-       # CREATE TEMPORARY DIRECTORY AND SWITCH TO IT
-    if [[ $create_remote_batch_job = true ]]
-    then
-       echo  "mkdir  $tempdir"           >>  $jobfile
-       echo  "if [[ \$? != 0 ]]"         >>  $jobfile
-       echo  "then"                      >>  $jobfile
-       echo  "   echo \"+++ temporary working directory cannot be created.\" "  >>  $jobfile
-       echo  "   echo \"    Check setting of variable fast_io_catalog in your config file.\" "  >>  $jobfile
-       echo  "   exit"                   >>  $jobfile
-       echo  "fi"                        >>  $jobfile
-       echo  "chmod  go+rx  $tempdir"    >>  $jobfile
-    else
-          # DIRECTORY FOR LOCAL BATCH JOBS IS CREATED NOW, DUE TO A
-          # REQUIREMENT OF THE GRID ENGINE BATCH SYSTEM (WORKING DIR IS GIVEN IN
-          # BATCH DIRECTIVE -wd AND MUST ALREADY EXIST WHEN THE JOB IS SUBMITTED)
-       mkdir  $tempdir
-       if [[ $? != 0 ]]
-       then
-          printf "\n  +++ temporary working directory cannot be created."
-          printf "\n      Check setting of variable fast_io_catalog in your config file."
-          locat=execution
-          exit
-       fi
-       chmod  go+rx  $tempdir
-    fi
-    echo  "cd  $tempdir"                 >>  $jobfile
-    echo  "export tempdir=$tempdir"      >>  $jobfile
-    echo  "cp  ${fast_io_catalog}/${sources_for_run_catalog}/.[!.]*  ."           >>  $jobfile
-    echo  "export PATH=.:${fast_io_catalog}/${sources_for_run_catalog}:\$PATH"    >>  $jobfile
-    echo  "export execute_palmrun=true"  >>  $jobfile
-
-
-       # PROVIDE NAME OF THE CURRENT WORKING-DIRECTORY ON THE LOCAL MACHINE (FROM WHERE THE JOB IS
-       # STARTED) BY SETTING AN ENVIRONMENT-VARIABLE. THIS INFORMATION IS USED IN THE JOB BY PALMRUN
-       # IN CASE THAT RESTART-RUNS HAVE TO BE GENERATED
-    echo  "LOCAL_PWD=$working_directory"                >>  $jobfile
-    echo  "export LOCAL_PWD"                            >>  $jobfile
-
-
-       # PROVIDE THE PATH OF THE LOCAL PALMRUN-SCRIPT FOR THE SAME REASON 
-    echo  "LOCAL_PALMRUN_PATH=${source_path}/../SCRIPTS"   >>  $jobfile
-    echo  "export LOCAL_PALMRUN_PATH"                      >>  $jobfile
-
-
-       # CALL PALMRUN WITHIN THE JOB
-       # AS FINAL ACTION, REMOVE THE TEMPORARY DIRECTORY CREATED AT THE BEGINNING OF THE JOB
-    echo  "set -x"                                              >>  $jobfile
-    echo  "[[ \$execute_palmrun = true ]]  &&  $palmrun_com"    >>  $jobfile
-
-
-       # TRANSFER JOBFILE TO THE TARGET HOST
-    if [[ $create_jobfile_only = false ]]
-    then
-
-          # CREATE LOCAL JOB FOLDER
-       eval  local_jobcatalog=$local_jobcatalog
-       if [[ ! -d $local_jobcatalog ]]
-       then
-          echo " "
-          echo " *** local jobcatalog \"$local_jobcatalog\" does not exist and will be created now"
-          mkdir  $local_jobcatalog
-       fi
- 
-       if [[ $create_remote_batch_job = true ]]
-       then
-
-          echo " "
-          echo " *** transfer of job to remote host via scp"
-
-             # CREATE REMOTE JOB FOLDER, IF IT DOES NOT EXIST
-          ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip}  "[[ ! -d $remote_jobcatalog ]]  &&  mkdir $remote_jobcatalog"  2>&1
-
-             # COPY THE JOB FILE 
-          if [[ $do_trace = true ]]
-          then
-             echo "     scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${configuration_identifier}_${run_id}"
-          fi
-          scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${configuration_identifier}_${run_id}  >  /dev/null
-
-             # SUBMIT THE JOB
-          printf " *** submit the job (output of submit command, \n"
-          printf "     e.g. the job-id given by the batch-system, may follow) \n"
-          if [[ $do_trace = true ]]
-          then
-             echo "     ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip} \"cd $remote_jobcatalog; $submit_command ${configuration_identifier}_${run_id}; rm ${configuration_identifier}_${run_id}\" "
-          fi
-          ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip} "cd $remote_jobcatalog; $submit_command ${configuration_identifier}_${run_id}; rm ${configuration_identifier}_${run_id}"
-
-       elif [[ $create_batch_job = true ]]
-       then
-
-          eval  local_jobcatalog=$local_jobcatalog
-          cp  $jobfile  ${local_jobcatalog}/${configuration_identifier}_${run_id}
-          cd $local_jobcatalog
-          echo " "
-          echo " *** submit the job"
-          if [[ $do_trace = true ]]
-          then
-             echo "$submit_command ${configuration_identifier}_${run_id}"
-          fi
-          $submit_command ${configuration_identifier}_${run_id}
-          rm ${configuration_identifier}_${run_id}
-          cd -  > /dev/null
-
-       fi
-
-       rm -rf  $jobfile
-
-    else
-
-       printf "\n *** jobfile created under name \"$jobfile\" "
-       printf "\n     no batch-job has been sent!"
-
-    fi
-
- fi  # END OF REMOTE-PART
Index: palm/trunk/SCRIPTS/palmrungui
===================================================================
--- palm/trunk/SCRIPTS/palmrungui	(revision 4901)
+++ 	(revision )
@@ -1,1949 +1,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id$
-# Bugfix: set check boxes for cyclic fill and svf I/O when loading job from history.
-# Added support for option -W (wait for job; dependency mode)
-#
-# 
-# 4670 2020-09-09 17:27:45Z maronga
-# Ported to PyQt5, removed support for user parameters. Added support for Option
-# "-V" (do not re-build pre-built source code). Changed activation strings
-# according to default .palm.iofiles (svfin/svfout/rec)
-# 
-# 4482 2020-04-01 13:17:50Z maronga
-# Added possibility to delete all files in a directory and option to create
-# blank new jobs
-# 
-# 4481 2020-03-31 18:55:54Z maronga
-# Bugfixes: - reading history lines discard button caused error message
-#           - deleting of USER_CODE files did not work
-# 
-# 4470 2020-03-24 06:52:19Z maronga
-# Added file size output, more I/O functionalities, new/removed buttons
-# 
-# 4428 2020-02-27 11:43:53Z maronga
-# Bugfix for update button
-# 
-# 4427 2020-02-27 11:29:51Z maronga
-# Small fixes and adjustments
-# 
-# 4420 2020-02-24 14:13:56Z maronga
-# Bugfix: minor fixes related to start buttons
-# 
-# 4411 2020-02-18 14:28:02Z maronga
-# Added new features: individual tag for submitted runs, automatic finding of
-# configuration, start of palmbuild from GUI
-# 
-# 4405 2020-02-12 19:11:11Z maronga
-# Major revisions: New layout. Merged with palm job manager (palm_jm).
-# Minor revisions: Misc. bugs fixed.
-# 
-# 4394 2020-02-04 21:40:38Z maronga
-# Bugfix: harmonized naming convention of configuration files
-# 
-# 4393 2020-02-04 21:24:48Z maronga
-# Removed PALM_BIN dependency and os calls 
-# 
-# 3487 2018-11-05 07:18:02Z maronga
-# Renamed options -d and -h to -r and -c.
-# 
-# 2825 2018-02-20 21:48:27Z maronga
-# Adjusted to work with newest version of palmrun
-# 
-# 2718 2018-01-02 08:49:38Z maronga
-# Corrected "Former revisions" section
-# 
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 2484 2017-09-20 14:22:42Z maronga
-# Added PALM logo
-# 
-# 2480 2017-09-19 06:24:14Z maronga
-# option -A (project account number) added
-# 
-# 2477 2017-09-18 08:42:29Z maronga
-# Renamed restart run appendix from "f" to "r". Bugfix for displaying restart runs.>
-# Revised list of recently submitted jobs
-# 
-# 2413 2017-09-06 12:48:29Z maronga
-# Renamed to palmrungui and adapted for use with palmrun instead of mrun.
-# 
-# 2316 2017-07-20 07:53:42Z maronga
-# Initial revision in python
-# 
-# 
-#
-# Description:
-# ------------
-# Graphical user interface for the palmrun script.
-# @author Felix Gaschler
-# @author BjÃ¶rn Maronga (maronga@muk.uni-hannover.de)
-#
-# Instructions:
-# -------------
-#
-#------------------------------------------------------------------------------!
-import sys
-import subprocess
-from PyQt5 import QtCore, QtGui, uic, QtWidgets
-from PyQt5.QtWidgets import QMainWindow, QApplication
-from PyQt5.QtCore import QProcess, pyqtSlot, QTimer
-from time import strftime
-import os
-import shutil
-
-global update_frequency
-update_frequency = 5*60000
-
-# Determine PALM directories
-try: 
-   devnull = open(os.devnull, 'w')      
-   palm_dir = os.getcwd()
-   palm_bin = palm_dir + '/trunk/SCRIPTS'
-   palm_source = palm_dir + '/trunk/SOURCE'
-   job_dir = palm_dir + '/JOBS'
-   user_dir = palm_dir + '/USER_CODE'
-   with open(palm_bin + '/palmrungui', 'r', encoding='utf8') as fh:
-      # file found
-      out = None
-except:   
-   print ("Error. palmrungui probably called in wrong directory.")
-   raise SystemExit
-
-
-# returns the human readable file size of filename
-def file_size(filename, suffix='B'):
-   size_raw = os.stat(filename).st_size
-   for unit in [' ',' K',' M',' G',' T']:
-      if abs(size_raw) < 1024.0:
-         return "%i%s%s" % (size_raw, unit, suffix)
-      size_raw /= 1024.0
-   return "%.1f%s%s" % (num, 'Y', suffix)
-
-def ilen(iterable):
-    return reduce(lambda sum, element: sum + 1, iterable, 0)
-
-palmrunline = ""
-set_list = []
-
-Ui_MainWindow = uic.loadUiType("%s/palmrungui_files/mainwindow.ui" % (palm_bin))[0]
-Ui_helpDialog = uic.loadUiType("%s/palmrungui_files/help.ui" % (palm_bin))[0]
-Ui_aboutDialog = uic.loadUiType("%s/palmrungui_files/about.ui" % (palm_bin))[0]
-
-class HelpDialog(QtWidgets.QDialog,Ui_helpDialog):
-    def __init__(self, parent=None):
-        super(HelpDialog,self).__init__()
-        self.setupUi(self)
-        
-class AboutDialog(QtWidgets.QDialog,Ui_aboutDialog):
-    def __init__(self, parent=None):
-        super(AboutDialog,self).__init__()
-        self.setupUi(self)        
-
-class Mainwindow(QtWidgets.QMainWindow, Ui_MainWindow):
-    def __init__(self, parent=None):
-        super(Mainwindow, self).__init__()
-        self.setupUi(self)
-
-        self.palm_logo.setPixmap(QtGui.QPixmap(palm_bin + "/palmrungui_files/logo.png"))
-        with open(palm_bin + "/palmrungui", encoding='utf8') as search:
-           for line in search:
-              line = line.rstrip()
-              if "$Id" in line:
-                 version = "Version: r" + line.split(" ")[3] + " (" + line.split(" ")[4] + ")"
-                 self.groupBox.findChild(QtWidgets.QLabel,"label_version").setText(version)
-                 break
-        self.recent_jobs(50)
-        self.load_jobs()
-
-
-
-        # look up configuration files and add to combo box
-        
-        self.group_execution.findChild(QtWidgets.QComboBox,"combo_configuration").addItem("")
-        
-        for files in os.listdir(palm_dir):
-           if files.startswith(".palm.config"):
-              tmpstring = list(filter(None,files.split(".palm.config.")))[0]
-              self.group_execution.findChild(QtWidgets.QComboBox,"combo_configuration").addItem(tmpstring)
-
-        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
-        commandline.setText("")
-        
-        self.tabWidget.setCurrentIndex(0)  
-        
-
-        filename = "%s/.palmrungui.default" % (palm_dir)  
-        if os.path.exists(filename):
-           file = open(filename, "r")
-           if ( file is not None ):
-              # File opened successfully
-              palmrunline = file.readline()
-              #if neue zeile zeichen
-              palmrunline = palmrunline[:len(palmrunline)-1]
-              file.close()
-
-           # In case a palmrunline was found, load it to mainwindow
-           if ( palmrunline != ""):
-              palmrunline = palmrunline[17:]
-              commandline.setText(palmrunline)
-              self.setup_gui(palmrunline)
-
-        QtWidgets.QApplication.processEvents()
-
-        # Start refresh timer. On timeout perform update
-
-        self.timer = QtCore.QTimer(self)
-        self.timer.timeout.connect(self.update_all)
-        self.timer.setSingleShot(False)
-        self.timer.start(update_frequency)
-
-        # The timetimer counts the time since last update
-        self.timetimer= QtCore.QElapsedTimer()
-        self.timetimer.start()
-
-        # The labeltimer induces the update of the remaining time in the UI
-
-        self.labeltimer = QtCore.QTimer(self)
-        self.labeltimer.timeout.connect(self.UpdatePush)
-        self.labeltimer.setSingleShot(False)
-
-        # Update in the UI will be performed at each 1/10 of the update interval
-        self.labeltimer.start(update_frequency/10)
-        self.push_update.setText("Update (" + str(int(update_frequency/1000/60)) + " min)")
-
-    # starts xterm with palmrun commandline
-    #######################################
-    def startpalmrun(self):
-        palmrunline = str(self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text())
-        palmrunline_save = palmrunline
-
-        # Disable the main window
-        self.tabWidget.setEnabled(False)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
-        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(False)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("wait...")
-        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText("Executing palmrun in xterm...")
-
-        # Wait until all commands have been executed (ugly) ?
-        #for i in range(0,21):
-        #    qApp->processEvents()       
-
-        # Start xterm as QProcess
-        palmrun = QProcess()
-        palmrun.setProcessChannelMode(QProcess.MergedChannels) # mergedChannels
-        palmrun.setWorkingDirectory(palm_dir)
-
-        geomet = self.frameGeometry()
-
-        posx = geomet.x()+geomet.width()
-        posy = geomet.y()
-
-        if ( os.path.isfile("palmrungui.log") ):
-           os.remove("palmrungui.log")
-
-        s = " -title \"Executing palmrun...\" -fa \"Monospace\" -l -lf \"palmrungui.log\" -fs 11 -geometry \"80x38+%d+%d\" -e \"" % (posx,posy)
-        palmrunline = "%s%s ;echo -n '--> Press enter to continue...';read yesno\"</dev/stdin" % (s, palmrunline.replace("\"","\'"))
-
-        mString = "xterm %s" % (palmrunline)
-        palmrun.start(mString)
-
-        if( palmrun.waitForStarted() is False ):
-            return
-
-        # Wait until palmrun has finished or wait for 200 minutes
-        palmrun.waitForFinished(3600000)        
-
-        # Jobs has been submitted or aborted. Continuing...
-        # Save the palmrun command to history file
-        filename = "%s/.palmrungui.history" % (palm_dir)
-        tmstamp = strftime("%Y/%m/%d %H:%M")
-        tag = str(self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").text())
-    
-        file = open(filename,"a")
-        s = "%s %s (%s)\n" % (tmstamp,palmrunline_save,tag)
-        file.write(s)
-        file.close()              
-        
-        # Enable main window again
-        self.tabWidget.setEnabled(True)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("palmrun")
-        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline_save)
-        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
-        
-        # Reload recent jobs
-        self.recent_jobs(50)
-        
-        
-       
-    # Update the label
-    def UpdatePush(self):
-        remaining_time = int((update_frequency - self.timetimer.elapsed()) / 1000 / 60)
-        self.push_update.setText("Update (" + str(remaining_time) + " min)")
-
-
-    # starts xterm with palmbuild commandline
-    #######################################
-    def startpalmbuild(self):
-        palmbuildline = 'palmbuild -c ' + str(self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").currentText())
-
-        full_build = self.group_execution.findChild(QtWidgets.QCheckBox,"check_rebuild").checkState()
-
-        if ( full_build == 2 ):
-           for filename in os.listdir(palm_source):
-              os.utime(palm_source + "/" + filename, None)
-
-        palmrunline_save = str(self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text())
-
-        # Disable the main window
-        palmbuildline_save = palmbuildline
-        self.tabWidget.setEnabled(False)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
-        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(False)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("wait...")
-        self.group_execution.findChild(QtWidgets.QPushButton,"button_palmbuild").setText("wait...")
-        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText("Executing palmbuild in xterm...")
-        
-        # Wait until all commands have been executed (ugly) ?
-        #for i in range(0,21):
-        #    qApp->processEvents()       
-        
-        # Start xterm as QProcess
-        palmbuild = QProcess()
-        palmbuild.setProcessChannelMode(QProcess.MergedChannels) # mergedChannels
-        palmbuild.setWorkingDirectory(palm_dir)
-    
-        geomet = self.frameGeometry()
-        
-        posx = geomet.x()+geomet.width()
-        posy = geomet.y()
-      
-        s = " -title \"Executing palmbuild...\" -fa \"Monospace\" -fs 11 -geometry \"80x38+%d+%d\" -e \"" % (posx,posy)
-        palmbuildline = "%s%s;echo -n '--> Press enter to continue...';read yesno\"</dev/stdin" % (s, palmbuildline.replace("\"","\'"))
-        
-        mString = "xterm %s" % (palmbuildline)
-        palmbuild.start(mString)
-    
-        if( palmbuild.waitForStarted() is False ):
-            return
-        
-        # Wait until palmbuild has finished or wait for 200 minutes
-        palmbuild.waitForFinished(3600000)        
-        
-          
-        
-        # Enable main window again
-        self.tabWidget.setEnabled(True)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
-        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
-        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("palmrun")
-        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline_save)
-        self.group_execution.findChild(QtWidgets.QPushButton,"button_palmbuild").setText("(re-)build")
-        # Reload recent jobs
-        self.recent_jobs(50)
-
-    # loads recent jobs 
-    ######################################
-    def recent_jobs(self, number):
-        fileDir = "%s/.palmrungui.history" % (palm_dir)
-        if os.path.exists(fileDir):
-            pass
-        else:
-            return
-
-        file = open(fileDir,"r")
-        history = file.readlines()
-        tmphistory = list()
-        tmptag = list()
-        file.close()
-        j = 0
-
-        list_jobname = self.group_history.findChild(QtWidgets.QListWidget,"list_jobname")
-        list_jobname.clear()
-
-        # Read history entries and append to recent job list
-        i=len(history)-1
-        count = 0
-        while i>=0 and count<number:
-            timestamp = history[i][:16]
-            listitem = history[i][17:len(history[i])-1]
-            tagitem = listitem
-            configitem = listitem
-            matchitems = list_jobname.findItems(listitem, QtCore.Qt.MatchExactly)
-
-            if ( len(matchitems) == 0 ):
-                listitem = list(filter(None,listitem.split(" -r")))[1]
-                listitem = listitem.strip()
-                listitem = list(filter(None,listitem.split(" ")))[0]
-                listitem = listitem.replace("\"","") 
-                list_jobname.addItem(listitem)
-                
-                configitem = list(filter(None,configitem.split(" -c")))
-                if ( len(configitem) < 2):
-                   count = count +1
-                   continue
-                else:
-                   configitem = configitem[1].strip()
-                configitem = list(filter(None,configitem.split(" ")))[0]
-                configitem = configitem.replace("\"","") 
-
-                s = "%s: %s (%s)" % (timestamp,listitem,configitem)
-                tmphistory.append(s)
-                
-                
-                tagitem = list(filter(None,tagitem.split(" (")))[1]
-                tagitem = tagitem.replace(")","")  
-                if ( len(tagitem) == 0 ): 
-                   s = "Tag: empty"
-                else:
-                   s = "Tag: %s" % (tagitem)                
-                tmptag.append(s)
-                count = count +1
-
-                j = j+1
-                
-            if ( j == number ):
-                break
-            i = i-1
-            
-        # Send to list
-        list_jobname.clear()
-        
-        i=0
-        while i<len(tmphistory):
-            list_jobname.addItem(tmphistory[i])
-            list_jobname.item(i).setToolTip(tmptag[i])
-            i = i+1
-            
-
-    # Enables coupled settings
-    ###############################
-    def enable_coupled(self):
-        coupledState = self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").currentText()
-        group = self.group_execution.findChild(QtWidgets.QGroupBox, "group_coupled")
-        
-        if (coupledState == "Restart run (coupled atmosphere ocean)" or coupledState == "Initial run (coupled atmosphere ocean)"):
-            self.group_coupled.setEnabled(True)
-        else: 
-            self.group_coupled.setEnabled(False)
-            
-
-    # select a job via click from list
-    #################################
-    def choosejob_list(self):
-        #  Get selected item from list
-        list_jobname = self.group_history.findChild(QtWidgets.QListWidget,"list_jobname")
-        filename = str(list_jobname.currentItem().text())
-
-        timestamp = filename[:16]
-        jobname = filename[18:].split(" ")[0]
-
-        itemint = list_jobname.currentRow()
-
-        # Reload list
-        self.recent_jobs(50)
-        self.load_jobs()
-    
-        # Set selected item to jobname
-        list_jobname.item(itemint).setSelected(True)
-    
-        # Set selected item to jobname in "available jobs" list
-        item2int = self.list_jobs.findItems(jobname,QtCore.Qt.MatchCaseSensitive)
-        
-        if ( item2int != [] ):
-           self.list_jobs.setCurrentItem(item2int[0])
-        self.update_input()
-           
-    
-        fileDir = "%s/.palmrungui.history" % (palm_dir)
-        file = open(fileDir,"r")
-        history = file.readlines()
-        tmphistory = list()
-        file.close()        
-    
-        i = len(history)
-        while i>=1:
-            listitem = history[i-1][17:len(history[i-1])-1]
-            listitem = list(filter(None,listitem.split(" -r")))[1]
-            listitem = listitem.strip()
-            listitem = list(filter(None,listitem.split(" ")))[0]
-            listitem = listitem.replace("\"","") 
-
-            # Select command line with correct timestamp and jobname
-            if (history[i-1][:16] == timestamp and listitem == jobname):
-                palmrunline = history[i-1]
-                palmrunline = palmrunline[17:]
-                palmrunline = palmrunline[:len(palmrunline)-1]
-                palmrunline = list(filter(None,palmrunline.split("(")))[0]
-                self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline)
-                
-              
-                tag = history[i-1].split('\n')[0]
-                tag = list(filter(None,tag.split("(")))[1]
-                tag = tag.replace(")","")
-
-                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setText(tag)
-                self.setup_gui(palmrunline)
-                self.list_jobname.item(itemint).setSelected(True)    
-                
-                return
-            i = i-1
-                
-    # Change run identifer (initial, restart, coupled...)
-    ######################################################
-    def change_rc_list(self):
-        drop_job = self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").currentText()
-        self.change_commandline("a","")
-    
-        # Enable PE distribution for atmosphere/ocean
-        if ( drop_job == "Restart run (coupled atmosphere ocean)" or drop_job == "Initial run (coupled atmosphere ocean)"):
-            drop_atmos = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").text()
-            drop_ocean = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").text()
-            s = "%s %s" % (drop_atmos,drop_ocean)
-            self.change_commandline("Y",s)
-    
-    
-        if ( drop_job == "Restart run" or drop_job == "Restart run (coupled atmosphere ocean)"):
-           self.change_commandline("r","")
-
-        # Check of ocean runs
-        else:
-            self.delete_commandline("Y")
-            if (drop_job == "Precursor run (ocean)"):
-                self.activate_flag("y")
-            else:
-                self.deactivate_flag("y")
-            
-    # changes commandline depending on parameters
-    ##########################################################      
-    def change_commandline(self, id_str, fwt_str):
-        fwt_str = str(fwt_str) 
-        initialize = False
-        palmrunline = str(self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text())
-        s = " -%s " % (id_str)
-        splitline = list(filter(None,palmrunline.split(s)))
-
-        if ( len(splitline) == 0 ):
-                splitline.append("palmrun")
-                splitline.append(" ")
-                initialize = True
-
-        elif ( len(splitline) == 1 ):
-            splitline.append(" ")
-        
-        param = splitline[1].split("-")
-    
-        # Change in parameter "r" (jobname)
-        if (id_str == "r"):
-            filename = str(self.group_execution.findChild(QtWidgets.QLineEdit,"line_jobname").text())
-            s = filename.split("JOBS/") 
-            param[0] = s[len(s)-1]
-     
-            if ( initialize == True ):#and self.group_runcontrol.isEnabled() == True ):
-                self.group_execution.setEnabled(True)
-                self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").setEnabled(True)
-                self.group_advanced.setEnabled(True)
-                self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
-                self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(True)
-                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
-            
-            elif ( param[0] == ""):            
-                self.group_execution.setEnabled(False)
-                self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").setEnabled(False)
-                self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
-                self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(False)
-                self.group_advanced.setEnabled(False)
-                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
-                self.delete_commandline("r")
-                self.change_commandline("a","remove")
-                return 1 
-            
-            else:
-
-                self.group_execution.setEnabled(True)
-                self.drop_job.setEnabled(True)
-                self.group_advanced.setEnabled(True)
-                   
-        # Change in parameter "a" (run control list)
-        elif (id_str == "a"): 
-    
-            drop_job = self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").currentText()
-            rc_flag = "#"
-    
-            if (drop_job == "Initial run"):
-                rc_flag = "#"
-            
-            elif (drop_job == "Restart run"):            
-                rc_flag = "r"
-            
-            elif (drop_job == "Precursor run (atmosphere)"):            
-                rc_flag = "#"
-            
-            elif (drop_job == "Precursor run (ocean)"):            
-                rc_flag = "o#"
-
-            elif (drop_job == "Initial run (coupled atmosphere ocean)"):            
-                rc_flag = "#"
-            
-            elif (drop_job == "Restart run (coupled atmosphere ocean)"):            
-                rc_flag = "r"
-            
-            param[0] = "\"d3%s" % (rc_flag)
-    
-    
-            if (drop_job == "Restart run (coupled atmosphere ocean)" or drop_job == "Initial run (coupled atmosphere ocean)"):
-                if (rc_flag == "#"):
-                   rc_flag = "o#"
-                else:
-                   rc_flag = "or"
-
-                param[0] = "%s d3%s" % (param[0],rc_flag)
-    
-            status_restarts = self.group_execution.findChild(QtWidgets.QCheckBox,"check_restarts").checkState()
-
-            if (status_restarts == 2):
-                param[0]="%s restart" % (param[0])
-
-
-            status_cycfill = self.group_execution.findChild(QtWidgets.QCheckBox,"check_cycfill").checkState()
-    
-            if (status_cycfill == 2):            
-                param[0]="%s rec" % (param[0])
-
-            status_svf = self.group_execution.findChild(QtWidgets.QCheckBox,"check_svf").checkState()
-
-            if (status_svf == 2):            
-               param[0]="%s svfin" % (param[0])
- 
-            status_svf_2 = self.group_execution.findChild(QtWidgets.QCheckBox,"check_svf_2").checkState()
-
-            if (status_svf_2 == 2):
-               param[0]="%s svfout" % (param[0])
-
-            param[0]="%s\"" % (param[0])
-
-            if ( fwt_str == "remove"):            
-                self.delete_commandline(id_str)
-                return 1
-            
-            else:            
-                self.button_start.setEnabled(True)
-                self.action_save.setEnabled(True)
-                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
-
-        # Change in any other parameter
-        else:
-            if ( fwt_str != ""):            
-                param[0] = "\"%s\"" % (fwt_str)
-            
-            else:            
-                self.delete_commandline(id_str)
-                return 1
-                        
-        # Join the new palmrunline
-        splitline[1]= " -".join(param)
-                
-                
-        s = " -%s " % (id_str)
-        newpalmrunline = s.join(splitline)
-    
-        # Print the new palmrunline to mainwindow
-        newpalmrunline = newpalmrunline.replace("  "," ")
-        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(newpalmrunline)
-
-    # change lineinput depending on sender
-    ###################################################################################
-    def change_lineinput(self):
-        if ( self.sender() == self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration") ):
-            tmptext = self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").currentText()
-            if not tmptext:
-               self.change_commandline("c"," ")
-               self.group_execution.findChild(QtWidgets.QPushButton,'button_palmbuild').setEnabled(False)
-            else:
-               self.change_commandline("c",tmptext)
-               self.group_execution.findChild(QtWidgets.QPushButton,'button_palmbuild').setEnabled(True)
-
-        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_q")):
-            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_q").text()
-            self.change_commandline("q",tmptext)
-        
-        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_account")):
-            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_account").text()
-            self.change_commandline("A",tmptext)
-
-        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_wait")):
-            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_wait").text()
-            self.change_commandline("W",tmptext)
-
-        elif ( self.sender() ==  self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe")):
-            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe").text()
-            self.change_commandline("X",tmptext)
-        
-        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_tpn")):
-            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_tpn").text()
-            self.change_commandline("T",tmptext)
-                
-        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_time")):
-            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_time").text()
-            self.change_commandline("t",tmptext)
-        
-        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_M")):
-            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_M").text()
-            self.change_commandline("M",tmptext)
-        
-        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_m")):
-            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_m").text()
-            self.change_commandline("m",tmptext)
-        
-        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_D")):
-            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_D").text()
-            self.change_commandline("D",tmptext)
-        
-        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_c")):
-            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_c").text()
-            if ( tmptext == ".palmrungui.config"):
-                tmptext = ""
-            self.change_commandline("c",tmptext)
-        
-        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_s")):
-            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_s").text()
-            self.change_commandline("s",tmptext)
-                
-        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_w")):
-            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_w").text()
-            self.change_commandline("w",tmptext)
-        
-        elif ( self.sender() == self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos") or
-               self.sender() == self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean")):
-            t1 = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").text()
-            t2 = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").text()
-            tmptext = "%s %s" % (t1,t2)
-            
-            self.change_commandline("Y",tmptext)
-
-            # try catch sowas in der art
-            pe1 = 0
-            pe2 = 0
-            
-            try:
-                pe1 = int(t1)
-            except ValueError:            
-                pass
-
-            try:
-                pe2 = int(t2)
-            except ValueError:
-                pass
-
-            PE_total = pe1+pe2   
-            self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe").setText(str(PE_total))
-            self.change_commandline("X",str(PE_total))
-
-    # deletes parameter from commandline
-    ##################################################################################### 
-    def delete_commandline(self, id_str):   
-        # Read palmrunline
-        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
-        palmrunline = str(commandline.text())
-        s = " -%s" % (id_str)
-        splitline = list(filter(None,palmrunline.split(s)))
-        
-        if ( len(splitline) == 1):
-            return 1
-        else:
-            param = splitline[1].split("-")
-            param[0] = ""
-            splitline[1]= " -".join(param)
-            newpalmrunline = "".join(splitline)
-            newpalmrunline = newpalmrunline.replace("  "," ")
-    
-            # Print new palmrunline to screen
-            commandline.setText(newpalmrunline)
-        
-    # controls flags
-    ###################################################################################
-    def check_flags(self):
-        status = self.group_execution.findChild(QtWidgets.QCheckBox,"check_delete_tmp_files" ).checkState()
-        if (status == 2):      
-            self.activate_flag("B")
-        else:
-            self.deactivate_flag("B")
-    
-        status = self.groupBox.findChild(QtWidgets.QCheckBox,"check_verbose" ).checkState()
-        if (status == 2):
-            self.activate_flag("v") 
-        else:
-            self.deactivate_flag("v")
-        
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_b" ).checkState()
-        if (status == 2):
-            self.activate_flag("b")
-        else:
-            self.deactivate_flag("b")
-    
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_F" ).checkState()
-        if (status == 2):
-            self.activate_flag("F")
-        else:
-            self.deactivate_flag("F")
-            
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_I" ).checkState()
-        if (status == 2):
-            self.activate_flag("I")
-        else:
-            self.deactivate_flag("I")
-
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_k" ).checkState()
-        if (status == 2):
-            self.activate_flag("k")
-        else:
-            self.deactivate_flag("k")
-
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_O" ).checkState()
-        if (status == 2):
-            self.activate_flag("O")
-        else:
-            self.deactivate_flag("O")
-
-        status = self.group_execution.findChild(QtWidgets.QCheckBox,"check_prebuilt" ).checkState()
-        if (status == 2):
-            self.activate_flag("V")
-        else:
-            self.deactivate_flag("V")
-
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_x" ).checkState()
-        if (status == 2):
-            self.activate_flag("x")
-        else:
-            self.deactivate_flag("x")
-        
-        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_Z" ).checkState()
-        if (status == 2):
-            self.activate_flag("Z")
-        else:
-            self.deactivate_flag("Z")
-        
-    # changes flag to parameter 
-    ##################################################################################    
-    def activate_flag(self, id_str):
-        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
-        palmrunline = str(commandline.text())
-        s = " -%s" % (id_str)
-        splitline = list(filter(None,palmrunline.split(s)))
-        
-        if ( len(splitline) == 1):
-            splitline.append("")
-            s = " -%s" % (id_str)
-            newpalmrunline = s.join(splitline)
-            newpalmrunline = newpalmrunline.replace("  "," ")
-            commandline.setText(newpalmrunline)                
-        
-    # deletes flag in commandline
-    ####################################################################################    
-    def deactivate_flag(self, id_str):
-        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
-        palmrunline = str(commandline.text())
-        s = " -%s" % (id_str)
-        splitline = list(filter(None,palmrunline.split(s)))
- 
-        newpalmrunline = "".join(splitline)
-        newpalmrunline = newpalmrunline.replace("  "," ")
-        commandline.setText(newpalmrunline)     
-
-    # Clears window 
-    #################################################################################
-    def reset_window(self):
-        self.setupUi(self)
-        self.tabWidget.setCurrentIndex(0)
-        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))
-        self.recent_jobs(50)
-        self.load_jobs()
-        
-
-    # Safes current commandline and user parameters to default file
-    ################################################################################
-    def save_default(self):
-        string_to_file = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text()
-
-        filename ="%s/.palmrungui.default" % (palm_dir)
-        tmstamp = strftime("%Y/%m/%d %H:%M")
-
-        file = open(filename,"w")
-        s = "%s %s" % (tmstamp, string_to_file)
-        file.write(s)
-        file.close()        
-
-        
-    # Executes command which starts watchdog (start palm_wd)
-    ########################################################
-    def start_watchdog(self):
-        subprocess.Popen(["nohup","palm_wd",">>","/dev/null", "2>&1","&"])
-
-    # Opens "help" dialog
-    #################################
-    def help(self):        
-        dialog = HelpDialog()
-        dialog.exec_()
-
-    # Opens "about" dialog
-    ##################################
-    def about_gui(self):
-        dialog = AboutDialog()
-        dialog.exec_()
-
-    # commandline to buttons etc
-    ##############################
-    def setup_gui(self, palmrun_str):  
-      
-        #self.palm_logo.setPixmap(QtWidgets.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))
-      
-        #  Some initial settings
-        coupled_run = False 
-        ocean_run   = False 
-        nojob       = False 
-
-        #Split parameters in palmrunline
-        splitline = palmrun_str.split(" -")
-        
-        if ( splitline[0] != "palmrun"):
-            return 1
-
-        else:
-            self.group_execution.setEnabled(True) 
-
-        # Loop for all parameters in palmrunline
-        i = len(splitline)-1
-        while i >= 1:
-
-            # Determine parameter
-            splitparameter = splitline[i].split(" ")
-
-            parameter = splitparameter[0] 
-            splitparameter.pop(0)
-            options = " ".join(splitparameter) 
-            options = options.replace("\"","") 
-
-            # Check for suitable switch
-            if ( parameter == "r"):
-              
-                if ( options != ""):
-                    self.group_execution.findChild(QtWidgets.QLineEdit,"line_jobname").setText(options)
-                    nojob = False 
-                
-                else:                 
-                    nojob = True 
-                
-            elif ( parameter == "c"):
-                tmpindex = self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").findText(options.strip(),QtCore.Qt.MatchExactly)
-                if tmpindex != -1: 
-                   self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").setCurrentIndex(tmpindex)
-                else:
-                   self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").setCurrentIndex(0)
-            elif ( parameter == "q"):
-                self.group_execution.findChild(QtWidgets.QLineEdit,"line_q").setText(options)
-             
-            elif ( parameter == "A"):
-                self.group_execution.findChild(QtWidgets.QLineEdit,"line_account").setText(options)
-
-            elif ( parameter == "W"):
-                self.group_execution.findChild(QtWidgets.QLineEdit,"line_wait").setText(options)
-
-            elif ( parameter == "X"):
-                self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe").setText(options)
-             
-            elif ( parameter == "T"):
-                self.group_execution.findChild(QtWidgets.QLineEdit,"line_tpn").setText(options)
-             
-            elif ( parameter == "t"):
-                self.group_execution.findChild(QtWidgets.QLineEdit,"line_time").setText(options)
-             
-            elif ( parameter == "B"):
-                self.group_execution.findChild(QtWidgets.QCheckBox,"check_delete_tmp_files").setChecked(True)
-             
-            elif ( parameter == "v"):
-                self.groupBox.findChild(QtWidgets.QCheckBox,"check_verbose").setChecked(True)
-                          
-            elif ( parameter == "b"): 
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_b").setChecked(True)
-             
-            elif ( parameter == "F"):
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_F").setChecked(True)
-             
-            elif ( parameter == "I"):
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_I").setChecked(True)
-             
-            elif ( parameter == "k"):
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_k").setChecked(True)
-             
-            elif ( parameter == "O"): 
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_O").setChecked(True)
-
-            elif ( parameter == "V"):
-                self.group_execution.findChild(QtWidgets.QCheckBox,"check_prebuilt").setChecked(True)
-
-            elif ( parameter == "x"):              
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_x").setChecked(True)
-
-            elif ( parameter == "Z"):
-                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_Z").setChecked(True)
-               
-            elif ( parameter == "m"):
-                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_m").setText(options)
-             
-            elif ( parameter == "M"):
-                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_M").setText(options)
-                          
-            elif ( parameter == "D"):
-                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_D").setText(options)
-             
-            elif ( parameter == "c"):
-                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_c").setText(options)
-                          
-            elif ( parameter == "s"):
-                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_s").setText(options)
-             
-            elif ( parameter == "w"):
-                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_w").setText(options)
-             
-
-            # Determine settings for coupled restart runs
-            elif ( parameter == "Y"):
-                optionssplit = options.split(" ") 
-                
-                group_coupled = self.group_execution.findChild(QtWidgets.QGroupBox,"group_coupled")
-                group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").setEnabled(True)
-                group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").setEnabled(True)
-                group_coupled.findChild(QtWidgets.QLabel,"label_coupled1").setEnabled(True)
-                group_coupled.findChild(QtWidgets.QLabel,"label_coupled2").setEnabled(True)
-                group_coupled.findChild(QtWidgets.QLabel,"label_coupled3").setEnabled(True)
-                group_coupled.findChild(QtWidgets.QLabel,"label_coupling").setEnabled(True)
-
-                if (optionssplit.count() == 2):
-                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").setEnabled(optionssplit[0])
-                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").setEnabled(optionssplit[1])
-                 
-                else:                  
-                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").setText("")
-                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").setText("")
- 
-                 
-                coupled_run = True 
-            
-            elif ( parameter == "y"):              
-                self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(3)
-             
-
-            # Determine settings for the run control list
-            elif ( parameter == "a"):
-              
-                optionssplit = options.split(" ") 
-
-                options_2 = None
-                options_all = None
-                
-                j = 0
-                while j < len(optionssplit):
-                 
-                    options_all = optionssplit[j] 
-                    options_2 = optionssplit[j][:2] 
-                                              
-                    if (options_2 == "d3"):      
-                        if (options_all[:3][-1] == "#"):
-                            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(0)
-                        elif (options_all[:3][-1] == "r"):
-                            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(1)
-                        
-                        elif (options_all[:3][-1] == "o"):
-                            ocean_run = True 
-                        
-                    if (options_all == "restart"):
-                        self.group_execution.findChild(QtWidgets.QCheckBox,"check_restarts").setChecked(True)
-
-                    if (options_all == "rec"):
-                        self.group_execution.findChild(QtWidgets.QCheckBox,"check_cycfill").setChecked(True)
-
-                    if (options_all == "svfin"):
-                        self.group_execution.findChild(QtWidgets.QCheckBox,"check_svf").setChecked(True)
-
-                    if (options_all == "svfout"):
-                        self.group_execution.findChild(QtWidgets.QCheckBox,"check_svf_2").setChecked(True)
-
-                    j = j+1
-            i = i-1
-        # Change drop box state in case of ocean precursor or coupled restart runs
-        if ( ocean_run == True ):
-            if ( coupled_run == True ):
-                self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(4)
-            
-            else:
-                self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(3)
-
-        # Join palmrunline and post it to mainwindow
-        palmrunline = " -".join(splitline) 
-        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline)
-
-        # Disable mainwindow if no job was found, otherwise enable
-        if ( nojob == True ):
-            self.group_execution.setEnabled(False) 
-            self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
-            self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(False)
-            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setEnabled(False)
-            self.group_advanced.setEnabled(False) 
-            self.check_advanced.setEnabled(False) 
-            self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(False)
-         
-        else:
-            self.group_execution.setEnabled(True) 
-            self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
-            self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(True)
-            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setEnabled(True)
-            self.group_advanced.setEnabled(True) 
-            self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
-
-
-        self.tabWidget.setCurrentIndex(0)
-
-
-    ## Open from history
-    ###################################
-    def open_from_file(self):
-
-#      Show History
-       opt = OpenHistoryBox()
-       opt.exec_()
-
-       if ( history_entry != "" ):
-          palmrunline = str(history_entry)
-          palmrunline = palmrunline[17:]
-          palmrunline = palmrunline[:len(palmrunline)-1]
-          palmrunline = list(filter(None,palmrunline.split("(")))[0]
-          self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline)
-
-#         Set selected item to jobname in "available jobs" list
-          jobname = str(history_entry[17:])
-          jobname = list(filter(None,jobname.split(" -r")))[1]
-          jobname = jobname.strip()
-          jobname = list(filter(None,jobname.split(" ")))[0]
-          jobname = jobname.replace("\"","")
-          item2int = self.list_jobs.findItems(jobname,QtCore.Qt.MatchCaseSensitive)
-
-          if ( item2int != [] ):
-             self.list_jobs.setCurrentItem(item2int[0])
-             self.update_input()
-
-#         Add tooltip tag
-          tag = str(history_entry).split('\n')[0]
-          tag = list(filter(None,tag.split("(")))[1]
-          tag = tag.replace(")","")
-          self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setText(tag)
- 
-#         Process palmrungui to set up gui controls
-          self.setup_gui(palmrunline)
-
-
-    def update_all(self):
- 
-       self.setEnabled(False)
-       self.list_input.clear() 
-       self.list_user.clear()
-       self.list_monitoring.clear()
-       self.list_output.clear()
-       self.load_jobs()
-       self.setEnabled(True)
-       self.update_input()
-
-
-    # Load jobs into list
-    def load_jobs(self):
-       
-       selected_job = self.list_jobs.currentItem()
-       
-       if ( selected_job is not None ):
-          jobname = selected_job.text()
-       else:
-          jobname = ""
-
-       self.list_jobs.clear() 
-       self.line_path.setText(job_dir + "/")
-       
-       list_of_files = os.listdir(job_dir)
-      
-
-       for i in range(0,len(list_of_files)):
-          tmp_file = job_dir + "/" + list_of_files[i]
-
-          if ( os.path.isdir(tmp_file) ):
-             self.list_jobs.addItem(str(list_of_files[i]))
-       
-
-
-       item2int = self.list_jobs.findItems(jobname,QtCore.Qt.MatchCaseSensitive)
-        
-       if ( item2int != [] ):
-          self.list_jobs.setCurrentItem(item2int[0])
-
-
-    # Update input and user code lists
-    def update_input(self):
-
-       self.labeltimer.stop() 
-
-      
-       self.list_input.clear() 
-       self.list_user.clear()
-       self.list_monitoring.clear()
-       self.list_output.clear()
-       
-       jobitem = self.list_jobs.currentItem()
-       
-       if ( jobitem != None ):
-       
-          job_to_show = job_dir + "/" + jobitem.text() + "/INPUT"
-
-          if ( os.path.isdir(job_to_show) ):
-
-             list_of_files = os.listdir(job_to_show)
-         
-             for i in range(0,len(list_of_files)):
-                tmp_file = job_to_show + "/" + list_of_files[i]
-             
-                if ( os.path.isfile(tmp_file) ):
-                   self.list_input.addItem(str(list_of_files[i]) + " (" + file_size(tmp_file) + ")")
-  
-          job_to_show = job_dir + "/" + jobitem.text() + "/USER_CODE"
-       
-          if ( os.path.isdir(job_to_show) ):
-          
-             list_of_files = os.listdir(job_to_show)
-          
-             for i in range(0,len(list_of_files)):
-                tmp_file = job_to_show + "/" + list_of_files[i]
-
-                if ( os.path.isfile(tmp_file) ):
-                   self.list_user.addItem(str(list_of_files[i]))
-
-          job_to_show = job_dir + "/" + jobitem.text() + "/MONITORING"
-       
-          if ( os.path.isdir(job_to_show) ):
-          
-             list_of_files = os.listdir(job_to_show)
-          
-             for i in range(0,len(list_of_files)):
-                tmp_file = job_to_show + "/" + list_of_files[i]
-
-                if ( os.path.isfile(tmp_file) ):
-                   self.list_monitoring.addItem(str(list_of_files[i]) + " (" + file_size(tmp_file) + ")")
-
-          job_to_show = job_dir + "/" + jobitem.text() + "/OUTPUT"
-
-          if ( os.path.isdir(job_to_show) ):
-
-             list_of_files = os.listdir(job_to_show)
-
-             for i in range(0,len(list_of_files)):
-                tmp_file = job_to_show + "/" + list_of_files[i]
-
-                if ( os.path.isfile(tmp_file) ):
-                   self.list_output.addItem(str(list_of_files[i]) + " (" + file_size(tmp_file) + ")")
-  
-          self.group_execution.findChild(QtWidgets.QLineEdit,"line_jobname").setText(jobitem.text())
-       self.group_history.findChild(QtWidgets.QListWidget,"list_jobname").clearSelection()
-
-       self.timetimer.start()
-       self.timer.start(update_frequency)
-       self.labeltimer.start(update_frequency/10)
-       self.push_update.setText("Update (" + str(int(update_frequency/1000/60)) + " min)")
-       QtWidgets.QApplication.processEvents()
-
-       # Change palmrunline accordingly
-       self.change_commandline("r","")
-       self.change_commandline("a","")  
-
-    # Create a new (empty) job
-    def create_new_job(self):
-
-       self.setEnabled(False)
-
-       text, ret = QtWidgets.QInputDialog.getText(self, "Create new job", "Enter new job name:", QtWidgets.QLineEdit.Normal, text = '')
-
-       if ( ret ):
-          new_job_name = str(text)
-       else:
-          self.setEnabled(True)
-          return
-
-       new_input_dir  = job_dir + "/" + new_job_name + "/INPUT"
-
-#      check if a job exists with the new job name. If not, the new job is created and an empty _p3d file is created.
-       if ( os.path.isdir(new_input_dir) ):
-          notify = QtWidgets.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.")
-          self.setEnabled(True)
-          return
-       else:
-          os.makedirs(new_input_dir)
-          os.mknod(new_input_dir + '/' + new_job_name + '_p3d')
-
-#      write default namelists into _p3d file
-       filename = open(new_input_dir + '/' + new_job_name + '_p3d', "w")
-       filename.write('&initialization_parameters\n    nx = 39,\n    ny = 39,\n    nz = 40,\n    dx = 50.0,\n    dy = 50.0,\n    dz = 50.0,\n/\n\n')
-       filename.write('&runtime_parameters\n    end_time = 3600.0,\n/\n')
-       filename.close()
-
-
-#      create empty USER_CODE folder for convenience
-       new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
-       os.makedirs(new_user_dir)
-
-
-       self.load_jobs()
-       self.list_input.clear()
-       self.list_user.clear()
-       self.list_monitoring.clear()
-       self.list_output.clear()
-       self.setEnabled(True)
-
-
-    # Make a copy of a job
-    def copy_job(self):
-
-       self.setEnabled(False)
-       old_job_name = self.list_jobs.currentItem().text()
-       
-       text, ret = QtWidgets.QInputDialog.getText(self, "Copy job", "Enter new job name:", QtWidgets.QLineEdit.Normal, text = old_job_name)
-       if ( ret ):
-          new_job_name = str(text)
-       else:
-          self.setEnabled(True)
-          return
-
-       new_input_dir  = job_dir + "/" + new_job_name + "/INPUT"
-
-#      check if a job exists with the new job name  
-       if ( os.path.isdir(new_input_dir) ):
-          notify = QtWidgets.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.")
-          self.setEnabled(True)
-          return
-       else:
-          os.makedirs(new_input_dir)
-
-#      copy and rename input files (if present)       
-       job_to_copy = job_dir + "/" + old_job_name + "/INPUT"
-
-       if ( os.path.isdir(job_to_copy) ):
-
-          list_of_files = os.listdir(job_to_copy)
-
-          for i in range(0,len(list_of_files)):
-
-             tmp_file = job_to_copy + "/" + list_of_files[i]          
-             new_file = new_input_dir + "/" + list_of_files[i].replace(old_job_name, new_job_name)
-             shutil.copy(tmp_file, new_file)
-
-
-
-
-       new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
-
-#      check if user code exists in the new job directory 
-       if ( os.path.isdir(new_user_dir) ):
-          notify = QtWidgets.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.")
-          self.setEnabled(True)
-          return
-       else:
-          os.makedirs(new_user_dir)
-
-
-#      copy user code files (if present)       
-       user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE"
-
-       if ( os.path.isdir(user_to_copy) ):
-
-          list_of_files = os.listdir(user_to_copy)
-         
-          for i in range(0,len(list_of_files)):
-
-             tmp_file = user_to_copy + "/" + list_of_files[i]          
-             new_file = new_user_dir + "/" + list_of_files[i]
-             shutil.copy(tmp_file, new_file)
-
-       self.load_jobs()
-       self.list_input.clear() 
-       self.list_user.clear()
-       self.list_monitoring.clear()
-       self.list_output.clear()
-       self.setEnabled(True)
-
-
-    # Create a whole set of jobs
-    def create_set(self):
-  
-       global set_list
-#      disable mainwindow  
-       self.setEnabled(False)
-      
-#      show Options Dialog      
-       opt = CreateSetBox()
-       opt.exec_()
-
-       old_job_name = self.list_jobs.currentItem().text()
-
-       for j in range(0,len(set_list)):
-
-          if ( set_list[j] != "" ):
-             new_job_name   = str(set_list[j])
-             new_input_dir  = job_dir + "/" + str(set_list[j]) + "/INPUT"
-          else:
-             continue
-
-#         check if a job exists with the new job name  
-          if ( os.path.isdir(new_input_dir) ):
-             notify = QtWidgets.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.")
-             self.setEnabled(True)
-             return
-          else:
-             os.makedirs(new_input_dir)
-
-#         copy and rename input files (if present)       
-          job_to_copy = job_dir + "/" + old_job_name + "/INPUT"
-
-          if ( os.path.isdir(job_to_copy) ):
-
-             list_of_files = os.listdir(job_to_copy)
-         
-             for i in range(0,len(list_of_files)):
-
-                tmp_file = job_to_copy + "/" + list_of_files[i]          
-                new_file = new_input_dir + "/" + list_of_files[i].replace(old_job_name, new_job_name)
-                shutil.copy(tmp_file, new_file)
-
-
-          new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
-
-#         check if user code exists in the new job directory 
-          if ( os.path.isdir(new_user_dir) ):
-             notify = QtWidgets.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.")
-             self.setEnabled(True)
-             return
-          else:
-             os.makedirs(new_user_dir)
-
-
-#         copy user code files (if present)       
-          user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE"
-
-          if ( os.path.isdir(user_to_copy) ):
-
-             list_of_files = os.listdir(user_to_copy)
-         
-             for i in range(0,len(list_of_files)):
-
-                tmp_file = user_to_copy + "/" + list_of_files[i]          
-                new_file = new_user_dir + "/" + list_of_files[i]
-                shutil.copy(tmp_file, new_file)
-
-          self.load_jobs()
-          self.list_input.clear() 
-          self.list_user.clear()
-          self.list_monitoring.clear()
-          self.list_output.clear()
-
-       self.setEnabled(True) 
-       set_list = []
-
-
- # Add a custom context menu for the job selection list
-    def openmenujob(self, position):
-
-        menu = QtWidgets.QMenu()
-
-
-        newAction = QtWidgets.QAction('Create new job', self)
-        newAction.triggered.connect(self.create_new_job)
-        menu.addAction(newAction)
-        selection = self.list_jobs.selectedItems()
-
-        if ( len(selection) != 0 ):
-
-
-           copyAction = QtWidgets.QAction('Copy job', self)
-           copyAction.triggered.connect(self.copy_job)
-           createAction = QtWidgets.QAction('Create set from job', self)
-           createAction.triggered.connect(self.create_set)
-           delAction = QtWidgets.QAction('Delete job', self)
-           delAction.triggered.connect(self.DeleteJob)
-
-           menu.addAction(copyAction)
-           menu.addAction(createAction)
-           menu.addAction(delAction)
-
-        action = menu.exec_(self.list_jobs.mapToGlobal(position))
-
- # Add a custom context menu
-    def openmenuinput(self, position):
-
-        menu = QtWidgets.QMenu()
-
-        selection = self.list_input.selectedItems()
-        
-        if ( len(selection) != 0 ):
-
-
-           openAction = QtWidgets.QAction('Open file(s)', self)
-           openAction.setStatusTip('Open file(s) in your favorite editor')
-           openAction.triggered.connect(self.OpenFilesInput)
-
-
-           delAction = QtWidgets.QAction('Delete selected file(s)', self)
-           delAction.triggered.connect(self.DeleteFilesInput)
-
-           menu.addAction(openAction)
-           menu.addAction(delAction)
-
-        delallAction = QtWidgets.QAction('Delete all files', self)
-        delallAction.triggered.connect(self.DeleteAllFilesInput)
-        menu.addAction(delallAction)
-
-        action = menu.exec_(self.list_input.mapToGlobal(position))
-
- # Add a custom context menu
-    def openmenuuser(self, position):
-
-        menu = QtWidgets.QMenu()
-
-        selection = self.list_user.selectedItems()
-        
-        if ( len(selection) != 0 ):
-
-           openAction = QtWidgets.QAction('Open file(s)', self)
-           openAction.setStatusTip('Open file(s) in your favorite editor')
-           openAction.triggered.connect(self.OpenFilesUser)
-
-
-           delAction = QtWidgets.QAction('Delete file(s)', self)
-           delAction.triggered.connect(self.DeleteFilesUser)
-
-           menu.addAction(openAction)
-           menu.addAction(delAction)
-
-        delallAction = QtWidgets.QAction('Delete all files', self)
-        delallAction.triggered.connect(self.DeleteAllFilesUser)
-        menu.addAction(delallAction)
-
-        action = menu.exec_(self.list_user.mapToGlobal(position))
-
- # Add a custom context menu
-    def openmenuoutput(self, position):
-
-        menu = QtWidgets.QMenu()
-
-        selection = self.list_output.selectedItems()
-
-        if ( len(selection) != 0 ):
-
-           openAction = QtWidgets.QAction('Open file(s)', self)
-           openAction.setStatusTip('Open file(s) in your favorite editor')
-           openAction.triggered.connect(self.OpenFilesOutput)
-
-           delAction = QtWidgets.QAction('Delete file(s)', self)
-           delAction.triggered.connect(self.DeleteFilesOutput)
-
-
-
-           menu.addAction(openAction)
-           menu.addAction(delAction)
-
-        delallAction = QtWidgets.QAction('Delete all files', self)
-        delallAction.triggered.connect(self.DeleteAllFilesOutput)
-        menu.addAction(delallAction)
-
-        action = menu.exec_(self.list_output.mapToGlobal(position))
-
- # Add a custom context menu
-    def openmenumonitoring(self, position):
-
-        menu = QtWidgets.QMenu()
-
-        selection = self.list_monitoring.selectedItems()
-        
-        if ( len(selection) != 0 ):
-
-           openAction = QtWidgets.QAction('Open file(s)', self)
-           openAction.setStatusTip('Open file(s) in your favorite editor')
-           openAction.triggered.connect(self.OpenFilesMonitoring)
-
-           delAction = QtWidgets.QAction('Delete file(s)', self)
-           delAction.triggered.connect(self.DeleteFilesMonitoring)
-
-
-
-           menu.addAction(openAction)
-           menu.addAction(delAction)
-
-        delallAction = QtWidgets.QAction('Delete all files', self)
-        delallAction.triggered.connect(self.DeleteAllFilesMonitoring)
-        menu.addAction(delallAction)
-
-        action = menu.exec_(self.list_monitoring.mapToGlobal(position))
-
-    def OpenConfig(self):
-
-       config = str(self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").currentText())
-       if ( config != "" ):
-          filename = ".palm.config." + config
-          open_file = "xdg-open " + filename
-          os.system(str(open_file))
-
-    def OpenFilesInput(self):
-   
-       sel_job = self.list_jobs.currentItem().text()
-       sel_files = self.list_input.selectedItems()
-       
-       input_dir = job_dir + "/" + sel_job + "/INPUT/"
-       
-       open_files = ""
-       for i in range(0,len(sel_files)):
-          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text().split("(")[0] + "; "
-
-       os.system(str(open_files))
-
-    def OpenFilesUser(self):
-   
-       sel_job = self.list_jobs.currentItem().text()
-       sel_files = self.list_user.selectedItems()
-       
-       input_dir = job_dir + "/" + sel_job + "/USER_CODE/"
-       
-       open_files = ""
-       for i in range(0,len(sel_files)):
-          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text() + "; "
-
-       os.system(str(open_files)) 
-       selection = self.list_jobs.selectedItems()
-  
-    def OpenFilesMonitoring(self):
-   
-       sel_job = self.list_jobs.currentItem().text()
-       sel_files = self.list_monitoring.selectedItems()
-       
-       input_dir = job_dir + "/" + sel_job + "/MONITORING/"
-       
-       open_files = ""
-       for i in range(0,len(sel_files)):
-          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text().split("(")[0]  + "; "
-
-       os.system(str(open_files)) 
-       selection = self.list_jobs.selectedItems()
-  
-    def OpenFilesOutput(self):
-   
-       sel_job = self.list_jobs.currentItem().text()
-       sel_files = self.list_output.selectedItems()
-       
-       input_dir = job_dir + "/" + sel_job + "/OUTPUT/"
-       
-       open_files = ""
-       for i in range(0,len(sel_files)):
-          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text().split("(")[0] + "; "
-
-       os.system(str(open_files)) 
-       selection = self.list_jobs.selectedItems()
-
-    def DeleteFilesInput(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          sel_job = self.list_jobs.currentItem().text()
-          sel_files = self.list_input.selectedItems()
-
-          input_dir = job_dir + "/" + sel_job + "/INPUT/"
-
-          for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
-             os.remove(filename)
-
-          self.update_all()
-
-
-    def DeleteFilesUser(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          sel_job = self.list_jobs.currentItem().text()
-          sel_files = self.list_user.selectedItems()
-
-          input_dir = job_dir + "/" + sel_job + "/USER_CODE/"
-
-          for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
-             os.remove(filename)
-
-          self.update_all()
-
-
-    def DeleteFilesMonitoring(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          sel_job = self.list_jobs.currentItem().text()
-          sel_files = self.list_monitoring.selectedItems()
-
-          input_dir = job_dir + "/" + sel_job + "/MONITORING/"
-
-          for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
-             os.remove(filename)
-
-          self.update_all()
-
-
-    def DeleteFilesOutput(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          sel_job = self.list_jobs.currentItem().text()
-          sel_files = self.list_output.selectedItems()
-
-          input_dir = job_dir + "/" + sel_job + "/OUTPUT/"
-
-          for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
-             os.remove(filename)
-
-          self.update_all()
-
-
-    def DeleteAllFilesInput(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          check = self.list_jobs.currentItem()
-          if ( check ):
-             sel_job = self.list_jobs.currentItem().text()
-             sel_files = self.list_input.selectedItems()
-
-             input_dir = job_dir + "/" + sel_job + "/INPUT/"
-
-             if os.path.exists(str(input_dir)):
-                shutil.rmtree(str(input_dir))
-                os.makedirs(str(input_dir))
-
-                self.update_all()
-
-
-    def DeleteAllFilesUser(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          check = self.list_jobs.currentItem()
-          if ( check ):
-             sel_job = self.list_jobs.currentItem().text()
-             sel_files = self.list_input.selectedItems()
-
-             input_dir = job_dir + "/" + sel_job + "/USER_CODE/"
-
-             if os.path.exists(str(input_dir)):
-                shutil.rmtree(str(input_dir))
-                os.makedirs(str(input_dir))
-
-                self.update_all()
-
-
-
-    def DeleteAllFilesOutput(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          check = self.list_jobs.currentItem()
-          if ( check ):
-             sel_job = self.list_jobs.currentItem().text()
-             sel_files = self.list_input.selectedItems()
-
-             input_dir = job_dir + "/" + sel_job + "/OUTPUT/"
-
-             if os.path.exists(str(input_dir)):
-                shutil.rmtree(str(input_dir))
-                os.makedirs(str(input_dir))
-
-                self.update_all()
-
-
-
-    def DeleteAllFilesMonitoring(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          check = self.list_jobs.currentItem()
-          if ( check ):
-             sel_job = self.list_jobs.currentItem().text()
-             sel_files = self.list_input.selectedItems()
-
-             input_dir = job_dir + "/" + sel_job + "/MONITORING/"
-
-             if os.path.exists(str(input_dir)):
-                shutil.rmtree(str(input_dir))
-                os.makedirs(str(input_dir))
-
-                self.update_all()
-
-
-
-    def DeleteJob(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete this job?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          sel_job = self.list_jobs.currentItem().text()
-
-          input_dir = job_dir + "/" + sel_job
-          shutil.rmtree(str(input_dir))
-
-          self.update_all()
-
-# Message box for showing RUN_CONTROL output
-class CreateSetBox(QtWidgets.QDialog):
-    def __init__(self):
-
-        super(CreateSetBox, self).__init__()
-
-        uic.loadUi(palm_bin + '/palmrungui_files/create_set.ui', self)
-
-        self.show()
-
-        return
-
-#   Cancel button
-    def rejected(self):
-
-       self.close()
-
-       return
-
-#   OK button
-    def accept(self):
-
-       global set_list
-
-       text = self.list.toPlainText() 
-       set_list = text.split('\n')
-       self.close()
-
-       return
-
-# Message box for showing RUN_CONTROL output
-class OpenHistoryBox(QtWidgets.QDialog):
-    def __init__(self):
-
-        super(OpenHistoryBox, self).__init__()
-
-        uic.loadUi(palm_bin + '/palmrungui_files/history.ui', self)
-
-        if os.path.exists(palm_dir + "/.palmrungui.history"):
-            pass
-        else:
-            return
-
-        filename = open(palm_dir + "/.palmrungui.history","r")
-        history = filename.readlines()
-        filename.close()
-
-
-        list_jobname = self.findChild(QtWidgets.QListWidget,"list_history")
-
-        # Read history entries and append to recent job list
-        len_history=len(history)-1
-        i = 0
-        while i<=len_history:
-            list_jobname.addItem(history[i])
-            i = i + 1
-
-        self.show()
-
-        return
-
-#   Select item / activate Load button
-    def ItemSelected(self):
-
-       self.push_open.setEnabled(True)
-
-       return
-
-
-#   Load job from history
-    def OpenFromHistory(self):
-
-       global history_entry
-       history_entry = self.list_history.selectedItems()[0].text()
-
-       self.close()
-
-       return
-
-#   Close history window
-    def DiscardHistory(self):
-
-       global history_entry
-       history_entry = ""
-       self.close()
-
-       return
-
-#   Clear history
-    def ClearHistory(self):
-
-       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete your history?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
-
-       if status == QtWidgets.QMessageBox.Yes:
-
-          if os.path.exists(palm_dir + "/.palmrungui.history"):
-             os.remove(palm_dir + "/.palmrungui.history")
-
-
-       return
-
-if __name__ == "__main__":
-    app = QtWidgets.QApplication(sys.argv)
-    window = Mainwindow()
-    window.show()
-    sys.exit(app.exec_())
Index: palm/trunk/SCRIPTS/palmtest
===================================================================
--- palm/trunk/SCRIPTS/palmtest	(revision 4901)
+++ 	(revision )
@@ -1,1439 +1,0 @@
-#!/usr/bin/env python3
-# PYTHON_ARGCOMPLETE_OK
-
-import os
-import sys
-import shutil
-from datetime import datetime
-import subprocess
-import multiprocessing
-import socket
-import getpass
-import math
-import re
-import threading
-import queue
-from contextlib import ContextDecorator
-
-try:
-    from argparse import ArgumentParser
-    from argparse import RawTextHelpFormatter
-except ImportError:
-    sys.exit(
-        'ERROR: You need argparse!\n' +
-        '   install it from http://pypi.python.org/pypi/argparse\n' +
-        '   or run \"pip install argparse\".'
-    )
-
-try:
-    import numpy as np
-except ImportError:
-    sys.exit(
-        'ERROR: You need numpy!\n' +
-        '   install it from http://pypi.python.org/pypi/numpy\n' +
-        '   or run \"python3 -m pip install numpy\".'
-    )
-
-try:
-    import netCDF4
-except ImportError:
-    sys.exit(
-        'ERROR: You need netCDF4!\n' +
-        '   install it from http://pypi.python.org/pypi/netCDF4\n' +
-        '   or run \"python3 -m pip install netCDF4\".'
-    )
-
-try:
-    import yaml
-except ImportError:
-    sys.exit(
-        'ERROR: You need PyYAML!\n' +
-        '   install it from http://pypi.python.org/pypi/PyYAML\n' +
-        '   or run \"python3 -m pip install PyYAML\".'
-    )
-
-try:
-    import argcomplete
-except ImportError:
-    print(
-        'INFO: To use Tab-completion you need argcomplete!\n' +
-        '   install it from http://pypi.python.org/pypi/argcomplete\n' +
-        '   or run \"python3 -m pip install argcomplete\".'
-    )
-    has_argcomplete = False
-else:
-    has_argcomplete = True
-
-try:
-    from termcolor import colored as tcolored
-except ImportError:
-    def tcolored(string, color):
-        return string
-
-disable_colored_output = False
-
-
-def colored(string, color):
-    if not disable_colored_output:
-        return tcolored(string, color)
-    else:
-        return string
-
-
-def disable_color():
-    global disable_colored_output
-    disable_colored_output = True
-
-
-version = '1.0.1'
-
-
-class Environment:
-
-    scripts_dir = os.path.dirname(os.path.realpath(__file__))
-    trunk_dir = os.path.realpath(os.path.join(scripts_dir, '..'))
-    workspace_dir = os.path.realpath(os.path.join(trunk_dir, '..'))
-
-    trunk_tests_dir = os.path.join(trunk_dir, 'TESTS')
-    trunk_tests_cases_dir = os.path.join(trunk_tests_dir, 'cases')
-    trunk_tests_builds_dir = os.path.join(trunk_tests_dir, 'builds')
-
-    tests_dir = os.path.join(workspace_dir, 'tests')
-
-
-class LogFormatter:
-
-    terminal_columns, terminal_lines = shutil.get_terminal_size()
-    hline = '#' * min(terminal_columns, 300) + '\n'
-    table_width_intro = 12
-    table_width_builds = len(max([s for s in next(os.walk(Environment.trunk_tests_builds_dir))[1] if not s[0] == '.'], key=len)) + len('_debug')
-    table_width_cases = len(max([s for s in next(os.walk(Environment.trunk_tests_cases_dir))[1] if not s[0] == '.'], key=len))
-    table_width_cores = 7
-    table_width_total = table_width_intro + table_width_builds + table_width_cases + table_width_cores + 3
-
-    intro_table_line_template = \
-        '{:' + str(table_width_intro) + '} '
-
-    task_table_line_template = \
-        '{:' + str(table_width_intro) + '} ' + \
-        '{:' + str(table_width_cases) + '} ' + \
-        '{:' + str(table_width_builds) + '} ' + \
-        '{:' + str(table_width_cores) + '} '
-
-    config_table_line_template = \
-        '{:' + str(table_width_intro) + '} ' + \
-        '{:' + str(max(table_width_builds, table_width_cases)) + '} ' + \
-        '{:8} '
-
-    file_table_line_template = \
-        '{:' + str(table_width_intro) + '} ' + \
-        '{:' + str(table_width_cases + 13) + '} '
-
-
-class SignificantDigitsRounder:
-
-    @staticmethod
-    def _round(value, digits=10):
-        if value == 0.0:
-            return value
-        negative = value < 0.0
-        value = -value if negative else value
-        rounded_value = round(value, -int(math.floor(math.log10(value))) + (digits - 1))
-        rounded_value = -rounded_value if negative else rounded_value
-        return rounded_value
-
-
-    vectorized_round = np.vectorize(_round)
-
-    _vectorized_round = np.vectorize(round)
-
-
-    @classmethod
-    def around(cls, array, digits=10):
-        # TODO: divide both arrays and check decimal point
-        sign_mask = np.ma.masked_where(array >= 0.0, array).mask
-        pos_array = np.where(sign_mask, array, -array)
-        non_zero_maks = np.ma.masked_where(pos_array == 0.0, pos_array).mask
-        non_zero_array = np.where(non_zero_maks, 1.0, pos_array)
-        i1 = -np.floor(np.log10(non_zero_array)).astype(int) + (digits - 1)
-        rounded_non_zero_array = cls._vectorized_round(non_zero_array, i1)
-        rounded_pos_array = np.where(non_zero_maks, 0.0, rounded_non_zero_array)
-        return np.where(sign_mask, rounded_pos_array, -rounded_pos_array)
-
-
-
-class Logger(ContextDecorator):
-
-    def __init__(self, logfile_dir, logfile_name='palmtest.log', logfile_mode='a', verbose=False):
-        self.logfile_path = os.path.join(logfile_dir, logfile_name)
-        self.logfile_mode = logfile_mode
-        self.verbose = verbose
-
-    def __enter__(self):
-        self._file = open(self.logfile_path, self.logfile_mode)
-        return self
-
-    def to_file(self, message):
-        self._file.write(message)
-        self._file.flush()
-
-    def to_log(self, message):
-        if self.verbose:
-            sys.stdout.write(message)
-            sys.stdout.flush()
-        self._file.write(message)
-        self._file.flush()
-
-    def to_all(self, message):
-        sys.stdout.write(message)
-        sys.stdout.flush()
-        self._file.write(message)
-        self._file.flush()
-
-    def __exit__(self, *exc):
-        self._file.close()
-        return False
-
-
-class Executor:
-
-    @staticmethod
-    def _enqueue_output(out, queue):
-        for line in iter(out.readline, b''):
-            queue.put(line)
-        out.close()
-
-    @staticmethod
-    def execute(cmd, cwd='.', verbose=True, dry_run=False):
-        assert isinstance(cmd, list)
-        if dry_run:
-            cmd = ['echo'] + cmd
-        cmd_str = ' '.join(cmd)
-        p = subprocess.Popen(cmd_str, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, bufsize=1)
-        q = queue.Queue()
-        t = threading.Thread(target=Executor._enqueue_output, args=(p.stdout, q))
-        t.daemon = True # thread dies with the program
-        t.start()
-
-        with Logger(cwd, verbose=verbose) as logger:
-            # read line without blocking
-            logger.to_log(LogFormatter.hline)
-            logger.to_log('CMD: ' + cmd_str + '\n')
-            logger.to_log(LogFormatter.hline)
-            while t.is_alive():
-                try:
-                    line = q.get_nowait()  # or q.get(timeout=.1)
-                except queue.Empty:
-                    pass  # print('no output yet')
-                else:  # got line
-                    logger.to_log(line.decode("utf-8"))
-            line = True
-            while line:
-                try:
-                    line = q.get_nowait()  # or q.get(timeout=.1)
-                except queue.Empty:
-                    line = False
-                else:  # got line
-                    logger.to_log(line.decode("utf-8"))
-            logger.to_log(LogFormatter.hline)
-
-        rc = p.poll()
-        failed = rc != 0
-        return failed
-
-
-class NetCDFInterface:
-
-    def __init__(self, filename):
-        self.filename = filename
-
-    def is_healthy(self):
-        try:
-            self.get_run_name()
-        except:
-            return False
-        else:
-            return True
-
-    def get_run_name(self):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            l = getattr(netcdf, 'title').split()
-            i = l.index('run:')
-            return l[i+1]
-
-    def get_var_list(self):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            var_list = list(netcdf.variables.keys())
-            var_list = filter(None, var_list)
-            return sorted(var_list)
-
-    def show_content(self):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            for name in netcdf.ncattrs():
-                print("Global attr", name, "=", getattr(netcdf, name))
-            print(netcdf)
-            for v in netcdf.variables:
-                print(v)
-
-    def get_times_list(self):
-        attributes, times = self.read_var('time')
-        times = [str(time) for time in times]
-        times = list(filter(None, times))
-        return times
-
-    def contains(self, variable):
-        return variable in self.get_var_list()
-
-    def read_var(self, variable):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            values = netcdf.variables[variable][:]  # extract values
-            attributes = dict()
-            try:
-                attributes['long_name'] = netcdf.variables[variable].name
-            except:
-                attributes['long_name'] = ''
-            try:
-                attributes['unit'] = netcdf.variables[variable].units
-            except:
-                attributes['unit'] = ''
-        return attributes, values
-
-
-class FileComparator:
-
-    @staticmethod
-    def compare_ascii(file_path1, file_path2, start_string=None):
-        try:
-            with open(file_path1, 'r') as file1:
-                content1 = file1.readlines()
-        except OSError:
-            return True, colored('[reference file not found]', 'red')
-        try:
-            with open(file_path2, 'r') as file2:
-                content2 = file2.readlines()
-        except OSError:
-            return True, colored('[output file not found]', 'red')
-        if start_string:
-            index1 = content1.index(start_string)
-            index2 = content2.index(start_string)
-            comparable_content1 = content1[index1:]
-            comparable_content2 = content2[index2:]
-            ln = index2 + 1
-        else:
-            comparable_content1 = content1
-            comparable_content2 = content2
-            ln = 1
-        if len(comparable_content1) != len(comparable_content2):
-            return True, colored('[mismatch in total number of lines]', 'red')
-        for line1, line2 in zip(comparable_content1, comparable_content2):
-                if not line1 == line2:
-                    return True, colored('[mismatch in content starting line ' + str(ln) + ']', 'red')
-                ln += 1
-        return False, colored('[file ok]', 'green')
-
-    @staticmethod
-    def compare_netcdf(file_path1, file_path2, digits=None):
-        nci1 = NetCDFInterface(file_path1)
-        nci2 = NetCDFInterface(file_path2)
-        if not nci1.is_healthy():
-            return True, colored('[reference file not found]', 'red')
-        if not nci2.is_healthy():
-            return True, colored('[output file not found]', 'red')
-        times_list1 = nci1.get_times_list()
-        times_list2 = nci2.get_times_list()
-        if not times_list1 == times_list2:
-            return True, colored('[wrong time dimension]', 'red')
-        else:
-            time_list = times_list1
-        var_list1 = nci1.get_var_list()
-        var_list2 = nci2.get_var_list()
-        if not var_list1 == var_list2:
-            return True, colored('[wrong set of variables]', 'red')
-        else:
-            var_list = var_list1
-        content1 = dict()
-        content2 = dict()
-        for var in var_list:
-            attributes1, values1 = nci1.read_var(var)
-            attributes2, values2 = nci2.read_var(var)
-            if sorted(attributes1.keys()) != sorted(attributes2.keys()):
-                return True, colored('[wrong set of attributes in variable \"'+var+'\"]', 'red')
-            if isinstance(digits, int):
-                values1 = SignificantDigitsRounder.around(values1, digits=digits)
-                values2 = SignificantDigitsRounder.around(values2, digits=digits)
-            content1[var] = values1
-            content2[var] = values2
-        #for decimals in
-        for i, time in enumerate(time_list):
-            for var in var_list:
-                t_content1 = content1[var][i]
-                t_content2 = content2[var][i]
-                if not (t_content1==t_content2).all():
-                    if isinstance(digits, int):
-                        return True, colored('[1st mismatch within ' + str(digits) + ' digits at time index ' + str(i) + ' in variable \"' + var + '\"]', 'red')
-                    else:
-                        return True, colored('[1st mismatch at time index ' + str(i) + ' in variable \"' + var + '\"]', 'red')
-        return False, colored('[file ok]', 'green')
-
-
-class OutputChecker:
-
-    def __init__(self, test_dir, setup_name, build_name, cores, significant_digits=None, verbose=True, dry_run=False):
-        self.test_dir = test_dir
-        self.setup_name = setup_name
-        self.build_name = build_name
-        self.cores = cores
-        self.significant_digits = significant_digits
-        self.verbose = verbose
-        self.dry_run = dry_run
-        self.job_name = self.setup_name + '__' + build_name + '__' + str(self.cores)
-        self.job_dir = os.path.join(self.test_dir, 'JOBS', self.job_name)
-        self.ref_monitoring_dir = os.path.join(Environment.trunk_tests_cases_dir, self.setup_name, 'MONITORING')
-        self.ref_output_dir = os.path.join(Environment.trunk_tests_cases_dir, self.setup_name, 'OUTPUT')
-        self.res_monitoring_dir = os.path.join(self.job_dir, 'MONITORING')
-        self.res_output_dir = os.path.join(self.job_dir, 'OUTPUT')
-        self.failed = None
-
-    def get_checkable_file_dicts(self):
-        if os.path.isdir(self.ref_monitoring_dir):
-            file_names_monitoring = [s for s in next(os.walk(self.ref_monitoring_dir))[2]]
-        else:
-            file_names_monitoring = []
-        file_paths_monitoring = []
-        for file_name in file_names_monitoring:
-            file_specific_ending = file_name[len(self.setup_name):]
-            file_specific_ending_split = file_specific_ending.split('.')
-            postfix = file_specific_ending_split[0]
-            if len(file_specific_ending_split) > 1:
-                extension = file_specific_ending_split[-1]
-            else:
-                extension = ''
-            if len(file_specific_ending_split) > 2:
-                cycle_info = file_specific_ending_split[1: -1]
-            else:
-                cycle_info = []
-            file_paths_monitoring.append(
-                dict(
-                    postfix=postfix,
-                    cycle_info=cycle_info,
-                    extension=extension,
-                    ref_path=self.ref_monitoring_dir,
-                    res_path=self.res_monitoring_dir,
-                )
-            )
-        if os.path.isdir(self.ref_output_dir):
-            file_names_output = [s for s in next(os.walk(self.ref_output_dir))[2]]
-        else:
-            file_names_output = []
-        file_paths_output = []
-        for file_name in file_names_output:
-            file_specific_ending = file_name[len(self.setup_name):]
-            file_specific_ending_split = file_specific_ending.split('.')
-            postfix = file_specific_ending_split[0]
-            if len(file_specific_ending_split) > 1:
-                extension = file_specific_ending_split[-1]
-            else:
-                extension = ''
-            if len(file_specific_ending_split) > 2:
-                cycle_info = file_specific_ending_split[1: -1]
-            else:
-                cycle_info = []
-            file_paths_output.append(
-                dict(
-                    postfix=postfix,
-                    cycle_info=cycle_info,
-                    extension=extension,
-                    ref_path=self.ref_output_dir,
-                    res_path=self.res_output_dir,
-                )
-            )
-        return file_paths_monitoring + file_paths_output
-
-    def check(self):
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_log('Checking output files:')
-            logger.to_all('\n')
-            failed = False
-            for file_dict in self.get_checkable_file_dicts():
-                file_failed = False
-                ext_list = [file_dict['extension']] if file_dict['extension'] else []
-                file_specific_ending = '.'.join([file_dict['postfix']] + file_dict['cycle_info'] + ext_list )
-                logger.to_all(LogFormatter.file_table_line_template.format('Checking:', self.setup_name + file_specific_ending))
-                ref_file_path = os.path.join(file_dict['ref_path'], self.setup_name + file_specific_ending)
-                res_file_path = os.path.join(file_dict['res_path'], self.job_name + file_specific_ending)
-                if re.match('_rc', file_dict['postfix']) and re.match('[0-9]{3}', file_dict['extension']):
-                    file_failed, message = FileComparator.compare_ascii(ref_file_path, res_file_path, start_string='Run-control output:\n')
-                elif re.match('nc', file_dict['extension']):
-                    if self.significant_digits is not None:
-                        if re.match('_ts', file_dict['postfix']) and 'timeseries' in self.significant_digits:
-                            file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path,
-                                                                                 digits=self.significant_digits['timeseries'])
-                        elif re.match('_pr', file_dict['postfix']) and 'profiles' in self.significant_digits:
-                            file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path,
-                                                                                 digits=self.significant_digits['profiles'])
-                        else:
-                            file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path,
-                                                                                 digits=self.significant_digits['other'])
-                    else:
-                        file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path)
-                else:
-                    message = colored('[ignored]', 'blue')
-                if file_failed:
-                    failed = True
-                logger.to_all(message + '\n')
-            if self.dry_run:
-                failed = False
-        return failed
-
-
-class PALMJob:
-    """The PALM job class deals with the execution of a single PALM job"""
-
-    @staticmethod
-    def get_job_name(setup_name, build_name, cores):
-        return setup_name + '__' + build_name + '__' + str(cores)
-
-    def __init__(self, test_dir, test_case, build_name, cores, verbose=False, dry_run=False):
-        self.test_dir = test_dir
-        self.test_case = test_case
-        self.build_name = build_name
-        self.cores = cores
-        self.verbose = verbose
-        self.dry_run = dry_run
-
-        self.attempted_debug = False
-        self.failed_debug = None
-        self.attempted_non_debug = False
-        self.failed_non_debug = None
-
-    def _link_restart_files(self, build_name):
-        if self.dry_run:
-            return True, colored('[restart data dry]', 'blue')
-        name = self.get_job_name(self.test_case.name, build_name, self.cores)
-        source_name = self.get_job_name(self.test_case.use_binary_files_from, build_name, self.cores)
-        source_restart_dir = os.path.join(self.test_dir, 'JOBS', source_name, 'RESTART')
-        try:
-            source_data_dirs_grp = [d for r, d, f in os.walk(source_restart_dir)]
-        except:
-            source_data_dirs_grp = []
-        if len(source_data_dirs_grp) == 0:
-            source_data_dirs = []
-        else:
-            source_data_dirs = source_data_dirs_grp[0]
-        if len(source_data_dirs) == 0 and re.match('.+_debug', build_name):
-            source_build_name = build_name[:-len('_debug')]
-            source_name = self.get_job_name(self.test_case.use_binary_files_from, source_build_name, self.cores)
-            source_restart_dir = os.path.join(self.test_dir, 'JOBS', source_name, 'RESTART')
-            try:
-                source_data_dirs_grp = [d for r, d, f in os.walk(source_restart_dir)]
-            except:
-                source_data_dirs_grp = []
-            if len(source_data_dirs_grp) == 0:
-                source_data_dirs = []
-            else:
-                source_data_dirs = source_data_dirs_grp[0]
-        if len(source_data_dirs) == 0:
-            source_data_dir = 'no_restart_data'
-        else:
-            source_data_dir = sorted(source_data_dirs)[-1]
-        source_data_dir_path = os.path.join(source_restart_dir, source_data_dir)
-        if os.path.isdir(source_data_dir_path) and re.match('.+_d3d.*', source_data_dir):
-            job_restart_dir = os.path.join(self.test_dir, 'JOBS', name, 'RESTART')
-            os.makedirs(job_restart_dir, exist_ok=False)
-            job_data_dir_path = os.path.join(job_restart_dir, name + '_d3d')
-            os.symlink(source_data_dir_path, job_data_dir_path, target_is_directory=True)
-            return False, colored('[linked restart data from: ' + source_data_dir_path + ']', 'green')
-        else:
-            return True, colored('[no restart data found]', 'red')
-
-    def _execute(self, name, build_name):
-        cmd_list = [
-            os.path.join(self.test_dir, 'trunk', 'SCRIPTS', 'palmrun'),
-            '-c', '\"' + build_name + '\"',
-            '-r', name,
-            '-a', '\"' + ' '.join(self.test_case.activation_strings) + '\"',
-            '-X', str(self.cores),
-        ]
-        if self.test_case.omp_num_threads_found:
-            cmd_list.extend(
-                [
-                    '-O', str(self.test_case.omp_num_threads),
-                ]
-            )
-        if self.test_case.tasks_per_node_found:
-            cmd_list.extend(
-                [
-                    '-T', str(self.test_case.tasks_per_node),
-                ]
-            )
-        cmd_list.extend(
-            [
-                '-B',
-                '-v',
-                '-z',
-            ]
-        )
-        execution_failed = Executor.execute(
-            cmd_list,
-            cwd=self.test_dir,
-            verbose=self.verbose,
-            dry_run=self.dry_run,
-        )
-
-        if self.dry_run:
-            return False, colored('[execution dry]', 'blue')
-        elif execution_failed:
-            return True, colored('[execution failed]', 'red')
-        else:
-            return False, colored('[execution ok]', 'green')
-
-    def _check(self, build_name):
-        checker = OutputChecker(
-            self.test_dir,
-            self.test_case.name,
-            build_name,
-            self.cores,
-            significant_digits=self.test_case.significant_digits,
-            verbose=self.verbose,
-            dry_run=self.dry_run,
-        )
-        check_failed = checker.check()
-
-        if self.dry_run:
-            return False, colored('[checks dry]', 'blue')
-        if check_failed:
-            return True, colored('[checks failed]', 'red')
-        else:
-            return False, colored('[checks ok]', 'green')
-
-    def execute(self, debug=False):
-        if debug:
-            attempted = self.attempted_debug
-            build_name = self.build_name + '_debug'
-            failed = self.failed_debug
-        else:
-            attempted = self.attempted_non_debug
-            build_name = self.build_name
-            failed = self.failed_non_debug
-
-        if not attempted:
-            with Logger(self.test_dir, verbose=self.verbose) as logger:
-                status_prefix = LogFormatter.task_table_line_template.format('Testing:', self.test_case.name, build_name, self.cores)
-                logger.to_all(status_prefix)
-                logger.to_log('[started]' + '\n')
-                attempted = True
-
-                name = self.get_job_name(self.test_case.name, build_name, self.cores)
-
-                input_dir = os.path.join(self.test_dir, 'JOBS', name, 'INPUT')
-                os.makedirs(input_dir, exist_ok=False)
-
-                # copying needs to be done per file, because input files need to be renamed
-                for input_file in self.test_case.input_file_names:
-                    postfix = input_file[len(self.test_case.name):]
-                    src = os.path.join(self.test_case.input_dir, input_file)
-                    dst = os.path.join(input_dir, name + postfix)
-                    shutil.copy(src, dst)
-
-                # copying the entire directory is ok, because source files do not need to be renamed
-                user_code_dir = os.path.join(self.test_dir, 'JOBS', name, 'USER_CODE')
-                if os.path.isdir(self.test_case.user_code_dir):
-                    shutil.copytree(self.test_case.user_code_dir, user_code_dir, copy_function=shutil.copy)
-
-                if self.test_case.requires_binary_files:
-                    link_restart_files_failed, message = self._link_restart_files(build_name)
-                    logger.to_log(status_prefix)
-                    logger.to_log(message + ' ')
-                    logger.to_log('\n')
-
-                failed, message = self._execute(name, build_name)
-                logger.to_log(status_prefix)
-                logger.to_all(message + ' ')
-                logger.to_log('\n')
-
-                failed, message = self._check(build_name)
-                logger.to_log(status_prefix)
-                logger.to_log(message + ' ')
-
-                logger.to_all('\n')
-
-        if debug:
-            self.attempted_debug = attempted
-            self.failed_debug = failed
-        else:
-            self.attempted_non_debug = attempted
-            self.failed_non_debug = failed
-
-        return failed
-
-    def status(self):
-        return dict(
-            attempted=self.attempted_non_debug or self.attempted_debug,
-            failed=self.failed_non_debug and self.failed_debug,
-            debugged=self.attempted_debug,
-            non_debug_failed=self.failed_non_debug,
-        )
-
-
-class PALMBuild:
-    """The PALM build class deals with configuration and execution of all required PALM builds"""
-
-    def __init__(self, test_dir, build_name, verbose=False, dry_run=False):
-        self.test_dir = test_dir
-        self.build_name = build_name
-        self.verbose = verbose
-        self.dry_run = dry_run
-        self.configured = False
-        self.executed = False
-        self.available = False
-        self.requires_mpi = False
-        self.requires_netcdf = False
-        self.requires_fftw = False
-        self.requires_rrtmg = False
-        self.attempted_non_debug = False
-        self.attempted_debug = False
-        self.failed_non_debug = None
-        self.failed_debug = None
-
-    def configure(self):
-        try:
-            with open(os.path.join(Environment.trunk_tests_builds_dir, self.build_name, 'build_config.yml'), 'r') as f:
-                build_config = yaml.load(f, Loader=yaml.SafeLoader)
-        except:
-            return True, colored('[build not found]', 'red')
-
-        if 'compiler' in build_config:
-            self.compiler = build_config['compiler']
-        else:
-            return True, colored('[missing \"compiler\" keyword]', 'red')
-
-        if not isinstance(self.compiler, dict):
-            return True, colored('[\"compiler\" keyword must be dict]', 'red')
-
-        if 'linker' in build_config:
-            self.linker = build_config['linker']
-        else:
-            return True, colored('[missing \"linker\" keyword]', 'red')
-
-        if not isinstance(self.linker, dict):
-            return True, colored('[\"linker\" keyword must be dict]', 'red')
-
-        if 'mpi_wrapper' in self.compiler:
-            if 'mpi_wrapper}}' in self.compiler['mpi_wrapper']:
-                self.requires_mpi = True
-        else:
-            return True, colored('[missing \"mpi_wrapper\" keyword]', 'red')
-
-        if 'includes' in self.compiler:
-            for include in self.compiler['includes']:
-                if 'include.netcdf}}' in include:
-                    self.requires_netcdf = True
-                if 'include.fftw}}' in include:
-                    self.requires_fftw = True
-                if 'include.rrtmg}}' in include:
-                    self.requires_rrtmg = True
-        else:
-            return True, colored('[missing \"includes\" keyword in compiler]', 'red')
-
-        if 'options' in self.linker:
-            for lib in self.linker['options']:
-                if 'lib.netcdf}}' in lib:
-                    self.requires_netcdf = True
-                if 'lib.fftw}}' in lib:
-                    self.requires_fftw = True
-                if 'lib.rrtmg}}' in lib:
-                    self.requires_rrtmg = True
-        else:
-            return True, colored('[missing \"options\" keyword in linker]', 'red')
-
-        library_names = []
-        if self.requires_netcdf:
-            library_names.append('netcdf')
-        if self.requires_fftw:
-            library_names.append('fftw')
-        if self.requires_rrtmg:
-            library_names.append('rrtmg')
-
-        if not 'executable' in self.compiler:
-            return True, colored('[missing \"executable\" keyword in compiler]', 'red')
-
-        if not 'definitions' in self.compiler:
-            return True, colored('[missing \"definitions\" keyword in compiler]', 'red')
-
-        if not 'options' in self.compiler:
-            return True, colored('[missing \"options\" keyword in compiler]', 'red')
-
-        if not 'default' in self.compiler['options']:
-            return True, colored('[missing \"default\" keyword in compiler.options]', 'red')
-
-        if not 'debug' in self.compiler['options']:
-            return True, colored('[missing \"debug\" keyword in compiler.options]', 'red')
-
-        try:
-            with open(os.path.join(Environment.workspace_dir, 'palmtest.yml'), 'r') as f:
-                palmtest_config = yaml.load(f, Loader=yaml.SafeLoader)
-        except:
-            return True, colored('[palmtest.yml not found]', 'red')
-
-        if 'palm_config_template' in palmtest_config:
-            if isinstance(palmtest_config['palm_config_template'], str):
-                custom_template = palmtest_config['palm_config_template']
-        try:
-            with open(os.path.join(custom_template), 'r') as palm_config_template_file:
-                template = palm_config_template_file.read()
-        except:
-            try:
-                with open(os.path.join(Environment.scripts_dir, '.palm.config.default.in'), 'r') as palm_config_template_file:
-                    template = palm_config_template_file.read()
-            except:
-                return True, colored('[trunk/SCRIPTS/.palm.config.default.in not found]', 'red')
-
-        template = template.replace('@CMAKE_INSTALL_PREFIX@', self.test_dir)
-        template = template.replace('@PALM_HOSTNAME@', socket.gethostname())
-        template = template.replace('@CMAKE_USERNAME@', getpass.getuser())
-        template = template.replace('@MPI_Fortran_COMPILER@', self.compiler['mpi_wrapper'])
-        template = template.replace('@CMAKE_Fortran_COMPILER@', self.compiler['executable'])
-        cpp_options_str = ['-D' + s for s in self.compiler['definitions']]
-        template = template.replace('@PALM_CPP_OPTIONS_STR@', ' '.join(cpp_options_str))
-        template = template.replace('@PALM_CORES@', str(multiprocessing.cpu_count()))
-        template = template.replace('@PALM_COMPILER_OPTIONS@', '{{palmtest.compiler.options}} ' + ' '.join(self.compiler['includes']))
-        template = template.replace('@PALM_LINKER_OPTIONS@', ' '.join(self.linker['options']))
-
-        if 'environments' in palmtest_config:
-            available_environments = palmtest_config['environments']
-        else:
-            return True, colored('[missing \"environments\" keyword in palmtest.yml]', 'red')
-
-        if 'id' in self.compiler:
-            c_id = self.compiler['id']
-        else:
-            return True, colored('[missing \"id\" keyword in compiler]', 'red')
-
-        if c_id in available_environments:
-            self.available = True
-
-            environment = available_environments[c_id]
-
-            if 'mpi_execution_command' in environment:
-                template = template.replace('@PALM_EXECUTE_COMMAND@', environment['mpi_execution_command'])
-            else:
-                template = template.replace('@PALM_EXECUTE_COMMAND@', 'mpirun -n {{mpi_tasks}}')
-
-            if 'executable' not in environment:
-                return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"executable\"]', 'red')
-            value = environment['executable']
-            if isinstance(value, str):
-                template = template.replace('{{' + '.'.join([c_id, 'executable']) + '}}', value)
-            if self.requires_mpi:
-                if 'mpi_wrapper' not in environment:
-                    return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"mpi_wrapper\"]', 'red')
-                value = environment['mpi_wrapper']
-                if isinstance(value, str):
-                    template = template.replace('{{' + '.'.join([c_id, 'mpi_wrapper']) + '}}', value)
-            if 'include' not in environment:
-                return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"include\"]', 'red')
-            if 'lib' not in environment:
-                return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"lib\"]', 'red')
-            for lib in library_names:
-                if lib not in environment['include']:
-                    return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"include.'+lib+'\"]', 'red')
-                value = environment['include'][lib]
-                if isinstance(value, str):
-                    template = template.replace('{{' + '.'.join([c_id, 'include', lib]) + '}}', value)
-                if lib not in environment['lib']:
-                    return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"lib.'+lib+'\"]', 'red')
-                value = environment['lib'][lib]
-                if isinstance(value, str):
-                    template = template.replace('{{' + '.'.join([c_id, 'lib', lib]) + '}}', value)
-
-            with open(os.path.join(self.test_dir, '.palm.config.' + self.build_name), 'w') as palm_config_file:
-                palm_config_file.write(
-                    template.replace(
-                        '{{palmtest.compiler.options}}',
-                        ' '.join(self.compiler['options']['default']),
-                    )
-                )
-            with open(os.path.join(self.test_dir, '.palm.config.' + self.build_name + '_debug'), 'w') as palm_config_file:
-                palm_config_file.write(
-                    template.replace(
-                        '{{palmtest.compiler.options}}',
-                        ' '.join(self.compiler['options']['debug']),
-                    )
-                )
-            self.configured = True
-            return False, colored('[configuration ok]', 'green')
-
-        else:
-            return True, colored('[palmtest.yml environment \"' + c_id + '\" not found]', 'red')
-
-    def _execute(self, build_name):
-        self.attempted = True
-        build_failed = Executor.execute(
-            [
-                os.path.join(self.test_dir, 'trunk', 'SCRIPTS', 'palmbuild'),
-                '-c', '\"' + build_name + '\"',
-                '-v',
-            ],
-            cwd=self.test_dir,
-            verbose=self.verbose,
-            dry_run=self.dry_run,
-        )
-
-        if self.dry_run:
-            return False, colored('[build dry]', 'blue')
-        if build_failed:
-            return True, colored('[build failed]', 'red')
-        else:
-            return False, colored('[build ok]', 'green')
-
-    def build(self, debug=False):
-        if debug:
-            attempted = self.attempted_debug
-            build_name = self.build_name + '_debug'
-            failed = self.failed_debug
-        else:
-            attempted = self.attempted_non_debug
-            build_name = self.build_name
-            failed = self.failed_non_debug
-
-        if not attempted:
-            with Logger(self.test_dir, verbose=self.verbose) as logger:
-                status_prefix = LogFormatter.task_table_line_template.format('Building:', '', build_name, '')
-                logger.to_all(status_prefix)
-                logger.to_log('[started]' + '\n')
-                attempted = True
-
-                failed, message = self._execute(build_name)
-                logger.to_log(status_prefix)
-                logger.to_all(message + ' ')
-                logger.to_all('\n')
-
-        if debug:
-            self.attempted_debug = attempted
-            self.failed_debug = failed
-        else:
-            self.attempted_non_debug = attempted
-            self.failed_non_debug = failed
-
-        return failed
-
-    def report(self):
-        return dict(
-            failed_debug=self.failed_debug,
-            failed_non_debug=self.failed_non_debug,
-        )
-
-
-class PALMTestCase:
-    """The PALM test case class deals with the configuration and execution of all PALM test cases"""
-
-    def __init__(self,test_dir,  name, verbose=False, dry_run=False):
-        self.test_dir = test_dir
-        self.name = name
-        self.verbose = verbose
-        self.dry_run = dry_run
-        self.user_code_dir = os.path.join(Environment.trunk_tests_cases_dir, self.name, 'USER_CODE')
-        self.input_dir = os.path.join(Environment.trunk_tests_cases_dir, self.name, 'INPUT')
-        self.number_of_cores = []
-        self.build_names = []
-        self.input_file_names = []
-        self.configured = False
-
-    def configure(self, requested_build_names, requested_cores):
-        f_name = os.path.join(Environment.trunk_tests_cases_dir, self.name, 'case_config.yml')
-        try:
-            with open(f_name, 'r') as f:
-                config = yaml.load(f, Loader=yaml.SafeLoader)
-        except:
-            return True, colored('[Case \"' + self.name + '\" could not be found.]', 'red')
-        try:
-            self.use_binary_files_from = config['use_binary_files_from']
-        except:
-            self.use_binary_files_from = None
-        self.requires_binary_files = bool(self.use_binary_files_from)
-
-        if 'allowed_builds' not in config:
-            return True, colored('[missing \"allowed_builds\" keyword]', 'red')
-        self.allowed_build_names = config['allowed_builds']
-
-        if 'allowed_number_of_cores' not in config:
-            return True, colored('[missing \"allowed_number_of_cores\" keyword]', 'red')
-        self.allowed_number_of_cores = config['allowed_number_of_cores']
-
-        if 'omp_num_threads' in config:
-            self.omp_num_threads_found = True
-            self.omp_num_threads = config['omp_num_threads']
-        else:
-            self.omp_num_threads_found = False
-
-        if 'tasks_per_node' in config:
-            self.tasks_per_node_found = True
-            self.tasks_per_node = config['tasks_per_node']
-        else:
-            self.tasks_per_node_found = False
-
-        if 'activation_strings' not in config:
-            return True, colored('[missing \"activation_strings\" keyword]', 'red')
-        self.activation_strings = config['activation_strings']
-
-        if 'significant_digits_for_netcdf_checks' not in config:
-            return True, colored('[missing \"significant_digits_for_netcdf_checks\" keyword]', 'red')
-        self.significant_digits = config['significant_digits_for_netcdf_checks']
-
-        if 'timeseries' not in config['significant_digits_for_netcdf_checks']:
-            return True, colored('[missing \"timeseries\" keyword in significant_digits_for_netcdf_checks]', 'red')
-
-        if 'profiles' not in config['significant_digits_for_netcdf_checks']:
-            return True, colored('[missing \"profiles\" keyword in significant_digits_for_netcdf_checks]', 'red')
-
-        if 'other' not in config['significant_digits_for_netcdf_checks']:
-            return True, colored('[missing \"other\" keyword in significant_digits_for_netcdf_checks]', 'red')
-
-        self.number_of_cores = sorted(set(requested_cores).intersection(self.allowed_number_of_cores))
-        self.build_names = sorted(set(requested_build_names).intersection(self.allowed_build_names))
-        self.input_file_names = [s for s in next(os.walk(self.input_dir))[2]]
-        self.configured = True
-        if len(self.number_of_cores) == 0 :
-            return True, colored('[no allowed cores requested]', 'blue')
-        if len(self.build_names) == 0:
-            return True, colored('[no allowed builds requested]', 'blue')
-        if len(self.input_file_names) == 0:
-            return True, colored('[no input files found]', 'red')
-        return False, colored('[configuration ok]', 'green')
-
-
-
-class PALMTest:
-
-    def __init__(self, args):
-        self.verbose = args.verbose
-        self.no_auto_debug = args.no_auto_debug
-        self.force_debug = args.force_debug
-        self.fail_on_debug = args.fail_on_debug
-        self.dry_run = args.dry_run
-        self.no_color = args.no_color
-        self.test_id = args.test_id
-        self.test_case_names = args.cases
-        self.requested_build_names = args.builds
-        self.requested_cores = args.cores
-        self.test_case_queue = []
-        self.build_database = dict()
-
-    def prepare(self):
-        if self.no_color:
-            disable_color()
-        self.test_dir = os.path.join(Environment.tests_dir, self.test_id)
-        try:
-            os.makedirs(self.test_dir, exist_ok=False)
-        except:
-            print('ERROR: Found existing test directory: ' + self.test_dir)
-            exit(1)
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_all(LogFormatter.hline)
-            logger.to_all('This is the PALM tester  (version: ' + version + ')' + '\n')
-            logger.to_all(LogFormatter.hline)
-            try:
-                with open(os.path.join(Environment.workspace_dir, 'palmtest.yml'), 'r') as f:
-                    pass
-            except:
-                logger.to_all('ERROR: No palmtest.yml file was found in your working directory!\n')
-                logger.to_all('INFO:  A template for this file can be found at: trunk/TESTS/palmtest.yml\n')
-                logger.to_all('       Please copy the template to your working directory and adjust it to your system!\n')
-                exit(1)
-
-            self.execution_trunk_dir = os.path.join(self.test_dir, 'trunk')
-            os.symlink(Environment.trunk_dir, self.execution_trunk_dir)
-            self.execution_jobs_dir = os.path.join(self.test_dir, 'JOBS')
-            os.makedirs(self.execution_jobs_dir, exist_ok=False)
-
-            try:
-                with open(os.path.join(Environment.scripts_dir, '.palm.iofiles'), 'r') as iofiles_template_file:
-                    iofiles_template = iofiles_template_file.read()
-                with open(os.path.join(self.test_dir, '.palm.iofiles'), 'w') as iofiles_file:
-                    iofiles_file.write(iofiles_template.replace('$fast_io_catalog', '$base_data').replace('$restart_data_path', '$base_data').replace('$output_data_path', '$base_data'))
-            except:
-                logger.to_all('ERROR: No .palm.iofiles file was found in trunk/SCRIPTS/')
-                exit(1)
-
-            available_cores = multiprocessing.cpu_count()
-            final_cores_list = list(filter(lambda x: x <= available_cores, self.requested_cores))
-
-            logger.to_all(LogFormatter.config_table_line_template.format('Object:', 'Name:', 'Action:') + 'Status:\n')
-            logger.to_all(LogFormatter.hline)
-
-            if 'all' in self.requested_build_names:
-                self.requested_build_names = [name for name in next(os.walk(Environment.trunk_tests_builds_dir))[1] if not name[0] == '.']
-            found_build_names = []
-            for build_name in self.requested_build_names:
-                build = PALMBuild(self.test_dir, build_name, verbose=self.verbose, dry_run=self.dry_run)
-                configuration_failed, message = build.configure()
-                if not configuration_failed:
-                    self.build_database[build_name] = build
-                    found_build_names.append(build_name)
-                    logger.to_all(LogFormatter.config_table_line_template.format('Build', build_name, 'approved'))
-                    logger.to_all(message + '\n')
-                else:
-                    logger.to_all(LogFormatter.config_table_line_template.format('Build', build_name, 'rejected'))
-                    logger.to_all(message + '\n')
-            final_build_list = found_build_names
-
-            if 'all' in self.test_case_names:
-                self.test_case_names = sorted([name for name in next(os.walk(Environment.trunk_tests_cases_dir))[1] if not name[0] == '.'])
-
-            additional_initial_runs_2 = [self.test_case_names]
-            while len(additional_initial_runs_2[-1]) > 0:
-                additional_initial_runs_1 = []
-                for test_case_name in additional_initial_runs_2[-1]:
-                    test_case = PALMTestCase(self.test_dir, test_case_name, verbose=self.verbose)
-                    test_case_configuration_failed, message = test_case.configure(final_build_list, final_cores_list)
-                    if not test_case_configuration_failed:
-                        if test_case.requires_binary_files:
-                            additional_initial_runs_1.append(test_case.use_binary_files_from)
-                additional_initial_runs_2.append(sorted(set(additional_initial_runs_1)))
-
-            test_case_order = []
-            for i in range(len(additional_initial_runs_2)-1):
-                # low and high refer to priority
-                low = additional_initial_runs_2[i]
-                high = additional_initial_runs_2[i+1]
-                for item in high:
-                    while item in low:
-                        low.remove(item)
-                test_case_order.append(low)
-
-            test_case_order_no_dublicates = []
-            for test_cases in test_case_order:
-                seen = set()
-                seen_add = seen.add
-                test_case_order_no_dublicates.append( [x for x in test_cases if not (x in seen or seen_add(x))] )
-
-            approved_test_case_order = [[]] + list(reversed(test_case_order_no_dublicates))
-            for i, test_cases in enumerate(list(approved_test_case_order)):
-                info = 'Case (dep)' if i < len(approved_test_case_order)-1 else 'Case'
-                for test_case_name in list(test_cases):
-                    sys.stdout.flush()
-                    test_case = PALMTestCase(self.test_dir, test_case_name, verbose=self.verbose)
-                    test_case_configuration_failed, message = test_case.configure(final_build_list, final_cores_list)
-                    if test_case_configuration_failed:
-                        # removing as configuration failed should only apply to added dependencies
-                        approved_test_case_order[i].remove(test_case_name)
-                        logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'rejected'))
-                        logger.to_all(message + '\n')
-                    elif test_case.requires_binary_files:
-                        if test_case.use_binary_files_from not in approved_test_case_order[i-1]:
-                            # removing as dependency is already removed
-                            approved_test_case_order[i].remove(test_case_name)
-                            logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'disabled'))
-                            logger.to_all(colored('[requires dependency \"' + test_case.use_binary_files_from + '\"]', 'red') + '\n')
-                        else:
-                            logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'approved'))
-                            logger.to_all(message + '\n')
-                    else:
-                        logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'approved'))
-                        logger.to_all(message + '\n')
-
-            final_case_list = []
-            for cases in approved_test_case_order:
-                for case in cases:
-                    if case not in final_case_list:
-                        final_case_list.append(case)
-
-            for build_name in final_build_list:
-                build = PALMBuild(
-                    self.test_dir,
-                    build_name,
-                    verbose=self.verbose,
-                    dry_run=self.dry_run,
-                )
-                configuration_failed, message = build.configure()
-                if not configuration_failed:
-                    self.build_database[build_name] = build
-                else:
-                    logger.to_all(message + '\n')
-
-            for case_name in final_case_list:
-                test_case = PALMTestCase(
-                    self.test_dir,
-                    case_name,
-                    verbose=self.verbose,
-                    dry_run=self.dry_run,
-                )
-                test_case_configuration_failed, message = test_case.configure(final_build_list, final_cores_list)
-                if not test_case_configuration_failed:
-                    self.test_case_queue.append(test_case)
-            logger.to_all(LogFormatter.hline)
-
-            logger.to_all(LogFormatter.intro_table_line_template.format('Test ID:') +
-                          self.test_id + '\n')
-            logger.to_all(LogFormatter.intro_table_line_template.format('Builds:') +
-                          str('\n' + LogFormatter.intro_table_line_template.format('')).join(sorted(self.build_database.keys())) + '\n')
-            logger.to_all(LogFormatter.intro_table_line_template.format('Cases:') +
-                          str('\n' + LogFormatter.intro_table_line_template.format('')).join([c.name for c in self.test_case_queue]) + '\n')
-            logger.to_all(LogFormatter.intro_table_line_template.format('Cores:') +
-                          ' '.join([str(i) for i in final_cores_list]) + '\n')
-
-    def _execute(self, test_case, build_name, cores):
-        job = PALMJob(
-            self.test_dir,
-            test_case,
-            build_name,
-            cores,
-            verbose=self.verbose,
-            dry_run=self.dry_run
-        )
-        if self.force_debug:
-            build_failed_non_debug = True
-            job_failed_non_debug = True
-            build_failed_debug = self.build_database[build_name].build(debug=True)
-            if build_failed_debug:
-                job_failed_debug = True
-            else:
-                job_failed_debug = job.execute(debug=True)
-        elif self.no_auto_debug:
-            build_failed_non_debug = self.build_database[build_name].build(debug=False)
-            if build_failed_non_debug:
-                job_failed_non_debug = True
-            else:
-                job_failed_non_debug = job.execute(debug=False)
-            build_failed_debug = None
-            job_failed_debug = None
-        else:
-            build_failed_non_debug = self.build_database[build_name].build(debug=False)
-            if build_failed_non_debug:
-                job_failed_non_debug = True
-                build_failed_debug = self.build_database[build_name].build(debug=True)
-                if build_failed_debug:
-                    job_failed_debug = False
-                else:
-                    job_failed_debug = job.execute(debug=True)
-            else:
-                job_failed_non_debug = job.execute(debug=False)
-                if job_failed_non_debug:
-                    build_failed_debug = self.build_database[build_name].build(debug=True)
-                    if build_failed_debug:
-                        job_failed_debug = True
-                    else:
-                        job_failed_debug = job.execute(debug=True)
-                else:
-                    build_failed_debug = None
-                    job_failed_debug = None
-        return dict(
-            build_failed_non_debug=build_failed_non_debug,
-            job_failed_non_debug=job_failed_non_debug,
-            build_failed_debug=build_failed_debug,
-            job_failed_debug=job_failed_debug,
-        )
-
-    def execute(self):
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_all(LogFormatter.hline)
-            logger.to_all(LogFormatter.task_table_line_template.format('Task:', 'Case:', 'Build:', 'Cores:') + 'Status:\n')
-            logger.to_all(LogFormatter.hline)
-            self.test_report = dict()
-            for test_case in self.test_case_queue:
-                logger.to_log(LogFormatter.hline)
-                logger.to_file(LogFormatter.hline)
-                logger.to_file(LogFormatter.hline)
-                status_dict = dict()
-                for build_name in test_case.build_names:
-                    status_dict[build_name] = dict()
-                    for cores in test_case.number_of_cores:
-                        status_dict[build_name][cores] = self._execute(test_case, build_name, cores)
-                self.test_report[test_case.name] = status_dict
-                logger.to_log(LogFormatter.hline)
-                logger.to_file('\n' * 10)
-
-    def report(self):
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_all(LogFormatter.hline)
-            r = '{:10}' + '    total: ' + '{:<3d}' + \
-                             '    ok: ' + colored('{:<3d}', 'green') + \
-                       '    debugged: ' + colored('{:<3d}', 'yellow') + \
-                         '    failed: ' + colored('{:<3d}', 'red')
-            n_all = 0
-            n_ok = 0
-            n_debugged = 0
-            n_failed = 0
-            for build_name, build in self.build_database.items():
-                status = build.report()
-                b = status['failed_non_debug']
-                bd = status['failed_debug']
-                n_all += 1
-                if not b and b is not None:
-                    n_ok += 1
-                if bd is not None:
-                    n_debugged += 1
-                if b and (bd or bd is None):
-                    n_failed += 1
-            logger.to_all(r.format('Builds:', n_all, n_ok, n_debugged, n_failed) + '\n')
-            total_failed = n_failed
-            total_debugged = n_debugged
-            n_all = 0
-            n_ok = 0
-            n_debugged = 0
-            n_failed = 0
-            # {'case_name': {'build_name': {4: {'build_failed_debug': None,
-            #                                   'build_failed_non_debug': False,
-            #                                   'job_failed_debug': None,
-            #                                   'job_failed_non_debug': False}}},
-            for case_name, case in self.test_report.items():
-                for build_name, build in case.items():
-                    for cores, results in build.items():
-                        n_all += 1
-                        b = results['build_failed_non_debug']
-                        bd = results['build_failed_debug']
-                        j = results['job_failed_non_debug']
-                        jd = results['job_failed_debug']
-                        if not j:
-                            n_ok += 1
-                        if jd is not None:
-                            n_debugged += 1
-                        if j and (jd or jd is None):
-                            n_failed += 1
-            logger.to_all(r.format('Tests:', n_all, n_ok, n_debugged, n_failed) + '\n')
-            total_failed += n_failed
-            total_debugged += n_debugged
-        if self.fail_on_debug:
-            return (total_failed + total_debugged) > 0
-        else:
-            return total_failed > 0
-
-
-class CustomCompleter:
-
-    def __init__(self):
-        pass
-
-    def __call__(self, prefix, parsed_args, **kwargs):
-        return (i for i in self.get_items() if i.startswith(prefix))
-
-    def get_items(self):
-        return []
-
-
-class CaseCompleter(CustomCompleter):
-
-    def get_items(self):
-        case_names = [name for name in next(os.walk(Environment.trunk_tests_cases_dir))[1] if not name[0] == '.']
-        return case_names + ['all']
-
-
-class BuildCompleter(CustomCompleter):
-
-    def get_items(self):
-        build_names = [name for name in next(os.walk(Environment.trunk_tests_builds_dir))[1] if not name[0] == '.']
-        return build_names + ['all']
-
-
-class PALMTestArgumentParser(ArgumentParser):
-
-    def __init__(self):
-        super().__init__(
-            description='This is the PALM tester\n' +
-                        'Developer Support: knoop@muk.uni-hannover.de',
-            formatter_class=RawTextHelpFormatter,
-            add_help=True,
-        )
-        self.add_argument(
-            '--version',
-            action='version',
-            version=version,
-        )
-        self.add_argument(
-            '--verbose',
-            action='store_true',
-            dest='verbose',
-            help='Increase verbosity of terminal output.',
-            required=False,
-        )
-        self.add_argument(
-            '--no-auto-debug',
-            action='store_true',
-            dest='no_auto_debug',
-            help='Disable automatic debugging in case of test failure.',
-            required=False,
-        )
-        self.add_argument(
-            '--force-debug',
-            action='store_true',
-            dest='force_debug',
-            help='Force debugging regardless of test failure (ignores --no-auto-debug).',
-            required=False,
-        )
-        self.add_argument(
-            '--fail-on-debug',
-            action='store_true',
-            dest='fail_on_debug',
-            help='Return a non-zero exit status in case debugging was required.',
-            required=False,
-        )
-        self.add_argument(
-            '--dry-run',
-            action='store_true',
-            dest='dry_run',
-            help='Prepare and process all requested tests without actually building or executing PALM.',
-            required=False,
-        )
-        self.add_argument(
-            '--no-color',
-            action='store_true',
-            dest='no_color',
-            help='Disable colored terminal output.',
-            required=False,
-        )
-        self.add_argument(
-            '--cases',
-            action='store',
-            dest='cases',
-            default=['all'],
-            help='A list of test cases to be executed. (default: %(default)s)',
-            nargs='+',
-            required=False,
-            type=str,
-            metavar='STR',
-        ).completer = CaseCompleter()
-        self.add_argument(
-            '--builds',
-            action='store',
-            dest='builds',
-            default=['all'],
-            help='A list of builds to be executed. (default: %(default)s)',
-            nargs='+',
-            required=False,
-            type=str,
-            metavar='STR',
-        ).completer = BuildCompleter()
-        self.add_argument(
-            '--cores',
-            action='store',
-            dest='cores',
-            default=[i for i in range(1, multiprocessing.cpu_count()+1)],
-            choices=[i for i in range(1, multiprocessing.cpu_count()+1)],
-            help='The number of cores tests are supposed to be executed on. (default: %(default)s)',
-            nargs='+',
-            required=False,
-            type=int,
-            metavar='INT',
-        )
-        self.add_argument(
-            '--test-id',
-            action='store',
-            dest='test_id',
-            default=datetime.now().strftime('%Y-%m-%d_%H:%M:%S.%f'),
-            help='An individual test id. (default: current timestamp)',
-            required=False,
-            type=str,
-            metavar='STR',
-        )
-
-
-if __name__ == '__main__':
-    parser = PALMTestArgumentParser()
-    if has_argcomplete:
-        argcomplete.autocomplete(parser)
-    args = parser.parse_args()
-    palm_test = PALMTest(args)
-    palm_test.prepare()
-    palm_test.execute()
-    failed = palm_test.report()
-    exit(1 if failed else 0)
Index: palm/trunk/SCRIPTS/palmtutorial
===================================================================
--- palm/trunk/SCRIPTS/palmtutorial	(revision 4901)
+++ 	(revision )
@@ -1,1411 +1,0 @@
-#!/usr/bin/env python3
-# PYTHON_ARGCOMPLETE_OK
-
-import os
-import sys
-import shutil
-from datetime import datetime
-import subprocess
-import multiprocessing
-import socket
-import getpass
-import math
-import re
-import threading
-import queue
-from contextlib import ContextDecorator
-
-try:
-    from argparse import ArgumentParser
-    from argparse import RawTextHelpFormatter
-except ImportError:
-    sys.exit(
-        'ERROR: You need argparse!\n' +
-        '   install it from http://pypi.python.org/pypi/argparse\n' +
-        '   or run \"pip install argparse\".'
-    )
-
-try:
-    import numpy as np
-except ImportError:
-    sys.exit(
-        'ERROR: You need numpy!\n' +
-        '   install it from http://pypi.python.org/pypi/numpy\n' +
-        '   or run \"python3 -m pip install numpy\".'
-    )
-
-try:
-    import netCDF4
-except ImportError:
-    sys.exit(
-        'ERROR: You need netCDF4!\n' +
-        '   install it from http://pypi.python.org/pypi/netCDF4\n' +
-        '   or run \"python3 -m pip install netCDF4\".'
-    )
-
-try:
-    import yaml
-except ImportError:
-    sys.exit(
-        'ERROR: You need PyYAML!\n' +
-        '   install it from http://pypi.python.org/pypi/PyYAML\n' +
-        '   or run \"python3 -m pip install PyYAML\".'
-    )
-
-try:
-    import argcomplete
-except ImportError:
-    print(
-        'INFO: To use Tab-completion you need argcomplete!\n' +
-        '   install it from http://pypi.python.org/pypi/argcomplete\n' +
-        '   or run \"python3 -m pip install argcomplete\".'
-    )
-    has_argcomplete = False
-else:
-    has_argcomplete = True
-
-try:
-    from termcolor import colored as tcolored
-except ImportError:
-    def tcolored(string, color):
-        return string
-
-disable_colored_output = False
-
-
-def colored(string, color):
-    if not disable_colored_output:
-        return tcolored(string, color)
-    else:
-        return string
-
-
-def disable_color():
-    global disable_colored_output
-    disable_colored_output = True
-
-
-version = '1.0.1'
-
-
-class Environment:
-
-    scripts_dir = os.path.dirname(os.path.realpath(__file__))
-    trunk_dir = os.path.realpath(os.path.join(scripts_dir, '..'))
-    workspace_dir = os.path.realpath(os.path.join(trunk_dir, '..'))
-
-    trunk_tests_dir = os.path.join(trunk_dir, 'TUTORIALS')
-    trunk_tests_cases_dir = os.path.join(trunk_tests_dir, 'cases')
-    trunk_tests_builds_dir = os.path.join(trunk_tests_dir, 'builds')
-
-    tests_dir = os.path.join(workspace_dir, 'tutorials')
-
-
-class LogFormatter:
-
-    terminal_columns, terminal_lines = shutil.get_terminal_size()
-    hline = '#' * min(terminal_columns, 300) + '\n'
-    table_width_intro = 12
-    table_width_builds = len(max([s for s in next(os.walk(Environment.trunk_tests_builds_dir))[1] if not s[0] == '.'], key=len)) + len('_debug')
-    table_width_cases = len(max([s for s in next(os.walk(Environment.trunk_tests_cases_dir))[1] if not s[0] == '.'], key=len))
-    table_width_cores = 7
-    table_width_total = table_width_intro + table_width_builds + table_width_cases + table_width_cores + 3
-
-    intro_table_line_template = \
-        '{:' + str(table_width_intro) + '} '
-
-    task_table_line_template = \
-        '{:' + str(table_width_intro) + '} ' + \
-        '{:' + str(table_width_cases) + '} ' + \
-        '{:' + str(table_width_builds) + '} ' + \
-        '{:' + str(table_width_cores) + '} '
-
-    config_table_line_template = \
-        '{:' + str(table_width_intro) + '} ' + \
-        '{:' + str(max(table_width_builds, table_width_cases)) + '} ' + \
-        '{:8} '
-
-    file_table_line_template = \
-        '{:' + str(table_width_intro) + '} ' + \
-        '{:' + str(table_width_cases + 13) + '} '
-
-
-class SignificantDigitsRounder:
-
-    @staticmethod
-    def _round(value, digits=10):
-        if value == 0.0:
-            return value
-        negative = value < 0.0
-        value = -value if negative else value
-        rounded_value = round(value, -int(math.floor(math.log10(value))) + (digits - 1))
-        rounded_value = -rounded_value if negative else rounded_value
-        return rounded_value
-
-
-    vectorized_round = np.vectorize(_round)
-
-    _vectorized_round = np.vectorize(round)
-
-
-    @classmethod
-    def around(cls, array, digits=10):
-        # TODO: divide both arrays and check decimal point
-        sign_mask = np.ma.masked_where(array >= 0.0, array).mask
-        pos_array = np.where(sign_mask, array, -array)
-        non_zero_maks = np.ma.masked_where(pos_array == 0.0, pos_array).mask
-        non_zero_array = np.where(non_zero_maks, 1.0, pos_array)
-        i1 = -np.floor(np.log10(non_zero_array)).astype(int) + (digits - 1)
-        rounded_non_zero_array = cls._vectorized_round(non_zero_array, i1)
-        rounded_pos_array = np.where(non_zero_maks, 0.0, rounded_non_zero_array)
-        return np.where(sign_mask, rounded_pos_array, -rounded_pos_array)
-
-
-
-class Logger(ContextDecorator):
-
-    def __init__(self, logfile_dir, logfile_name='palmtest.log', logfile_mode='a', verbose=False):
-        self.logfile_path = os.path.join(logfile_dir, logfile_name)
-        self.logfile_mode = logfile_mode
-        self.verbose = verbose
-
-    def __enter__(self):
-        self._file = open(self.logfile_path, self.logfile_mode)
-        return self
-
-    def to_file(self, message):
-        self._file.write(message)
-        self._file.flush()
-
-    def to_log(self, message):
-        if self.verbose:
-            sys.stdout.write(message)
-            sys.stdout.flush()
-        self._file.write(message)
-        self._file.flush()
-
-    def to_all(self, message):
-        sys.stdout.write(message)
-        sys.stdout.flush()
-        self._file.write(message)
-        self._file.flush()
-
-    def __exit__(self, *exc):
-        self._file.close()
-        return False
-
-
-class Executor:
-
-    @staticmethod
-    def _enqueue_output(out, queue):
-        for line in iter(out.readline, b''):
-            queue.put(line)
-        out.close()
-
-    @staticmethod
-    def execute(cmd, cwd='.', verbose=True, dry_run=False):
-        assert isinstance(cmd, list)
-        if dry_run:
-            cmd = ['echo'] + cmd
-        cmd_str = ' '.join(cmd)
-        p = subprocess.Popen(cmd_str, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, bufsize=1)
-        q = queue.Queue()
-        t = threading.Thread(target=Executor._enqueue_output, args=(p.stdout, q))
-        t.daemon = True # thread dies with the program
-        t.start()
-
-        with Logger(cwd, verbose=verbose) as logger:
-            # read line without blocking
-            logger.to_log(LogFormatter.hline)
-            logger.to_log('CMD: ' + cmd_str + '\n')
-            logger.to_log(LogFormatter.hline)
-            while t.is_alive():
-                try:
-                    line = q.get_nowait()  # or q.get(timeout=.1)
-                except queue.Empty:
-                    pass  # print('no output yet')
-                else:  # got line
-                    logger.to_log(line.decode("utf-8"))
-            line = True
-            while line:
-                try:
-                    line = q.get_nowait()  # or q.get(timeout=.1)
-                except queue.Empty:
-                    line = False
-                else:  # got line
-                    logger.to_log(line.decode("utf-8"))
-            logger.to_log(LogFormatter.hline)
-
-        rc = p.poll()
-        failed = rc != 0
-        return failed
-
-
-class NetCDFInterface:
-
-    def __init__(self, filename):
-        self.filename = filename
-
-    def is_healthy(self):
-        try:
-            self.get_run_name()
-        except:
-            return False
-        else:
-            return True
-
-    def get_run_name(self):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            l = getattr(netcdf, 'title').split()
-            i = l.index('run:')
-            return l[i+1]
-
-    def get_var_list(self):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            var_list = list(netcdf.variables.keys())
-            var_list = filter(None, var_list)
-            return sorted(var_list)
-
-    def show_content(self):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            for name in netcdf.ncattrs():
-                print("Global attr", name, "=", getattr(netcdf, name))
-            print(netcdf)
-            for v in netcdf.variables:
-                print(v)
-
-    def get_times_list(self):
-        attributes, times = self.read_var('time')
-        times = [str(time) for time in times]
-        times = list(filter(None, times))
-        return times
-
-    def contains(self, variable):
-        return variable in self.get_var_list()
-
-    def read_var(self, variable):
-        with netCDF4.Dataset(self.filename, mode='r') as netcdf:
-            values = netcdf.variables[variable][:]  # extract values
-            attributes = dict()
-            try:
-                attributes['long_name'] = netcdf.variables[variable].name
-            except:
-                attributes['long_name'] = ''
-            try:
-                attributes['unit'] = netcdf.variables[variable].units
-            except:
-                attributes['unit'] = ''
-        return attributes, values
-
-
-class FileComparator:
-
-    @staticmethod
-    def compare_ascii(file_path1, file_path2, start_string=None):
-        try:
-            with open(file_path1, 'r') as file1:
-                content1 = file1.readlines()
-        except OSError:
-            return True, colored('[reference file not found]', 'red')
-        try:
-            with open(file_path2, 'r') as file2:
-                content2 = file2.readlines()
-        except OSError:
-            return True, colored('[output file not found]', 'red')
-        if start_string:
-            index1 = content1.index(start_string)
-            index2 = content2.index(start_string)
-            comparable_content1 = content1[index1:]
-            comparable_content2 = content2[index2:]
-            ln = index2 + 1
-        else:
-            comparable_content1 = content1
-            comparable_content2 = content2
-            ln = 1
-        if len(comparable_content1) != len(comparable_content2):
-            return True, colored('[mismatch in total number of lines]', 'red')
-        for line1, line2 in zip(comparable_content1, comparable_content2):
-                if not line1 == line2:
-                    return True, colored('[mismatch in content starting line ' + str(ln) + ']', 'red')
-                ln += 1
-        return False, colored('[file ok]', 'green')
-
-    @staticmethod
-    def compare_netcdf(file_path1, file_path2, digits=None):
-        nci1 = NetCDFInterface(file_path1)
-        nci2 = NetCDFInterface(file_path2)
-        if not nci1.is_healthy():
-            return True, colored('[reference file not found]', 'red')
-        if not nci2.is_healthy():
-            return True, colored('[output file not found]', 'red')
-        times_list1 = nci1.get_times_list()
-        times_list2 = nci2.get_times_list()
-        if not times_list1 == times_list2:
-            return True, colored('[wrong time dimension]', 'red')
-        else:
-            time_list = times_list1
-        var_list1 = nci1.get_var_list()
-        var_list2 = nci2.get_var_list()
-        if not var_list1 == var_list2:
-            return True, colored('[wrong set of variables]', 'red')
-        else:
-            var_list = var_list1
-        content1 = dict()
-        content2 = dict()
-        for var in var_list:
-            attributes1, values1 = nci1.read_var(var)
-            attributes2, values2 = nci2.read_var(var)
-            if sorted(attributes1.keys()) != sorted(attributes2.keys()):
-                return True, colored('[wrong set of attributes in variable \"'+var+'\"]', 'red')
-            if isinstance(digits, int):
-                values1 = SignificantDigitsRounder.around(values1, digits=digits)
-                values2 = SignificantDigitsRounder.around(values2, digits=digits)
-            content1[var] = values1
-            content2[var] = values2
-        #for decimals in
-        for i, time in enumerate(time_list):
-            for var in var_list:
-                t_content1 = content1[var][i]
-                t_content2 = content2[var][i]
-                if not (t_content1==t_content2).all():
-                    if isinstance(digits, int):
-                        return True, colored('[1st mismatch within ' + str(digits) + ' digits at time index ' + str(i) + ' in variable \"' + var + '\"]', 'red')
-                    else:
-                        return True, colored('[1st mismatch at time index ' + str(i) + ' in variable \"' + var + '\"]', 'red')
-        return False, colored('[file ok]', 'green')
-
-
-class OutputChecker:
-
-    def __init__(self, test_dir, setup_name, build_name, cores, significant_digits=None, verbose=True, dry_run=False):
-        self.test_dir = test_dir
-        self.setup_name = setup_name
-        self.build_name = build_name
-        self.cores = cores
-        self.significant_digits = significant_digits
-        self.verbose = verbose
-        self.dry_run = dry_run
-        self.job_name = self.setup_name + '__' + build_name + '__' + str(self.cores)
-        self.job_dir = os.path.join(self.test_dir, 'JOBS', self.job_name)
-        self.ref_monitoring_dir = os.path.join(Environment.trunk_tests_cases_dir, self.setup_name, 'MONITORING')
-        self.ref_output_dir = os.path.join(Environment.trunk_tests_cases_dir, self.setup_name, 'OUTPUT')
-        self.res_monitoring_dir = os.path.join(self.job_dir, 'MONITORING')
-        self.res_output_dir = os.path.join(self.job_dir, 'OUTPUT')
-        self.failed = None
-
-    def get_checkable_file_dicts(self):
-        if os.path.isdir(self.ref_monitoring_dir):
-            file_names_monitoring = [s for s in next(os.walk(self.ref_monitoring_dir))[2]]
-        else:
-            file_names_monitoring = []
-        file_paths_monitoring = []
-        for file_name in file_names_monitoring:
-            file_specific_ending = file_name[len(self.setup_name):]
-            file_specific_ending_split = file_specific_ending.split('.')
-            postfix = file_specific_ending_split[0]
-            if len(file_specific_ending_split) > 1:
-                extension = file_specific_ending_split[-1]
-            else:
-                extension = ''
-            if len(file_specific_ending_split) > 2:
-                cycle_info = file_specific_ending_split[1: -1]
-            else:
-                cycle_info = []
-            file_paths_monitoring.append(
-                dict(
-                    postfix=postfix,
-                    cycle_info=cycle_info,
-                    extension=extension,
-                    ref_path=self.ref_monitoring_dir,
-                    res_path=self.res_monitoring_dir,
-                )
-            )
-        if os.path.isdir(self.ref_output_dir):
-            file_names_output = [s for s in next(os.walk(self.ref_output_dir))[2]]
-        else:
-            file_names_output = []
-        file_paths_output = []
-        for file_name in file_names_output:
-            file_specific_ending = file_name[len(self.setup_name):]
-            file_specific_ending_split = file_specific_ending.split('.')
-            postfix = file_specific_ending_split[0]
-            if len(file_specific_ending_split) > 1:
-                extension = file_specific_ending_split[-1]
-            else:
-                extension = ''
-            if len(file_specific_ending_split) > 2:
-                cycle_info = file_specific_ending_split[1: -1]
-            else:
-                cycle_info = []
-            file_paths_output.append(
-                dict(
-                    postfix=postfix,
-                    cycle_info=cycle_info,
-                    extension=extension,
-                    ref_path=self.ref_output_dir,
-                    res_path=self.res_output_dir,
-                )
-            )
-        return file_paths_monitoring + file_paths_output
-
-    def check(self):
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_log('Checking output files:')
-            logger.to_all('\n')
-            failed = False
-            for file_dict in self.get_checkable_file_dicts():
-                file_failed = False
-                ext_list = [file_dict['extension']] if file_dict['extension'] else []
-                file_specific_ending = '.'.join([file_dict['postfix']] + file_dict['cycle_info'] + ext_list )
-                logger.to_all(LogFormatter.file_table_line_template.format('Checking:', self.setup_name + file_specific_ending))
-                ref_file_path = os.path.join(file_dict['ref_path'], self.setup_name + file_specific_ending)
-                res_file_path = os.path.join(file_dict['res_path'], self.job_name + file_specific_ending)
-                if re.match('_rc', file_dict['postfix']) and not file_dict['extension']:
-                    file_failed, message = FileComparator.compare_ascii(ref_file_path, res_file_path, start_string='Run-control output:\n')
-                elif re.match('nc', file_dict['extension']):
-                    if self.significant_digits is not None:
-                        if re.match('_ts', file_dict['postfix']) and 'timeseries' in self.significant_digits:
-                            file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path,
-                                                                                 digits=self.significant_digits['timeseries'])
-                        elif re.match('_pr', file_dict['postfix']) and 'profiles' in self.significant_digits:
-                            file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path,
-                                                                                 digits=self.significant_digits['profiles'])
-                        else:
-                            file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path,
-                                                                                 digits=self.significant_digits['other'])
-                    else:
-                        file_failed, message = FileComparator.compare_netcdf(ref_file_path, res_file_path)
-                else:
-                    message = colored('[ignored]', 'blue')
-                if file_failed:
-                    failed = True
-                logger.to_all(message + '\n')
-            if self.dry_run:
-                failed = False
-        return failed
-
-
-class PALMJob:
-    """The PALM job class deals with the execution of a single PALM job"""
-
-    @staticmethod
-    def get_job_name(setup_name, build_name, cores):
-        return setup_name + '__' + build_name + '__' + str(cores)
-
-    def __init__(self, test_dir, test_case, build_name, cores, verbose=False, dry_run=False):
-        self.test_dir = test_dir
-        self.test_case = test_case
-        self.build_name = build_name
-        self.cores = cores
-        self.verbose = verbose
-        self.dry_run = dry_run
-
-        self.attempted_debug = False
-        self.failed_debug = None
-        self.attempted_non_debug = False
-        self.failed_non_debug = None
-
-    def _link_restart_files(self, build_name):
-        if self.dry_run:
-            return True, colored('[restart data dry]', 'blue')
-        name = self.get_job_name(self.test_case.name, build_name, self.cores)
-        source_name = self.get_job_name(self.test_case.use_binary_files_from, build_name, self.cores)
-        source_restart_dir = os.path.join(self.test_dir, 'JOBS', source_name, 'RESTART')
-        try:
-            source_data_dirs_grp = [d for r, d, f in os.walk(source_restart_dir)]
-        except:
-            source_data_dirs_grp = []
-        if len(source_data_dirs_grp) == 0:
-            source_data_dirs = []
-        else:
-            source_data_dirs = source_data_dirs_grp[0]
-        if len(source_data_dirs) == 0 and re.match('.+_debug', build_name):
-            source_build_name = build_name[:-len('_debug')]
-            source_name = self.get_job_name(self.test_case.use_binary_files_from, source_build_name, self.cores)
-            source_restart_dir = os.path.join(self.test_dir, 'JOBS', source_name, 'RESTART')
-            try:
-                source_data_dirs_grp = [d for r, d, f in os.walk(source_restart_dir)]
-            except:
-                source_data_dirs_grp = []
-            if len(source_data_dirs_grp) == 0:
-                source_data_dirs = []
-            else:
-                source_data_dirs = source_data_dirs_grp[0]
-        if len(source_data_dirs) == 0:
-            source_data_dir = 'no_restart_data'
-        else:
-            source_data_dir = sorted(source_data_dirs)[-1]
-        source_data_dir_path = os.path.join(source_restart_dir, source_data_dir)
-        if os.path.isdir(source_data_dir_path) and re.match('.+_d3d.*', source_data_dir):
-            job_restart_dir = os.path.join(self.test_dir, 'JOBS', name, 'RESTART')
-            os.makedirs(job_restart_dir, exist_ok=False)
-            job_data_dir_path = os.path.join(job_restart_dir, name + '_d3d')
-            os.symlink(source_data_dir_path, job_data_dir_path, target_is_directory=True)
-            return False, colored('[linked restart data from: ' + source_data_dir_path + ']', 'green')
-        else:
-            return True, colored('[no restart data found]', 'red')
-
-    def _execute(self, name, build_name):
-        execution_failed = Executor.execute(
-            [
-                os.path.join(self.test_dir, 'trunk', 'SCRIPTS', 'palmrun'),
-                '-c', '\"' + build_name + '\"',
-                '-r', name,
-                '-a', '\"' + ' '.join(self.test_case.activation_strings) + '\"',
-                '-X', str(self.cores),
-                '-T', str(self.cores),
-                '-B',
-                '-v',
-                '-z',
-            ],
-            cwd=self.test_dir,
-            verbose=self.verbose,
-            dry_run=self.dry_run,
-        )
-
-        if self.dry_run:
-            return False, colored('[execution dry]', 'blue')
-        elif execution_failed:
-            return True, colored('[execution failed]', 'red')
-        else:
-            return False, colored('[execution ok]', 'green')
-
-    def _check(self, build_name):
-        checker = OutputChecker(
-            self.test_dir,
-            self.test_case.name,
-            build_name,
-            self.cores,
-            significant_digits=self.test_case.significant_digits,
-            verbose=self.verbose,
-            dry_run=self.dry_run,
-        )
-        check_failed = checker.check()
-
-        if self.dry_run:
-            return False, colored('[checks dry]', 'blue')
-        if check_failed:
-            return True, colored('[checks failed]', 'red')
-        else:
-            return False, colored('[checks ok]', 'green')
-
-    def execute(self, debug=False):
-        if debug:
-            attempted = self.attempted_debug
-            build_name = self.build_name + '_debug'
-            failed = self.failed_debug
-        else:
-            attempted = self.attempted_non_debug
-            build_name = self.build_name
-            failed = self.failed_non_debug
-
-        if not attempted:
-            with Logger(self.test_dir, verbose=self.verbose) as logger:
-                status_prefix = LogFormatter.task_table_line_template.format('Testing:', self.test_case.name, build_name, self.cores)
-                logger.to_all(status_prefix)
-                logger.to_log('[started]' + '\n')
-                attempted = True
-
-                name = self.get_job_name(self.test_case.name, build_name, self.cores)
-
-                input_dir = os.path.join(self.test_dir, 'JOBS', name, 'INPUT')
-                os.makedirs(input_dir, exist_ok=False)
-
-                # copying needs to be done per file, because input files need to be renamed
-                for input_file in self.test_case.input_file_names:
-                    postfix = input_file[len(self.test_case.name):]
-                    src = os.path.join(self.test_case.input_dir, input_file)
-                    dst = os.path.join(input_dir, name + postfix)
-                    shutil.copy(src, dst)
-
-                # copying the entire directory is ok, because source files do not need to be renamed
-                user_code_dir = os.path.join(self.test_dir, 'JOBS', name, 'USER_CODE')
-                if os.path.isdir(self.test_case.user_code_dir):
-                    shutil.copytree(self.test_case.user_code_dir, user_code_dir, copy_function=shutil.copy)
-
-                if self.test_case.requires_binary_files:
-                    link_restart_files_failed, message = self._link_restart_files(build_name)
-                    logger.to_log(status_prefix)
-                    logger.to_log(message + ' ')
-                    logger.to_log('\n')
-
-                failed, message = self._execute(name, build_name)
-                logger.to_log(status_prefix)
-                logger.to_all(message + ' ')
-                logger.to_log('\n')
-
-                failed, message = self._check(build_name)
-                logger.to_log(status_prefix)
-                logger.to_log(message + ' ')
-
-                logger.to_all('\n')
-
-        if debug:
-            self.attempted_debug = attempted
-            self.failed_debug = failed
-        else:
-            self.attempted_non_debug = attempted
-            self.failed_non_debug = failed
-
-        return failed
-
-    def status(self):
-        return dict(
-            attempted=self.attempted_non_debug or self.attempted_debug,
-            failed=self.failed_non_debug and self.failed_debug,
-            debugged=self.attempted_debug,
-            non_debug_failed=self.failed_non_debug,
-        )
-
-
-class PALMBuild:
-    """The PALM build class deals with configuration and execution of all required PALM builds"""
-
-    def __init__(self, test_dir, build_name, verbose=False, dry_run=False):
-        self.test_dir = test_dir
-        self.build_name = build_name
-        self.verbose = verbose
-        self.dry_run = dry_run
-        self.configured = False
-        self.executed = False
-        self.available = False
-        self.requires_mpi = False
-        self.requires_netcdf = False
-        self.requires_fftw = False
-        self.requires_rrtmg = False
-        self.attempted_non_debug = False
-        self.attempted_debug = False
-        self.failed_non_debug = None
-        self.failed_debug = None
-
-    def configure(self):
-        try:
-            with open(os.path.join(Environment.trunk_tests_builds_dir, self.build_name, 'build_config.yml'), 'r') as f:
-                build_config = yaml.load(f)
-        except:
-            return True, colored('[build not found]', 'red')
-
-        if 'compiler' in build_config:
-            self.compiler = build_config['compiler']
-        else:
-            return True, colored('[missing \"compiler\" keyword]', 'red')
-
-        if not isinstance(self.compiler, dict):
-            return True, colored('[\"compiler\" keyword must be dict]', 'red')
-
-        if 'linker' in build_config:
-            self.linker = build_config['linker']
-        else:
-            return True, colored('[missing \"linker\" keyword]', 'red')
-
-        if not isinstance(self.linker, dict):
-            return True, colored('[\"linker\" keyword must be dict]', 'red')
-
-        if 'mpi_wrapper' in self.compiler:
-            if 'mpi_wrapper}}' in self.compiler['mpi_wrapper']:
-                self.requires_mpi = True
-        else:
-            return True, colored('[missing \"mpi_wrapper\" keyword]', 'red')
-
-        if 'includes' in self.compiler:
-            for include in self.compiler['includes']:
-                if 'include.netcdf}}' in include:
-                    self.requires_netcdf = True
-                if 'include.fftw}}' in include:
-                    self.requires_fftw = True
-                if 'include.rrtmg}}' in include:
-                    self.requires_rrtmg = True
-        else:
-            return True, colored('[missing \"includes\" keyword in compiler]', 'red')
-
-        if 'options' in self.linker:
-            for lib in self.linker['options']:
-                if 'lib.netcdf}}' in lib:
-                    self.requires_netcdf = True
-                if 'lib.fftw}}' in lib:
-                    self.requires_fftw = True
-                if 'lib.rrtmg}}' in lib:
-                    self.requires_rrtmg = True
-        else:
-            return True, colored('[missing \"options\" keyword in linker]', 'red')
-
-        library_names = []
-        if self.requires_netcdf:
-            library_names.append('netcdf')
-        if self.requires_fftw:
-            library_names.append('fftw')
-        if self.requires_rrtmg:
-            library_names.append('rrtmg')
-
-        if not 'executable' in self.compiler:
-            return True, colored('[missing \"executable\" keyword in compiler]', 'red')
-
-        if not 'definitions' in self.compiler:
-            return True, colored('[missing \"definitions\" keyword in compiler]', 'red')
-
-        if not 'options' in self.compiler:
-            return True, colored('[missing \"options\" keyword in compiler]', 'red')
-
-        if not 'default' in self.compiler['options']:
-            return True, colored('[missing \"default\" keyword in compiler.options]', 'red')
-
-        if not 'debug' in self.compiler['options']:
-            return True, colored('[missing \"debug\" keyword in compiler.options]', 'red')
-
-        try:
-            with open(os.path.join(Environment.workspace_dir, 'palmtest.yml'), 'r') as f:
-                palmtest_config = yaml.load(f)
-        except:
-            return True, colored('[palmtest.yml not found]', 'red')
-
-        if 'palm_config_template' in palmtest_config:
-            if isinstance(palmtest_config['palm_config_template'], str):
-                custom_template = palmtest_config['palm_config_template']
-        try:
-            with open(os.path.join(custom_template), 'r') as palm_config_template_file:
-                template = palm_config_template_file.read()
-        except:
-            try:
-                with open(os.path.join(Environment.scripts_dir, '.palm.config.default.in'), 'r') as palm_config_template_file:
-                    template = palm_config_template_file.read()
-            except:
-                return True, colored('[trunk/SCRIPTS/.palm.config.default.in not found]', 'red')
-
-        template = template.replace('@CMAKE_INSTALL_PREFIX@', self.test_dir)
-        template = template.replace('@PALM_HOSTNAME@', socket.gethostname())
-        template = template.replace('@CMAKE_USERNAME@', getpass.getuser())
-        template = template.replace('@MPI_Fortran_COMPILER@', self.compiler['mpi_wrapper'])
-        template = template.replace('@CMAKE_Fortran_COMPILER@', self.compiler['executable'])
-        cpp_options_str = ['-D' + s for s in self.compiler['definitions']]
-        template = template.replace('@PALM_CPP_OPTIONS_STR@', ' '.join(cpp_options_str))
-        template = template.replace('@PALM_CORES@', str(multiprocessing.cpu_count()))
-        template = template.replace('@PALM_COMPILER_OPTIONS@', '{{palmtest.compiler.options}} ' + ' '.join(self.compiler['includes']))
-        template = template.replace('@PALM_LINKER_OPTIONS@', ' '.join(self.linker['options']))
-
-        if 'environments' in palmtest_config:
-            available_environments = palmtest_config['environments']
-        else:
-            return True, colored('[missing \"environments\" keyword in palmtest.yml]', 'red')
-
-        if 'id' in self.compiler:
-            c_id = self.compiler['id']
-        else:
-            return True, colored('[missing \"id\" keyword in compiler]', 'red')
-
-        if c_id in available_environments:
-            self.available = True
-
-            environment = available_environments[c_id]
-
-            if 'mpi_execution_command' in environment:
-                template = template.replace('@PALM_EXECUTE_COMMAND@', environment['mpi_execution_command'])
-            else:
-                template = template.replace('@PALM_EXECUTE_COMMAND@', 'mpirun -n {{mpi_tasks}}')
-
-            if 'executable' not in environment:
-                return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"executable\"]', 'red')
-            value = environment['executable']
-            if isinstance(value, str):
-                template = template.replace('{{' + '.'.join([c_id, 'executable']) + '}}', value)
-            if self.requires_mpi:
-                if 'mpi_wrapper' not in environment:
-                    return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"mpi_wrapper\"]', 'red')
-                value = environment['mpi_wrapper']
-                if isinstance(value, str):
-                    template = template.replace('{{' + '.'.join([c_id, 'mpi_wrapper']) + '}}', value)
-            if 'include' not in environment:
-                return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"include\"]', 'red')
-            if 'lib' not in environment:
-                return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"lib\"]', 'red')
-            for lib in library_names:
-                if lib not in environment['include']:
-                    return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"include.'+lib+'\"]', 'red')
-                value = environment['include'][lib]
-                if isinstance(value, str):
-                    template = template.replace('{{' + '.'.join([c_id, 'include', lib]) + '}}', value)
-                if lib not in environment['lib']:
-                    return True, colored('[palmtest.yml environment \"' + c_id + '\" has no \"lib.'+lib+'\"]', 'red')
-                value = environment['lib'][lib]
-                if isinstance(value, str):
-                    template = template.replace('{{' + '.'.join([c_id, 'lib', lib]) + '}}', value)
-
-            with open(os.path.join(self.test_dir, '.palm.config.' + self.build_name), 'w') as palm_config_file:
-                palm_config_file.write(
-                    template.replace(
-                        '{{palmtest.compiler.options}}',
-                        ' '.join(self.compiler['options']['default']),
-                    )
-                )
-            with open(os.path.join(self.test_dir, '.palm.config.' + self.build_name + '_debug'), 'w') as palm_config_file:
-                palm_config_file.write(
-                    template.replace(
-                        '{{palmtest.compiler.options}}',
-                        ' '.join(self.compiler['options']['debug']),
-                    )
-                )
-            self.configured = True
-            return False, colored('[configuration ok]', 'green')
-
-        else:
-            return True, colored('[palmtest.yml environment \"' + c_id + '\" not found]', 'red')
-
-    def _execute(self, build_name):
-        self.attempted = True
-        build_failed = Executor.execute(
-            [
-                os.path.join(self.test_dir, 'trunk', 'SCRIPTS', 'palmbuild'),
-                '-c', '\"' + build_name + '\"',
-                '-v',
-            ],
-            cwd=self.test_dir,
-            verbose=self.verbose,
-            dry_run=self.dry_run,
-        )
-
-        if self.dry_run:
-            return False, colored('[build dry]', 'blue')
-        if build_failed:
-            return True, colored('[build failed]', 'red')
-        else:
-            return False, colored('[build ok]', 'green')
-
-    def build(self, debug=False):
-        if debug:
-            attempted = self.attempted_debug
-            build_name = self.build_name + '_debug'
-            failed = self.failed_debug
-        else:
-            attempted = self.attempted_non_debug
-            build_name = self.build_name
-            failed = self.failed_non_debug
-
-        if not attempted:
-            with Logger(self.test_dir, verbose=self.verbose) as logger:
-                status_prefix = LogFormatter.task_table_line_template.format('Building:', '', build_name, '')
-                logger.to_all(status_prefix)
-                logger.to_log('[started]' + '\n')
-                attempted = True
-
-                failed, message = self._execute(build_name)
-                logger.to_log(status_prefix)
-                logger.to_all(message + ' ')
-                logger.to_all('\n')
-
-        if debug:
-            self.attempted_debug = attempted
-            self.failed_debug = failed
-        else:
-            self.attempted_non_debug = attempted
-            self.failed_non_debug = failed
-
-        return failed
-
-    def report(self):
-        return dict(
-            failed_debug=self.failed_debug,
-            failed_non_debug=self.failed_non_debug,
-        )
-
-
-class PALMTestCase:
-    """The PALM test case class deals with the configuration and execution of all PALM test cases"""
-
-    def __init__(self,test_dir,  name, verbose=False, dry_run=False):
-        self.test_dir = test_dir
-        self.name = name
-        self.verbose = verbose
-        self.dry_run = dry_run
-        self.user_code_dir = os.path.join(Environment.trunk_tests_cases_dir, self.name, 'USER_CODE')
-        self.input_dir = os.path.join(Environment.trunk_tests_cases_dir, self.name, 'INPUT')
-        self.number_of_cores = []
-        self.build_names = []
-        self.input_file_names = []
-        self.configured = False
-
-    def configure(self, requested_build_names, requested_cores):
-        f_name = os.path.join(Environment.trunk_tests_cases_dir, self.name, 'case_config.yml')
-        try:
-            with open(f_name, 'r') as f:
-                config = yaml.load(f)
-        except:
-            return True, colored('[Case \"' + self.name + '\" could not be found.]', 'red')
-        try:
-            self.use_binary_files_from = config['use_binary_files_from']
-        except:
-            self.use_binary_files_from = None
-        self.requires_binary_files = bool(self.use_binary_files_from)
-
-        if 'allowed_builds' not in config:
-            return True, colored('[missing \"allowed_builds\" keyword]', 'red')
-        self.allowed_build_names = config['allowed_builds']
-
-        if 'allowed_number_of_cores' not in config:
-            return True, colored('[missing \"allowed_number_of_cores\" keyword]', 'red')
-        self.allowed_number_of_cores = config['allowed_number_of_cores']
-
-        if 'activation_strings' not in config:
-            return True, colored('[missing \"activation_strings\" keyword]', 'red')
-        self.activation_strings = config['activation_strings']
-
-        if 'significant_digits_for_netcdf_checks' not in config:
-            return True, colored('[missing \"significant_digits_for_netcdf_checks\" keyword]', 'red')
-        self.significant_digits = config['significant_digits_for_netcdf_checks']
-
-        if 'timeseries' not in config['significant_digits_for_netcdf_checks']:
-            return True, colored('[missing \"timeseries\" keyword in significant_digits_for_netcdf_checks]', 'red')
-
-        if 'profiles' not in config['significant_digits_for_netcdf_checks']:
-            return True, colored('[missing \"profiles\" keyword in significant_digits_for_netcdf_checks]', 'red')
-
-        if 'other' not in config['significant_digits_for_netcdf_checks']:
-            return True, colored('[missing \"other\" keyword in significant_digits_for_netcdf_checks]', 'red')
-
-        self.number_of_cores = sorted(set(requested_cores).intersection(self.allowed_number_of_cores))
-        self.build_names = sorted(set(requested_build_names).intersection(self.allowed_build_names))
-        self.input_file_names = [s for s in next(os.walk(self.input_dir))[2]]
-        self.configured = True
-        if len(self.number_of_cores) == 0 :
-            return True, colored('[no allowed cores requested]', 'blue')
-        if len(self.build_names) == 0:
-            return True, colored('[no allowed builds requested]', 'blue')
-        if len(self.input_file_names) == 0:
-            return True, colored('[no input files found]', 'red')
-        return False, colored('[configuration ok]', 'green')
-
-
-
-class PALMTest:
-
-    def __init__(self, args):
-        self.verbose = args.verbose
-        self.no_auto_debug = args.no_auto_debug
-        self.force_debug = args.force_debug
-        self.fail_on_debug = args.fail_on_debug
-        self.dry_run = args.dry_run
-        self.no_color = args.no_color
-        self.test_id = args.test_id
-        self.test_case_names = args.cases
-        self.requested_build_names = args.builds
-        self.requested_cores = args.cores
-        self.test_case_queue = []
-        self.build_database = dict()
-
-    def prepare(self):
-        if self.no_color:
-            disable_color()
-        self.test_dir = os.path.join(Environment.tests_dir, self.test_id)
-        try:
-            os.makedirs(self.test_dir, exist_ok=False)
-        except:
-            print('ERROR: Found existing test directory: ' + self.test_dir)
-            exit(1)
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_all(LogFormatter.hline)
-            logger.to_all('This is the PALM tester  (version: ' + version + ')' + '\n')
-            logger.to_all(LogFormatter.hline)
-            try:
-                with open(os.path.join(Environment.workspace_dir, 'palmtest.yml'), 'r') as f:
-                    pass
-            except:
-                logger.to_all('ERROR: No palmtest.yml file was found in your working directory!\n')
-                logger.to_all('INFO:  A template for this file can be found at: trunk/TESTS/palmtest.yml\n')
-                logger.to_all('       Please copy the template to your working directory and adjust it to your system!\n')
-                exit(1)
-
-            self.execution_trunk_dir = os.path.join(self.test_dir, 'trunk')
-            os.symlink(Environment.trunk_dir, self.execution_trunk_dir)
-            self.execution_jobs_dir = os.path.join(self.test_dir, 'JOBS')
-            os.makedirs(self.execution_jobs_dir, exist_ok=False)
-
-            try:
-                with open(os.path.join(Environment.scripts_dir, '.palm.iofiles'), 'r') as iofiles_template_file:
-                    iofiles_template = iofiles_template_file.read()
-                with open(os.path.join(self.test_dir, '.palm.iofiles'), 'w') as iofiles_file:
-                    iofiles_file.write(iofiles_template.replace('$fast_io_catalog', '$base_data').replace('$restart_data_path', '$base_data').replace('$output_data_path', '$base_data'))
-            except:
-                logger.to_all('ERROR: No .palm.iofiles file was found in trunk/SCRIPTS/')
-                exit(1)
-
-            available_cores = multiprocessing.cpu_count()
-            final_cores_list = list(filter(lambda x: x <= available_cores, self.requested_cores))
-
-            logger.to_all(LogFormatter.config_table_line_template.format('Object:', 'Name:', 'Action:') + 'Status:\n')
-            logger.to_all(LogFormatter.hline)
-
-            if 'all' in self.requested_build_names:
-                self.requested_build_names = [name for name in next(os.walk(Environment.trunk_tests_builds_dir))[1] if not name[0] == '.']
-            found_build_names = []
-            for build_name in self.requested_build_names:
-                build = PALMBuild(self.test_dir, build_name, verbose=self.verbose, dry_run=self.dry_run)
-                configuration_failed, message = build.configure()
-                if not configuration_failed:
-                    self.build_database[build_name] = build
-                    found_build_names.append(build_name)
-                    logger.to_all(LogFormatter.config_table_line_template.format('Build', build_name, 'approved'))
-                    logger.to_all(message + '\n')
-                else:
-                    logger.to_all(LogFormatter.config_table_line_template.format('Build', build_name, 'rejected'))
-                    logger.to_all(message + '\n')
-            final_build_list = found_build_names
-
-            if 'all' in self.test_case_names:
-                self.test_case_names = sorted([name for name in next(os.walk(Environment.trunk_tests_cases_dir))[1] if not name[0] == '.'])
-
-            additional_initial_runs_2 = [self.test_case_names]
-            while len(additional_initial_runs_2[-1]) > 0:
-                additional_initial_runs_1 = []
-                for test_case_name in additional_initial_runs_2[-1]:
-                    test_case = PALMTestCase(self.test_dir, test_case_name, verbose=self.verbose)
-                    test_case_configuration_failed, message = test_case.configure(final_build_list, final_cores_list)
-                    if not test_case_configuration_failed:
-                        if test_case.requires_binary_files:
-                            additional_initial_runs_1.append(test_case.use_binary_files_from)
-                additional_initial_runs_2.append(sorted(set(additional_initial_runs_1)))
-
-            test_case_order = []
-            for i in range(len(additional_initial_runs_2)-1):
-                # low and high refer to priority
-                low = additional_initial_runs_2[i]
-                high = additional_initial_runs_2[i+1]
-                for item in high:
-                    while item in low:
-                        low.remove(item)
-                test_case_order.append(low)
-
-            test_case_order_no_dublicates = []
-            for test_cases in test_case_order:
-                seen = set()
-                seen_add = seen.add
-                test_case_order_no_dublicates.append( [x for x in test_cases if not (x in seen or seen_add(x))] )
-
-            approved_test_case_order = [[]] + list(reversed(test_case_order_no_dublicates))
-            for i, test_cases in enumerate(list(approved_test_case_order)):
-                info = 'Case (dep)' if i < len(approved_test_case_order)-1 else 'Case'
-                for test_case_name in list(test_cases):
-                    sys.stdout.flush()
-                    test_case = PALMTestCase(self.test_dir, test_case_name, verbose=self.verbose)
-                    test_case_configuration_failed, message = test_case.configure(final_build_list, final_cores_list)
-                    if test_case_configuration_failed:
-                        # removing as configuration failed should only apply to added dependencies
-                        approved_test_case_order[i].remove(test_case_name)
-                        logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'rejected'))
-                        logger.to_all(message + '\n')
-                    elif test_case.requires_binary_files:
-                        if test_case.use_binary_files_from not in approved_test_case_order[i-1]:
-                            # removing as dependency is already removed
-                            approved_test_case_order[i].remove(test_case_name)
-                            logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'disabled'))
-                            logger.to_all(colored('[requires dependency \"' + test_case.use_binary_files_from + '\"]', 'red') + '\n')
-                        else:
-                            logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'approved'))
-                            logger.to_all(message + '\n')
-                    else:
-                        logger.to_all(LogFormatter.config_table_line_template.format(info, test_case_name, 'approved'))
-                        logger.to_all(message + '\n')
-
-            final_case_list = []
-            for cases in approved_test_case_order:
-                for case in cases:
-                    if case not in final_case_list:
-                        final_case_list.append(case)
-
-            for build_name in final_build_list:
-                build = PALMBuild(
-                    self.test_dir,
-                    build_name,
-                    verbose=self.verbose,
-                    dry_run=self.dry_run,
-                )
-                configuration_failed, message = build.configure()
-                if not configuration_failed:
-                    self.build_database[build_name] = build
-                else:
-                    logger.to_all(message + '\n')
-
-            for case_name in final_case_list:
-                test_case = PALMTestCase(
-                    self.test_dir,
-                    case_name,
-                    verbose=self.verbose,
-                    dry_run=self.dry_run,
-                )
-                test_case_configuration_failed, message = test_case.configure(final_build_list, final_cores_list)
-                if not test_case_configuration_failed:
-                    self.test_case_queue.append(test_case)
-            logger.to_all(LogFormatter.hline)
-
-            logger.to_all(LogFormatter.intro_table_line_template.format('Test ID:') +
-                          self.test_id + '\n')
-            logger.to_all(LogFormatter.intro_table_line_template.format('Builds:') +
-                          str('\n' + LogFormatter.intro_table_line_template.format('')).join(sorted(self.build_database.keys())) + '\n')
-            logger.to_all(LogFormatter.intro_table_line_template.format('Cases:') +
-                          str('\n' + LogFormatter.intro_table_line_template.format('')).join([c.name for c in self.test_case_queue]) + '\n')
-            logger.to_all(LogFormatter.intro_table_line_template.format('Cores:') +
-                          ' '.join([str(i) for i in final_cores_list]) + '\n')
-
-    def _execute(self, test_case, build_name, cores):
-        job = PALMJob(
-            self.test_dir,
-            test_case,
-            build_name,
-            cores,
-            verbose=self.verbose,
-            dry_run=self.dry_run
-        )
-        if self.force_debug:
-            build_failed_non_debug = True
-            job_failed_non_debug = True
-            build_failed_debug = self.build_database[build_name].build(debug=True)
-            if build_failed_debug:
-                job_failed_debug = True
-            else:
-                job_failed_debug = job.execute(debug=True)
-        elif self.no_auto_debug:
-            build_failed_non_debug = self.build_database[build_name].build(debug=False)
-            if build_failed_non_debug:
-                job_failed_non_debug = True
-            else:
-                job_failed_non_debug = job.execute(debug=False)
-            build_failed_debug = None
-            job_failed_debug = None
-        else:
-            build_failed_non_debug = self.build_database[build_name].build(debug=False)
-            if build_failed_non_debug:
-                job_failed_non_debug = True
-                build_failed_debug = self.build_database[build_name].build(debug=True)
-                if build_failed_debug:
-                    job_failed_debug = False
-                else:
-                    job_failed_debug = job.execute(debug=True)
-            else:
-                job_failed_non_debug = job.execute(debug=False)
-                if job_failed_non_debug:
-                    build_failed_debug = self.build_database[build_name].build(debug=True)
-                    if build_failed_debug:
-                        job_failed_debug = True
-                    else:
-                        job_failed_debug = job.execute(debug=True)
-                else:
-                    build_failed_debug = None
-                    job_failed_debug = None
-        return dict(
-            build_failed_non_debug=build_failed_non_debug,
-            job_failed_non_debug=job_failed_non_debug,
-            build_failed_debug=build_failed_debug,
-            job_failed_debug=job_failed_debug,
-        )
-
-    def execute(self):
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_all(LogFormatter.hline)
-            logger.to_all(LogFormatter.task_table_line_template.format('Task:', 'Case:', 'Build:', 'Cores:') + 'Status:\n')
-            logger.to_all(LogFormatter.hline)
-            self.test_report = dict()
-            for test_case in self.test_case_queue:
-                logger.to_log(LogFormatter.hline)
-                logger.to_file(LogFormatter.hline)
-                logger.to_file(LogFormatter.hline)
-                status_dict = dict()
-                for build_name in test_case.build_names:
-                    status_dict[build_name] = dict()
-                    for cores in test_case.number_of_cores:
-                        status_dict[build_name][cores] = self._execute(test_case, build_name, cores)
-                self.test_report[test_case.name] = status_dict
-                logger.to_log(LogFormatter.hline)
-                logger.to_file('\n' * 10)
-
-    def report(self):
-        with Logger(self.test_dir, verbose=self.verbose) as logger:
-            logger.to_all(LogFormatter.hline)
-            r = '{:10}' + '    total: ' + '{:<3d}' + \
-                             '    ok: ' + colored('{:<3d}', 'green') + \
-                       '    debugged: ' + colored('{:<3d}', 'yellow') + \
-                         '    failed: ' + colored('{:<3d}', 'red')
-            n_all = 0
-            n_ok = 0
-            n_debugged = 0
-            n_failed = 0
-            for build_name, build in self.build_database.items():
-                status = build.report()
-                b = status['failed_non_debug']
-                bd = status['failed_debug']
-                n_all += 1
-                if not b and b is not None:
-                    n_ok += 1
-                if bd is not None:
-                    n_debugged += 1
-                if b and (bd or bd is None):
-                    n_failed += 1
-            logger.to_all(r.format('Builds:', n_all, n_ok, n_debugged, n_failed) + '\n')
-            total_failed = n_failed
-            total_debugged = n_debugged
-            n_all = 0
-            n_ok = 0
-            n_debugged = 0
-            n_failed = 0
-            # {'case_name': {'build_name': {4: {'build_failed_debug': None,
-            #                                   'build_failed_non_debug': False,
-            #                                   'job_failed_debug': None,
-            #                                   'job_failed_non_debug': False}}},
-            for case_name, case in self.test_report.items():
-                for build_name, build in case.items():
-                    for cores, results in build.items():
-                        n_all += 1
-                        b = results['build_failed_non_debug']
-                        bd = results['build_failed_debug']
-                        j = results['job_failed_non_debug']
-                        jd = results['job_failed_debug']
-                        if not j:
-                            n_ok += 1
-                        if jd is not None:
-                            n_debugged += 1
-                        if j and (jd or jd is None):
-                            n_failed += 1
-            logger.to_all(r.format('Tests:', n_all, n_ok, n_debugged, n_failed) + '\n')
-            total_failed += n_failed
-            total_debugged += n_debugged
-        if self.fail_on_debug:
-            return (total_failed + total_debugged) > 0
-        else:
-            return total_failed > 0
-
-
-class CustomCompleter:
-
-    def __init__(self):
-        pass
-
-    def __call__(self, prefix, parsed_args, **kwargs):
-        return (i for i in self.get_items() if i.startswith(prefix))
-
-    def get_items(self):
-        return []
-
-
-class CaseCompleter(CustomCompleter):
-
-    def get_items(self):
-        case_names = [name for name in next(os.walk(Environment.trunk_tests_cases_dir))[1] if not name[0] == '.']
-        return case_names + ['all']
-
-
-class BuildCompleter(CustomCompleter):
-
-    def get_items(self):
-        build_names = [name for name in next(os.walk(Environment.trunk_tests_builds_dir))[1] if not name[0] == '.']
-        return build_names + ['all']
-
-
-class PALMTestArgumentParser(ArgumentParser):
-
-    def __init__(self):
-        super().__init__(
-            description='This is the PALM tester\n' +
-                        'Developer Support: knoop@muk.uni-hannover.de',
-            formatter_class=RawTextHelpFormatter,
-            add_help=True,
-        )
-        self.add_argument(
-            '--version',
-            action='version',
-            version=version,
-        )
-        self.add_argument(
-            '--verbose',
-            action='store_true',
-            dest='verbose',
-            help='Increase verbosity of terminal output.',
-            required=False,
-        )
-        self.add_argument(
-            '--no-auto-debug',
-            action='store_true',
-            dest='no_auto_debug',
-            help='Disable automatic debugging in case of test failure.',
-            required=False,
-        )
-        self.add_argument(
-            '--force-debug',
-            action='store_true',
-            dest='force_debug',
-            help='Force debugging regardless of test failure (ignores --no-auto-debug).',
-            required=False,
-        )
-        self.add_argument(
-            '--fail-on-debug',
-            action='store_true',
-            dest='fail_on_debug',
-            help='Return a non-zero exit status in case debugging was required.',
-            required=False,
-        )
-        self.add_argument(
-            '--dry-run',
-            action='store_true',
-            dest='dry_run',
-            help='Prepare and process all requested tests without actually building or executing PALM.',
-            required=False,
-        )
-        self.add_argument(
-            '--no-color',
-            action='store_true',
-            dest='no_color',
-            help='Disable colored terminal output.',
-            required=False,
-        )
-        self.add_argument(
-            '--cases',
-            action='store',
-            dest='cases',
-            default=['all'],
-            help='A list of test cases to be executed. (default: %(default)s)',
-            nargs='+',
-            required=False,
-            type=str,
-            metavar='STR',
-        ).completer = CaseCompleter()
-        self.add_argument(
-            '--builds',
-            action='store',
-            dest='builds',
-            default=['all'],
-            help='A list of builds to be executed. (default: %(default)s)',
-            nargs='+',
-            required=False,
-            type=str,
-            metavar='STR',
-        ).completer = BuildCompleter()
-        self.add_argument(
-            '--cores',
-            action='store',
-            dest='cores',
-            default=[i for i in range(1, multiprocessing.cpu_count()+1)],
-            choices=[i for i in range(1, multiprocessing.cpu_count()+1)],
-            help='The number of cores tests are supposed to be executed on. (default: %(default)s)',
-            nargs='+',
-            required=False,
-            type=int,
-            metavar='INT',
-        )
-        self.add_argument(
-            '--test-id',
-            action='store',
-            dest='test_id',
-            default=datetime.now().strftime('%Y-%m-%d_%H:%M:%S.%f'),
-            help='An individual test id. (default: current timestamp)',
-            required=False,
-            type=str,
-            metavar='STR',
-        )
-
-
-if __name__ == '__main__':
-    parser = PALMTestArgumentParser()
-    if has_argcomplete:
-        argcomplete.autocomplete(parser)
-    args = parser.parse_args()
-    palm_test = PALMTest(args)
-    palm_test.prepare()
-    palm_test.execute()
-    failed = palm_test.report()
-    exit(1 if failed else 0)
Index: palm/trunk/SCRIPTS/postprocess_vm_measurements.py
===================================================================
--- palm/trunk/SCRIPTS/postprocess_vm_measurements.py	(revision 4901)
+++ 	(revision )
@@ -1,288 +1,0 @@
-#!/usr/bin/env python3
-# --------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-# --------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-#
-#
-# Former revisions:
-# -----------------
-# $Id: postprocess_vm_measurements.py 4853 2021-01-15 15:22:11Z suehring #
-# extensive re-work of postprocess_vm_measurements.py:
-#    - bugfix: convert atmosphere and soil time to record dimension
-#    - bugfix: make overwrite optional
-#    - reduce complexity
-#    - remove unnecessary parts
-#    - variable renaming
-#    - code restructuring to follow coding standard
-#
-# 4853 2021-01-15 15:22:11Z suehring
-# Initial revision
-#
-# --------------------------------------------------------------------------------#
-# Description:
-# ------------
-"""Merge virtual measurement output.
-
-Removes empty time stamps from the netCDF files and concatenates files
-from several restart files into one file.
-
-Example:
-module load nco anaconda3
-python3 postprocess_vm_measurements.py my_palm_simulation/OUTPUT
-"""
-#
-# @Authors Matthias SÃŒhring (suehring@muk.uni-hannover.de)
-#          Tobias Gronemeier (gronemeier@muk.uni-hannover.de)
-# --------------------------------------------------------------------------------#
-
-
-import argparse
-import subprocess
-import os
-import sys
-try:
-    import numpy as np
-except ImportError:
-    sys.exit(
-        'package "numpy" is required but not installed! Run\n'
-        + 'python -m pip install --user numpy\nto install it.')
-try:
-    from netCDF4 import Dataset
-except ImportError:
-    sys.exit(
-        'package "netCDF4" is required but not installed! Run\n'
-        + 'python -m pip install --user netCDF4\nto install it.')
-
-
-def concatenate(files_per_site, sites, output_directory, overwrite_file=False):
-    """Concatenate netCDF files via ncrcat.
-
-    Concatenate a list of netCDF files using NCO command 'ncrcat'.
-    Return value: output file
-    """
-
-    if not os.path.isdir(output_directory):
-        mkdir = os.mkdir(output_directory)
-
-    if output_directory[-1] != '/':
-        output_directory += '/'
-
-    for site_index, file_list in enumerate(files_per_site):
-
-        ncrcat_command = "ncrcat"
-
-        if overwrite_file:
-            ncrcat_command += " -O"
-
-        for file_name in file_list:
-            ncrcat_command += " " + file_name
-
-        # Check if output file already exists
-        output_file = output_directory + sites[site_index]
-        if not overwrite_file and os.path.isfile(output_file):
-            for i in range(1000):
-                output_file = output_directory + sites[site_index] + "_{:03d}".format(i)
-                if not os.path.isfile(output_file):
-                    break
-                elif i == 999:
-                    raise IOError("could not guarantee non overwriting output file: {}".format(
-                            output_file))
-        ncrcat_command += " " + output_file
-
-        print(ncrcat_command)
-        ncrcat_output = subprocess.run(ncrcat_command, shell=True, check=True)
-
-    return output_file
-
-
-def truncate(input_file, time_index_shift=0, overwrite_file=False):
-    """Truncate netCDF files via ncrcat.
-
-    Truncate all time dimensions of the input file and convert them to
-    record dimensions. The output is saved to 'input_file.trunc' or to
-    'input_file.trunc.nc' if the input_file has a '.nc' extension.
-    If "overwrite_file" is true, write output directly to input_file.
-    Shift the time index variables by time_index_shift.
-
-    Return values:
-        highest time index of time dimension in output file
-        output-file name
-    """
-
-    # Gather information about time coordinate in file
-    ncfile = Dataset(input_file, "r")
-    time_dim = ncfile.dimensions["ntime"]
-    time_var = ncfile.variables["time"][:, :]
-    time_mask = ~np.ma.getmaskarray(time_var)
-    start_index = 0
-
-    soil = any([var == "time_soil" for var in ncfile.variables.keys()])
-
-    if np.any(time_mask is False):
-        end_ind = np.where(time_mask is False)
-        end_index = end_ind[0][0] - 1
-        cut = True
-    elif np.any(time_var == 0):
-        end_ind = np.where(time_var == 0)
-        end_index = end_ind[0][0] - 1
-        cut = True
-    else:
-        end_index = len(time_var[:][0])
-        cut = False
-
-    for att in ncfile.ncattrs():
-        if (att == "site"):
-            site = ncfile.getncattr(att)
-        if (att == "featureType"):
-            feat = ncfile.getncattr(att)
-
-    # if feat == "timeSeries":
-    #     site = site + "_ts"
-    # if feat == "timeSeriesProfile":
-    #     site = site + "_tspr"
-    # if feat == "trajectory":
-    #     site = site + "_traj"
-    # print(cut)
-
-    # Compose nco commands
-    ncks_command = "ncks"
-
-    if overwrite_file:
-        ncks_command += " -O"
-        output_file = input_file
-    else:
-        # Add '.trunc' to file name before '.nc' file extension
-        output_file, file_extension = os.path.splitext(input_file)
-        if file_extension != '.nc':
-            output_file += file_extension + '.trunc'
-        else:
-            output_file += '.trunc' + file_extension
-        if os.path.isfile(output_file):
-            raise IOError("truncated file already exists: {}".format(output_file))
-
-    if cut:
-        # set dimension limits
-        ncks_command += " -d ntime,{0},{1}".format(start_index, end_index)
-        if soil:
-            ncks_command += " -d ntime_soil,{0},{1}".format(start_index, end_index)
-
-    # convert time into record dimension
-    time_is_limited = not time_dim.isunlimited()
-    if time_is_limited:
-        ncks_command += " --mk_rec_dmn"
-        ncks_command += " ntime"
-
-    if cut or time_is_limited:
-        # set input and output file
-        ncks_command += " {0} {1}".format(input_file, output_file)
-
-        # execute ncks
-        print(ncks_command)
-        ncks_output = subprocess.run(ncks_command, shell=True, check=True, stdout=subprocess.PIPE)
-
-        new_input_file = output_file
-
-    else:
-        new_input_file = input_file
-
-    # If soil is present, also convert soil time to record dimension
-    # (must be done separately due to NCO limitations)
-    if soil:
-        soil_time_is_limited = not ncfile.dimensions["ntime_soil"].isunlimited()
-        if soil_time_is_limited:
-
-            ncks_command = "ncks -O --mk_rec_dmn ntime_soil {0} {1}".format(
-                    new_input_file, output_file)
-            print(ncks_command)
-            ncks_output = subprocess.run(
-                    ncks_command, shell=True, check=True, stdout=subprocess.PIPE)
-
-            new_input_file = output_file
-
-    # Add time shift to ntime variables
-    if time_index_shift != 0:
-        ncap2_command = "ncap2 -O -s 'ntime=ntime+{}' ".format(time_index_shift)
-        if soil:
-            ncap2_command += " -s 'ntime_soil=ntime_soil+{}' ".format(time_index_shift)
-
-        ncap2_command += " {0} {1}".format(new_input_file, output_file)
-
-        print(ncap2_command)
-        ncap2_output = subprocess.run(ncap2_command, shell=True, check=True)
-
-        end_index += time_index_shift
-        new_input_file = output_file
-
-    return output_file, end_index
-
-
-def main(base_input_directory, output_directory, overwrite_file=False):
-
-    if base_input_directory[-1] != '/':
-        base_input_directory += '/'
-
-    if output_directory[-1] != '/':
-        output_directory += '/'
-
-    # Get directory list
-    input_directory_list = [
-            base_input_directory + directory + '/' for directory in
-            sorted(os.listdir(base_input_directory))]
-
-    # Obtain list of sites that need to be processed
-    sites = sorted(os.listdir(input_directory_list[0]))
-
-    files_per_site_and_directory = [[None] * len(input_directory_list) for i in range(len(sites))]
-
-    # Truncate each file and save end index of time dimension
-    for site_index, site_name in enumerate(sites):
-
-        start_index = 0
-        for dir_index, directory in enumerate(input_directory_list):
-            files_per_site_and_directory[site_index][dir_index], end_index = \
-                    truncate(directory + site_name, start_index, overwrite_file)
-            start_index = end_index
-
-    # Concatenate all files
-    file_concatenated = concatenate(
-            files_per_site_and_directory, sites, output_directory, overwrite_file)
-
-
-if __name__ == '__main__':
-    parser = argparse.ArgumentParser(
-            description='Merge virtual measurement output from multiple PALM run cycles',
-            formatter_class=argparse.ArgumentDefaultsHelpFormatter)
-    parser.add_argument(
-            'input',
-            metavar='IN',
-            help='PALM output directory containing virtual measurements')
-    parser.add_argument(
-            '--out',
-            '-o',
-            metavar='OUT',
-            default='./merge',
-            help='Output directory to store merged data')
-    parser.add_argument(
-            '--overwrite',
-            action='store_true',
-            help='Overwrite input files with output files')
-
-    args = parser.parse_args()
-
-    main(args.input, output_directory=args.out, overwrite_file=args.overwrite)
Index: palm/trunk/SCRIPTS/process_dvr_output
===================================================================
--- palm/trunk/SCRIPTS/process_dvr_output	(revision 4901)
+++ 	(revision )
@@ -1,463 +1,0 @@
-#!/bin/ksh
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Corrected "Former revisions" section
-#
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 1310 2014-03-14 08:01:56Z raasch
-# update GPL copyright
-#
-# 1046 2012-11-09 14:38:45Z maronga
-# code put under GPL (PALM 3.9)
-#
-# process_dvr_output - a script processing dvr steering + data files
-
-     # This script determines the number of streams opened by the dvr software
-     # and creates one single dvrs- and html-file which allow the dvr-plugin
-     # to display all streams in one sequence.
-
-     # Last changes:
-     # 16/03/09 - Siggi - Generating the first version
-
-
-
-    # Variable declarations + default values
- camera=false
- create_config_file=false
- create_sequence_output=false
- data_catalog=`pwd`
- dvrp_output=rtsp
- file_identifier=all_streams
- groundplate=false
- palm_run_identifier="unknown_run"
- topography=false
-
- typeset  -i  a acceleration=1 k i j nstream nscenes
-
-
-    # Read shellscript options
- while  getopts  :a:cd:f:ls option
- do
-   case  $option  in
-       (a)   acceleration=$OPTARG;;
-       (c)   create_config_file=true;;
-       (d)   data_catalog=$OPTARG;;
-       (f)   file_identifier=$OPTARG;;
-       (l)   dvrp_output=local;;
-       (s)   create_sequence_output=true;;
-       (\?)  printf "\n  +++ unknown option $OPTARG \n"
-             printf "\n      allowed option are -d, -f, -l, -s \n"
-             exit;;
-   esac
- done
-
-
-    # Create the config file for the streaming server; do nothing else
- if [[ $create_config_file = true ]]
- then
-    cp  ${PALM_BIN}/.dvrserver.config  .
-
-       # Entering the BASEDIR, UID and GID into this file
-    user_id=`id -u`
-    group_id=`id -g`
-
-       # data directory is always the current working directory
-    sed "s/<replace by dvr data directory>/./g" .dvrserver.config > .dvrserver.1
-    sed "s/<replace by user id>/$user_id/g"    .dvrserver.1 > .dvrserver.2
-    sed "s/<replace by group id>/$group_id/g"  .dvrserver.2 > .dvrserver.3
-    mv  .dvrserver.3  .dvrserver.config
-    rm  .dvrserver.1  .dvrserver.2
-    exit
- fi
-
-
-    # Find out the PALM run identifier
- if [[ -f CPU_MEASURES ]]
- then
-    palm_run_identifier=`head -1  CPU_MEASURES`
- fi
-
-
-    # Process the streaming server output
- if [[ $dvrp_output = rtsp ]]
- then
-
-       # Change to the given directory
-    cd $data_catalog
-
-
-       # Find out the number of streams
-    (( i = 0 ))
-    while true
-    do
-       (( i = i + 1 ))
-       if (( i < 10 ))
-       then
-          cstream=0$i
-       else
-          cstream=$i
-       fi
-
-       if [[ $(ls -1 *.* | grep -c $cstream) = 0 ]]
-       then
-          (( i = i - 1 ))
-          break
-       fi
-
-          # find out the stream name
-       streamname[$i]=`ls -1 ${cstream}_*-ge.dvrs | cut -f1 -d"-"`
-
-          # get addres
-       adr[$i]=`grep ADR= ${streamname[$i]}.dvrs | grep '*' | cut -f2 -d"="`
-
-          # get maxbytes
-       maxbytes[$i]=`head -1 ${streamname[$i]}.max`
-
-          # get number of frames
-       frames[$i]=`tail -1 ${streamname[$i]}.max`
-
-    done
-
-    nstream=$i
-    nscenes=$nstream
-
-
-       # Check, if there are files containing the camera data, the ground plate
-       # and topography data.
-       # Check the first stream only, because all streams have the same files.
-    if [[ -f ${streamname[1]}_camera.max ]]
-    then
-       camera=true
-       adr_camera=`grep ADR= ${streamname[1]}.dvrs | grep 'camera' | cut -f2 -d"="`
-       maxbytes_camera=`head -1 ${streamname[1]}_camera.max`
-       (( nscenes = nscenes + 1 ))
-    fi
-    if [[ -f ${streamname[1]}_groundplate.max ]]
-    then
-       groundplate=true
-       adr_groundplate=`echo $adr_camera | sed "s/camera/groundplate/g"`
-       maxbytes_groundplate=`head -1 ${streamname[1]}_groundplate.max`
-       (( nscenes = nscenes + 1 ))
-    fi
-    if [[ -f ${streamname[1]}_topography.max ]]
-    then
-       topography=true
-       adr_topography=`echo $adr_camera | sed "s/camera/topography/g"`
-       maxbytes_topography=`head -1 ${streamname[1]}_topography.max`
-       (( nscenes = nscenes + 1 ))
-    fi
-
-
-
-       # Start with writing the dvrs file for the combined streams
-    dvr_file=${file_identifier}_streaming.dvrs
-
-    echo  "SCENES=$nscenes"  >  $dvr_file
-
-       # First, add the static scenes
-    if [[ $camera = true ]]
-    then
-       echo  "MED=TCP"                    >>  $dvr_file
-       echo  "ADR=$adr_camera"            >>  $dvr_file
-       echo  "MAXBYTES=$maxbytes_camera"  >>  $dvr_file
-       echo  "FRAMES=1"                   >>  $dvr_file
-       echo  "FRAMES_P_SEC=0"             >>  $dvr_file
-       echo  "SCENEEND"                   >>  $dvr_file
-    fi
-
-    if [[ $groundplate = true ]]
-    then
-       echo  "MED=TCP"                         >>  $dvr_file
-       echo  "ADR=$adr_groundplate"            >>  $dvr_file
-       echo  "MAXBYTES=$maxbytes_groundplate"  >>  $dvr_file
-       echo  "FRAMES=1"                        >>  $dvr_file
-       echo  "FRAMES_P_SEC=0"                  >>  $dvr_file
-       echo  "SCENEEND"                        >>  $dvr_file
-    fi
-
-    if [[ $topography = true ]]
-    then
-       echo  "MED=TCP"                        >>  $dvr_file
-       echo  "ADR=$adr_topography"            >>  $dvr_file
-       echo  "MAXBYTES=$maxbytes_topography"  >>  $dvr_file
-       echo  "FRAMES=1"                       >>  $dvr_file
-       echo  "FRAMES_P_SEC=0"                 >>  $dvr_file
-       echo  "SCENEEND"                       >>  $dvr_file
-    fi
-
-
-       # Now add the streams
-    (( i = 0 ))
-    while (( i < nstream ))
-    do
-
-       (( i = i + 1 ))
-
-       echo  "MED=TCP"                   >>  $dvr_file
-       echo  "ADR=${adr[$i]}"            >>  $dvr_file
-       echo  "MAXBYTES=${maxbytes[$i]}"  >>  $dvr_file
-       echo  "FRAMES=${frames[$i]}"      >>  $dvr_file
-       echo  "FRAMES_P_SEC=25"           >>  $dvr_file
-       echo  "SCENEEND"                  >>  $dvr_file
-
-    done
-
-
-       # Change path to the current file identifier
-       # Remove path because BASEDIR of streaming server is set to "."
-#    sed  "s/DATA_DVR/${file_identifier}_dvr/g"  $dvr_file > tmp_file
-    sed  "s/DATA_DVR\///g"  $dvr_file > tmp_file
-    mv  tmp_file  $dvr_file
-
-
-       # If there is a dvr configuration file, set the BASEDIR to the parent
-       # directory of the above given path (i.e. ".")
-    if [[ -f .dvrserver.config ]]
-    then
-       old_path=`grep  BASEDIR  .dvrserver.config`
-       sed  "s&${old_path}&BASEDIR=.&g"  .dvrserver.config  >  .dvrserver.config.new
-       mv  .dvrserver.config.new  .dvrserver.config
-    fi
-
-
-       # Create the html file for the combined streames
-    cp  01_*-ge.html  tmp.html
-    replace=$(echo `grep src= tmp.html`)
-    sed "s&${replace}&src=\"${file_identifier}_streaming.dvrs\"&g" tmp.html > tmp1.html
-    if [[ "$palm_run_identifier" = "" ]]
-    then
-       cp  tmp1.html  ${file_identifier}_streaming.html
-    else
-       sed "s&DATA_DVR/${streamname[1]}/\*\*\*\*\*.dvr (DVR 3D Streaming)&DVR 3D streaming generated by $palm_run_identifier&g"  tmp1.html  >  ${file_identifier}_streaming.html
-    fi
-    rm  tmp.html  tmp1.html
-
-
-       # Informative messages
-    printf "\n\n  *** processing dvr stream output:"
-    printf "\n      number of detected streams = $nstream"
-    printf "\n      stream names:"
-
-    (( i = 0 ))
-    while (( i < nstream ))
-    do
-
-       (( i = i + 1 ))
-       printf " ${streamname[$i]}"
-
-    done
-    printf "\n"
-
-
- else
-
-       # This is the branch for local output (dvrp_output=local).
-       # Find out the number of streams.
-    (( i = 0 ))
-    while true
-    do
-
-       (( i = i + 1 ))
-       if (( i < 10 ))
-       then
-          cstream=0$i
-       else
-          cstream=$i
-       fi
-
-       if [[ $(ls -1 *.* | grep -c ${cstream}_) = 0 ]]
-       then
-          (( i = i - 1 ))
-          break
-       fi
-
-          # find out the stream name
-       streamname[$i]=`ls -1 ${cstream}_*.camera.dvr | cut -f1 -d"."`
-
-    done
-
-       # Exit, if there are no streams.
-    [[ $i = 0 ]]  &&  exit
-
-    nstream=$i
-
-    mkdir -p  ${data_catalog}/sequence_data
-
-
-       # First, merge static scenes into one file
-    if [[ -f ${streamname[1]}.camera.dvr ]]
-    then
-       cat  ${streamname[1]}.camera.dvr  >>  ${data_catalog}/sequence_data/static_scenes.dvr
-    fi
-
-    if [[ -f ${streamname[1]}.groundplate.dvr ]]
-    then
-       cat  ${streamname[1]}.groundplate.dvr  >>  ${data_catalog}/sequence_data/static_scenes.dvr
-    fi
-
-    if [[ -f ${streamname[1]}.topography.dvr ]]
-    then
-       cat  ${streamname[1]}.topography.dvr  >>  ${data_catalog}/sequence_data/static_scenes.dvr
-    fi
-
-
-       # Find out the number of frames
-    frames[1]=`grep sequence ${streamname[1]}_00000.html | cut -f2 -d";" | cut -f1 -d'"' | cut -f2 -d"-"`
-
-
-       # Now, merge the data, frame by frame
-    (( j = 0 ))
-    while (( j < ${frames[1]} ))
-    do
-
-       nframe=`printf "%05d" $j`
-
-       (( i = 0 ))
-       while (( i < nstream ))
-       do
-          (( i = i + 1 ))
-          cat  ${streamname[$i]}_$nframe.dvr  >>  ${data_catalog}/sequence_data/$nframe.dvr
-       done
-
-       (( j = j + 1 ))
-
-    done
-
-
-       # Create the html file to be used for the sequence mode
-    cp  ${streamname[1]}_00000.html  tmp1.html
-    sed  "s&${streamname[1]}_camera.dvr&sequence_data/static_scenes.dvr&g"  tmp1.html  >  tmp2.html
-    sed  "s&${streamname[1]}_&sequence_data/&g"  tmp2.html  >  tmp3.html
-    if [[ "$palm_run_identifier" = "" ]]
-    then
-       cp  tmp3.html  ${file_identifier}_sequence.html
-    else
-       sed "s&sequence_data/%05d.dvr (DVR 3D Sequence)&DVR 3D sequence generated by $palm_run_identifier&g"  tmp3.html  >  ${file_identifier}_sequence.html
-    fi
-    rm  tmp1.html  tmp2.html  tmp3.html
-    mv  ${file_identifier}_sequence.html  ${data_catalog}
-
-
-       # Informative messages
-    printf "\n\n  *** processing dvr local output (using dvrp_output=local):"
-    printf "\n      number of detected streams = $nstream"
-    printf "\n      stream names:"
-
-    (( i = 0 ))
-    while (( i < nstream ))
-    do
-
-       (( i = i + 1 ))
-       printf " ${streamname[$i]}"
-
-    done
-    printf "\n"
-
- fi
-
-
-    # Create output for viewing dvr data in sequence mode
- if [[ $create_sequence_output = true ]]
- then
-
-    rm -rf  sequence_data
-    mkdir  sequence_data
-
-       # First, merge static scenes into one file
-    if [[ $camera = true ]]
-    then
-       cat  ${streamname[1]}/camera.dvr  >>  sequence_data/static_scenes.dvr
-    fi
-
-    if [[ $groundplate = true ]]
-    then
-       cat  ${streamname[1]}/groundplate.dvr  >>  sequence_data/static_scenes.dvr
-    fi
-
-    if [[ $topography = true ]]
-    then
-       cat  ${streamname[1]}/topography.dvr  >>  sequence_data/static_scenes.dvr
-    fi
-
-
-       # Now, merge the data, frame by frame
-    (( j = 0 ))
-    (( k = 0 ))
-    (( a = 0 ))
-    while (( j < ${frames[1]} ))
-    do
-
-       rframe=`printf "%05d" $j`
-
-       if (( a == 0 ))
-       then
-
-          wframe=`printf "%05d" $k`
-          (( k = k + 1 ))
-
-          (( i = 0 ))
-          while (( i < nstream ))
-          do
-             (( i = i + 1 ))
-             cat  ${streamname[$i]}/$rframe.dvr  >>  sequence_data/$wframe.dvr
-          done
-
-
-       fi
-
-       (( a = a + 1 ))
-       if (( a == acceleration ))
-       then
-          (( a = 0 ))
-       fi
-
-       (( j = j + 1 ))
-
-    done
-
-
-       # Create the html file to be used for the sequence mode
-    cp  ${streamname[1]}.html  tmp1.html
-    sed  "s/camera.dvr/static_scenes.dvr/g"  tmp1.html  >  tmp2.html
-    sed  "s&${streamname[1]}&sequence_data&g"  tmp2.html  >  tmp3.html
-    sed  "s/;0-0/;0-$wframe/g"  tmp3.html  >  tmp4.html
-    if [[ "$palm_run_identifier" = "" ]]
-    then
-       cp  tmp4.html  ${file_identifier}_sequence.html
-    else
-       sed "s&DATA_DVR/sequence_data/\*\*\*\*\*.dvr (DVR 3D Sequence)&DVR 3D sequence generated by $palm_run_identifier&g"  tmp4.html  >  ${file_identifier}_sequence.html
-    fi
-    rm  tmp1.html  tmp2.html  tmp3.html  tmp4.html
-
-    printf "      data for using sequence mode generated"
-
- fi
-
-
-
-    # Change back to directory from where script has been called
- cd - > /dev/null  2>&1
Index: palm/trunk/SCRIPTS/release_tutorial
===================================================================
--- palm/trunk/SCRIPTS/release_tutorial	(revision 4901)
+++ 	(revision )
@@ -1,89 +1,0 @@
-#!/bin/bash
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# 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-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# ------------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Corrected "Former revisions" section
-# 
-# 2696 2017-12-14 17:12:51Z kanani
-# Change in file header (GPL part)
-#
-# 1841 2016-04-07 19:14:06Z raasch
-# script now running under bash
-#
-# 1046 2012-11-09 14:38:45Z maronga
-# code put under GPL (PALM 3.9)
-#
-# 981 2012-08-09 14:57:44Z maronga
-# Typo removed
-#
-# 955 2012-07-20 09:54:04Z maronga
-# The pdf files are now directly transfered to the trac system. A user account
-# on the palm server is required. Without ssh-key, the passwort has to be given
-# four times.
-#
-# 946 2012-07-17 16:02:40Z maronga
-# Typo removed
-#
-# 915 2012-05-30 15:11:11Z maronga
-# Initial revision
-#
-# Description:
-# ------------
-# Script for copying the compiled PDFs to a desired web directory. This script
-# should be used by user raasch only.
-#
-# Execution:
-# ----------
-# release_tutorial --> Copy all PDF files to $release_directory on
-# the trac server (see below)
-#------------------------------------------------------------------------------!
-
-    release_directory="/palmdata/trac/htdocs/tutorial"
-    server="palm"
-    mod_lecture="664"
-    mod_handout="664"
-    mod_web="664"
-
-    full_name=`readlink -f $0`
-    directory="$(dirname $full_name)/../TUTORIAL/SOURCE"
-    input_dir="$(dirname $full_name)/../TUTORIAL"
-    cd $input_dir
-
-    printf "\n Files will be released in $release_directory/."
-    printf "\n Start copying...\n"
-
-#   copy files to trac system
-    scp LECTURE/*.pdf $USER@$server:"$release_directory/LECTURE/"
-    scp HANDOUT/*.pdf $USER@$server:"$release_directory/HANDOUT/"
-    scp WEB/*.pdf $USER@$server:"$release_directory/WEB/"
-
-#   change permissions
-    ssh $server -l $USER "cd $release_directory/LECTURE; chmod $mod_lecture $release_directory/LECTURE/*; chmod $mod_handout $release_directory/HANDOUT/*; chmod $mod_web $release_directory/WEB/*"
-
-    printf " \n *** All actions finished.\n"
-
-exit
-
-
-
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1)
+++ palm/trunk/SCRIPTS/subjob	(revision 1)
@@ -0,0 +1,1001 @@
+#!/bin/ksh
+# subjob - Plot-Shellskript         Version:  @(#)SUBJOB 1.0    28/11/06
+
+     # 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
+
+
+    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
+ delete_dayfile=false 
+ filetransfer_protocol=scp
+ locat=normal
+ no_default_queue=none
+ no_submit=false
+ job_catalog="~/job_queue"
+ job_name=none
+ local_user=$LOGNAME
+ node_usage=shared
+ numprocs=1
+ punkte="..........................................................."
+ submcom=qsub
+ queue=default
+ remote_host=none
+ remote_user=""
+ verify=true
+
+ typeset  -i   cputime=0  memory=0  Memory=0  minuten  resttime  sekunden  stunden
+ typeset  -i   inumprocs  nodes=0  tasks_per_node=0  threads_per_task=1
+ typeset  -L20 spalte1
+ typeset  -R40 spalte2
+ typeset  -L60 spalte3
+
+
+
+    # FEHLERBEHANDLUNG
+    # BEI EXIT:
+ trap 'if [[ $locat != normal ]]
+       then
+          case  $locat  in
+             (option)  printf "\n  --> available optios can be displayed"
+                       printf " by typing:"
+                       printf "\n      \"subjob ?\" \n";;
+             (ftpcopy|parameter|scp|verify)  printf "\n";;
+             (*)       printf "\n  +++ unknown error"
+                       printf "\n      please inform S. Raasch!\n"
+          esac
+          [[ -f $job_to_send ]]  &&  rm  $job_to_send
+          printf "\n\n+++ SUBJOB killed \n\n"
+       fi' exit
+
+
+    # BEI TERMINAL-BREAK:
+ trap '[[ -f $job_to_send ]]  &&  rm  $job_to_send
+       printf "\n\n+++ SUBJOB killed \n\n"
+       exit
+      ' 2
+
+
+
+
+    # LOKALEN HOSTNAMEN FESTSTELLEN
+ local_host=$(hostname)
+
+
+
+    # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST
+    # UEBERHAUPT ZULAESSIG IST
+ case  $local_host  in
+     (atmos)                 local_addres=172.20.25.35;   local_host=lcide;;
+     (bora)                  local_addres=130.75.105.103; local_host=hpmuk;;
+     (breg*-en0|berni*-en0)  local_addres=130.73.230.10;  local_host=ibmb;;
+     (breva)                 local_addres=130.75.105.98;  local_host=hpmuk;;     
+     (caurus)                local_addres=130.75.105.19;  local_host=hpmuk;;
+     (chinook)               local_addres=130.75.105.100; local_host=hpmuk;;
+     (cs*)                   local_addres=136.172.44.131; local_host=nech;;
+     (elephanta)             local_addres=130.75.105.6;   local_host=hpmuk;;
+     (gfdl5)                 local_addres=165.132.26.58;  local_host=ibmy;;
+     (gfdl3.yonsei.ac.kr)    local_addres=165.132.26.56;  local_host=decalpha;;
+     (gregale)               local_addres=130.75.105.109; local_host=hpmuk;;
+     (hababai)               local_addres=130.75.105.108; local_host=hpmuk;;
+     (hreg*-en0|hanni*-en0)  local_addres=130.75.4.10;    local_host=ibmh;;
+     (irifi)                 local_addres=130.75.105.104; local_host=hpmuk;;
+     (levanto)               local_addres=130.75.105.45;  local_host=hpmuk;;
+     (maestro)               local_addres=130.75.105.2;   local_host=hpmuk;;
+     (nobel*)                local_addres=150.183.5.101;  local_host=ibms;;
+     (orkan)                 local_addres=130.75.105.3;   local_host=hpmuk;;
+     (ostria)                local_addres=130.75.105.106; local_host=hpmuk;;
+     (quanero)               local_addres=130.75.105.107; local_host=hpmuk;;
+     (scirocco)              local_addres=172.20.25.41;   local_host=lcmuk;;
+     (sun1|sun2)             local_addres=130.75.6.1;     local_host=unics;;
+     (tgg*)                  local_addres=172.17.75.161;  local_host=lctit;;
+     (vorias)                local_addres=172.20.25.43;   local_host=lcmuk;;
+     (*)                     printf "\n  +++ \"$local_host\" unknown";
+                             printf "\n      please inform S. Raasch!";
+                             locat=parameter; exit;;
+ esac
+
+
+
+    # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN
+ remote_host=$local_host
+
+
+
+
+    # PROZEDUROPTIONEN EINLESEN
+ while  getopts  :c:dDf:h:m:n:N:O:q:t:T:u:vX:  option
+ do
+   case  $option  in
+       (c)   job_catalog=$OPTARG;;
+       (d)   delete_dayfile=true;;
+       (D)   no_submit=true;;
+       (f)   filetransfer_protocol=$OPTARG;;
+       (h)   remote_host=$OPTARG;;
+       (m)   memory=$OPTARG;;
+       (n)   job_name=$OPTARG;;
+       (N)   node_usage=$OPTARG;;
+       (O)   threads_per_task=$OPTARG;;
+       (q)   no_default_queue=$OPTARG;;
+       (t)   cputime=$OPTARG;;
+       (T)   tasks_per_node=$OPTARG;;
+       (u)   remote_user=$OPTARG;;
+       (v)   verify=false;;
+       (X)   numprocs=$OPTARG;;
+       (\?)  printf "\n  +++ Option $OPTARG unknown \n";
+             locat=option; exit;;
+   esac
+ done
+
+
+    # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN
+ shift OPTIND-1; file_to_send=$1
+
+
+    # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
+ if [ "$1" = "?" ]
+ then
+   (printf "\n  *** subjob can be called as follows:\n"
+    printf "\n      subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v  <jobfile>\n"
+    printf "\n      Description of available options:\n"
+    printf "\n      Option  Description                         Default-Value"
+    printf "\n        -c    job-input- and output-catalog       ~/job_queue"
+    printf "\n        -d    no job-protocol will be created     ---"
+    printf "\n        -D    only the job-file will be created   ---"
+    printf "\n        -f    filetransfer protocol               scp"
+    printf "\n        -h    execution host, available hosts:    $remote_host"
+    printf "\n              hpmuk, ibm, ibmb, ibmh, ibms, ibmy,"
+    printf "\n              unics"
+    printf "\n        -m    memory demand per process in MByte  ---"
+    printf "\n        -n    jobname                             <jobdatei>"
+    printf "\n        -O    threads per task (for OpenMP usage) 1"
+    printf "\n        -q    job-queue to be used                default"
+    printf "\n        -t    allowed cpu-time in seconds         ---"
+    printf "\n        -T    tasks per node (on parallel hosts)  ---"
+    printf "\n        -u    username on execution host          from .netrc"
+    printf "\n        -v    no prompt for confirmation          ---"
+    printf "\n        -X    # of processors (on parallel hosts) 1"
+    printf "\n "
+    printf "\n      The only possible positional parameter is <jobfile>:"
+    printf "\n      The complete NQS-job must be provided here."
+    printf "\n      <jobfile>=? creates this outline\n\n") | more
+    exit
+ fi
+
+
+
+    # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT
+ if [[ "$file_to_send" = "" ]]
+ then
+    printf "\n  +++ job-file missing"
+    locat=parameter; exit
+ else
+    if [[ -f $file_to_send ]]
+    then
+       true
+    else
+       printf "\n  +++ job-file: "
+       printf "\n           $file_to_send"
+       printf "\n      does not exist"
+       locat=parameter; exit
+    fi
+ fi
+
+
+
+    # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME
+    # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE
+ if [[ $job_name = none ]]
+ then
+    job_name=$file_to_send
+ fi
+ if [[ $(echo $job_name | grep -c "/") != 0 ]]
+ then
+    printf "\n  +++ job-file name: "
+    printf "\n           $job_name"
+    printf "\n      must not contain \"/\"-characters"
+    locat=parameter; exit
+ fi
+
+
+
+
+    # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST
+    # ODER WENN HOST NICHT ANGEGEBEN WURDE
+ if [[ $remote_host = none ]]
+ then
+    printf "\n  +++ host missing"
+    locat=option; exit
+ else
+    case  $remote_host  in
+        (hpmuk)  qsubmem=d; qsubtime=t; queue=hpmuk; remote_addres=130.75.105.19; submcom=/opt/nqs/bin/qsub;;
+        (ibm)    queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
+        (ibmb)   queue=cpar; remote_addres=130.73.230.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
+        (ibmh)   queue=cpar; remote_addres=130.75.4.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
+        (ibms)   queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
+        (ibmy)   queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
+        (lctit)  queue=test; remote_addres=172.17.75.161; submcom=/n1ge/TITECH_GRID/tools/bin/n1ge;;
+        (nech)   qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";;
+        (vpp)    qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;;
+        (unics)  qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;;
+        (*)      printf "\n  +++ hostname \"$remote_host\" not allowed";
+                 locat=parameter; exit;;
+    esac
+ fi
+
+
+    # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST
+ if [[ $no_default_queue != none ]]
+ then
+    error=false
+    ndq=$no_default_queue
+    case  $remote_host  in
+        (hpmuk)  case  $ndq  in
+                     (hpmuk)  error=false;;
+                     (*)      error=true;;
+                 esac;;
+        (ibm)    case  $ndq  in
+                     (p690_express|p690_standard|p690_long)  error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (ibmb)   case  $ndq  in
+                     (cdata|cdev|cexp|c1|cshare|csolo|cspec) error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (ibmh)   case  $ndq  in
+                     (cdata|cdev|cexp|channi|cxxl|c1|cshare|csolo|cspec)  error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (ibms)   case  $ndq  in
+                     (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand)     error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (ibmy)   case  $ndq  in
+                     (parallel)                              error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (lctit)  case  $ndq  in
+                     (cs|default|high|test)                  error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (t3eb)   case  $ndq  in
+                     (berte|p50|p100|p392|forfree|p25himem)  error=false;;
+                     (*)    error=true;;
+                 esac;;
+        (t3eh)   case  $ndq  in
+                     (para_t3e|em|k|l|lm|comp_t3e|c|p|ht)  error=false;;
+                     (*)    error=true;;
+                 esac;;
+        (t3ej2|t3ej5)  case  $ndq  in
+                     (low|normal|high)  error=false;;
+                     (*)    error=true;;
+                 esac;;
+        (t3es)  case  $ndq  in
+                     (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128)  error=false;;
+                     (*)    error=true;;
+                 esac;;
+        (unics)  case  $ndq  in
+                     (unics|ht)  error=false;;
+                     (*)         error=true;;
+                 esac;;
+    esac
+    if [[ $error = true ]]
+    then
+       printf "\n  +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed"
+       locat=parameter; exit
+    else
+       queue=$no_default_queue
+    fi
+ fi
+
+
+
+    # KNOTENNUTZUNG IN ENTWICKLERQUEUE MUSS SHARED SEIN
+ if [[ $node_usage != shared  &&  $queue = cdev ]]
+ then
+    node_usage=shared
+ fi
+
+
+
+    # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN
+    # AUFTEILEN
+ done=false
+ while [[ $done = false ]]
+ do
+    if (( $cputime <= 0 ))
+    then
+       printf "\n  +++ wrong cpu-time or cpu-time missing"
+       printf "\n  >>> Please type cpu-time in seconds as INTEGER:"
+       printf "\n  >>> "
+       read  cputime  1>/dev/null  2>&1
+    else
+       done=true
+    fi
+ done
+ if [[ $remote_host = nech ]]
+ then
+    if (( tasks_per_node != 0 ))
+    then
+       (( cputime = cputime * tasks_per_node ))
+    elif [[ $numprocs != 0 ]]
+    then
+       (( cputime = cputime * numprocs ))
+    fi
+ fi
+ (( stunden  = cputime / 3600 ))
+ (( resttime = cputime - stunden * 3600 ))
+ (( minuten  = resttime / 60 ))
+ (( sekunden = resttime - minuten * 60 ))
+ timestring=${stunden}:${minuten}:${sekunden}
+
+
+
+    # PRUEFEN DER KERNSPEICHERANFORDERUNG
+ done=false
+ while [[ $done = false ]]
+ do
+    if (( memory <= 0 ))
+    then
+       printf "\n  +++ wrong memory demand or memory demand missing"
+       printf "\n  >>> Please type memory in  MByte per process  as INTEGER:"
+       printf "\n  >>> "
+       read  memory  1>/dev/null  2>&1
+    else
+       done=true
+    fi
+ done
+
+ if [[ $remote_host = nech ]]
+ then
+    if (( tasks_per_node != 0 ))
+    then
+       (( Memory = memory * tasks_per_node / 1000 ))
+    elif [[ $numprocs != 0 ]]
+    then
+       (( Memory = memory * numprocs / 1000 ))
+    else
+       (( Memory = memory / 1000 ))
+    fi
+ fi
+
+
+    # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG
+ if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
+ then
+    (( memory = memory * threads_per_task ))
+ fi
+
+
+    # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN
+ if (( tasks_per_node != 0 ))
+ then
+    (( nodes = numprocs / ( tasks_per_node * threads_per_task ) ))
+ fi
+
+
+
+    # HEADER-AUSGABE
+ if [[ $verify = true ]]
+ then
+    printf "\n\n"
+    printf "#--------------------------------------------------------------# \n"
+    spalte1=SUBJOB;spalte2=$(date)
+    printf "| $spalte1$spalte2 | \n"
+    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"
+    printf "#--------------------------------------------------------------# \n\n"
+
+
+       # KONTROLLABFRAGE, OB ALLES O.K.
+    antwort="dummy"
+    while [[ $antwort != y  &&  $antwort != Y  &&  $antwort != n  &&  $antwort != N ]]
+    do
+       read antwort?" >>> continue (y/n) ? "
+    done
+    if [[ $antwort = n  ||  $antwort = N ]]
+    then
+       locat=verify; exit
+    fi
+    printf "\n"
+ fi
+
+
+
+    # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN
+ kennung=$RANDOM
+ job_on_remhost=${job_name}_${kennung}_$local_host
+ job_to_send=job_to_send_$kennung
+ if [[ $delete_dayfile = false ]]
+ then
+    remote_dayfile=${local_host}_${job_name}_result_$kennung
+    local_dayfile=${remote_host}_${job_name}
+ else
+    remote_dayfile=/dev/null
+    if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
+    then
+       notification='# @ notification = never'
+    fi
+ fi
+
+
+
+    # QSUB- ODER LL-KOMMANDOS BZW. SKRIPTE  GENERIEREN
+ if [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs != 0 ]]
+ then
+
+    if [[ $remote_host = ibmy ]]
+    then
+       consumable_memory=""
+    else
+       consumable_memory="ConsumableMemory($memory mb)"
+    fi
+    if [[ $queue = cdev ]]
+    then
+       data_limit="# @ data_limit = 1.76gb"
+       network_to_use="# @ network.mpi = sn_all,shared,ip"
+    else
+       if [[ $remote_host = ibms ]]
+       then
+          network_to_use="# @ network.mpi = csss,shared,us"
+       elif [[ $remote_host = ibmy ]]
+       then
+          network_to_use=""
+       else
+          network_to_use="# @ network.mpi = sn_all,shared,us"
+          data_limit="# @ data_limit = 1.76gb"
+       fi
+    fi
+
+    cat > $job_to_send << %%END%%
+#!/bin/ksh
+
+# @ job_type = parallel
+# @ job_name = palm
+# @ wall_clock_limit = ${timestring},$timestring
+# @ resources = ConsumableCpus($threads_per_task) $consumable_memory
+# @ output = $remote_dayfile
+# @ error = $remote_dayfile
+# @ image_size = 50
+# @ class = $queue
+# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes
+$network_to_use
+$data_limit
+$notification
+
+%%END%%
+
+    if (( nodes > 0 ))
+    then
+
+       cat >> $job_to_send << %%END%%
+# @ node = $nodes
+# @ tasks_per_node = $tasks_per_node
+# @ node_usage = $node_usage
+# @ queue
+
+%%END%%
+
+    else
+
+       if [[ $remote_host != ibmy ]]
+       then
+
+          cat >> $job_to_send << %%END%%
+# @ blocking = unlimited
+# @ total_tasks = $numprocs
+# @ node_usage = $node_usage
+# @ queue
+
+%%END%%
+
+       else
+
+          cat >> $job_to_send << %%END%%
+# @ node = 1
+# @ total_tasks = $numprocs
+# @ queue
+
+%%END%%
+
+       fi
+
+    fi
+
+ elif [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs = 0 ]]
+ then
+
+    cat > $job_to_send << %%END%%
+#!/bin/ksh
+
+# @ job_type = serial
+# @ node_usage = $node_usage
+# @ job_name = palm
+# @ wall_clock_limit = ${timestring},$timestring
+# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)
+# @ output = $remote_dayfile
+# @ error = $remote_dayfile
+# @ class = $queue
+$notification
+
+# @ queue
+
+%%END%%
+
+ elif [[ $remote_host = nech ]]
+ then
+
+    if (( nodes > 1 ))
+    then
+       cat > $job_to_send << %%END%%
+#!/bin/ksh
+#PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime
+#PBS -l ${qsubmem}=${Memory}gb
+#PBS -b $nodes
+#PBS -o $remote_dayfile
+#PBS -N palm
+#PBS -j o
+#PBS -T mpisx
+
+%%END%%
+
+    elif [[ $numprocs != 0 ]]
+    then
+       cat > $job_to_send << %%END%%
+#!/bin/ksh
+#PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime
+#PBS -l ${qsubmem}=${Memory}gb
+#PBS -o $remote_dayfile
+#PBS -N palm
+#PBS -j o
+
+%%END%%
+
+    else
+       cat > $job_to_send << %%END%%
+#!/bin/ksh
+#PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime
+#PBS -o $remote_dayfile
+#PBS -j o
+
+%%END%%
+
+    fi
+
+ elif [[ $remote_host = lctit ]]
+ then
+    cat > $job_to_send << %%END%%
+#!/bin/bash
+#$ -S /bin/bash
+cd $job_catalog
+PATH=$job_catalog:${job_catalog}/../pub:\$PATH
+export PATH
+
+%%END%%
+
+       # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN
+    submcom="$submcom  -N $job_name  -sgeout $remote_dayfile  -q default"
+
+ else
+
+    cat > $job_to_send << %%END%%
+# @\$-q ${queue}
+# @\$-l${qsubtime} $timestring
+# @\$-l${qsubmem} ${memory}mb
+# @\$-o $remote_dayfile
+# @\$-eo
+
+%%END%%
+
+ fi
+
+
+    # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP
+    # BEI EXIT VERANLASSEN
+    # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT
+    # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH
+ if [[ $delete_dayfile = false  &&  $remote_host != $local_host ]]
+ then
+    echo "set +vx"                              >>  $job_to_send
+    echo "trap '"                               >>  $job_to_send
+    echo "set +vx"                              >>  $job_to_send
+    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $remote_host = nech  ||  $remote_host = lctit ]]
+    then
+       if [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
+       then
+          return_queue=c1
+       elif [[ $remote_host = ibms ]]
+       then
+          return_queue=p_normal
+       elif [[ $remote_host = ibmy ]]
+       then
+          return_queue=serial
+       elif [[ $remote_host = lctit ]]
+       then
+          return_queue=default
+       elif [[ $remote_host = t3eb ]]
+       then
+          return_queue=berte
+       elif [[ $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
+       then
+          return_queue=normal
+       elif [[ $remote_host = t3es ]]
+       then
+          return_queue=batch
+       else
+          return_queue=unknown
+       fi
+
+       if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
+       then
+
+          echo "echo \"#!/bin/ksh\" >> scpjob.$kennung"               >>  $job_to_send
+          echo "echo \"# @ job_type = serial\" >> scpjob.$kennung"    >>  $job_to_send
+          echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung "  >>  $job_to_send
+          echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"# @ image_size = 10\" >> scpjob.$kennung"      >>  $job_to_send
+          echo "echo \"# @ notification = never\" >> scpjob.$kennung" >>  $job_to_send
+
+          echo "echo \"# @ queue\" >> scpjob.$kennung"                >>  $job_to_send
+          echo "echo \" \" >> scpjob.$kennung"                        >>  $job_to_send
+
+          echo "echo \"set -x\" >> scpjob.$kennung"                   >>  $job_to_send
+          echo "echo \"batch_scp  -d  -w 10  -u $local_user  $local_addres  ${job_catalog}/$remote_dayfile  \\\"$job_catalog\\\"  $local_dayfile\" >> scpjob.$kennung"  >>  $job_to_send
+          echo "echo \"exit\" >> scpjob.$kennung"                     >>  $job_to_send
+
+       elif [[ $remote_host = nech ]]
+       then
+          echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
+          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
+          echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100"  >>  $job_to_send
+          echo "#PBS -o last_job_transfer_protocol"      >>  $job_to_send
+          echo "#PBS -j o"                         >>  $job_to_send
+          echo " "                                 >>  $job_to_send
+          echo "set -x"                            >>  $job_to_send
+          echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
+          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
+          echo "%%END%%"                           >>  $job_to_send
+
+       elif [[ $remote_host = lctit ]]
+       then
+          echo "cat > scpjob.$kennung << %%END%%"          >>  $job_to_send
+          echo "set -x"                                    >>  $job_to_send
+          echo "PATH=\$PATH:$job_catalog/../pub"           >>  $job_to_send
+          echo "cd $job_catalog"                           >>  $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
+
+       else
+
+          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
+          echo "# @\\\$-q $return_queue"           >>  $job_to_send
+          echo "# @\\\$-l${qsubtime} 10"           >>  $job_to_send
+          echo "# @\\\$-l${qsubmem} 10mb"          >>  $job_to_send
+          if [[ $remote_host = t3ej2  ||  $remote_host = t3ej5  ||  $remote_host = t3es ]]
+          then
+             echo "# @\$-l mpp_p=0"                >>  $job_to_send
+          fi
+          echo '# @\$-lF 10mb'                     >>  $job_to_send
+#          echo '# @\$-o /dev/null'                 >>  $job_to_send
+          echo '# @\$-o job_queue/last_job_transfer_protocol'    >>  $job_to_send
+          echo '# @\\\$-eo'                          >>  $job_to_send
+          echo " "                                 >>  $job_to_send
+          if [[ $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
+          then
+             echo "set +vx"                        >>  $job_to_send
+             echo ". .profile"                     >>  $job_to_send
+          fi
+          echo "set -x"                            >>  $job_to_send
+          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
+          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
+          echo "%%END%%"                           >>  $job_to_send
+       fi
+
+       if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
+       then
+          echo "llsubmit  scpjob.$kennung"      >>  $job_to_send
+       elif [[ $remote_host = lctit ]]
+       then
+          echo "chmod  u+x  scpjob.$kennung"    >>  $job_to_send
+          echo "rm -rf ${job_catalog}/last_job_transfer_protocol"  >>  $job_to_send
+          echo "n1ge  -N jobtransfer  -q $return_queue  -sgeout ${job_catalog}/last_job_transfer_protocol  scpjob.$kennung"  >>  $job_to_send
+          echo "sleep 10"                       >>  $job_to_send
+       elif [[ $remote_host = t3eb  ||  $remote_host = t3eh  ||  $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
+       then
+          echo "qsub -J n  scpjob.$kennung"     >>  $job_to_send
+       elif [[ $remote_host = t3es ]]
+       then
+          echo "qsub -J n  -s /bin/ksh  scpjob.$kennung"     >>  $job_to_send
+       else
+          echo "qsub  scpjob.$kennung"          >>  $job_to_send
+       fi
+       echo "rm  scpjob.$kennung"               >>  $job_to_send
+       if [[ $remote_host = nech ]]
+       then
+          echo "cd -"                           >>  $job_to_send
+       fi
+    else
+#       echo "ftpcopy  -d  $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+       echo "nohup  ftpcopy  -d  -w 15  $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null  &"  >>  $job_to_send
+    fi
+    echo "set -x"                               >>  $job_to_send
+    echo "     ' exit"                          >>  $job_to_send
+    echo "set -x"                               >>  $job_to_send
+ fi
+
+
+
+    # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN
+ cat  $file_to_send  >>  $job_to_send
+ if [[ $remote_host = ibm ]]
+ then
+    echo " "         >>  $job_to_send
+    echo "exit"      >>  $job_to_send
+ fi
+
+
+
+    # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN
+ if [[ -z $remote_user ]]
+ then
+    if [[ $remote_host = t3eb  ||  $remote_host = t3eh  ||  $remote_host = t3ej2  ||  $remote_host = t3ej5  ||  $remote_host = t3es  ||  $remote_host = vpp ]]
+    then
+       grep  $remote_addres  ~/.netrc | read dum dum dum remote_user dum dum
+    fi
+ fi
+
+
+
+    # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN
+ if [[ $no_submit = false ]]
+ then
+    if [[ $remote_host != $local_host ]]
+    then
+       [[ $verify = true ]]  &&  printf "\n >>> transfering job to \"$remote_host\"..."
+       if [[ $filetransfer_protocol = scp ]]
+       then
+          if [[ $remote_host = ibms  ||  $remote_host = ibmy ]]    # ssh on ibms cannot handle "~/"
+          then
+             job_catalog_save=$job_catalog
+             job_catalog=job_queue
+          elif [[ $remote_host = nech ]]
+          then
+             job_catalog_save=$job_catalog
+             job_catalog=/hpf/b/${remote_user}/job_queue
+          fi
+          if [[ $local_host = decalpha ]]
+          then
+                # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE
+                # PASSWORT AB
+             /bin/scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
+          elif [[ $remote_host = nech ]]
+          then
+                # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ
+                # TRANSFERIERT WERDEN
+             scp  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
+          else
+             scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
+          fi
+          if [[ $? = 1 ]]
+          then
+             locat=scp; exit
+          fi
+          if [[ $remote_host = ibms ]]
+          then
+             job_catalog=$job_catalog_save
+          fi
+       else
+          ftpcopy -s -o  $remote_addres  $job_to_send  "$job_catalog"  $job_on_remhost
+          if [[ $? = 1 ]]
+          then
+             locat=ftpcopy; exit
+          fi
+       fi
+       [[ $verify = true ]]  &&  printf "\n >>> finished\n"
+    else
+       eval  job_catalog=$job_catalog
+       cp  $job_to_send  ${job_catalog}/$job_on_remhost
+    fi
+
+
+
+       # NQS- BZW. LOADLEVELER-JOB STARTEN
+    if [[ $remote_host != $local_host ]]
+    then
+       [[ $verify = true ]]  &&  printf "\n >>> submitting job using \"qsub\"...\n"
+       if [[ $filetransfer_protocol = scp ]]
+       then
+          if [[ $remote_host != lctit ]]
+          then
+             ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
+          else
+                # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
+                # MIT SSH, DESHALB AUFRUF PER PIPE
+                # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR
+             print  "cd $job_catalog; chmod u+x $job_on_remhost"  |  ssh  $remote_addres  -l $remote_user  > /dev/null  2>&1 
+             echo "first try" > send_protocol
+             while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]]
+             do
+                if [[ $(cat send_protocol | grep -c "first try") = 1 ]]
+                then
+                   printf "\n trying to submit job to TIT cluster..."
+                else
+                   printf "\n +++ failed ... trying to submit again ..."
+                fi
+                print  "cd $job_catalog; $submcom $job_on_remhost"  |  ssh  $remote_addres  -l $remote_user  >  send_protocol  2>&1 
+                cat send_protocol
+             done
+             sleep 10
+             print  "cd $job_catalog;  rm $job_on_remhost"  |  ssh  $remote_addres  -l $remote_user  > /dev/null  2>&1 
+             echo "$submcom  $job_on_remhost"
+             rm  send_protocol
+          fi
+       else
+          if [[ $remote_host = ibms ]]
+          then
+             password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'`
+             echo "echo \"$remote_user\" "       >  telnet_script
+             echo "sleep 5"                      >> telnet_script
+             echo "echo \"$password\" "          >> telnet_script
+             echo "sleep 10"                     >> telnet_script
+             echo "echo \"\" "                   >> telnet_script
+             echo "sleep 2"                      >> telnet_script
+             echo "echo \"cd $job_catalog; $submcom $job_on_remhost; rm -rf $job_on_remhost\" " >> telnet_script
+             echo "sleep 10"                     >> telnet_script
+             echo "echo \"exit\" "               >> telnet_script
+
+             chmod  u+x  telnet_script
+             telnet_script  |  telnet $remote_addres  2>&1  |  grep "llsubmit:"
+             rm  telnet_script
+          elif [[ $remote_host = t3es ]]
+          then
+             password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'`
+             echo "printf \"$remote_user\\\n\" " >  telnet_script
+             echo "sleep 10"                     >> telnet_script
+             echo "printf \"$password\\\n\" "    >> telnet_script
+             echo "sleep 10"                     >> telnet_script
+             echo "printf \"\\\n\" "             >> telnet_script
+             echo "sleep 5"                      >> telnet_script
+             echo "printf \"\\\n\" "             >> telnet_script
+             echo "sleep 5"                      >> telnet_script
+             echo "printf \"cd $job_catalog; $submcom $job_on_remhost; rm -f $job_on_remhost\\\n\" " >> telnet_script
+             echo "sleep 10"                     >> telnet_script
+             echo "printf \"exit\\\n\" "         >> telnet_script
+
+             chmod  u+x  telnet_script
+             cat telnet_script
+             telnet_script | telnet $remote_addres  |  grep $remote_user
+             rm  telnet_script
+          else
+             remcom.x  $remote_addres  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
+          fi
+       fi
+       [[ $verify = true ]]  &&  printf " >>> o.k.\n"
+    else
+       cd  $job_catalog
+       if [[ $(echo $local_host | cut -c1-3) = ibm ]]
+       then
+          eval  $submcom  $job_on_remhost
+       elif [[ $local_host = lctit ]]
+       then
+          eval  $submcom  $job_on_remhost
+          echo "$submcom  $job_on_remhost"
+          chmod  u+x  $job_on_remhost
+          sleep 5   # WEIL N1GE IM HINTERGRUND ARBEITET UND DATEI SONST EVTL.
+                    # SCHON WIEDER GELOESCT IST
+       elif [[ $local_host = nech ]]
+       then
+          if [[ $queue = default ]]
+          then
+             eval  $submcom  $job_on_remhost 
+          else
+             eval  $submcom  -q $queue  $job_on_remhost 
+          fi
+       else
+          qsub  $job_on_remhost
+       fi
+       rm  $job_on_remhost
+       cd  -  > /dev/null
+    fi
+ fi
+
+
+
+    # ABSCHLUSSARBEITEN
+
+ if [[ $no_submit = false ]]
+ then
+    rm  $job_to_send
+ fi
+ [[ $verify = true ]]  &&  printf "\n\n *** SUBJOB finished \n\n"
