Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 817)
+++ palm/trunk/SCRIPTS/mbuild	(revision 818)
@@ -128,4 +128,6 @@
      # 31/01/12 - BjornM- bugfix for compilation of utility programs on 
      #                    multiple localhost branches
+     # 08/03/12 - BjornM- bugfix: cpp directive for namelist check program
+     #                    corrected
 
 
@@ -1421,5 +1423,5 @@
              rm -rf ${mainprog}_sources_check.tar
 
-             copts_check="-cpp -D_parallel -D__check"
+             copts_check="-cpp -D__parallel -D__check"
              make  -f Makefile_check $make_options F90=$compiler_name_ser  COPT="$copts_check"
 
@@ -1433,5 +1435,5 @@
              cd $check_depository_path
              printf "\n\n"
-             echo "  *** skipped compilation of mrun GUI (already."       
+             echo "  *** skipped compilation of mrun GUI."       
              printf "\n\n"
              echo "  *** skipped compilation of check_namelist_files."            
Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 817)
+++ palm/trunk/SCRIPTS/mrun	(revision 818)
@@ -239,4 +239,7 @@
      # 03/02/12 - BjornM - namelist file check temporary disabled
      #                     until severel bugs are fixed
+     # 08/02/12 - BjornM - bugfixes: skipping namelist file check in case of 
+     #                     restart runs. check is now possible with topography 
+     #                     and the -v (silent) option is considered
  
     # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
@@ -2404,6 +2407,6 @@
 
 #### PERFORM PARAMETER FILE CHECK (COUPLED RUNS ARE NOT SUPPORTED YET)
- skip_check=true
- if [[ $check_namelist_files == false || $fromhost != $localhost || $run_coupled_model == true ]]
+ skip_check=false
+ if [[ $check_namelist_files == false || $fromhost != $localhost || $run_coupled_model == true || $restart_run == true ]]
  then
     skip_check=true
@@ -2463,4 +2466,23 @@
        printf "\n  +++ no PARIN list entry found for d3f in the configuration file."
     fi
+#   GET TOPOGRAPHY PARAMETER FILE SUFFIX (USUALLY "_P3DF"). THIS FILE MIGHT IS
+#   NOT NECESSARILY REQUIRED
+    line=""
+    found=false
+    grep  "d3f" $config_file | grep "TOPOGRAPHY_DATA"  >  $tmp_check
+    while read line1
+    do
+       line="$line1"
+       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+       then
+          topo_suffix=`echo $line | tr -s " " | cut -d" " -s -f5`
+          found=true
+       fi
+    done < $tmp_check
+
+    if [[ $found = false ]]
+    then
+       printf "\n  +++ no TOPOGRAPHY list entry found in the configuration file."
+    fi
 
     rm -rf ${working_directory}/tmp_check
@@ -2498,13 +2520,16 @@
           printf "\n\n"
 
-          while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
-          do
-             printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
-             read  answer
-          done
-          if [[ $answer = a  ||  $answer = A ]]
-          then
-             printf "\n  +++ Aborting...."
-             locat=normal; exit
+          if [[ $silent == false ]]
+          then
+             while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
+             do
+                printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
+                read  answer
+             done
+             if [[ $answer = a  ||  $answer = A ]]
+             then
+                printf "\n  +++ Aborting...."
+                locat=normal; exit
+             fi
           fi
        else
@@ -2541,14 +2566,19 @@
           answer=dummy
           printf "\n\n"
-          while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
-          do
-             printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
-             read  answer
-          done
-          if [[ $answer = a  ||  $answer = A ]]
-          then
-             printf "\n  +++ Aborting..."
-             rm -rf  $check_sources
-             locat=normal; exit
+          if [[ $silent == false ]]
+          then
+             while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
+             do
+                printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
+                read  answer
+             done
+             if [[ $answer = a  ||  $answer = A ]]
+             then
+                printf "\n  +++ Aborting..."
+                rm -rf  $check_sources
+                locat=normal; exit
+             else
+                skip_check=true
+             fi
           else
              skip_check=true
@@ -2563,4 +2593,16 @@
     then
        cp $working_directory/JOBS/$fname/INPUT/${fname}${p3df_suffix} ./PARINF   
