Index: palm/trunk/UTIL/inifor/README
===================================================================
--- palm/trunk/UTIL/inifor/README	(revision 3447)
+++ palm/trunk/UTIL/inifor/README	(revision 3456)
@@ -1,3 +1,3 @@
-# INIFOR - Mesoscale Interface for Initializing and Forcing PALM-4U (v1.4.0)
+# INIFOR - Mesoscale Interface for Initializing and Forcing PALM-4U (v1.4.1)
 
 INIFOR provides the meteorological fields required to initialize and drive the
@@ -64,5 +64,5 @@
 
 
-### AVAILABLE NAMELIST PARAMETERS
+### NAMELIST PARAMETERS
 
 INIFOR mirrors a subset of the PALM-4U's Fortran namelists `inipar` and `d3par`
@@ -103,5 +103,8 @@
 
 
-### AVAILABLE COMMAND-LINE PARAMETERS
+### COMMAND-LINE PARAMETERS
+
+#### INIFOR configuration
+
     --averaging-mode <mode>:
         Selects how averaged quantities (large-scale forcing terms) are computed.
@@ -114,5 +117,5 @@
 
     -d, --date, -date <date>:
-        Start date of the simulation in the form YYYYMMDD of YYYYMMDDHH. If no
+        Start date of the simulation in the form YYYYMMDD or YYYYMMDDHH. If no
         hours (HH) are given, INIFOR assumes that the simulation starts at O UTC
         on that day. Default: 20130721
@@ -122,4 +125,21 @@
         as either profiles or three-dimensional fields. The corresponding modes
         are 'profile' and 'volume'. Default: volume
+
+    -r, --surface-pressure, -p0 <pressure>:
+        Manually set the pressure at z=0 in the PALM-4U domain [Pa]. If not
+        given, the surface pressure is computed from the COSMO pressure field.
+
+    -u, --geostrophic-u, -ug <velocity>:
+        Manually specify the geostrophic wind in x direction [m/s]. If not
+        given, the geostrophic wind is computed from the COSMO pressure field.
+
+    -v, --geostrophic-v, -vg <velocity>:
+        Manually specify the geostrophic wind in y direction [m/s]. If not
+        given, the geostrophic wind is computed from the COSMO pressure field.
+
+    -z, --elevation, -z0 <height>: Specifies the elevation of the PALM-4U domain
+        above sea level [m]. Default: 35
+
+#### I/O
 
     -l, --hhl-file, -hhl <netCDF file>:
@@ -140,8 +160,4 @@
         Scenario path, i.e. the path of the meteorological input data. Default: ./
 
-    -r, --surface-pressure, -p0 <pressure>:
-        Manually set the pressure at z=0 in the PALM-4U domain [Pa]. If not
-        given, the surface pressure is computed from the COSMO pressure field.
-
     -s, --soil-file, -soil <netCDF file>:
         Location of the netCDF file containing the COSMO soil type map.
@@ -152,17 +168,7 @@
         to be simulated with PALM-4U. Optional parameter. Default: None
 
-    -u, --geostrophic-u, -ug <velocity>:
-        Manually specify the geostrophic wind in x direction [m/s]. If not
-        given, the geostrophic wind is computed from the COSMO pressure field.
-
-    -v, --geostrophic-v, -vg <velocity>:
-        Manually specify the geostrophic wind in y direction [m/s]. If not
-        given, the geostrophic wind is computed from the COSMO pressure field.
-
-    -z, --elevation, -z0 <height>: Specifies the elevation of the PALM-4U domain
-        above sea level [m]. Default: 35
 
 
-#### ADDITIONAL COMMAND-LINE OPTIONS
+#### FILE PREFIXES
 
     --input-prefix <prefix>:
@@ -182,6 +188,8 @@
         Set the file prefix of soil moisture input files. Default: laf
 
+#### Non-parameter options
+
     --debug:
-        Enable debugging messages.
+        Enable additional terminal messages and netCDF output for debugging.
 
     --version:
Index: palm/trunk/UTIL/inifor/src/inifor.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor.f90	(revision 3447)
+++ palm/trunk/UTIL/inifor/src/inifor.f90	(revision 3456)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! NetCDf output of internal arrays only with --debug option 
+! 
+! 
+! 3401 2018-10-23 09:33:31Z eckhard
 ! Re-compute geostrophic winds every time step
 ! 
@@ -125,5 +129,6 @@
 
     ! Add the output variables to the netCDF output file
-    CALL setup_netcdf_variables(output_file % name, output_var_table)
+    CALL setup_netcdf_variables(output_file % name, output_var_table,          &
+                                cfg % debug)
 
     CALL setup_io_groups()
@@ -424,5 +429,6 @@
                       message = "Writing variable '" // TRIM(output_var%name) // "'."
                       CALL report('main loop', message)
-                      CALL update_output(output_var, output_arr, iter, output_file)
+                      CALL update_output(output_var, output_arr, iter,         &
+                                         output_file, cfg)
  CALL run_control('time', 'write')
                    END IF
Index: palm/trunk/UTIL/inifor/src/inifor_defs.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_defs.f90	(revision 3447)
+++ palm/trunk/UTIL/inifor/src/inifor_defs.f90	(revision 3456)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Bumped version number
+! 
+! 
+! 3447 2018-10-29 15:52:54Z eckhard
 ! Renamed source files for compatibilty with PALM build system
 ! 
