Index: palm/trunk/UTIL/inifor/src/inifor.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor.f90	(revision 3867)
+++ palm/trunk/UTIL/inifor/src/inifor.f90	(revision 3997)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Alert user to warnings if any
+! 
+! 
+! 3866 2019-04-05 14:25:01Z eckhard
 ! Use PALM's working precision
 ! Show error message if compiled without netCDF support
@@ -185,6 +189,6 @@
 !
 !-- Initialize the netCDF output file and define dimensions
-    CALL setup_netcdf_dimensions(output_file, palm_grid, cfg%start_date,    &
-                                 origin_lon, origin_lat)
+    CALL setup_netcdf_dimensions( output_file, palm_grid, cfg%start_date,      &
+                                  origin_lon, origin_lat )
     CALL log_runtime( 'time', 'write' )
 
@@ -587,6 +591,13 @@
     CALL log_runtime( 'report', 'void' )
 
-    message = "Finished writing dynamic driver '" // TRIM( output_file%name ) // &
-              "' successfully."
+    message = "Finished writing dynamic driver '" // TRIM( output_file%name )
+   
+    IF ( n_wrngs > 0 )  THEN
+       message = TRIM( message ) // "' with " // TRIM( str( n_wrngs ) ) //     &
+       " warning(s). Please see logfile '" // LOG_FILE_NAME // "'."
+    ELSE
+       message = TRIM( message ) // "' successfully."
+    END IF
+
     CALL report( 'main loop', message )
     CALL close_log
Index: palm/trunk/UTIL/inifor/src/inifor_control.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_control.f90	(revision 3867)
+++ palm/trunk/UTIL/inifor/src/inifor_control.f90	(revision 3997)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Added warnings counter
+! 
+! 
+! 3866 2019-04-05 14:25:01Z eckhard
 ! Use PALM's working precision
 ! Renamed run_control -> log_runtime
@@ -85,4 +89,5 @@
     CHARACTER (LEN=5000) ::  tip     = '' !< optional log message buffer for tips on how to rectify encountered errors
     INTEGER, SAVE        ::  u            !< Fortran file unit for the log file
+    INTEGER, SAVE        ::  n_wrngs = 0  !< Fortran file unit for the log file
 
  CONTAINS
@@ -143,4 +148,5 @@
     CHARACTER(LEN=*), INTENT(IN) ::  message !< log message
 
