Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 3528)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 3529)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Save time zone in variable run_zone, change date format into YYYY-MM-DD
+! 
+! 3525 2018-11-14 16:06:14Z kanani
 ! Changes related to clean-up of biometeorology (dom_dwd_user)
 ! 
@@ -1089,6 +1092,6 @@
 !-- Generate the file header which is used as a header for most of PALM's
 !-- output files
-    CALL DATE_AND_TIME( date, time )
-    run_date = date(7:8)//'-'//date(5:6)//'-'//date(3:4)
+    CALL DATE_AND_TIME( date, time, run_zone )
+    run_date = date(1:4)//'-'//date(5:6)//'-'//date(7:8)
     run_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
     IF ( coupling_mode == 'uncoupled' )  THEN
Index: /palm/trunk/SOURCE/header.f90
===================================================================
--- /palm/trunk/SOURCE/header.f90	(revision 3528)
+++ /palm/trunk/SOURCE/header.f90	(revision 3529)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! change date format into YYYY-MM-DD
+! 
+! 3525 2018-11-14 16:06:14Z kanani
 ! Changes related to clean-up of biometeorology (dom_dwd_user)
 ! 
@@ -2097,5 +2100,5 @@
 101 FORMAT (35X,'coupled run: ',A/ &
             35X,42('-'))
-102 FORMAT (/' Date:                 ',A8,4X,'Run:       ',A34/      &
+102 FORMAT (/' Date:               ',A10,4X,'Run:       ',A34/      &
             ' Time:                 ',A8,4X,'Run-No.:   ',I2.2/     &
             ' Run on host:        ',A10)
@@ -2494,5 +2497,5 @@
 503 FORMAT (' --> Momentum advection via Wicker-Skamarock-Scheme 5th order')
 504 FORMAT (' --> Scalar advection via Wicker-Skamarock-Scheme 5th order')
-512 FORMAT (/' Date:                 ',A8,6X,'Run:       ',A34/      &
+512 FORMAT (/' Date:               ',A10,6X,'Run:       ',A34/      &
             ' Time:                 ',A8,6X,'Run-No.:   ',I2.2/     &
             ' Run on host:        ',A10,6X,'En-No.:    ',I2.2)
Index: /palm/trunk/SOURCE/modules.f90
===================================================================
--- /palm/trunk/SOURCE/modules.f90	(revision 3528)
+++ /palm/trunk/SOURCE/modules.f90	(revision 3529)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! +run_zone
+! 
+! 3473 2018-10-30 20:50:15Z suehring
 ! +virtual_measurement
 ! 
@@ -1119,6 +1122,7 @@
                                                                           !< '_NV': vertically nested atmosphere PE, '_N##': PE of nested domain ##
     CHARACTER (LEN=8)    ::  most_method = 'newton'                       !< namelist parameter
-    CHARACTER (LEN=8)    ::  run_date                                     !< date of simulation run, printed to HEADER file
-    CHARACTER (LEN=8)    ::  run_time                                     !< time of simulation run, printed to HEADER file
+    CHARACTER (LEN=10)   ::  run_date = ' '                               !< date of simulation run
+    CHARACTER (LEN=8)    ::  run_time = ' '                               !< time of simulation run
+    CHARACTER (LEN=5)    ::  run_zone = ' '                               !< time zone of simulation run
     CHARACTER (LEN=9)    ::  simulated_time_chr                           !< simulated time, printed to RUN_CONTROL file
     CHARACTER (LEN=11)   ::  topography_grid_convention = ' '             !< namelist parameter
Index: /palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3528)
+++ /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3529)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! - read optional attributes from file
+! - set default origin_time
+! 
+! 3518 2018-11-12 18:10:23Z suehring
 ! Additional checks
 ! 
@@ -341,5 +345,5 @@
     TYPE init_type
 
-       CHARACTER(LEN=23) ::  origin_time !< reference time of input data
+       CHARACTER(LEN=23) ::  origin_time = '2000-01-01 00:00:00 +00' !< reference time of input data
 
        INTEGER(iwp) ::  lod_msoil !< level of detail - soil moisture
@@ -566,5 +570,5 @@
        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=12 ) ::  campaign = 'PALM-4U'               !< name of campaign
        CHARACTER(LEN=8)   ::  campaign_char = 'campaign'         !< name of attribute
        CHARACTER(LEN=200) ::  comment                            !< comment to data
@@ -586,11 +590,11 @@
        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) ::  licence                            !< licence of data set
+       CHARACTER(LEN=7)   ::  licence_char = 'licence'           !< 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=23 ) ::  origin_time = '2000-01-01 00:00:00 +00'  !< reference time
        CHARACTER(LEN=11)  ::  origin_time_char = 'origin_time'   !< name of attribute
        CHARACTER(LEN=8)   ::  origin_x_char = 'origin_x'         !< name of attribute
@@ -823,5 +827,6 @@
            chem_emis, chem_emis_att, chem_emis_att_type, chem_emis_val_type,   &
            coord_ref_sys,                                                      &