@@ -94,5 +98,5 @@
  INTEGER, PARAMETER          ::  FORCING_STEP = 1             !< Number of hours between forcing time steps [h]
  REAL(dp), PARAMETER         ::  NUDGING_TAU = 21600.0_dp     !< Nudging relaxation time scale [s]
- CHARACTER(LEN=*), PARAMETER ::  VERSION = '1.4.0'            !< INIFOR version number
+ CHARACTER(LEN=*), PARAMETER ::  VERSION = '1.4.1'            !< INIFOR version number
  CHARACTER(LEN=*), PARAMETER ::  COPYRIGHT = 'Copyright 2017-2018 Leibniz Universitaet Hannover' // &
      NEW_LINE(' ') // ' Copyright 2017-2018 Deutscher Wetterdienst Offenbach' !< Copyright notice
Index: palm/trunk/UTIL/inifor/src/inifor_grid.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_grid.f90	(revision 3447)
+++ palm/trunk/UTIL/inifor/src/inifor_grid.f90	(revision 3456)
@@ -26,4 +26,9 @@
 ! -----------------
 ! $Id$
+! Remove surface forcing from netCDF output (radiation + precipitation)
+! NetCDf output of internal arrays only with --debug option 
+! 
+! 
+! 3447 2018-10-29 15:52:54Z eckhard
 ! Renamed source files for compatibilty with PALM build system
 ! 
@@ -185,4 +190,5 @@
     LOGICAL ::  ls_forcing_variables_required
     LOGICAL ::  profile_grids_required
+    LOGICAL ::  surface_forcing_required
 
     TYPE(nc_var), ALLOCATABLE, TARGET ::  input_var_table(:)  !< table of input variables
@@ -371,4 +377,5 @@
        boundary_variables_required = TRIM( cfg % bc_mode ) == 'real'
        ls_forcing_variables_required = TRIM( cfg % bc_mode ) == 'ideal'
+       surface_forcing_required = .FALSE.
 
        IF ( ls_forcing_variables_required )  THEN
@@ -3270,5 +3277,5 @@
           var % dimvarids(3)    = output_file % dimvarid_time
           var % dimvarids(1:2)  = output_file % dimvarids_soil(1:2)
-          var % to_be_processed = boundary_variables_required
+          var % to_be_processed = surface_forcing_required
           var % is_internal     = .FALSE.
           var % task            = "interpolate_2d"
Index: palm/trunk/UTIL/inifor/src/inifor_io.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_io.f90	(revision 3447)
+++ palm/trunk/UTIL/inifor/src/inifor_io.f90	(revision 3456)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! NetCDf output of internal arrays only with --debug option 
+! 
+! 
+! 3447 2018-10-29 15:52:54Z eckhard
 ! Removed INCLUDE statement for get_netcdf_variable()
 ! Renamed source files for compatibilty with PALM build system
@@ -711,10 +715,13 @@
 
 
-    SUBROUTINE setup_netcdf_variables(filename, output_variable_table)
+    SUBROUTINE setup_netcdf_variables(filename, output_variable_table, debug)
 
        CHARACTER (LEN=*), INTENT(IN)        ::  filename
        TYPE(nc_var), INTENT(INOUT), TARGET  ::  output_variable_table(:)
+       LOGICAL, INTENT(IN)                  ::  debug
+
        TYPE(nc_var), POINTER                ::  var
        INTEGER                              ::  i, ncid
+       LOGICAL                              ::  to_be_written
 
        message = "Defining variables in dynamic driver '" // TRIM(filename) // "'."
@@ -728,5 +735,8 @@
           var => output_variable_table(i)
 
-          IF ( var % to_be_processed )  THEN
+          to_be_written = ( var % to_be_processed  .AND. .NOT. var % is_internal) .OR.                        &
+                          ( var % is_internal  .AND.  debug )
+
+          IF ( to_be_written )  THEN
              message = "  variable #" // TRIM(str(i)) // " '" // TRIM(var%name) // "'."
              CALL report('setup_netcdf_variables', message)
@@ -920,9 +930,10 @@
 
 
-    SUBROUTINE update_output(var, array, iter, output_file)
+    SUBROUTINE update_output(var, array, iter, output_file, cfg)
        TYPE(nc_var), INTENT(IN)  ::  var
        REAL(dp), INTENT(IN)      ::  array(:,:,:)
        INTEGER, INTENT(IN)       ::  iter
        TYPE(nc_file), INTENT(IN) ::  output_file
+       TYPE(inifor_config)       ::  cfg
 
        INTEGER ::  ncid, ndim, start(4), count(4)
@@ -1007,9 +1018,17 @@
                                    start=start(1:ndim+1) ) )
 
-       CASE ( 'constant scalar profile', 'geostrophic', 'internal profile' )
+       CASE ( 'constant scalar profile', 'geostrophic' )
 
           CALL check(nf90_put_var( ncid, var%varid, array(1,1,:),              &
                                    start=start(1:ndim+1),                      &
                                    count=count(1:ndim) ) )
+
+       CASE ( 'internal profile' )
+
+          IF ( cfg % debug )  THEN
+             CALL check(nf90_put_var( ncid, var%varid, array(1,1,:),           &
+                                      start=start(1:ndim+1),                   &
+                                      count=count(1:ndim) ) )
+          END IF
 
        CASE ( 'large-scale scalar forcing', 'large-scale w forcing' )