+    n_wrngs = n_wrngs + 1
     CALL report(routine, "WARNING: " // TRIM(message))
 
Index: palm/trunk/UTIL/inifor/src/inifor_defs.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_defs.f90	(revision 3867)
+++ palm/trunk/UTIL/inifor/src/inifor_defs.f90	(revision 3997)
@@ -26,4 +26,10 @@
 ! -----------------
 ! $Id$
+! Defined netCDF attribute names for PALM origin coordinates
+! Make netCDF variable names constants
+! Bumped version number
+! 
+! 
+! 3867 2019-04-05 16:15:55Z eckhard
 ! Added parameter for INIFOR's log file name
 ! Use PALM's working precision
@@ -145,13 +151,19 @@
  REAL(wp), PARAMETER ::  CP_PALM = 1005.0_wp  !< heat capacity of dry air at constant pressure, used in computation of PALM-4U's potential temperature [J/kg/K]
 
+!
+!-- PALM static driver attribute names (PIDS 1.9)
+CHARACTER(SNAME), PARAMETER ::  PIDS_ORIGIN_LON = 'origin_lon'
+CHARACTER(SNAME), PARAMETER ::  PIDS_ORIGIN_LAT = 'origin_lat'
+CHARACTER(SNAME), PARAMETER ::  PIDS_ORIGIN_Z   = 'origin_z'
+
 ! 
 !-- COSMO netCDF names
-CHARACTER(SNAME) ::  NC_DEPTH_NAME = 'depth_2'
-CHARACTER(SNAME) ::  NC_HHL_NAME = 'HHL'
-CHARACTER(SNAME) ::  NC_RLAT_NAME = 'rlat'
-CHARACTER(SNAME) ::  NC_RLON_NAME = 'rlon'
-CHARACTER(SNAME) ::  NC_ROTATED_POLE_NAME = 'rotated_pole'
-CHARACTER(SNAME) ::  NC_POLE_LATITUDE_NAME = 'grid_north_pole_latitude'
-CHARACTER(SNAME) ::  NC_POLE_LONGITUDE_NAME = 'grid_north_pole_longitude'
+CHARACTER(SNAME), PARAMETER ::  NC_DEPTH_NAME = 'depth_2'
+CHARACTER(SNAME), PARAMETER ::  NC_HHL_NAME = 'HHL'
+CHARACTER(SNAME), PARAMETER ::  NC_RLAT_NAME = 'rlat'
+CHARACTER(SNAME), PARAMETER ::  NC_RLON_NAME = 'rlon'
+CHARACTER(SNAME), PARAMETER ::  NC_ROTATED_POLE_NAME = 'rotated_pole'
+CHARACTER(SNAME), PARAMETER ::  NC_POLE_LATITUDE_NAME = 'grid_north_pole_latitude'
+CHARACTER(SNAME), PARAMETER ::  NC_POLE_LONGITUDE_NAME = 'grid_north_pole_longitude'
 
 !
@@ -164,5 +176,5 @@
     ACHAR( 10 ) // ' Copyright 2017-2019 Deutscher Wetterdienst Offenbach' !< Copyright notice
  CHARACTER(LEN=*), PARAMETER ::  LOG_FILE_NAME = 'inifor.log' !< Name of INIFOR's log file
- CHARACTER(LEN=*), PARAMETER ::  VERSION = '1.4.9rc'          !< INIFOR version number
+ CHARACTER(LEN=*), PARAMETER ::  VERSION = '1.4.9'            !< INIFOR version number
  
  END MODULE inifor_defs
Index: palm/trunk/UTIL/inifor/src/inifor_grid.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_grid.f90	(revision 3867)
+++ palm/trunk/UTIL/inifor/src/inifor_grid.f90	(revision 3997)
@@ -26,4 +26,9 @@
 ! -----------------
 ! $Id$
+! Read origin_z from static driver if given on the command line
+! Warn if origin_z is specified twice (by static driver and --elevation)
+! 
+! 
+! 3866 2019-04-05 14:25:01Z eckhard
 ! Use PALM's working precision
 ! Catch errors while reading namelists
@@ -140,5 +145,8 @@
                SNAME, LNAME, PATH, FORCING_STEP, WATER_ID, FILL_ITERATIONS,    &
                BETA, P_SL, T_SL, BETA, RD, RV, G, P_REF, RD_PALM, CP_PALM,     &
-               RHO_L, OMEGA, HECTO, wp, iwp
+               RHO_L, OMEGA, HECTO, wp, iwp,                                   &
+               PIDS_ORIGIN_LON,                                                &
+               PIDS_ORIGIN_LAT,                                                &
+               PIDS_ORIGIN_Z
     USE inifor_io,                                                             &
         ONLY:  get_cosmo_grid, get_netcdf_attribute, get_netcdf_dim_vector,    &
@@ -440,6 +448,4 @@
 
     output_file%name = cfg%output_file
-    z0 = cfg%z0
-    p0 = cfg%p0
 
     init_variables_required = .TRUE.
@@ -536,6 +542,8 @@
     IF (TRIM(cfg%static_driver_file) .NE. '')  THEN
 
-       origin_lon = get_netcdf_attribute(cfg%static_driver_file, 'origin_lon')
-       origin_lat = get_netcdf_attribute(cfg%static_driver_file, 'origin_lat')
+       origin_lon = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_LON ) )
+       origin_lat = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_LAT ) )
+       z0         = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_Z ) )
+
 
        message = TRIM(message) // " static driver file '"                   &
@@ -556,4 +564,17 @@
 
     CALL report('setup_parameters', message)
+
+    IF ( cfg%z0_is_set .AND. TRIM( cfg%static_driver_file ) .NE. '' )  THEN
+
+       message = 'You specified both --static-driver/-t and --elevation/-z0. ' // &
+                 'Using the command line value (' // TRIM( real_to_str_f( cfg%z0 ) ) // &
+                 ') instead of static driver value (' // TRIM( real_to_str_f( z0 ) ) // ').'
+       CALL warn('setup_parameters', message)
+
+       z0 = cfg%z0
+
+    END IF
+
+    p0 = cfg%p0
 
     CALL log_runtime('time', 'read')