-           init_3d, init_model, input_file_static, input_pids_static,          &
+           init_3d, init_model, input_file_atts, input_file_static,            &
+           input_pids_static,                                                  &
            input_pids_dynamic, input_pids_vm, input_file_vm,                   &
            leaf_area_density_f, nest_offl,                                     &
@@ -932,4 +937,19 @@
        CALL get_attribute( id_mod, input_file_atts%rotation_angle_char,        &
                            input_file_atts%rotation_angle, .TRUE. )
+
+       CALL get_attribute( id_mod, input_file_atts%author_char,         input_file_atts%author,         .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%contact_person_char, input_file_atts%contact_person, .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%institution_char,    input_file_atts%institution,    .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%acronym_char,        input_file_atts%acronym,        .TRUE., no_abort=.FALSE. )
+
+       CALL get_attribute( id_mod, input_file_atts%campaign_char, input_file_atts%campaign, .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%location_char, input_file_atts%location, .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%site_char,     input_file_atts%site,     .TRUE., no_abort=.FALSE. )
+
+       CALL get_attribute( id_mod, input_file_atts%source_char,     input_file_atts%source,     .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%references_char, input_file_atts%references, .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%keywords_char,   input_file_atts%keywords,   .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%licence_char,    input_file_atts%licence,    .TRUE., no_abort=.FALSE. )
+       CALL get_attribute( id_mod, input_file_atts%comment_char,    input_file_atts%comment,    .TRUE., no_abort=.FALSE. )
 !
 !--    Read coordinate reference system if available
@@ -4925,5 +4945,5 @@
 !------------------------------------------------------------------------------!
      SUBROUTINE get_attribute_string( id, attribute_name, value, global,       &
-                                      variable_name )
+                                      variable_name, no_abort )
 
        USE pegrid
@@ -4938,12 +4958,19 @@
        INTEGER(iwp)                ::  id_var           !< variable id
 
+       LOGICAL ::  check_error                          !< flag indicating if handle_error shall be checked
        LOGICAL, INTENT(IN) ::  global                   !< flag indicating global attribute
+       LOGICAL, INTENT(IN), OPTIONAL ::  no_abort       !< flag indicating if errors should be checked
 #if defined( __netcdf )
 
+       IF ( PRESENT( no_abort ) )  THEN
+          check_error = no_abort
+       ELSE
+          check_error = .TRUE.
+       ENDIF
 !
 !--    Read global attribute
        IF ( global )  THEN
           nc_stat = NF90_GET_ATT( id, NF90_GLOBAL, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_string global', 525, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_string global', 525, attribute_name )
 !
 !--    Read attributes referring to a single variable. Therefore, first inquire
@@ -4951,8 +4978,8 @@
        ELSE
           nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
-          CALL handle_error( 'get_attribute_string', 525, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_string', 525, attribute_name )
 
           nc_stat = NF90_GET_ATT( id, id_var, TRIM( attribute_name ), value )
-          CALL handle_error( 'get_attribute_string',525, attribute_name )
+          IF ( check_error)  CALL handle_error( 'get_attribute_string',525, attribute_name )
 
        ENDIF
Index: /palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 3528)
+++ /palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 3529)
@@ -25,4 +25,11 @@
 ! -----------------
 ! $Id$
+! - set time units
+! - add additional global attributes,
+! - add additinal variable attributes
+! - move definition of UTM and geographic coordinates into subroutine
+! - change fill_value
+! 
+! 3525 2018-11-14 16:06:14Z kanani
 ! Changes related to clean-up of biometeorology (dom_dwd_user)
 ! 
@@ -551,5 +558,5 @@
     INTEGER(iwp), DIMENSION(1:max_masks,0:1,100) ::  id_var_domask
 
-    REAL(wp) ::  fill_value = -999.0_wp    !< value for the _FillValue attribute
+    REAL(wp) ::  fill_value = -9999.0_wp    !< value for the _FillValue attribute
 
 
@@ -584,4 +591,8 @@
        MODULE PROCEDURE netcdf_create_var
     END INTERFACE netcdf_create_var
+
+    INTERFACE netcdf_create_att
+       MODULE PROCEDURE netcdf_create_att_string
+    END INTERFACE netcdf_create_att
 
     INTERFACE netcdf_define_header
@@ -895,20 +906,12 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_mask(mid,av), 464 )
-
           IF ( av == 0 )  THEN
+             CALL netcdf_create_global_atts( id_set_mask(mid,av), 'podsmasked', TRIM( run_description_header ), 464 )
              time_average_text = ' '
           ELSE
-             WRITE (time_average_text, '('', '',F7.1,'' s average'')') &
-                                                            averaging_interval
-          ENDIF
-          nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'title', &
-                                  TRIM( run_description_header ) //    &
-                                  TRIM( time_average_text ) )
-          CALL netcdf_handle_error( 'netcdf_define_header', 465 )
-          IF ( av == 1 )  THEN
+             CALL netcdf_create_global_atts( id_set_mask(mid,av), 'podsmasked', TRIM( run_description_header ), 464 )
              WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
