Index: /palm/trunk/SCRIPTS/.palm.config.atosb
===================================================================
--- /palm/trunk/SCRIPTS/.palm.config.atosb	(revision 4808)
+++ /palm/trunk/SCRIPTS/.palm.config.atosb	(revision 4809)
@@ -26,5 +26,5 @@
 %compiler_options    -fpe0 -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 use /sw/modules/HLRN; module purge; module load HLRNenv sw.skl slurm intel/18.0.6 impi/2018.5 netcdf-parallel/impi/intel fftw3/impi/intel
+%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
Index: /palm/trunk/SCRIPTS/.palm.config.atosb_debug
===================================================================
--- /palm/trunk/SCRIPTS/.palm.config.atosb_debug	(revision 4808)
+++ /palm/trunk/SCRIPTS/.palm.config.atosb_debug	(revision 4809)
@@ -26,5 +26,5 @@
 %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 use /sw/modules/HLRN; module purge; module load HLRNenv sw.skl slurm intel/18.0.6 impi/2018.5 netcdf-parallel/impi/intel fftw3/impi/intel
+%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
Index: /palm/trunk/SCRIPTS/palmbuild
===================================================================
--- /palm/trunk/SCRIPTS/palmbuild	(revision 4808)
+++ /palm/trunk/SCRIPTS/palmbuild	(revision 4809)
@@ -22,48 +22,51 @@
 # Current revisions:
 # ------------------
-# 
-# 
+#
+#
 # Former revisions:
 # -----------------
 # $Id$
+# 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. 
-# 
+# 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 
+# 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",
@@ -72,17 +75,17 @@
 # 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)
@@ -91,5 +94,5 @@
 # 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
@@ -97,17 +100,17 @@
 # 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
@@ -191,5 +194,5 @@
     printf "\n           $config_file"
     printf "\n      does not exist"
-    locat=configuration; exit  
+    locat=configuration; exit
  fi
 
@@ -258,5 +261,5 @@
  done < $config_file
 
- 
+
     # CHECK, IF THE BASE DIRECTORY PATH HAS BEEN GIVEN
  if [[ "$base_directory" = "" ]]
@@ -296,5 +299,5 @@
     printf "\n           $makefile"
     printf "\n      does not exist"
-    locat=makefile; exit  
+    locat=makefile; exit
  fi
 
@@ -334,5 +337,5 @@
  if [[ "$remote_ip" != "" ]]
  then
- 
+
     if [[ "$remote_username" = "" ]]
     then
@@ -409,5 +412,5 @@
     done
     printf "|                                                                        | \n"
-   
+
     if [[ "$remote_ip" != "" ]]
     then
@@ -430,5 +433,5 @@
        line=$(echo "$line" | cut -c51-)
     done
-   
+
     if [[ "$remote_ip" != "" ]]
     then
@@ -439,8 +442,8 @@
        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
@@ -777,5 +780,9 @@
        if [[ "$module_commands" != "" ]]
        then
-          eval $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
+          }
        fi
 
@@ -961,5 +968,9 @@
           fi
           [[ "$login_init_cmd" != "" ]]   &&  eval $login_init_cmd
-          [[ "$module_commands" != "" ]]  &&  eval $module_commands
+          [[ "$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
