Index: /palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3040)
+++ /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3041)
@@ -20,9 +20,13 @@
 ! Current revisions:
 ! -----------------
-! 
-! 
+!
+!
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Add data type for global file attributes
+! Add read of global attributes of static driver
+!
+! 3037 2018-05-24 10:39:29Z gronemeier
 ! renamed 'depth' to 'zsoil'
 !
@@ -220,4 +224,6 @@
 
     TYPE init_type
+
+       CHARACTER(LEN=23) ::  origin_time !< reference time of input data
 
        INTEGER(iwp) ::  lod_msoil !< level of detail - soil moisture
@@ -246,5 +252,4 @@
        LOGICAL ::  from_file_w      = .FALSE. !< flag indicating whether w is already initialized from file
 
-
        REAL(wp) ::  fill_msoil       !< fill value for soil moisture
        REAL(wp) ::  fill_pt          !< fill value for pt
@@ -256,4 +261,8 @@
        REAL(wp) ::  latitude         !< latitude of the southern model boundary
        REAL(wp) ::  longitude        !< longitude of the western model boundary
+       REAL(wp) ::  origin_x         !< x position of the western model boundary
+       REAL(wp) ::  origin_y         !< y position of the northern model boundary
+       REAL(wp) ::  origin_z         !< reference height of input data
+       REAL(wp) ::  rotation_angle   !< rotation angle of input data
 
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  msoil_init   !< initial vertical profile of soil moisture
@@ -370,4 +379,66 @@
     END TYPE pars
 !
+!-- Define type for global file attributes
+!-- Please refer to the PALM data standard for a detailed description of each
+!-- attribute.
+    TYPE global_atts_type
+       CHARACTER(LEN=12 ) ::  acronym                            !< acronym of institution
+       CHARACTER(LEN=7)   ::  acronym_char = 'acronym'           !< name of attribute
+       CHARACTER(LEN=200) ::  author                             !< first name, last name, email adress
+       CHARACTER(LEN=6)   ::  author_char = 'author'             !< name of attribute
+       CHARACTER(LEN=12 ) ::  campaign                           !< name of campaign
+       CHARACTER(LEN=8)   ::  campaign_char = 'campaign'         !< name of attribute
+       CHARACTER(LEN=200) ::  comment                            !< comment to data
+       CHARACTER(LEN=7)   ::  comment_char = 'comment'           !< name of attribute
+       CHARACTER(LEN=200) ::  contact_person                     !< first name, last name, email adress
+       CHARACTER(LEN=14)  ::  contact_person_char = 'contact_person'  !< name of attribute
+       CHARACTER(LEN=200) ::  conventions = 'CF-1.7'             !< netCDF convention
+       CHARACTER(LEN=11)  ::  conventions_char = 'Conventions'   !< name of attribute
+       CHARACTER(LEN=23 ) ::  creation_time                      !< creation time of data set
+       CHARACTER(LEN=13)  ::  creation_time_char = 'creation_time'  !< name of attribute
+       CHARACTER(LEN=16 ) ::  data_content                       !< content of data set
+       CHARACTER(LEN=12)  ::  data_content_char = 'data_content' !< name of attribute
+       CHARACTER(LEN=200) ::  dependencies                       !< dependencies of data set
+       CHARACTER(LEN=12)  ::  dependencies_char = 'dependencies' !< name of attribute
+       CHARACTER(LEN=200) ::  history                            !< information about data processing
+       CHARACTER(LEN=7)   ::  history_char = 'history'           !< name of attribute
+       CHARACTER(LEN=200) ::  institution                        !< name of responsible institution
+       CHARACTER(LEN=11)  ::  institution_char = 'institution'   !< name of attribute
+       CHARACTER(LEN=200) ::  keywords                           !< keywords of data set
+       CHARACTER(LEN=8)   ::  keywords_char = 'keywords'         !< name of attribute
+       CHARACTER(LEN=200) ::  license                            !< license of data set
+       CHARACTER(LEN=7)   ::  license_char = 'license'           !< name of attribute
+       CHARACTER(LEN=200) ::  location                           !< place which refers to data set
+       CHARACTER(LEN=8)   ::  location_char = 'location'         !< name of attribute
+       CHARACTER(LEN=10)  ::  origin_lat_char = 'origin_lat'     !< name of attribute
+       CHARACTER(LEN=10)  ::  origin_lon_char = 'origin_lon'     !< name of attribute
+       CHARACTER(LEN=23 ) ::  origin_time                        !< reference time
+       CHARACTER(LEN=11)  ::  origin_time_char = 'origin_time'   !< name of attribute
+       CHARACTER(LEN=8)   ::  origin_x_char = 'origin_x'         !< name of attribute
+       CHARACTER(LEN=8)   ::  origin_y_char = 'origin_y'         !< name of attribute
+       CHARACTER(LEN=8)   ::  origin_z_char = 'origin_z'         !< name of attribute
+       CHARACTER(LEN=12)  ::  palm_version_char = 'palm_version' !< name of attribute
+       CHARACTER(LEN=200) ::  references                         !< literature referring to data set
+       CHARACTER(LEN=10)  ::  references_char = 'references'     !< name of attribute
+       CHARACTER(LEN=14)  ::  rotation_angle_char = 'rotation_angle'  !< name of attribute
+       CHARACTER(LEN=12 ) ::  site                               !< name of model domain
+       CHARACTER(LEN=4)   ::  site_char = 'site'                 !< name of attribute
+       CHARACTER(LEN=200) ::  source                             !< source of data set
+       CHARACTER(LEN=6)   ::  source_char = 'source'             !< name of attribute
+       CHARACTER(LEN=200) ::  title                              !< title of data set
+       CHARACTER(LEN=5)   ::  title_char = 'title'               !< name of attribute
+       CHARACTER(LEN=7)   ::  version_char = 'version'           !< name of attribute
+
+       INTEGER(iwp) ::  version              !< version of data set
+
+       REAL(wp) ::  origin_lat               !< latitude of lower left corner
+       REAL(wp) ::  origin_lon               !< longitude of lower left corner
+       REAL(wp) ::  origin_x                 !< easting (UTM coordinate) of lower left corner
+       REAL(wp) ::  origin_y                 !< northing (UTM coordinate) of lower left corner
+       REAL(wp) ::  origin_z                 !< reference height
+       REAL(wp) ::  palm_version             !< PALM version of data set
+       REAL(wp) ::  rotation_angle           !< rotation angle of coordinate system of data set
+    END TYPE global_atts_type
+!
 !-- Define variables
     TYPE(dims_xy)    ::  dim_static  !< data structure for x, y-dimension in static input file