+    fi
+
+
+    if [[ -f $working_directory/JOBS/$fname/INPUT/${fname}${topo_suffix} && $skip_check == false ]]
+    then
+       printf "\n  *** adding topography data"
+       cp $working_directory/JOBS/$fname/INPUT/${fname}${topo_suffix} ./TOPOGRAPHY_DATA
+
+#      IN CASE OF TOPOGRAPHY AND HIGH GRID POINT NUMBERS, THE STACK SIZE 
+#      MUST BE INCREASED. THIS IS DUE TO THE ARRAY nzb_local AND topo_height, 
+#      WHICH REQUIRE SUFFICIENT MEMORY
+       ulimit -s unlimited          
     fi
 
@@ -2577,21 +2619,27 @@
 
 #   SAFETY CHECK: ONLY PROCEED IF THE PARAMETER CHECK PROGRAM WAS PROPERLY COMPILED
-    if [[ ! -f check_namelist_files.x ]] then
+    if [[ ! -f check_namelist_files.x && $skip_check == false ]] then
        printf "\n  +++ WARNING: check_namelist_files.x not found."
        answer=dummy
        printf "\n\n"
-       while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
-       do
-          printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
-          read  answer
-       done
-       if [[ $answer = a  ||  $answer = A ]]
-       then
-          printf "\n  +++ Aborting..."
-          rm -rf  $check_sources
-          locat=normal; exit
-       else
-          printf "\n  *** Skipping parameter file check."
-       fi       
+
+       if [[ $silent == false ]]
+       then
+          while [[ "$answer" != c  &&  "$answer" != C  && "$answer" != a  &&  "$answer" != A ]]
+          do
+             printf " >>> continue anyway (c(ontinue)/a(bort)) ?  "
+             read  answer
+          done
+          if [[ $answer = a  ||  $answer = A ]]
+          then
+             printf "\n  +++ Aborting..."
+             rm -rf  $check_sources
+             locat=normal; exit
+          else
+             printf "\n  *** Skipping parameter file check."
+         
+          fi
+      fi
+       
     elif [[ $skip_check == false ]]
     then
@@ -2694,4 +2742,6 @@
  fi
 
+    # DELETE TEMPORARY DIRECTORY AND FINISH NAMELIST FILE CHECK   
+ rm -rf  $check_sources
  cd $working_directory
 
Index: palm/trunk/SOURCE/Makefile_check
===================================================================
--- palm/trunk/SOURCE/Makefile_check	(revision 817)
+++ palm/trunk/SOURCE/Makefile_check	(revision 818)
@@ -4,5 +4,5 @@
 # Current revisions:
 # ------------------
-#
+# Added all user routines.
 #
 # Former revisions:
@@ -27,8 +27,17 @@
       message.f90 modules.f90 package_parin.f90 parin.f90 poisfft.f90 \
       poisfft_hybrid.f90 singleton.f90 subsidence.f90 temperton_fft.f90 \
+      user_3d_data_averaging.f90 user_actions.f90 \
+      user_additional_routines.f90 user_advec_particles.f90 \
       user_check_data_output.f90 user_check_data_output_pr.f90 \
-      user_check_parameters.f90 user_init.f90 user_init_3d_model.f90 \
-      user_init_grid.f90 user_init_particles.f90 user_init_plant_canopy.f90 \
-      user_module.f90 user_parin.f90  \
+      user_check_parameters.f90 user_data_output_2d.f90 \
+      user_data_output_3d.f90 user_data_output_dvrp.f90 user_data_output_mask.f90 \
+      user_define_netcdf_grid.f90 user_dvrp_coltab.f90 user_header.f90 \
+      user_init.f90 user_init_3d_model.f90 user_init_grid.f90 \
+      user_init_particles.f90 user_init_plant_canopy.f90 \
+      user_last_actions.f90 user_module.f90 user_parin.f90 \
+      user_particle_attributes.f90 user_read_restart_data.f90 \
+      user_spectra.f90 user_statistics.f90 \
+
+
 
 
@@ -38,8 +47,13 @@
       modules.o package_parin.o parin.o poisfft.o \
       poisfft_hybrid.o singleton.o subsidence.o temperton_fft.o \