-             nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, &
-                                     'time_avg', TRIM( time_average_text ) )
+             nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'time_avg',   &
+                                     TRIM( time_average_text ) )
              CALL netcdf_handle_error( 'netcdf_define_header', 466 )
           ENDIF
@@ -921,5 +924,8 @@
                                   (/ id_dim_time_mask(mid,av) /), 'time',      &
                                   NF90_DOUBLE, id_var_time_mask(mid,av),       &
-                                 'seconds', '', 468, 469, 000 )
+                                 'seconds since '//TRIM(init_model%origin_time), 'time', 468, 469, 000 )
+          CALL netcdf_create_att( id_set_mask(mid,av), id_var_time_mask(mid,av), 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_mask(mid,av), id_var_time_mask(mid,av), 'axis', 'T', 000)
+
 !
 !--       Define spatial dimensions and coordinates:
@@ -999,82 +1005,10 @@
                                   'meters', '', 486, 487, 000 )
 !
-!--       Define UTM coordinates
-          IF ( init_model%rotation_angle == 0.0_wp )  THEN
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_x_mask(mid,av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_y_mask(mid,av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_xu_mask(mid,av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_y_mask(mid,av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_x_mask(mid,av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_yv_mask(mid,av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ELSE
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,0),   &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,0),   &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,1),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,1),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,2),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_mask(mid,av), &
-                                 (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,2),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ENDIF
-!
-!--       Define geographic coordinates
-          CALL netcdf_create_var( id_set_mask(mid,av), &
-                              (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
-                              'lon', NF90_DOUBLE, id_var_lon_mask(mid,av,0),      &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_mask(mid,av), &
-                              (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
-                              'lat', NF90_DOUBLE, id_var_lat_mask(mid,av,0),      &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_mask(mid,av), &
-                              (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
-                              'lonu', NF90_DOUBLE, id_var_lon_mask(mid,av,1),     &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_mask(mid,av), &
-                              (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
-                              'latu', NF90_DOUBLE, id_var_lat_mask(mid,av,1),     &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_mask(mid,av), &
-                              (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
-                              'lonv', NF90_DOUBLE, id_var_lon_mask(mid,av,2),     &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_mask(mid,av), &
-                              (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
-                              'latv', NF90_DOUBLE, id_var_lat_mask(mid,av,2),     &
-                              'degrees_north', 'latitude', 000, 000, 000 )
+!--       Define UTM and geographic coordinates
+          CALL define_geo_coordinates( id_set_mask(mid,av),               &
+                  (/ id_dim_x_mask(mid,av), id_dim_xu_mask(mid,av) /),    &
+                  (/ id_dim_y_mask(mid,av), id_dim_yv_mask(mid,av) /),    &
+                  id_var_eutm_mask(mid,av,:), id_var_nutm_mask(mid,av,:), &
+                  id_var_lat_mask(mid,av,:), id_var_lon_mask(mid,av,:)    )
 !
 !--       Define coordinate-reference system
@@ -1748,19 +1682,11 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_3d(av), 62 )
-
           IF ( av == 0 )  THEN
+             CALL netcdf_create_global_atts( id_set_3d(av), '3d', TRIM( run_description_header ), 62 )
              time_average_text = ' '
           ELSE
-             WRITE (time_average_text, '('', '',F7.1,'' s average'')') &
-                                                            averaging_interval
-          ENDIF
-          nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'title', &
-                                  TRIM( run_description_header ) //    &
-                                  TRIM( time_average_text ) )
-          CALL netcdf_handle_error( 'netcdf_define_header', 63 )
-          IF ( av == 1 )  THEN
+             CALL netcdf_create_global_atts( id_set_3d(av), '3d_av', TRIM( run_description_header ), 62 )
              WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
-             nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg', &
+             nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg',   &
                                      TRIM( time_average_text ) )
              CALL netcdf_handle_error( 'netcdf_define_header', 63 )
@@ -1781,5 +1707,7 @@
           CALL netcdf_create_var( id_set_3d(av), (/ id_dim_time_3d(av) /),     &
                                   'time', NF90_DOUBLE, id_var_time_3d(av),     &
-                                  'seconds', '', 65, 66, 00 )
+                                  'seconds since '//TRIM(init_model%origin_time), 'time', 65, 66, 00 )
+          CALL netcdf_create_att( id_set_3d(av), id_var_time_3d(av), 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_3d(av), id_var_time_3d(av), 'axis', 'T', 000)
 !
 !--       Define spatial dimensions and coordinates:
@@ -1826,82 +1754,10 @@
                                   362, 363, 000 )
 !
-!--       Define UTM coordinates
-          IF ( init_model%rotation_angle == 0.0_wp )  THEN
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_x_3d(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_3d(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_y_3d(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_3d(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_xu_3d(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_3d(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_y_3d(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_3d(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_x_3d(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_3d(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_yv_3d(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_3d(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ELSE
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_3d(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_3d(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_3d(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_3d(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_3d(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_3d(av), &
-                                 (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_3d(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ENDIF
-!
-!--       Define geographic coordinates
-          CALL netcdf_create_var( id_set_3d(av), &
-                              (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
-                              'lon', NF90_DOUBLE, id_var_lon_3d(av,0),  &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_3d(av), &
-                              (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
-                              'lat', NF90_DOUBLE, id_var_lat_3d(av,0),  &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_3d(av), &
-                              (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
-                              'lonu', NF90_DOUBLE, id_var_lon_3d(av,1), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_3d(av), &
-                              (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
-                              'latu', NF90_DOUBLE, id_var_lat_3d(av,1), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_3d(av), &
-                              (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
-                              'lonv', NF90_DOUBLE, id_var_lon_3d(av,2), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_3d(av), &
-                              (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
-                              'latv', NF90_DOUBLE, id_var_lat_3d(av,2), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
+!--       Define UTM and geographic coordinates
+          CALL define_geo_coordinates( id_set_3d(av),         &
+                  (/ id_dim_x_3d(av), id_dim_xu_3d(av) /),    &
+                  (/ id_dim_y_3d(av), id_dim_yv_3d(av) /),    &
+                  id_var_eutm_3d(av,:), id_var_nutm_3d(av,:), &
+                  id_var_lat_3d(av,:), id_var_lon_3d(av,:)    )
 !
 !--       Define coordinate-reference system
@@ -2651,6 +2507,8 @@
 
           CALL netcdf_create_var( id_set_agt, (/ id_dim_time_agt /), 'time',   &
-                                  NF90_REAL4, id_var_time_agt, 'seconds', '',  &
+                                  NF90_REAL4, id_var_time_agt, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
                                   332, 333, 000 )
+          CALL netcdf_create_att( id_set_agt, id_var_time_agt, 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_agt, id_var_time_agt, 'axis', 'T', 000)
 
           CALL netcdf_create_dim( id_set_agt, 'agent_number',                  &
@@ -2762,19 +2620,11 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_xy(av), 97 )
-
           IF ( av == 0 )  THEN
+             CALL netcdf_create_global_atts( id_set_xy(av), 'xy', TRIM( run_description_header ), 97 )
              time_average_text = ' '
           ELSE
-             WRITE (time_average_text, '('', '',F7.1,'' s average'')') &
-                                                            averaging_interval
-          ENDIF
-          nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'title', &
-                                  TRIM( run_description_header ) //    &
-                                  TRIM( time_average_text ) )
-          CALL netcdf_handle_error( 'netcdf_define_header', 98 )
-          IF ( av == 1 )  THEN
+             CALL netcdf_create_global_atts( id_set_xy(av), 'xy_av', TRIM( run_description_header ), 97 )
              WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
-             nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg', &
+             nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg',   &
                                      TRIM( time_average_text ) )
              CALL netcdf_handle_error( 'netcdf_define_header', 98 )
@@ -2795,5 +2645,7 @@
           CALL netcdf_create_var( id_set_xy(av), (/ id_dim_time_xy(av) /),     &
                                   'time', NF90_DOUBLE, id_var_time_xy(av),     &
-                                  'seconds', '', 100, 101, 000 )
+                                  'seconds since '//TRIM(init_model%origin_time), 'time', 100, 101, 000 )
+          CALL netcdf_create_att( id_set_xy(av), id_var_time_xy(av), 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_xy(av), id_var_time_xy(av), 'axis', 'T', 000)
 !
 !--       Define the spatial dimensions and coordinates for xy-sections.
@@ -2884,82 +2736,10 @@
                                   365, 366, 000 )
 !
-!--       Define UTM coordinates
-          IF ( init_model%rotation_angle == 0.0_wp )  THEN
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_x_xy(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_xy(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_y_xy(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_xy(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_xu_xy(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xy(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_y_xy(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xy(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_x_xy(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xy(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_yv_xy(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xy(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ELSE
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_xy(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_xy(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xy(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xy(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xy(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xy(av), &
-                                 (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xy(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ENDIF
-!
-!--       Define geographic coordinates
-          CALL netcdf_create_var( id_set_xy(av), &
-                              (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
-                              'lon', NF90_DOUBLE, id_var_lon_xy(av,0),  &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xy(av), &
-                              (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
-                              'lat', NF90_DOUBLE, id_var_lat_xy(av,0),  &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xy(av), &
-                              (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
-                              'lonu', NF90_DOUBLE, id_var_lon_xy(av,1), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xy(av), &
-                              (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
-                              'latu', NF90_DOUBLE, id_var_lat_xy(av,1), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xy(av), &
-                              (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
-                              'lonv', NF90_DOUBLE, id_var_lon_xy(av,2), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xy(av), &
-                              (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
-                              'latv', NF90_DOUBLE, id_var_lat_xy(av,2), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
+!--       Define UTM and geographic coordinates
+          CALL define_geo_coordinates( id_set_xy(av),         &
+                  (/ id_dim_x_xy(av), id_dim_xu_xy(av) /),    &
+                  (/ id_dim_y_xy(av), id_dim_yv_xy(av) /),    &
+                  id_var_eutm_xy(av,:), id_var_nutm_xy(av,:), &
+                  id_var_lat_xy(av,:), id_var_lon_xy(av,:)    )
 !
 !--       Define coordinate-reference system
@@ -3800,19 +3580,11 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_xz(av), 140 )
-
           IF ( av == 0 )  THEN
+             CALL netcdf_create_global_atts( id_set_xz(av), 'xz', TRIM( run_description_header ), 140 )
              time_average_text = ' '
           ELSE
-             WRITE (time_average_text, '('', '',F7.1,'' s average'')')         &
-                                                            averaging_interval
-          ENDIF
-          nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'title',         &
-                                  TRIM( run_description_header )  //           &
-                                  TRIM( time_average_text ) )
-          CALL netcdf_handle_error( 'netcdf_define_header', 141 )
-          IF ( av == 1 )  THEN
+             CALL netcdf_create_global_atts( id_set_xz(av), 'xz_av', TRIM( run_description_header ), 140 )
              WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
-             nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg', &
+             nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg',   &
                                      TRIM( time_average_text ) )
              CALL netcdf_handle_error( 'netcdf_define_header', 141 )
@@ -3833,5 +3605,7 @@
           CALL netcdf_create_var( id_set_xz(av), (/ id_dim_time_xz(av) /),     &
                                   'time', NF90_DOUBLE, id_var_time_xz(av),     &
-                                  'seconds', '', 143, 144, 000 )
+                                  'seconds since '//TRIM(init_model%origin_time), 'time', 143, 144, 000 )
+          CALL netcdf_create_att( id_set_xz(av), id_var_time_xz(av), 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_xz(av), id_var_time_xz(av), 'axis', 'T', 000)
 !
 !--       Define the spatial dimensions and coordinates for xz-sections.
@@ -3895,82 +3669,10 @@
                                   157, 158, 000 )
 !
-!--       Define UTM coordinates
-          IF ( init_model%rotation_angle == 0.0_wp )  THEN
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_x_xz(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_xz(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_y_xz(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_xz(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_xu_xz(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xz(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_y_xz(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xz(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_x_xz(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xz(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_yv_xz(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xz(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ELSE
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_xz(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_xz(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xz(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xz(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xz(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_xz(av), &
-                                 (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xz(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ENDIF
-!
-!--       Define geographic coordinates
-          CALL netcdf_create_var( id_set_xz(av), &
-                              (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
-                              'lon', NF90_DOUBLE, id_var_lon_xz(av,0),  &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xz(av), &
-                              (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
-                              'lat', NF90_DOUBLE, id_var_lat_xz(av,0),  &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xz(av), &
-                              (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
-                              'lonu', NF90_DOUBLE, id_var_lon_xz(av,1), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xz(av), &
-                              (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
-                              'latu', NF90_DOUBLE, id_var_lat_xz(av,1), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xz(av), &
-                              (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
-                              'lonv', NF90_DOUBLE, id_var_lon_xz(av,2), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_xz(av), &
-                              (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
-                              'latv', NF90_DOUBLE, id_var_lat_xz(av,2), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
+!--       Define UTM and geographic coordinates
+          CALL define_geo_coordinates( id_set_xz(av),         &
+                  (/ id_dim_x_xz(av), id_dim_xu_xz(av) /),    &
+                  (/ id_dim_y_xz(av), id_dim_yv_xz(av) /),    &
+                  id_var_eutm_xz(av,:), id_var_nutm_xz(av,:), &
+                  id_var_lat_xz(av,:), id_var_lon_xz(av,:)    )
 !
 !--       Define coordinate-reference system
@@ -4737,17 +4439,9 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_yz(av), 179 )
-
           IF ( av == 0 )  THEN
+             CALL netcdf_create_global_atts( id_set_yz(av), 'yz', TRIM( run_description_header ), 179 )
              time_average_text = ' '
           ELSE
-             WRITE (time_average_text, '('', '',F7.1,'' s average'')')         &
-                                                            averaging_interval
-          ENDIF
-          nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'title',         &
-                                  TRIM( run_description_header ) //            &
-                                  TRIM( time_average_text ) )
-          CALL netcdf_handle_error( 'netcdf_define_header', 180 )
-          IF ( av == 1 )  THEN
+             CALL netcdf_create_global_atts( id_set_yz(av), 'yz_av', TRIM( run_description_header ), 179 )
              WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
              nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'time_avg',   &
@@ -4770,5 +4464,7 @@
           CALL netcdf_create_var( id_set_yz(av), (/ id_dim_time_yz(av) /),     &
                                   'time', NF90_DOUBLE, id_var_time_yz(av),     &
-                                  'seconds', '', 182, 183, 000 )
+                                  'seconds since '//TRIM(init_model%origin_time), 'time', 182, 183, 000 )
+          CALL netcdf_create_att( id_set_yz(av), id_var_time_yz(av), 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_yz(av), id_var_time_yz(av), 'axis', 'T', 000)
 !
 !--       Define the spatial dimensions and coordinates for yz-sections.
@@ -4833,82 +4529,10 @@
                                   196, 197, 000 )
 !
-!--       Define UTM coordinates
-          IF ( init_model%rotation_angle == 0.0_wp )  THEN
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_x_yz(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_yz(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_y_yz(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_yz(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_xu_yz(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_yz(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_y_yz(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_yz(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_x_yz(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_yz(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_yv_yz(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_yz(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ELSE
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
-                                 'E_UTM', NF90_DOUBLE, id_var_eutm_yz(av,0),  &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
-                                 'N_UTM', NF90_DOUBLE, id_var_nutm_yz(av,0),  &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
-                                 'Eu_UTM', NF90_DOUBLE, id_var_eutm_yz(av,1), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
-                                 'Nu_UTM', NF90_DOUBLE, id_var_nutm_yz(av,1), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
-                                 'Ev_UTM', NF90_DOUBLE, id_var_eutm_yz(av,2), &
-                                 'm', 'projection_x_coordinate', 000, 000, 000 )
-             CALL netcdf_create_var( id_set_yz(av), &
-                                 (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
-                                 'Nv_UTM', NF90_DOUBLE, id_var_nutm_yz(av,2), &
-                                 'm', 'projection_y_coordinate', 000, 000, 000 )
-          ENDIF
-!
-!--       Define geographic coordinates
-          CALL netcdf_create_var( id_set_yz(av), &
-                              (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
-                              'lon', NF90_DOUBLE, id_var_lon_yz(av,0),  &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_yz(av), &
-                              (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
-                              'lat', NF90_DOUBLE, id_var_lat_yz(av,0),  &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_yz(av), &
-                              (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
-                              'lonu', NF90_DOUBLE, id_var_lon_yz(av,1), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_yz(av), &
-                              (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
-                              'latu', NF90_DOUBLE, id_var_lat_yz(av,1), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_yz(av), &
-                              (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
-                              'lonv', NF90_DOUBLE, id_var_lon_yz(av,2), &
-                              'degrees_east', 'longitude', 000, 000, 000 )
-          CALL netcdf_create_var( id_set_yz(av), &
-                              (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
-                              'latv', NF90_DOUBLE, id_var_lat_yz(av,2), &
-                              'degrees_north', 'latitude', 000, 000, 000 )
+!--       Define UTM and geographic coordinates
+          CALL define_geo_coordinates( id_set_yz(av),         &
+                  (/ id_dim_x_yz(av), id_dim_xu_yz(av) /),    &
+                  (/ id_dim_y_yz(av), id_dim_yv_yz(av) /),    &
+                  id_var_eutm_yz(av,:), id_var_nutm_yz(av,:), &
+                  id_var_lat_yz(av,:), id_var_lon_yz(av,:)    )
 !
 !--       Define coordinate-reference system
@@ -5661,23 +5285,14 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_pr, 451 )
 
           IF ( averaging_interval_pr /= 0.0_wp )  THEN
-             WRITE (time_average_text,'('', '',F7.1,'' s average'')')          &
-                                                            averaging_interval_pr
-             nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title',          &
-                                     TRIM( run_description_header ) //         &
-                                     TRIM( time_average_text ) )
-             CALL netcdf_handle_error( 'netcdf_define_header', 218 )
-
+             CALL netcdf_create_global_atts( id_set_pr, 'podsprav', TRIM( run_description_header ), 451 )
              WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval_pr
              nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'time_avg',       &
                                      TRIM( time_average_text ) )
           ELSE
-             nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title',          &
-                                     TRIM( run_description_header ) )
+             CALL netcdf_create_global_atts( id_set_pr, 'podspr', TRIM( run_description_header ), 451 )
           ENDIF
           CALL netcdf_handle_error( 'netcdf_define_header', 219 )
-
 !
 !--       Write number of columns and rows of coordinate systems to be plotted
@@ -5831,6 +5446,8 @@
                                   id_dim_time_pr, 220 )
           CALL netcdf_create_var( id_set_pr, (/ id_dim_time_pr /), 'time',     &
-                                  NF90_DOUBLE, id_var_time_pr, 'seconds', '',  &
+                                  NF90_DOUBLE, id_var_time_pr, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
                                   221, 222, 000 )
+          CALL netcdf_create_att( id_set_pr, id_var_time_pr, 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_pr, id_var_time_pr, 'axis', 'T', 000)
 !
 !--       Define the variables
@@ -6071,9 +5688,9 @@
 !
 !--       Define some global attributes of the dataset
-          CALL netcdf_create_global_atts( id_set_ts, 329 )
-
-          nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title',             &
-                                  TRIM( run_description_header ) )
-          CALL netcdf_handle_error( 'netcdf_define_header', 249 )
+          CALL netcdf_create_global_atts( id_set_ts, 'podsts', TRIM(run_description_header), 329 )
+
+          ! nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title',             &
+          !                         TRIM( run_description_header ) )
+          ! CALL netcdf_handle_error( 'netcdf_define_header', 249 )
 
 !
@@ -6082,6 +5699,8 @@
                                   id_dim_time_ts, 250 )
           CALL netcdf_create_var( id_set_ts, (/ id_dim_time_ts /), 'time',     &
-                                  NF90_DOUBLE, id_var_time_ts, 'seconds', '',  &
+                                  NF90_DOUBLE, id_var_time_ts, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
                                   251, 252, 000 )
+          CALL netcdf_create_att( id_set_ts, id_var_time_ts, 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_ts, id_var_time_ts, 'axis', 'T', 000)
 !
 !--       Define the variables
@@ -6277,6 +5896,8 @@
                                   id_dim_time_sp, 270 )
           CALL netcdf_create_var( id_set_sp, (/ id_dim_time_sp /), 'time',     &
-                                  NF90_DOUBLE, id_var_time_sp, 'seconds', '',  &
+                                  NF90_DOUBLE, id_var_time_sp, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
                                   271, 272, 000 )
+          CALL netcdf_create_att( id_set_sp, id_var_time_sp, 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_sp, id_var_time_sp, 'axis', 'T', 000)
 !
 !--       Define the spatial dimensions and coordinates for spectra.
@@ -6766,6 +6387,8 @@
                                   id_dim_time_pts, 397 )
           CALL netcdf_create_var( id_set_pts, (/ id_dim_time_pts /), 'time',   &
-                                  NF90_DOUBLE, id_var_time_pts, 'seconds', '', &
+                                  NF90_DOUBLE, id_var_time_pts, 'seconds since '//TRIM(init_model%origin_time), 'time', &
                                   398, 399, 000 )
+          CALL netcdf_create_att( id_set_pts, id_var_time_pts, 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_pts, id_var_time_pts, 'axis', 'T', 000)
 !
 !--       Define the variables. If more than one particle group is defined,
@@ -6962,6 +6585,8 @@
                                   id_dim_time_fl, 250 )
           CALL netcdf_create_var( id_set_fl, (/ id_dim_time_fl /), 'time',     &
-                                  NF90_DOUBLE, id_var_time_fl, 'seconds', '',  &
+                                  NF90_DOUBLE, id_var_time_fl, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
                                   251, 252, 000 )
+          CALL netcdf_create_att( id_set_fl, id_var_time_fl, 'standard_name', 'time', 000)
+          CALL netcdf_create_att( id_set_fl, id_var_time_fl, 'axis', 'T', 000)
 
           DO l = 1, num_leg
@@ -7389,9 +7014,47 @@
 ! Description:
 ! ------------
+!> Write attributes to file.
+!------------------------------------------------------------------------------!
+ SUBROUTINE netcdf_create_att_string( ncid, varid, name, value, err )
+
+    IMPLICIT NONE
+
+    CHARACTER(LEN=*), INTENT(IN) ::  name    !< attribute name
+    CHARACTER(LEN=*), INTENT(IN) ::  value   !< attribute value
+
+    INTEGER, INTENT(IN) ::  err              !< error id
+    INTEGER, INTENT(IN) ::  ncid             !< file id
+
+    INTEGER, INTENT(IN), OPTIONAL ::  varid  !< variable id
+
+#if defined( __netcdf )
+    IF ( PRESENT( varid ) )  THEN
+       nc_stat = NF90_PUT_ATT( ncid, varid, TRIM( name ), TRIM( value ) )
+    ELSE
+       nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( name ), TRIM( value ) )
+    ENDIF
+    CALL netcdf_handle_error( 'netcdf_create_att_string', err )
+#endif
+
+ END SUBROUTINE netcdf_create_att_string
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
 !> Write a set of global attributes to file.
 !------------------------------------------------------------------------------!
- SUBROUTINE netcdf_create_global_atts( ncid, error_no )
+ SUBROUTINE netcdf_create_global_atts( ncid, data_content, title, error_no )
+
+    USE control_parameters,  &
+        ONLY:  revision, run_date, run_time, run_zone, runnr, version
+        
+    USE netcdf_data_input_mod,  &
+        ONLY:  input_file_atts
 
     IMPLICIT NONE
+
+    CHARACTER(LEN=*), INTENT(IN)  ::  data_content  !< describes the type of data in file
+    CHARACTER(LEN=*), INTENT(IN)  ::  title         !< file title
 
     INTEGER, INTENT(IN)  ::  error_no  !< error number
@@ -7399,25 +7062,62 @@
 
 #if defined( __netcdf )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions',  &
-                            'COARDS' )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'title', TRIM( title ) )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat',  &
-                            init_model%latitude )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions', 'CF-1.7' )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon',  &
-                            init_model%longitude )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'creation_time', TRIM( run_date )//' '//TRIM( run_time )//' '//run_zone(1:3) )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x',  &
-                            init_model%origin_x )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'data_content', TRIM(data_content) )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y',  &
-                            init_model%origin_y )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'version', runnr+1 )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z',  &
-                            init_model%origin_z )
+
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_time', init_model%origin_time )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle',  &
-                            init_model%rotation_angle )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat', init_model%latitude )
     CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon', init_model%longitude )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x', init_model%origin_x )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y', init_model%origin_y )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z', init_model%origin_z )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', init_model%rotation_angle )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'dependencies', '' )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'history', '' )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%author_char ), TRIM( input_file_atts%author ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%contact_person_char ), TRIM( input_file_atts%contact_person ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%institution_char ), TRIM( input_file_atts%institution ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%acronym_char ), TRIM( input_file_atts%acronym ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%campaign_char ), TRIM( input_file_atts%campaign ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%location_char ), TRIM( input_file_atts%location ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%site_char ), TRIM( input_file_atts%site ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'source', TRIM( version )//' '//TRIM( revision ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%references_char ), TRIM( input_file_atts%references ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%keywords_char ), TRIM( input_file_atts%keywords ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%licence_char ), TRIM( input_file_atts%licence ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%comment_char ), TRIM( input_file_atts%comment ) )
+    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
+
 #endif
 
@@ -7493,5 +7193,77 @@
 
 #endif
-END SUBROUTINE netcdf_create_crs
+ END SUBROUTINE netcdf_create_crs
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Define UTM coordinates and longitude and latitude in file.
+!------------------------------------------------------------------------------!
+ SUBROUTINE define_geo_coordinates( id_set, id_dim_x, id_dim_y, id_var_eutm, id_var_nutm, id_var_lat, id_var_lon )
+
+    IMPLICIT NONE
+
+    INTEGER ::  i                    !< loop index
+    INTEGER, INTENT(IN)  ::  id_set  !< file id
+
+    INTEGER(iwp), DIMENSION(0:1), INTENT(IN) ::  id_dim_x  !< dimension id of x and xu
+    INTEGER(iwp), DIMENSION(0:1), INTENT(IN) ::  id_dim_y  !< dimension id of y and yv
+
+    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_eutm  !< variable id for E_UTM coordinates
+    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_lat   !< variable id for latitude coordinates
+    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_lon   !< variable id for longitude coordinates
+    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_nutm  !< variable id for N_UTM coordinates
+
+#if defined( __netcdf )
+
+!
+!-- Define UTM coordinates
+    IF ( init_model%rotation_angle == 0.0_wp )  THEN
+       CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(1) /), 'Eu_UTM', NF90_DOUBLE, id_var_eutm(1), 'm', 'easting', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'Nu_UTM', NF90_DOUBLE, id_var_nutm(1), 'm', 'northing', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'Ev_UTM', NF90_DOUBLE, id_var_eutm(2), 'm', 'easting', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_y(1) /), 'Nv_UTM', NF90_DOUBLE, id_var_nutm(2), 'm', 'northing', 000, 000, 000 )
+    ELSE
+       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), &
+                               'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), &
+                               'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), &
+                               'Eu_UTM', NF90_DOUBLE, id_var_eutm(1), 'm', 'easting', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), &
+                               'Nu_UTM', NF90_DOUBLE, id_var_nutm(1), 'm', 'northing', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), &
+                               'Ev_UTM', NF90_DOUBLE, id_var_eutm(2), 'm', 'easting', 000, 000, 000 )
+       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), &
+                               'Nv_UTM', NF90_DOUBLE, id_var_nutm(2), 'm', 'northing', 000, 000, 000 )
+    ENDIF
+!
+!-- Define geographic coordinates
+    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), 'lon', NF90_DOUBLE, id_var_lon(0), &
+                            'degrees_east', 'longitude', 000, 000, 000 )
+    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), 'lat', NF90_DOUBLE, id_var_lat(0), &
+                            'degrees_north', 'latitude', 000, 000, 000 )
+    CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), 'lonu', NF90_DOUBLE, id_var_lon(1), &
+                            'degrees_east', 'longitude', 000, 000, 000 )
+    CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), 'latu', NF90_DOUBLE, id_var_lat(1), &
+                            'degrees_north', 'latitude', 000, 000, 000 )
+    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), 'lonv', NF90_DOUBLE, id_var_lon(2), &
+                            'degrees_east', 'longitude', 000, 000, 000 )
+    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), 'latv', NF90_DOUBLE, id_var_lat(2), &
+                            'degrees_north', 'latitude', 000, 000, 000 )
+
+    DO  i = 0, 2
+       CALL netcdf_create_att( id_set, id_var_eutm(i), 'standard_name', 'projection_x_coordinate', 000)
+       CALL netcdf_create_att( id_set, id_var_nutm(i), 'standard_name', 'projection_y_coordinate', 000)
+
+       CALL netcdf_create_att( id_set, id_var_lat(i), 'standard_name', 'latitude', 000)
+       CALL netcdf_create_att( id_set, id_var_lon(i), 'standard_name', 'longitude', 000)
+    ENDDO
+
+#endif
+ END SUBROUTINE define_geo_coordinates
 
 