@@ -421,7 +492,5 @@
     CHARACTER(LEN=3)  ::  char_lod  = 'lod'         !< name of level-of-detail attribute in NetCDF file
 
-    CHARACTER(LEN=10) ::  char_fill = '_FillValue'  !< name of fill value attribute in NetCDF file
-    CHARACTER(LEN=10) ::  char_lon  = 'origin_lon'  !< name of global attribute for longitude in NetCDF file
-    CHARACTER(LEN=10) ::  char_lat  = 'origin_lat'  !< name of global attribute for latitude in NetCDF file
+    CHARACTER(LEN=10) ::  char_fill = '_FillValue'        !< name of fill value attribute in NetCDF file
 
     CHARACTER(LEN=100) ::  input_file_static  = 'PIDS_STATIC'  !< Name of file which comprises static input data
@@ -434,4 +503,6 @@
 
     LOGICAL ::  collective_read = .FALSE.      !< Enable NetCDF collective read
+
+    TYPE(global_atts_type) ::  input_file_atts !< global attributes of input file
 
     SAVE
@@ -578,13 +649,33 @@
                                   TRIM( coupling_char ), id_mod )
 !
-!--          Read global attribute for latitude and longitude
-             CALL get_attribute( id_mod, char_lat,                             &
-                                 init_model%latitude, .TRUE. )
-
-             CALL get_attribute( id_mod, char_lon,                             &
-                                 init_model%longitude, .TRUE. )
+!--          Read global attributes
+             CALL get_attribute( id_mod, input_file_atts%origin_lat_char,      &
+                                 input_file_atts%origin_lat, .TRUE. )
+
+             CALL get_attribute( id_mod, input_file_atts%origin_lon_char,      &
+                                 input_file_atts%origin_lon, .TRUE. )
+
+             CALL get_attribute( id_mod, input_file_atts%origin_time_char,     &
+                                 input_file_atts%origin_time, .TRUE. )
+
+             CALL get_attribute( id_mod, input_file_atts%origin_x_char,        &
+                                 input_file_atts%origin_x, .TRUE. )
+
+             CALL get_attribute( id_mod, input_file_atts%origin_y_char,        &
+                                 input_file_atts%origin_y, .TRUE. )
+
+             CALL get_attribute( id_mod, input_file_atts%origin_z_char,        &
+                                 input_file_atts%origin_z, .TRUE. )
+
+             CALL get_attribute( id_mod, input_file_atts%rotation_angle_char,  &
+                                 input_file_atts%rotation_angle, .TRUE. )
+
 !
 !--          Finally, close input file
              CALL close_input_file( id_mod )
+!
+!--          Copy lon/lat values
+             init_model%latitude = input_file_atts%origin_lat
+             init_model%longitude = input_file_atts%origin_lon
 #endif
           ENDIF