-      user_check_data_output.o user_check_data_output_pr.o \
-      user_check_parameters.o user_init.o user_init_3d_model.o \
-      user_init_grid.o user_init_particles.o user_init_plant_canopy.o \
-      user_module.o user_parin.o  \
+      user_3d_data_averaging.o user_actions.o user_additional_routines.o \
+      user_advec_particles.o user_check_data_output.o \
+      user_check_data_output_pr.o user_check_parameters.o \
+      user_data_output_2d.o user_data_output_3d.o user_data_output_mask.o user_data_output_dvrp.o \
+      user_define_netcdf_grid.o user_dvrp_coltab.o user_header.o \
+      user_init.o user_init_3d_model.o user_init_grid.o \
+      user_init_particles.o user_init_plant_canopy.o user_last_actions.o \
+      user_module.o user_parin.o user_particle_attributes.o \
+      user_read_restart_data.o user_spectra.o user_statistics.o \
 
 CC = cc
@@ -88,4 +102,18 @@
 subsidence.o: modules.o
 temperton_fft.o: modules.o
+user_3d_data_averaging.o: modules.o user_module.o
+user_actions.o: modules.o user_module.o
+user_additional_routines.o: modules.o user_module.o
+user_advec_particles.o: modules.o user_module.o
+user_check_data_output.o: modules.o user_module.o
+user_check_data_output_pr.o: modules.o user_module.o
+user_check_parameters.o: modules.o user_module.o
+user_data_output_2d.o: modules.o user_module.o
+user_data_output_3d.o: modules.o user_module.o
+user_data_output_mask.o: modules.o user_module.o
+user_data_output_dvrp.o: modules.o user_module.o
+user_define_netcdf_grid.o: modules.o user_module.o
+user_dvrp_coltab.o: modules.o user_module.o
+user_header.o: modules.o user_module.o
 user_init.o: modules.o user_module.o
 user_init_3d_model.o: modules.o user_module.o
@@ -93,7 +121,9 @@
 user_init_particles.o: modules.o user_module.o
 user_init_plant_canopy.o: modules.o user_module.o
+user_last_actions.o: modules.o user_module.o
 user_module.o: user_module.f90
 user_parin.o: modules.o user_module.o
-user_check_parameters.o: modules.o user_module.o
-user_check_data_output.o: modules.o user_module.o
-user_check_data_output_pr.o: modules.o user_module.o
+user_particle_attributes.o: modules.o user_module.o
+user_read_restart_data.o: modules.o user_module.o
+user_spectra.o: modules.o user_module.o
+user_statistics.o: modules.o user_module.o
Index: palm/trunk/SOURCE/check_namelist_files.f90
===================================================================
--- palm/trunk/SOURCE/check_namelist_files.f90	(revision 817)
+++ palm/trunk/SOURCE/check_namelist_files.f90	(revision 818)
@@ -35,4 +35,5 @@
 10  CONTINUE
 
+
 !
 !-- Read control parameters from NAMELIST files and read environment-variables1
@@ -48,8 +49,8 @@
 
 
-!
 !-- Check control parameters and deduce further quantities    
     CALL check_parameters
 
 
+
  END PROGRAM check_namelist_files
Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 817)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 818)
@@ -4,5 +4,6 @@
 ! Current revisions:
 ! -----------------
-!
+! Bugfix: topo_height is only required if topography is used. It is thus now
+! allocated in the topography branch
 !
 ! Former revisions:
@@ -38,5 +39,5 @@
 !
 ! 555 2010-09-07 07:32:53Z raasch
-! Bugfix: default setting of nzb_local for flat topographie
+! Bugfix: default setting of nzb_local for flat topography
 !
 ! 274 2009-03-26 15:11:21Z heinze
@@ -100,5 +101,5 @@
     REAL    ::  dx_l, dy_l, dz_stretched
 
-    REAL, DIMENSION(0:ny,0:nx)          ::  topo_height
+    REAL, DIMENSION(:,:), ALLOCATABLE   ::  topo_height
 
     REAL, DIMENSION(:,:,:), ALLOCATABLE ::  distance
