Index: palm/trunk/UTIL/inifor/src/types.f90
===================================================================
--- palm/trunk/UTIL/inifor/src/types.f90	(revision 2718)
+++ palm/trunk/UTIL/inifor/src/types.f90	(revision 3182)
@@ -21,4 +21,9 @@
 ! Current revisions:
 ! -----------------
+! Introduced new PALM grid stretching:
+! - Converted vertical grid_definition coordinte variables to pointers
+! Improved command line interface:
+! - Moved INIFOR configuration into a new derived data type
+! Removed unnecessary variables 
 ! 
 ! 
@@ -41,9 +46,34 @@
  
  USE defs,                                                                     &
-    ONLY:  dp, PATH, SNAME, LNAME
+    ONLY:  dp, DATE, PATH, SNAME, LNAME
  USE netcdf,                                                                   &
     ONLY:  NF90_MAX_VAR_DIMS, NF90_MAX_NAME
 
  IMPLICIT NONE
+
+ TYPE inifor_config
+    CHARACTER(LEN=DATE)  ::  start_date           !< String of the FORMAT YYYYMMDDHH indicating the start of the intended PALM-4U simulation
+
+    CHARACTER(LEN=PATH)  ::  input_path           !< Path to the input data file directory
+    CHARACTER(LEN=PATH)  ::  hhl_file             !< Path to the file containing the COSMO-DE HHL variable (height of half layers, i.e. vertical cell faces)
+    CHARACTER(LEN=PATH)  ::  namelist_file        !< Path to the PALM-4U namelist file
+    CHARACTER(LEN=PATH)  ::  output_file          !< Path to the INIFOR output file (i.e. PALM-4U dynamic driver')
+    CHARACTER(LEN=PATH)  ::  soiltyp_file         !< Path to the file containing the COSMO-DE SOILTYP variable (map of COSMO-DE soil types)
+    CHARACTER(LEN=PATH)  ::  static_driver_file   !< Path to the file containing the COSMO-DE SOILTYP variable (map of COSMO-DE soil types)
+
+    CHARACTER(LEN=SNAME) ::  flow_prefix          !< Prefix of flow input files, e.g. 'laf' for COSMO-DE analyses
+    CHARACTER(LEN=SNAME) ::  soil_prefix          !< Prefix of soil input files, e.g. 'laf' for COSMO-DE analyses
+    CHARACTER(LEN=SNAME) ::  radiation_prefix     !< Prefix of radiation input files, e.g 'laf' for COSMO-DE analyses
+    CHARACTER(LEN=SNAME) ::  soilmoisture_prefix  !< Prefix of input files for soil moisture spin-up, e.g 'laf' for COSMO-DE analyses
+
+    CHARACTER(LEN=SNAME) ::  bc_mode
+    CHARACTER(LEN=SNAME) ::  ic_mode
+    CHARACTER(LEN=SNAME) ::  rotation_method
+
+    REAL(dp)             ::  p0
+    REAL(dp)             ::  ug
+    REAL(dp)             ::  vg
+    REAL(dp)             ::  z0 !< Elevation of the PALM-4U domain above sea level [m]
+ END TYPE inifor_config
 
  TYPE grid_definition
@@ -55,13 +85,6 @@
     INTEGER, ALLOCATABLE  ::  jj(:,:,:)     !< Given a point (i,j,k) in the PALM-4U grid, jj(i,j,l) gives the y index of the l'th horizontl neighbour on the COSMO-DE grid.
     INTEGER, ALLOCATABLE  ::  kk(:,:,:,:)   !< Given a point (i,j,k) in the PALM-4U grid, kk(i,j,k,l) gives the z index of the l'th vertical neighbour in the intermediate grid.
-    REAL(dp)              ::  dx            !< grid spacing in the first dimension [m]
-    REAL(dp)              ::  dy            !< grid spacing in the second dimension [m]
-    REAL(dp)              ::  dz            !< grid spacing in the third dimension [m]
-    REAL(dp)              ::  dxi           !< inverse grid spacing in the first dimension [m^-1]
-    REAL(dp)              ::  dyi           !< inverse grid spacing in the second dimension [m^-1]
-    REAL(dp)              ::  dzi           !< inverse grid spacing in the third dimension [m^-1]
     REAL(dp)              ::  lx            !< domain length in the first dimension [m]
     REAL(dp)              ::  ly            !< domain length in the second dimension [m]
-    REAL(dp)              ::  lz            !< domain length in the third dimension [m]
     REAL(dp)              ::  x0            !< x coordinate of PALM-4U domain projection centre, i.e. location of zero distortion
     REAL(dp)              ::  y0            !< y coordinate of PALM-4U domain projection centre, i.e. location of zwro distortion
@@ -69,5 +92,5 @@
     REAL(dp), ALLOCATABLE ::  x(:)          !< coordinates of cell centers in x direction [m]
     REAL(dp), ALLOCATABLE ::  y(:)          !< coordinates of cell centers in y direction [m]
-    REAL(dp), ALLOCATABLE ::  z(:)          !< coordinates of cell centers in z direction [m]
+    REAL(dp), POINTER     ::  z(:)          !< coordinates of cell centers in z direction [m]
     REAL(dp), ALLOCATABLE ::  h(:,:,:)      !< heights grid point for intermediate grids [m]
     REAL(dp), POINTER     ::  hhl(:,:,:)    !< heights of half layers (cell faces) above sea level in COSMO-DE, read in from 
@@ -76,5 +99,5 @@
     REAL(dp), ALLOCATABLE ::  xu(:)         !< coordinates of cell faces in x direction [m]
     REAL(dp), ALLOCATABLE ::  yv(:)         !< coordinates of cell faces in y direction [m]
-    REAL(dp), ALLOCATABLE ::  zw(:)         !< coordinates of cell faces in z direction [m]
+    REAL(dp), POINTER     ::  zw(:)         !< coordinates of cell faces in z direction [m]
     REAL(dp), ALLOCATABLE ::  lat(:)        !< rotated-pole latitudes of scalars (cell centers) of the COSMO-DE grid [rad]
     REAL(dp), ALLOCATABLE ::  lon(:)        !< rotated-pole longitudes of scalars (cell centres) of the COSMO-DE grid [rad]
@@ -89,5 +112,5 @@
     REAL(dp), ALLOCATABLE ::  w_horiz(:,:,:)   !< weights for bilinear horizontal interpolation
     REAL(dp), ALLOCATABLE ::  w_verti(:,:,:,:) !< weights for linear vertical interpolation
- END TYPE
+ END TYPE grid_definition
 
 
@@ -103,5 +126,5 @@
     INTEGER               ::  dimvarids_soil(3)!< NetCDF IDs of the grid coordinates for soil points x, y, depth 
     REAL(dp), POINTER     ::  time(:)       ! vector of output time steps
- END TYPE
+ END TYPE nc_file
 
 
@@ -123,7 +146,7 @@
     CHARACTER(LEN=SNAME)                  ::  kind                      !< Kind of grid
     CHARACTER(LEN=SNAME)                  ::  task                      !< Processing task that generates this variable, e.g. 'interpolate_2d' or 'average profile'
-    LOGICAL                               ::  to_be_processed = .FALSE. !< Inifor flag indicating whether variable shall be processed
-    LOGICAL                               ::  is_read = .FALSE.         !< Inifor flag indicating whether variable has been read
-    LOGICAL                               ::  is_upside_down  = .FALSE. !< Inifor flag indicating whether variable shall be processed
+    LOGICAL                               ::  to_be_processed = .FALSE. !< INIFOR flag indicating whether variable shall be processed
+    LOGICAL                               ::  is_read = .FALSE.         !< INIFOR flag indicating whether variable has been read
+    LOGICAL                               ::  is_upside_down  = .FALSE. !< INIFOR flag indicating whether variable shall be processed
     TYPE(grid_definition), POINTER        ::  grid                      !< Pointer to the corresponding output grid
     TYPE(grid_definition), POINTER        ::  intermediate_grid         !< Pointer to the corresponding intermediate grid