Index: palm/trunk/UTIL/inifor/src/inifor_io.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_io.f90	(revision 3867)
+++ palm/trunk/UTIL/inifor/src/inifor_io.f90	(revision 3997)
@@ -26,4 +26,9 @@
 ! -----------------
 ! $Id$
+! Added boolean indicator for --elevation option invocation
+! Stop INIFOR if no command-line options given
+! 
+! 
+! 3866 2019-04-05 14:25:01Z eckhard
 ! Use PALM's working precision
 ! Improved coding style
@@ -143,6 +148,6 @@
 !------------------------------------------------------------------------------!
     INTERFACE get_netcdf_variable
-        MODULE PROCEDURE get_netcdf_variable_int
-        MODULE PROCEDURE get_netcdf_variable_real
+       MODULE PROCEDURE get_netcdf_variable_int
+       MODULE PROCEDURE get_netcdf_variable_real
     END INTERFACE get_netcdf_variable
 
@@ -411,12 +416,13 @@
     INTEGER                            ::  arg_count, i
 
-    cfg%p0_is_set = .FALSE.
-    cfg%ug_defined_by_user = .FALSE.
-    cfg%vg_defined_by_user = .FALSE.
     cfg%flow_prefix_is_set = .FALSE.
     cfg%input_prefix_is_set = .FALSE.
+    cfg%p0_is_set = .FALSE.
     cfg%radiation_prefix_is_set = .FALSE.
     cfg%soil_prefix_is_set = .FALSE.
     cfg%soilmoisture_prefix_is_set = .FALSE.
+    cfg%ug_defined_by_user = .FALSE.
+    cfg%vg_defined_by_user = .FALSE.
+    cfg%z0_is_set = .FALSE.
 
     arg_count = COMMAND_ARGUMENT_COUNT()
@@ -448,4 +454,5 @@
 
              CASE( '-z0', '-z', '--elevation' )
+                cfg%z0_is_set = .TRUE.
                 CALL get_option_argument( i, arg )
                 READ(arg, *) cfg%z0
@@ -552,6 +559,7 @@
     ELSE
          
-       message = "No arguments present, using default input and output files"
-       CALL report('parse_command_line_arguments', message)
+       CALL print_version
+       CALL report( 'parse_command_line_arguments', 'No arguments present, exiting.' )
+       STOP
 
     ENDIF
@@ -559,5 +567,5 @@
  END SUBROUTINE parse_command_line_arguments
 
-   
+
 
  SUBROUTINE get_datetime_file_list( start_date_string, start_hour, end_hour, &
Index: palm/trunk/UTIL/inifor/src/inifor_types.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/inifor_types.f90	(revision 3867)
+++ palm/trunk/UTIL/inifor/src/inifor_types.f90	(revision 3997)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Added boolean indicator for --elevation option invocation, sorted varibles
+! 
+! 
+! 3866 2019-04-05 14:25:01Z eckhard
 ! Use PALM's working precision
 !
@@ -117,12 +121,13 @@
     
     LOGICAL              ::  debug                       !< indicates whether --debug option was given
-    LOGICAL              ::  p0_is_set                   !< indicates whether p0 was set manually
-    LOGICAL              ::  ug_defined_by_user          !< indicates whether ug was set manually
-    LOGICAL              ::  vg_defined_by_user          !< indicates whether vg was set manually
     LOGICAL              ::  flow_prefix_is_set          !< indicates whether the flow prefix was set manually
     LOGICAL              ::  input_prefix_is_set         !< indicates whether the input prefix was set manually
+    LOGICAL              ::  p0_is_set                   !< indicates whether p0 was set manually
     LOGICAL              ::  radiation_prefix_is_set     !< indicates whether the radiation prefix was set manually
     LOGICAL              ::  soil_prefix_is_set          !< indicates whether the soil prefix was set manually
     LOGICAL              ::  soilmoisture_prefix_is_set  !< indicates whether the soilmoisture prefix was set manually
+    LOGICAL              ::  ug_defined_by_user          !< indicates whether ug was set manually
+    LOGICAL              ::  vg_defined_by_user          !< indicates whether vg was set manually
+    LOGICAL              ::  z0_is_set                   !< indicates whether z0 was set manually
  END TYPE inifor_config
 