@@ -331,4 +332,5 @@
     ALLOCATE( l_wall(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
 
+
     nzb_s_inner = nzb;  nzb_s_outer = nzb
     nzb_u_inner = nzb;  nzb_u_outer = nzb
@@ -517,4 +519,6 @@
        CASE ( 'read_from_file' )
 
+          ALLOCATE ( topo_height(0:ny,0:nx) )
+
           DO  ii = 0, io_blocks-1
              IF ( ii == io_group )  THEN
@@ -552,4 +556,6 @@
              ENDDO
           ENDDO
+
+          DEALLOCATE ( topo_height )
 !
 !--       Add cyclic boundaries (additional layers are for calculating
Index: palm/trunk/UTIL/mrungui/mainwindow.cpp
===================================================================
--- palm/trunk/UTIL/mrungui/mainwindow.cpp	(revision 817)
+++ palm/trunk/UTIL/mrungui/mainwindow.cpp	(revision 818)
@@ -2,5 +2,5 @@
 // Current revisions:
 // -----------------
-//
+// New: flag parameter -z implemented (used for skipping parameter file check)
 //
 // Former revisions:
@@ -199,4 +199,5 @@
     ui->check_advanced->setEnabled(false);
     ui->check_verbose->setEnabled(false);
+    ui->check_namelist_check->setEnabled(false);
     ui->button_start->setEnabled(false);
     ui->button_start->setText("wait...");
@@ -255,4 +256,5 @@
     ui->check_advanced->setEnabled(true);
     ui->check_verbose->setEnabled(true);
+    ui->check_namelist_check->setEnabled(true);
     ui->button_start->setEnabled(true);
     ui->action_save->setEnabled(true);
@@ -990,4 +992,15 @@
     }
 
+    status = ui->check_namelist_check->checkState();
+
+    if (status == 2)
+    {
+        activate_flag("z");
+    }
+    else
+    {
+        deactivate_flag("z");
+    }
+
     status = ui->check_A->checkState();
 
@@ -1414,4 +1427,8 @@
             {
                ui->check_verbose->setChecked(true);
+            }
+            else if ( parameter == "z")
+            {
+               ui->check_namelist_check->setChecked(true);
             }
             else if ( parameter == "A")
Index: palm/trunk/UTIL/mrungui/mainwindow.ui
===================================================================
--- palm/trunk/UTIL/mrungui/mainwindow.ui	(revision 817)
+++ palm/trunk/UTIL/mrungui/mainwindow.ui	(revision 818)
@@ -46,7 +46,7 @@
      <rect>
       <x>10</x>
-      <y>590</y>
+      <y>595</y>
       <width>901</width>
-      <height>71</height>
+      <height>61</height>
      </rect>
     </property>
@@ -90,5 +90,5 @@
       <rect>
        <x>10</x>
-       <y>40</y>
+       <y>35</y>
        <width>881</width>
        <height>25</height>
@@ -400,7 +400,7 @@
      <rect>
       <x>10</x>
-      <y>325</y>
+      <y>320</y>
       <width>491</width>
-      <height>261</height>
+      <height>271</height>
      </rect>
     </property>
@@ -690,5 +690,5 @@
       <rect>
        <x>7</x>
-       <y>160</y>
+       <y>155</y>
        <width>481</width>
        <height>16</height>
@@ -703,5 +703,5 @@
       <rect>
        <x>10</x>
-       <y>180</y>
+       <y>170</y>
        <width>121</width>
        <height>23</height>
@@ -716,5 +716,5 @@
       <rect>
        <x>10</x>
-       <y>205</y>
+       <y>195</y>
        <width>271</width>
        <height>23</height>
@@ -777,5 +777,5 @@
       <rect>
        <x>10</x>
-       <y>230</y>
+       <y>220</y>
        <width>261</width>
        <height>23</height>
@@ -783,5 +783,5 @@
      </property>
      <property name="text">
-      <string>No prompt on confirmation</string>
+      <string>No prompt on confirmation (silent)</string>
      </property>
     </widget>
@@ -793,5 +793,5 @@
       <rect>
        <x>130</x>
-       <y>180</y>
+       <y>170</y>
        <width>241</width>
        <height>21</height>
@@ -806,4 +806,17 @@
      <property name="text">
       <string/>
+     </property>
+    </widget>
+    <widget class="QCheckBox" name="check_namelist_check">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>245</y>
+       <width>261</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Skip namelist file check</string>
      </property>
     </widget>
@@ -1360,12 +1373,5 @@
     <addaction name="action_about"/>
    </widget>
-   <widget class="QMenu" name="menuTools">
-    <property name="title">
-     <string>Tools</string>
-    </property>
-    <addaction name="actionCheck_parameter_file"/>
-   </widget>
    <addaction name="menuStart"/>
-   <addaction name="menuTools"/>
    <addaction name="menuHelp"/>
   </widget>
@@ -1484,5 +1490,5 @@
     <hint type="sourcelabel">
      <x>160</x>
-     <y>687</y>
+     <y>657</y>
     </hint>
     <hint type="destinationlabel">
@@ -1500,5 +1506,5 @@
     <hint type="sourcelabel">
      <x>73</x>
-     <y>687</y>
+     <y>657</y>
     </hint>
     <hint type="destinationlabel">
@@ -1756,5 +1762,5 @@
     <hint type="sourcelabel">
      <x>72</x>
-     <y>571</y>
+     <y>541</y>
     </hint>
     <hint type="destinationlabel">
@@ -1772,5 +1778,5 @@
     <hint type="sourcelabel">
      <x>76</x>
-     <y>596</y>
+     <y>566</y>
     </hint>
     <hint type="destinationlabel">
@@ -1788,5 +1794,5 @@
     <hint type="sourcelabel">
      <x>53</x>
-     <y>626</y>
+     <y>591</y>
     </hint>
     <hint type="destinationlabel">
@@ -1932,5 +1938,5 @@
     <hint type="sourcelabel">
      <x>119</x>
-     <y>407</y>
+     <y>403</y>
     </hint>
     <hint type="destinationlabel">
@@ -1948,5 +1954,5 @@
     <hint type="sourcelabel">
      <x>149</x>
-     <y>431</y>
+     <y>428</y>
     </hint>
     <hint type="destinationlabel">
@@ -1980,5 +1986,5 @@
     <hint type="sourcelabel">
      <x>179</x>
-     <y>482</y>
+     <y>478</y>
     </hint>
     <hint type="destinationlabel">
@@ -2012,5 +2018,5 @@
     <hint type="sourcelabel">
      <x>361</x>
-     <y>429</y>
+     <y>428</y>
     </hint>
     <hint type="destinationlabel">
@@ -2044,5 +2050,5 @@
     <hint type="sourcelabel">
      <x>262</x>
-     <y>508</y>
+     <y>503</y>
     </hint>
     <hint type="destinationlabel">
@@ -2060,5 +2066,5 @@
     <hint type="sourcelabel">
      <x>324</x>
-     <y>504</y>
+     <y>503</y>
     </hint>
     <hint type="destinationlabel">
@@ -2171,5 +2177,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>906</x>
+     <x>900</x>
      <y>513</y>
     </hint>
@@ -2187,5 +2193,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>919</x>
+     <x>900</x>
      <y>538</y>
     </hint>
@@ -2203,5 +2209,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>917</x>
+     <x>900</x>
      <y>563</y>
     </hint>
@@ -2252,5 +2258,5 @@
     <hint type="sourcelabel">
      <x>307</x>
-     <y>675</y>
+     <y>657</y>
     </hint>
     <hint type="destinationlabel">
@@ -2267,6 +2273,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>904</x>
-     <y>333</y>
+     <x>900</x>
+     <y>343</y>
     </hint>
     <hint type="destinationlabel">
@@ -2401,4 +2407,20 @@
      <x>4</x>
      <y>122</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>check_namelist_check</sender>
+   <signal>stateChanged(int)</signal>
+   <receiver>MainWindow</receiver>
+   <slot>check_flags()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>61</x>
+     <y>609</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>5</x>
+     <y>594</y>
     </hint>
    </hints>
