Changeset 3529


Ignore:
Timestamp:
Nov 15, 2018 9:03:15 PM (5 years ago)
Author:
gronemeier
Message:

change date format in output files; add global attributes; change fill_value; move definition of UTM and lon/lat into subroutine; change attributes of time variable; read optional attributes from input netcdf file; update test cases

Location:
palm/trunk/SOURCE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/check_parameters.f90

    r3525 r3529  
    2525! -----------------
    2626! $Id$
     27! Save time zone in variable run_zone, change date format into YYYY-MM-DD
     28!
     29! 3525 2018-11-14 16:06:14Z kanani
    2730! Changes related to clean-up of biometeorology (dom_dwd_user)
    2831!
     
    10891092!-- Generate the file header which is used as a header for most of PALM's
    10901093!-- output files
    1091     CALL DATE_AND_TIME( date, time )
    1092     run_date = date(7:8)//'-'//date(5:6)//'-'//date(3:4)
     1094    CALL DATE_AND_TIME( date, time, run_zone )
     1095    run_date = date(1:4)//'-'//date(5:6)//'-'//date(7:8)
    10931096    run_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
    10941097    IF ( coupling_mode == 'uncoupled' )  THEN
  • palm/trunk/SOURCE/header.f90

    r3525 r3529  
    2525! -----------------
    2626! $Id$
     27! change date format into YYYY-MM-DD
     28!
     29! 3525 2018-11-14 16:06:14Z kanani
    2730! Changes related to clean-up of biometeorology (dom_dwd_user)
    2831!
     
    20972100101 FORMAT (35X,'coupled run: ',A/ &
    20982101            35X,42('-'))
    2099 102 FORMAT (/' Date:                 ',A8,4X,'Run:       ',A34/      &
     2102102 FORMAT (/' Date:               ',A10,4X,'Run:       ',A34/      &
    21002103            ' Time:                 ',A8,4X,'Run-No.:   ',I2.2/     &
    21012104            ' Run on host:        ',A10)
     
    24942497503 FORMAT (' --> Momentum advection via Wicker-Skamarock-Scheme 5th order')
    24952498504 FORMAT (' --> Scalar advection via Wicker-Skamarock-Scheme 5th order')
    2496 512 FORMAT (/' Date:                 ',A8,6X,'Run:       ',A34/      &
     2499512 FORMAT (/' Date:               ',A10,6X,'Run:       ',A34/      &
    24972500            ' Time:                 ',A8,6X,'Run-No.:   ',I2.2/     &
    24982501            ' Run on host:        ',A10,6X,'En-No.:    ',I2.2)
  • palm/trunk/SOURCE/modules.f90

    r3473 r3529  
    2525! -----------------
    2626! $Id$
     27! +run_zone
     28!
     29! 3473 2018-10-30 20:50:15Z suehring
    2730! +virtual_measurement
    2831!
     
    11191122                                                                          !< '_NV': vertically nested atmosphere PE, '_N##': PE of nested domain ##
    11201123    CHARACTER (LEN=8)    ::  most_method = 'newton'                       !< namelist parameter
    1121     CHARACTER (LEN=8)    ::  run_date                                     !< date of simulation run, printed to HEADER file
    1122     CHARACTER (LEN=8)    ::  run_time                                     !< time of simulation run, printed to HEADER file
     1124    CHARACTER (LEN=10)   ::  run_date = ' '                               !< date of simulation run
     1125    CHARACTER (LEN=8)    ::  run_time = ' '                               !< time of simulation run
     1126    CHARACTER (LEN=5)    ::  run_zone = ' '                               !< time zone of simulation run
    11231127    CHARACTER (LEN=9)    ::  simulated_time_chr                           !< simulated time, printed to RUN_CONTROL file
    11241128    CHARACTER (LEN=11)   ::  topography_grid_convention = ' '             !< namelist parameter
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r3518 r3529  
    2525! -----------------
    2626! $Id$
     27! - read optional attributes from file
     28! - set default origin_time
     29!
     30! 3518 2018-11-12 18:10:23Z suehring
    2731! Additional checks
    2832!
     
    341345    TYPE init_type
    342346
    343        CHARACTER(LEN=23) ::  origin_time !< reference time of input data
     347       CHARACTER(LEN=23) ::  origin_time = '2000-01-01 00:00:00 +00' !< reference time of input data
    344348
    345349       INTEGER(iwp) ::  lod_msoil !< level of detail - soil moisture
     
    566570       CHARACTER(LEN=200) ::  author                             !< first name, last name, email adress
    567571       CHARACTER(LEN=6)   ::  author_char = 'author'             !< name of attribute
    568        CHARACTER(LEN=12 ) ::  campaign                           !< name of campaign
     572       CHARACTER(LEN=12 ) ::  campaign = 'PALM-4U'               !< name of campaign
    569573       CHARACTER(LEN=8)   ::  campaign_char = 'campaign'         !< name of attribute
    570574       CHARACTER(LEN=200) ::  comment                            !< comment to data
     
    586590       CHARACTER(LEN=200) ::  keywords                           !< keywords of data set
    587591       CHARACTER(LEN=8)   ::  keywords_char = 'keywords'         !< name of attribute
    588        CHARACTER(LEN=200) ::  license                            !< license of data set
    589        CHARACTER(LEN=7)   ::  license_char = 'license'           !< name of attribute
     592       CHARACTER(LEN=200) ::  licence                            !< licence of data set
     593       CHARACTER(LEN=7)   ::  licence_char = 'licence'           !< name of attribute
    590594       CHARACTER(LEN=200) ::  location                           !< place which refers to data set
    591595       CHARACTER(LEN=8)   ::  location_char = 'location'         !< name of attribute
    592596       CHARACTER(LEN=10)  ::  origin_lat_char = 'origin_lat'     !< name of attribute
    593597       CHARACTER(LEN=10)  ::  origin_lon_char = 'origin_lon'     !< name of attribute
    594        CHARACTER(LEN=23 ) ::  origin_time                        !< reference time
     598       CHARACTER(LEN=23 ) ::  origin_time = '2000-01-01 00:00:00 +00'  !< reference time
    595599       CHARACTER(LEN=11)  ::  origin_time_char = 'origin_time'   !< name of attribute
    596600       CHARACTER(LEN=8)   ::  origin_x_char = 'origin_x'         !< name of attribute
     
    823827           chem_emis, chem_emis_att, chem_emis_att_type, chem_emis_val_type,   &
    824828           coord_ref_sys,                                                      &
    825            init_3d, init_model, input_file_static, input_pids_static,          &
     829           init_3d, init_model, input_file_atts, input_file_static,            &
     830           input_pids_static,                                                  &
    826831           input_pids_dynamic, input_pids_vm, input_file_vm,                   &
    827832           leaf_area_density_f, nest_offl,                                     &
     
    932937       CALL get_attribute( id_mod, input_file_atts%rotation_angle_char,        &
    933938                           input_file_atts%rotation_angle, .TRUE. )
     939
     940       CALL get_attribute( id_mod, input_file_atts%author_char,         input_file_atts%author,         .TRUE., no_abort=.FALSE. )
     941       CALL get_attribute( id_mod, input_file_atts%contact_person_char, input_file_atts%contact_person, .TRUE., no_abort=.FALSE. )
     942       CALL get_attribute( id_mod, input_file_atts%institution_char,    input_file_atts%institution,    .TRUE., no_abort=.FALSE. )
     943       CALL get_attribute( id_mod, input_file_atts%acronym_char,        input_file_atts%acronym,        .TRUE., no_abort=.FALSE. )
     944
     945       CALL get_attribute( id_mod, input_file_atts%campaign_char, input_file_atts%campaign, .TRUE., no_abort=.FALSE. )
     946       CALL get_attribute( id_mod, input_file_atts%location_char, input_file_atts%location, .TRUE., no_abort=.FALSE. )
     947       CALL get_attribute( id_mod, input_file_atts%site_char,     input_file_atts%site,     .TRUE., no_abort=.FALSE. )
     948
     949       CALL get_attribute( id_mod, input_file_atts%source_char,     input_file_atts%source,     .TRUE., no_abort=.FALSE. )
     950       CALL get_attribute( id_mod, input_file_atts%references_char, input_file_atts%references, .TRUE., no_abort=.FALSE. )
     951       CALL get_attribute( id_mod, input_file_atts%keywords_char,   input_file_atts%keywords,   .TRUE., no_abort=.FALSE. )
     952       CALL get_attribute( id_mod, input_file_atts%licence_char,    input_file_atts%licence,    .TRUE., no_abort=.FALSE. )
     953       CALL get_attribute( id_mod, input_file_atts%comment_char,    input_file_atts%comment,    .TRUE., no_abort=.FALSE. )
    934954!
    935955!--    Read coordinate reference system if available
     
    49254945!------------------------------------------------------------------------------!
    49264946     SUBROUTINE get_attribute_string( id, attribute_name, value, global,       &
    4927                                       variable_name )
     4947                                      variable_name, no_abort )
    49284948
    49294949       USE pegrid
     
    49384958       INTEGER(iwp)                ::  id_var           !< variable id
    49394959
     4960       LOGICAL ::  check_error                          !< flag indicating if handle_error shall be checked
    49404961       LOGICAL, INTENT(IN) ::  global                   !< flag indicating global attribute
     4962       LOGICAL, INTENT(IN), OPTIONAL ::  no_abort       !< flag indicating if errors should be checked
    49414963#if defined( __netcdf )
    49424964
     4965       IF ( PRESENT( no_abort ) )  THEN
     4966          check_error = no_abort
     4967       ELSE
     4968          check_error = .TRUE.
     4969       ENDIF
    49434970!
    49444971!--    Read global attribute
    49454972       IF ( global )  THEN
    49464973          nc_stat = NF90_GET_ATT( id, NF90_GLOBAL, TRIM( attribute_name ), value )
    4947           CALL handle_error( 'get_attribute_string global', 525, attribute_name )
     4974          IF ( check_error)  CALL handle_error( 'get_attribute_string global', 525, attribute_name )
    49484975!
    49494976!--    Read attributes referring to a single variable. Therefore, first inquire
     
    49514978       ELSE
    49524979          nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
    4953           CALL handle_error( 'get_attribute_string', 525, attribute_name )
     4980          IF ( check_error)  CALL handle_error( 'get_attribute_string', 525, attribute_name )
    49544981
    49554982          nc_stat = NF90_GET_ATT( id, id_var, TRIM( attribute_name ), value )
    4956           CALL handle_error( 'get_attribute_string',525, attribute_name )
     4983          IF ( check_error)  CALL handle_error( 'get_attribute_string',525, attribute_name )
    49574984
    49584985       ENDIF
  • palm/trunk/SOURCE/netcdf_interface_mod.f90

    r3525 r3529  
    2525! -----------------
    2626! $Id$
     27! - set time units
     28! - add additional global attributes,
     29! - add additinal variable attributes
     30! - move definition of UTM and geographic coordinates into subroutine
     31! - change fill_value
     32!
     33! 3525 2018-11-14 16:06:14Z kanani
    2734! Changes related to clean-up of biometeorology (dom_dwd_user)
    2835!
     
    551558    INTEGER(iwp), DIMENSION(1:max_masks,0:1,100) ::  id_var_domask
    552559
    553     REAL(wp) ::  fill_value = -999.0_wp    !< value for the _FillValue attribute
     560    REAL(wp) ::  fill_value = -9999.0_wp    !< value for the _FillValue attribute
    554561
    555562
     
    584591       MODULE PROCEDURE netcdf_create_var
    585592    END INTERFACE netcdf_create_var
     593
     594    INTERFACE netcdf_create_att
     595       MODULE PROCEDURE netcdf_create_att_string
     596    END INTERFACE netcdf_create_att
    586597
    587598    INTERFACE netcdf_define_header
     
    895906!
    896907!--       Define some global attributes of the dataset
    897           CALL netcdf_create_global_atts( id_set_mask(mid,av), 464 )
    898 
    899908          IF ( av == 0 )  THEN
     909             CALL netcdf_create_global_atts( id_set_mask(mid,av), 'podsmasked', TRIM( run_description_header ), 464 )
    900910             time_average_text = ' '
    901911          ELSE
    902              WRITE (time_average_text, '('', '',F7.1,'' s average'')') &
    903                                                             averaging_interval
    904           ENDIF
    905           nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'title', &
    906                                   TRIM( run_description_header ) //    &
    907                                   TRIM( time_average_text ) )
    908           CALL netcdf_handle_error( 'netcdf_define_header', 465 )
    909           IF ( av == 1 )  THEN
     912             CALL netcdf_create_global_atts( id_set_mask(mid,av), 'podsmasked', TRIM( run_description_header ), 464 )
    910913             WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
    911              nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, &
    912                                      'time_avg', TRIM( time_average_text ) )
     914             nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'time_avg',   &
     915                                     TRIM( time_average_text ) )
    913916             CALL netcdf_handle_error( 'netcdf_define_header', 466 )
    914917          ENDIF
     
    921924                                  (/ id_dim_time_mask(mid,av) /), 'time',      &
    922925                                  NF90_DOUBLE, id_var_time_mask(mid,av),       &
    923                                  'seconds', '', 468, 469, 000 )
     926                                 'seconds since '//TRIM(init_model%origin_time), 'time', 468, 469, 000 )
     927          CALL netcdf_create_att( id_set_mask(mid,av), id_var_time_mask(mid,av), 'standard_name', 'time', 000)
     928          CALL netcdf_create_att( id_set_mask(mid,av), id_var_time_mask(mid,av), 'axis', 'T', 000)
     929
    924930!
    925931!--       Define spatial dimensions and coordinates:
     
    9991005                                  'meters', '', 486, 487, 000 )
    10001006!
    1001 !--       Define UTM coordinates
    1002           IF ( init_model%rotation_angle == 0.0_wp )  THEN
    1003              CALL netcdf_create_var( id_set_mask(mid,av), &
    1004                                  (/ id_dim_x_mask(mid,av) /),      &
    1005                                  'E_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,0),  &
    1006                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1007              CALL netcdf_create_var( id_set_mask(mid,av), &
    1008                                  (/ id_dim_y_mask(mid,av) /),      &
    1009                                  'N_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,0),  &
    1010                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1011              CALL netcdf_create_var( id_set_mask(mid,av), &
    1012                                  (/ id_dim_xu_mask(mid,av) /),     &
    1013                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,1), &
    1014                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1015              CALL netcdf_create_var( id_set_mask(mid,av), &
    1016                                  (/ id_dim_y_mask(mid,av) /),     &
    1017                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,1), &
    1018                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1019              CALL netcdf_create_var( id_set_mask(mid,av), &
    1020                                  (/ id_dim_x_mask(mid,av) /),     &
    1021                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,2), &
    1022                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1023              CALL netcdf_create_var( id_set_mask(mid,av), &
    1024                                  (/ id_dim_yv_mask(mid,av) /),     &
    1025                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,2), &
    1026                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1027           ELSE
    1028              CALL netcdf_create_var( id_set_mask(mid,av), &
    1029                                  (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
    1030                                  'E_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,0),   &
    1031                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1032              CALL netcdf_create_var( id_set_mask(mid,av), &
    1033                                  (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
    1034                                  'N_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,0),   &
    1035                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1036              CALL netcdf_create_var( id_set_mask(mid,av), &
    1037                                  (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
    1038                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,1),  &
    1039                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1040              CALL netcdf_create_var( id_set_mask(mid,av), &
    1041                                  (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
    1042                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,1),  &
    1043                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1044              CALL netcdf_create_var( id_set_mask(mid,av), &
    1045                                  (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
    1046                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,2),  &
    1047                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1048              CALL netcdf_create_var( id_set_mask(mid,av), &
    1049                                  (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
    1050                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,2),  &
    1051                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1052           ENDIF
    1053 !
    1054 !--       Define geographic coordinates
    1055           CALL netcdf_create_var( id_set_mask(mid,av), &
    1056                               (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
    1057                               'lon', NF90_DOUBLE, id_var_lon_mask(mid,av,0),      &
    1058                               'degrees_east', 'longitude', 000, 000, 000 )
    1059           CALL netcdf_create_var( id_set_mask(mid,av), &
    1060                               (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), &
    1061                               'lat', NF90_DOUBLE, id_var_lat_mask(mid,av,0),      &
    1062                               'degrees_north', 'latitude', 000, 000, 000 )
    1063           CALL netcdf_create_var( id_set_mask(mid,av), &
    1064                               (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
    1065                               'lonu', NF90_DOUBLE, id_var_lon_mask(mid,av,1),     &
    1066                               'degrees_east', 'longitude', 000, 000, 000 )
    1067           CALL netcdf_create_var( id_set_mask(mid,av), &
    1068                               (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),&
    1069                               'latu', NF90_DOUBLE, id_var_lat_mask(mid,av,1),     &
    1070                               'degrees_north', 'latitude', 000, 000, 000 )
    1071           CALL netcdf_create_var( id_set_mask(mid,av), &
    1072                               (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
    1073                               'lonv', NF90_DOUBLE, id_var_lon_mask(mid,av,2),     &
    1074                               'degrees_east', 'longitude', 000, 000, 000 )
    1075           CALL netcdf_create_var( id_set_mask(mid,av), &
    1076                               (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),&
    1077                               'latv', NF90_DOUBLE, id_var_lat_mask(mid,av,2),     &
    1078                               'degrees_north', 'latitude', 000, 000, 000 )
     1007!--       Define UTM and geographic coordinates
     1008          CALL define_geo_coordinates( id_set_mask(mid,av),               &
     1009                  (/ id_dim_x_mask(mid,av), id_dim_xu_mask(mid,av) /),    &
     1010                  (/ id_dim_y_mask(mid,av), id_dim_yv_mask(mid,av) /),    &
     1011                  id_var_eutm_mask(mid,av,:), id_var_nutm_mask(mid,av,:), &
     1012                  id_var_lat_mask(mid,av,:), id_var_lon_mask(mid,av,:)    )
    10791013!
    10801014!--       Define coordinate-reference system
     
    17481682!
    17491683!--       Define some global attributes of the dataset
    1750           CALL netcdf_create_global_atts( id_set_3d(av), 62 )
    1751 
    17521684          IF ( av == 0 )  THEN
     1685             CALL netcdf_create_global_atts( id_set_3d(av), '3d', TRIM( run_description_header ), 62 )
    17531686             time_average_text = ' '
    17541687          ELSE
    1755              WRITE (time_average_text, '('', '',F7.1,'' s average'')') &
    1756                                                             averaging_interval
    1757           ENDIF
    1758           nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'title', &
    1759                                   TRIM( run_description_header ) //    &
    1760                                   TRIM( time_average_text ) )
    1761           CALL netcdf_handle_error( 'netcdf_define_header', 63 )
    1762           IF ( av == 1 )  THEN
     1688             CALL netcdf_create_global_atts( id_set_3d(av), '3d_av', TRIM( run_description_header ), 62 )
    17631689             WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
    1764              nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg', &
     1690             nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg',   &
    17651691                                     TRIM( time_average_text ) )
    17661692             CALL netcdf_handle_error( 'netcdf_define_header', 63 )
     
    17811707          CALL netcdf_create_var( id_set_3d(av), (/ id_dim_time_3d(av) /),     &
    17821708                                  'time', NF90_DOUBLE, id_var_time_3d(av),     &
    1783                                   'seconds', '', 65, 66, 00 )
     1709                                  'seconds since '//TRIM(init_model%origin_time), 'time', 65, 66, 00 )
     1710          CALL netcdf_create_att( id_set_3d(av), id_var_time_3d(av), 'standard_name', 'time', 000)
     1711          CALL netcdf_create_att( id_set_3d(av), id_var_time_3d(av), 'axis', 'T', 000)
    17841712!
    17851713!--       Define spatial dimensions and coordinates:
     
    18261754                                  362, 363, 000 )
    18271755!
    1828 !--       Define UTM coordinates
    1829           IF ( init_model%rotation_angle == 0.0_wp )  THEN
    1830              CALL netcdf_create_var( id_set_3d(av), &
    1831                                  (/ id_dim_x_3d(av) /),      &
    1832                                  'E_UTM', NF90_DOUBLE, id_var_eutm_3d(av,0),  &
    1833                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1834              CALL netcdf_create_var( id_set_3d(av), &
    1835                                  (/ id_dim_y_3d(av) /),      &
    1836                                  'N_UTM', NF90_DOUBLE, id_var_nutm_3d(av,0),  &
    1837                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1838              CALL netcdf_create_var( id_set_3d(av), &
    1839                                  (/ id_dim_xu_3d(av) /),     &
    1840                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_3d(av,1), &
    1841                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1842              CALL netcdf_create_var( id_set_3d(av), &
    1843                                  (/ id_dim_y_3d(av) /),     &
    1844                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_3d(av,1), &
    1845                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1846              CALL netcdf_create_var( id_set_3d(av), &
    1847                                  (/ id_dim_x_3d(av) /),     &
    1848                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_3d(av,2), &
    1849                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1850              CALL netcdf_create_var( id_set_3d(av), &
    1851                                  (/ id_dim_yv_3d(av) /),     &
    1852                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_3d(av,2), &
    1853                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1854           ELSE
    1855              CALL netcdf_create_var( id_set_3d(av), &
    1856                                  (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
    1857                                  'E_UTM', NF90_DOUBLE, id_var_eutm_3d(av,0),  &
    1858                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1859              CALL netcdf_create_var( id_set_3d(av), &
    1860                                  (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
    1861                                  'N_UTM', NF90_DOUBLE, id_var_nutm_3d(av,0),  &
    1862                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1863              CALL netcdf_create_var( id_set_3d(av), &
    1864                                  (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
    1865                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_3d(av,1), &
    1866                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1867              CALL netcdf_create_var( id_set_3d(av), &
    1868                                  (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
    1869                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_3d(av,1), &
    1870                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1871              CALL netcdf_create_var( id_set_3d(av), &
    1872                                  (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
    1873                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_3d(av,2), &
    1874                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    1875              CALL netcdf_create_var( id_set_3d(av), &
    1876                                  (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
    1877                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_3d(av,2), &
    1878                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    1879           ENDIF
    1880 !
    1881 !--       Define geographic coordinates
    1882           CALL netcdf_create_var( id_set_3d(av), &
    1883                               (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
    1884                               'lon', NF90_DOUBLE, id_var_lon_3d(av,0),  &
    1885                               'degrees_east', 'longitude', 000, 000, 000 )
    1886           CALL netcdf_create_var( id_set_3d(av), &
    1887                               (/ id_dim_x_3d(av), id_dim_y_3d(av) /),      &
    1888                               'lat', NF90_DOUBLE, id_var_lat_3d(av,0),  &
    1889                               'degrees_north', 'latitude', 000, 000, 000 )
    1890           CALL netcdf_create_var( id_set_3d(av), &
    1891                               (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
    1892                               'lonu', NF90_DOUBLE, id_var_lon_3d(av,1), &
    1893                               'degrees_east', 'longitude', 000, 000, 000 )
    1894           CALL netcdf_create_var( id_set_3d(av), &
    1895                               (/ id_dim_xu_3d(av), id_dim_y_3d(av) /),     &
    1896                               'latu', NF90_DOUBLE, id_var_lat_3d(av,1), &
    1897                               'degrees_north', 'latitude', 000, 000, 000 )
    1898           CALL netcdf_create_var( id_set_3d(av), &
    1899                               (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
    1900                               'lonv', NF90_DOUBLE, id_var_lon_3d(av,2), &
    1901                               'degrees_east', 'longitude', 000, 000, 000 )
    1902           CALL netcdf_create_var( id_set_3d(av), &
    1903                               (/ id_dim_x_3d(av), id_dim_yv_3d(av) /),     &
    1904                               'latv', NF90_DOUBLE, id_var_lat_3d(av,2), &
    1905                               'degrees_north', 'latitude', 000, 000, 000 )
     1756!--       Define UTM and geographic coordinates
     1757          CALL define_geo_coordinates( id_set_3d(av),         &
     1758                  (/ id_dim_x_3d(av), id_dim_xu_3d(av) /),    &
     1759                  (/ id_dim_y_3d(av), id_dim_yv_3d(av) /),    &
     1760                  id_var_eutm_3d(av,:), id_var_nutm_3d(av,:), &
     1761                  id_var_lat_3d(av,:), id_var_lon_3d(av,:)    )
    19061762!
    19071763!--       Define coordinate-reference system
     
    26512507
    26522508          CALL netcdf_create_var( id_set_agt, (/ id_dim_time_agt /), 'time',   &
    2653                                   NF90_REAL4, id_var_time_agt, 'seconds', '',  &
     2509                                  NF90_REAL4, id_var_time_agt, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
    26542510                                  332, 333, 000 )
     2511          CALL netcdf_create_att( id_set_agt, id_var_time_agt, 'standard_name', 'time', 000)
     2512          CALL netcdf_create_att( id_set_agt, id_var_time_agt, 'axis', 'T', 000)
    26552513
    26562514          CALL netcdf_create_dim( id_set_agt, 'agent_number',                  &
     
    27622620!
    27632621!--       Define some global attributes of the dataset
    2764           CALL netcdf_create_global_atts( id_set_xy(av), 97 )
    2765 
    27662622          IF ( av == 0 )  THEN
     2623             CALL netcdf_create_global_atts( id_set_xy(av), 'xy', TRIM( run_description_header ), 97 )
    27672624             time_average_text = ' '
    27682625          ELSE
    2769              WRITE (time_average_text, '('', '',F7.1,'' s average'')') &
    2770                                                             averaging_interval
    2771           ENDIF
    2772           nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'title', &
    2773                                   TRIM( run_description_header ) //    &
    2774                                   TRIM( time_average_text ) )
    2775           CALL netcdf_handle_error( 'netcdf_define_header', 98 )
    2776           IF ( av == 1 )  THEN
     2626             CALL netcdf_create_global_atts( id_set_xy(av), 'xy_av', TRIM( run_description_header ), 97 )
    27772627             WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
    2778              nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg', &
     2628             nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg',   &
    27792629                                     TRIM( time_average_text ) )
    27802630             CALL netcdf_handle_error( 'netcdf_define_header', 98 )
     
    27952645          CALL netcdf_create_var( id_set_xy(av), (/ id_dim_time_xy(av) /),     &
    27962646                                  'time', NF90_DOUBLE, id_var_time_xy(av),     &
    2797                                   'seconds', '', 100, 101, 000 )
     2647                                  'seconds since '//TRIM(init_model%origin_time), 'time', 100, 101, 000 )
     2648          CALL netcdf_create_att( id_set_xy(av), id_var_time_xy(av), 'standard_name', 'time', 000)
     2649          CALL netcdf_create_att( id_set_xy(av), id_var_time_xy(av), 'axis', 'T', 000)
    27982650!
    27992651!--       Define the spatial dimensions and coordinates for xy-sections.
     
    28842736                                  365, 366, 000 )
    28852737!
    2886 !--       Define UTM coordinates
    2887           IF ( init_model%rotation_angle == 0.0_wp )  THEN
    2888              CALL netcdf_create_var( id_set_xy(av), &
    2889                                  (/ id_dim_x_xy(av) /),      &
    2890                                  'E_UTM', NF90_DOUBLE, id_var_eutm_xy(av,0),  &
    2891                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    2892              CALL netcdf_create_var( id_set_xy(av), &
    2893                                  (/ id_dim_y_xy(av) /),      &
    2894                                  'N_UTM', NF90_DOUBLE, id_var_nutm_xy(av,0),  &
    2895                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    2896              CALL netcdf_create_var( id_set_xy(av), &
    2897                                  (/ id_dim_xu_xy(av) /),     &
    2898                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_xy(av,1), &
    2899                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    2900              CALL netcdf_create_var( id_set_xy(av), &
    2901                                  (/ id_dim_y_xy(av) /),     &
    2902                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_xy(av,1), &
    2903                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    2904              CALL netcdf_create_var( id_set_xy(av), &
    2905                                  (/ id_dim_x_xy(av) /),     &
    2906                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_xy(av,2), &
    2907                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    2908              CALL netcdf_create_var( id_set_xy(av), &
    2909                                  (/ id_dim_yv_xy(av) /),     &
    2910                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_xy(av,2), &
    2911                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    2912           ELSE
    2913              CALL netcdf_create_var( id_set_xy(av), &
    2914                                  (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
    2915                                  'E_UTM', NF90_DOUBLE, id_var_eutm_xy(av,0),  &
    2916                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    2917              CALL netcdf_create_var( id_set_xy(av), &
    2918                                  (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
    2919                                  'N_UTM', NF90_DOUBLE, id_var_nutm_xy(av,0),  &
    2920                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    2921              CALL netcdf_create_var( id_set_xy(av), &
    2922                                  (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
    2923                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_xy(av,1), &
    2924                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    2925              CALL netcdf_create_var( id_set_xy(av), &
    2926                                  (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
    2927                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_xy(av,1), &
    2928                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    2929              CALL netcdf_create_var( id_set_xy(av), &
    2930                                  (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
    2931                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_xy(av,2), &
    2932                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    2933              CALL netcdf_create_var( id_set_xy(av), &
    2934                                  (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
    2935                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_xy(av,2), &
    2936                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    2937           ENDIF
    2938 !
    2939 !--       Define geographic coordinates
    2940           CALL netcdf_create_var( id_set_xy(av), &
    2941                               (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
    2942                               'lon', NF90_DOUBLE, id_var_lon_xy(av,0),  &
    2943                               'degrees_east', 'longitude', 000, 000, 000 )
    2944           CALL netcdf_create_var( id_set_xy(av), &
    2945                               (/ id_dim_x_xy(av), id_dim_y_xy(av) /),      &
    2946                               'lat', NF90_DOUBLE, id_var_lat_xy(av,0),  &
    2947                               'degrees_north', 'latitude', 000, 000, 000 )
    2948           CALL netcdf_create_var( id_set_xy(av), &
    2949                               (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
    2950                               'lonu', NF90_DOUBLE, id_var_lon_xy(av,1), &
    2951                               'degrees_east', 'longitude', 000, 000, 000 )
    2952           CALL netcdf_create_var( id_set_xy(av), &
    2953                               (/ id_dim_xu_xy(av), id_dim_y_xy(av) /),     &
    2954                               'latu', NF90_DOUBLE, id_var_lat_xy(av,1), &
    2955                               'degrees_north', 'latitude', 000, 000, 000 )
    2956           CALL netcdf_create_var( id_set_xy(av), &
    2957                               (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
    2958                               'lonv', NF90_DOUBLE, id_var_lon_xy(av,2), &
    2959                               'degrees_east', 'longitude', 000, 000, 000 )
    2960           CALL netcdf_create_var( id_set_xy(av), &
    2961                               (/ id_dim_x_xy(av), id_dim_yv_xy(av) /),     &
    2962                               'latv', NF90_DOUBLE, id_var_lat_xy(av,2), &
    2963                               'degrees_north', 'latitude', 000, 000, 000 )
     2738!--       Define UTM and geographic coordinates
     2739          CALL define_geo_coordinates( id_set_xy(av),         &
     2740                  (/ id_dim_x_xy(av), id_dim_xu_xy(av) /),    &
     2741                  (/ id_dim_y_xy(av), id_dim_yv_xy(av) /),    &
     2742                  id_var_eutm_xy(av,:), id_var_nutm_xy(av,:), &
     2743                  id_var_lat_xy(av,:), id_var_lon_xy(av,:)    )
    29642744!
    29652745!--       Define coordinate-reference system
     
    38003580!
    38013581!--       Define some global attributes of the dataset
    3802           CALL netcdf_create_global_atts( id_set_xz(av), 140 )
    3803 
    38043582          IF ( av == 0 )  THEN
     3583             CALL netcdf_create_global_atts( id_set_xz(av), 'xz', TRIM( run_description_header ), 140 )
    38053584             time_average_text = ' '
    38063585          ELSE
    3807              WRITE (time_average_text, '('', '',F7.1,'' s average'')')         &
    3808                                                             averaging_interval
    3809           ENDIF
    3810           nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'title',         &
    3811                                   TRIM( run_description_header )  //           &
    3812                                   TRIM( time_average_text ) )
    3813           CALL netcdf_handle_error( 'netcdf_define_header', 141 )
    3814           IF ( av == 1 )  THEN
     3586             CALL netcdf_create_global_atts( id_set_xz(av), 'xz_av', TRIM( run_description_header ), 140 )
    38153587             WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
    3816              nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg', &
     3588             nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg',   &
    38173589                                     TRIM( time_average_text ) )
    38183590             CALL netcdf_handle_error( 'netcdf_define_header', 141 )
     
    38333605          CALL netcdf_create_var( id_set_xz(av), (/ id_dim_time_xz(av) /),     &
    38343606                                  'time', NF90_DOUBLE, id_var_time_xz(av),     &
    3835                                   'seconds', '', 143, 144, 000 )
     3607                                  'seconds since '//TRIM(init_model%origin_time), 'time', 143, 144, 000 )
     3608          CALL netcdf_create_att( id_set_xz(av), id_var_time_xz(av), 'standard_name', 'time', 000)
     3609          CALL netcdf_create_att( id_set_xz(av), id_var_time_xz(av), 'axis', 'T', 000)
    38363610!
    38373611!--       Define the spatial dimensions and coordinates for xz-sections.
     
    38953669                                  157, 158, 000 )
    38963670!
    3897 !--       Define UTM coordinates
    3898           IF ( init_model%rotation_angle == 0.0_wp )  THEN
    3899              CALL netcdf_create_var( id_set_xz(av), &
    3900                                  (/ id_dim_x_xz(av) /),      &
    3901                                  'E_UTM', NF90_DOUBLE, id_var_eutm_xz(av,0),  &
    3902                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    3903              CALL netcdf_create_var( id_set_xz(av), &
    3904                                  (/ id_dim_y_xz(av) /),      &
    3905                                  'N_UTM', NF90_DOUBLE, id_var_nutm_xz(av,0),  &
    3906                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    3907              CALL netcdf_create_var( id_set_xz(av), &
    3908                                  (/ id_dim_xu_xz(av) /),     &
    3909                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_xz(av,1), &
    3910                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    3911              CALL netcdf_create_var( id_set_xz(av), &
    3912                                  (/ id_dim_y_xz(av) /),     &
    3913                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_xz(av,1), &
    3914                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    3915              CALL netcdf_create_var( id_set_xz(av), &
    3916                                  (/ id_dim_x_xz(av) /),     &
    3917                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_xz(av,2), &
    3918                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    3919              CALL netcdf_create_var( id_set_xz(av), &
    3920                                  (/ id_dim_yv_xz(av) /),     &
    3921                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_xz(av,2), &
    3922                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    3923           ELSE
    3924              CALL netcdf_create_var( id_set_xz(av), &
    3925                                  (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
    3926                                  'E_UTM', NF90_DOUBLE, id_var_eutm_xz(av,0),  &
    3927                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    3928              CALL netcdf_create_var( id_set_xz(av), &
    3929                                  (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
    3930                                  'N_UTM', NF90_DOUBLE, id_var_nutm_xz(av,0),  &
    3931                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    3932              CALL netcdf_create_var( id_set_xz(av), &
    3933                                  (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
    3934                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_xz(av,1), &
    3935                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    3936              CALL netcdf_create_var( id_set_xz(av), &
    3937                                  (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
    3938                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_xz(av,1), &
    3939                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    3940              CALL netcdf_create_var( id_set_xz(av), &
    3941                                  (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
    3942                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_xz(av,2), &
    3943                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    3944              CALL netcdf_create_var( id_set_xz(av), &
    3945                                  (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
    3946                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_xz(av,2), &
    3947                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    3948           ENDIF
    3949 !
    3950 !--       Define geographic coordinates
    3951           CALL netcdf_create_var( id_set_xz(av), &
    3952                               (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
    3953                               'lon', NF90_DOUBLE, id_var_lon_xz(av,0),  &
    3954                               'degrees_east', 'longitude', 000, 000, 000 )
    3955           CALL netcdf_create_var( id_set_xz(av), &
    3956                               (/ id_dim_x_xz(av), id_dim_y_xz(av) /),      &
    3957                               'lat', NF90_DOUBLE, id_var_lat_xz(av,0),  &
    3958                               'degrees_north', 'latitude', 000, 000, 000 )
    3959           CALL netcdf_create_var( id_set_xz(av), &
    3960                               (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
    3961                               'lonu', NF90_DOUBLE, id_var_lon_xz(av,1), &
    3962                               'degrees_east', 'longitude', 000, 000, 000 )
    3963           CALL netcdf_create_var( id_set_xz(av), &
    3964                               (/ id_dim_xu_xz(av), id_dim_y_xz(av) /),     &
    3965                               'latu', NF90_DOUBLE, id_var_lat_xz(av,1), &
    3966                               'degrees_north', 'latitude', 000, 000, 000 )
    3967           CALL netcdf_create_var( id_set_xz(av), &
    3968                               (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
    3969                               'lonv', NF90_DOUBLE, id_var_lon_xz(av,2), &
    3970                               'degrees_east', 'longitude', 000, 000, 000 )
    3971           CALL netcdf_create_var( id_set_xz(av), &
    3972                               (/ id_dim_x_xz(av), id_dim_yv_xz(av) /),     &
    3973                               'latv', NF90_DOUBLE, id_var_lat_xz(av,2), &
    3974                               'degrees_north', 'latitude', 000, 000, 000 )
     3671!--       Define UTM and geographic coordinates
     3672          CALL define_geo_coordinates( id_set_xz(av),         &
     3673                  (/ id_dim_x_xz(av), id_dim_xu_xz(av) /),    &
     3674                  (/ id_dim_y_xz(av), id_dim_yv_xz(av) /),    &
     3675                  id_var_eutm_xz(av,:), id_var_nutm_xz(av,:), &
     3676                  id_var_lat_xz(av,:), id_var_lon_xz(av,:)    )
    39753677!
    39763678!--       Define coordinate-reference system
     
    47374439!
    47384440!--       Define some global attributes of the dataset
    4739           CALL netcdf_create_global_atts( id_set_yz(av), 179 )
    4740 
    47414441          IF ( av == 0 )  THEN
     4442             CALL netcdf_create_global_atts( id_set_yz(av), 'yz', TRIM( run_description_header ), 179 )
    47424443             time_average_text = ' '
    47434444          ELSE
    4744              WRITE (time_average_text, '('', '',F7.1,'' s average'')')         &
    4745                                                             averaging_interval
    4746           ENDIF
    4747           nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'title',         &
    4748                                   TRIM( run_description_header ) //            &
    4749                                   TRIM( time_average_text ) )
    4750           CALL netcdf_handle_error( 'netcdf_define_header', 180 )
    4751           IF ( av == 1 )  THEN
     4445             CALL netcdf_create_global_atts( id_set_yz(av), 'yz_av', TRIM( run_description_header ), 179 )
    47524446             WRITE ( time_average_text,'(F7.1,'' s avg'')' )  averaging_interval
    47534447             nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'time_avg',   &
     
    47704464          CALL netcdf_create_var( id_set_yz(av), (/ id_dim_time_yz(av) /),     &
    47714465                                  'time', NF90_DOUBLE, id_var_time_yz(av),     &
    4772                                   'seconds', '', 182, 183, 000 )
     4466                                  'seconds since '//TRIM(init_model%origin_time), 'time', 182, 183, 000 )
     4467          CALL netcdf_create_att( id_set_yz(av), id_var_time_yz(av), 'standard_name', 'time', 000)
     4468          CALL netcdf_create_att( id_set_yz(av), id_var_time_yz(av), 'axis', 'T', 000)
    47734469!
    47744470!--       Define the spatial dimensions and coordinates for yz-sections.
     
    48334529                                  196, 197, 000 )
    48344530!
    4835 !--       Define UTM coordinates
    4836           IF ( init_model%rotation_angle == 0.0_wp )  THEN
    4837              CALL netcdf_create_var( id_set_yz(av), &
    4838                                  (/ id_dim_x_yz(av) /),      &
    4839                                  'E_UTM', NF90_DOUBLE, id_var_eutm_yz(av,0),  &
    4840                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    4841              CALL netcdf_create_var( id_set_yz(av), &
    4842                                  (/ id_dim_y_yz(av) /),      &
    4843                                  'N_UTM', NF90_DOUBLE, id_var_nutm_yz(av,0),  &
    4844                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    4845              CALL netcdf_create_var( id_set_yz(av), &
    4846                                  (/ id_dim_xu_yz(av) /),     &
    4847                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_yz(av,1), &
    4848                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    4849              CALL netcdf_create_var( id_set_yz(av), &
    4850                                  (/ id_dim_y_yz(av) /),     &
    4851                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_yz(av,1), &
    4852                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    4853              CALL netcdf_create_var( id_set_yz(av), &
    4854                                  (/ id_dim_x_yz(av) /),     &
    4855                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_yz(av,2), &
    4856                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    4857              CALL netcdf_create_var( id_set_yz(av), &
    4858                                  (/ id_dim_yv_yz(av) /),     &
    4859                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_yz(av,2), &
    4860                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    4861           ELSE
    4862              CALL netcdf_create_var( id_set_yz(av), &
    4863                                  (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
    4864                                  'E_UTM', NF90_DOUBLE, id_var_eutm_yz(av,0),  &
    4865                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    4866              CALL netcdf_create_var( id_set_yz(av), &
    4867                                  (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
    4868                                  'N_UTM', NF90_DOUBLE, id_var_nutm_yz(av,0),  &
    4869                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    4870              CALL netcdf_create_var( id_set_yz(av), &
    4871                                  (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
    4872                                  'Eu_UTM', NF90_DOUBLE, id_var_eutm_yz(av,1), &
    4873                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    4874              CALL netcdf_create_var( id_set_yz(av), &
    4875                                  (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
    4876                                  'Nu_UTM', NF90_DOUBLE, id_var_nutm_yz(av,1), &
    4877                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    4878              CALL netcdf_create_var( id_set_yz(av), &
    4879                                  (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
    4880                                  'Ev_UTM', NF90_DOUBLE, id_var_eutm_yz(av,2), &
    4881                                  'm', 'projection_x_coordinate', 000, 000, 000 )
    4882              CALL netcdf_create_var( id_set_yz(av), &
    4883                                  (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
    4884                                  'Nv_UTM', NF90_DOUBLE, id_var_nutm_yz(av,2), &
    4885                                  'm', 'projection_y_coordinate', 000, 000, 000 )
    4886           ENDIF
    4887 !
    4888 !--       Define geographic coordinates
    4889           CALL netcdf_create_var( id_set_yz(av), &
    4890                               (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
    4891                               'lon', NF90_DOUBLE, id_var_lon_yz(av,0),  &
    4892                               'degrees_east', 'longitude', 000, 000, 000 )
    4893           CALL netcdf_create_var( id_set_yz(av), &
    4894                               (/ id_dim_x_yz(av), id_dim_y_yz(av) /),      &
    4895                               'lat', NF90_DOUBLE, id_var_lat_yz(av,0),  &
    4896                               'degrees_north', 'latitude', 000, 000, 000 )
    4897           CALL netcdf_create_var( id_set_yz(av), &
    4898                               (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
    4899                               'lonu', NF90_DOUBLE, id_var_lon_yz(av,1), &
    4900                               'degrees_east', 'longitude', 000, 000, 000 )
    4901           CALL netcdf_create_var( id_set_yz(av), &
    4902                               (/ id_dim_xu_yz(av), id_dim_y_yz(av) /),     &
    4903                               'latu', NF90_DOUBLE, id_var_lat_yz(av,1), &
    4904                               'degrees_north', 'latitude', 000, 000, 000 )
    4905           CALL netcdf_create_var( id_set_yz(av), &
    4906                               (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
    4907                               'lonv', NF90_DOUBLE, id_var_lon_yz(av,2), &
    4908                               'degrees_east', 'longitude', 000, 000, 000 )
    4909           CALL netcdf_create_var( id_set_yz(av), &
    4910                               (/ id_dim_x_yz(av), id_dim_yv_yz(av) /),     &
    4911                               'latv', NF90_DOUBLE, id_var_lat_yz(av,2), &
    4912                               'degrees_north', 'latitude', 000, 000, 000 )
     4531!--       Define UTM and geographic coordinates
     4532          CALL define_geo_coordinates( id_set_yz(av),         &
     4533                  (/ id_dim_x_yz(av), id_dim_xu_yz(av) /),    &
     4534                  (/ id_dim_y_yz(av), id_dim_yv_yz(av) /),    &
     4535                  id_var_eutm_yz(av,:), id_var_nutm_yz(av,:), &
     4536                  id_var_lat_yz(av,:), id_var_lon_yz(av,:)    )
    49134537!
    49144538!--       Define coordinate-reference system
     
    56615285!
    56625286!--       Define some global attributes of the dataset
    5663           CALL netcdf_create_global_atts( id_set_pr, 451 )
    56645287
    56655288          IF ( averaging_interval_pr /= 0.0_wp )  THEN
    5666              WRITE (time_average_text,'('', '',F7.1,'' s average'')')          &
    5667                                                             averaging_interval_pr
    5668              nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title',          &
    5669                                      TRIM( run_description_header ) //         &
    5670                                      TRIM( time_average_text ) )
    5671              CALL netcdf_handle_error( 'netcdf_define_header', 218 )
    5672 
     5289             CALL netcdf_create_global_atts( id_set_pr, 'podsprav', TRIM( run_description_header ), 451 )
    56735290             WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval_pr
    56745291             nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'time_avg',       &
    56755292                                     TRIM( time_average_text ) )
    56765293          ELSE
    5677              nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title',          &
    5678                                      TRIM( run_description_header ) )
     5294             CALL netcdf_create_global_atts( id_set_pr, 'podspr', TRIM( run_description_header ), 451 )
    56795295          ENDIF
    56805296          CALL netcdf_handle_error( 'netcdf_define_header', 219 )
    5681 
    56825297!
    56835298!--       Write number of columns and rows of coordinate systems to be plotted
     
    58315446                                  id_dim_time_pr, 220 )
    58325447          CALL netcdf_create_var( id_set_pr, (/ id_dim_time_pr /), 'time',     &
    5833                                   NF90_DOUBLE, id_var_time_pr, 'seconds', '',  &
     5448                                  NF90_DOUBLE, id_var_time_pr, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
    58345449                                  221, 222, 000 )
     5450          CALL netcdf_create_att( id_set_pr, id_var_time_pr, 'standard_name', 'time', 000)
     5451          CALL netcdf_create_att( id_set_pr, id_var_time_pr, 'axis', 'T', 000)
    58355452!
    58365453!--       Define the variables
     
    60715688!
    60725689!--       Define some global attributes of the dataset
    6073           CALL netcdf_create_global_atts( id_set_ts, 329 )
    6074 
    6075           nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title',             &
    6076                                   TRIM( run_description_header ) )
    6077           CALL netcdf_handle_error( 'netcdf_define_header', 249 )
     5690          CALL netcdf_create_global_atts( id_set_ts, 'podsts', TRIM(run_description_header), 329 )
     5691
     5692          ! nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title',             &
     5693          !                         TRIM( run_description_header ) )
     5694          ! CALL netcdf_handle_error( 'netcdf_define_header', 249 )
    60785695
    60795696!
     
    60825699                                  id_dim_time_ts, 250 )
    60835700          CALL netcdf_create_var( id_set_ts, (/ id_dim_time_ts /), 'time',     &
    6084                                   NF90_DOUBLE, id_var_time_ts, 'seconds', '',  &
     5701                                  NF90_DOUBLE, id_var_time_ts, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
    60855702                                  251, 252, 000 )
     5703          CALL netcdf_create_att( id_set_ts, id_var_time_ts, 'standard_name', 'time', 000)
     5704          CALL netcdf_create_att( id_set_ts, id_var_time_ts, 'axis', 'T', 000)
    60865705!
    60875706!--       Define the variables
     
    62775896                                  id_dim_time_sp, 270 )
    62785897          CALL netcdf_create_var( id_set_sp, (/ id_dim_time_sp /), 'time',     &
    6279                                   NF90_DOUBLE, id_var_time_sp, 'seconds', '',  &
     5898                                  NF90_DOUBLE, id_var_time_sp, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
    62805899                                  271, 272, 000 )
     5900          CALL netcdf_create_att( id_set_sp, id_var_time_sp, 'standard_name', 'time', 000)
     5901          CALL netcdf_create_att( id_set_sp, id_var_time_sp, 'axis', 'T', 000)
    62815902!
    62825903!--       Define the spatial dimensions and coordinates for spectra.
     
    67666387                                  id_dim_time_pts, 397 )
    67676388          CALL netcdf_create_var( id_set_pts, (/ id_dim_time_pts /), 'time',   &
    6768                                   NF90_DOUBLE, id_var_time_pts, 'seconds', '', &
     6389                                  NF90_DOUBLE, id_var_time_pts, 'seconds since '//TRIM(init_model%origin_time), 'time', &
    67696390                                  398, 399, 000 )
     6391          CALL netcdf_create_att( id_set_pts, id_var_time_pts, 'standard_name', 'time', 000)
     6392          CALL netcdf_create_att( id_set_pts, id_var_time_pts, 'axis', 'T', 000)
    67706393!
    67716394!--       Define the variables. If more than one particle group is defined,
     
    69626585                                  id_dim_time_fl, 250 )
    69636586          CALL netcdf_create_var( id_set_fl, (/ id_dim_time_fl /), 'time',     &
    6964                                   NF90_DOUBLE, id_var_time_fl, 'seconds', '',  &
     6587                                  NF90_DOUBLE, id_var_time_fl, 'seconds since '//TRIM(init_model%origin_time), 'time',  &
    69656588                                  251, 252, 000 )
     6589          CALL netcdf_create_att( id_set_fl, id_var_time_fl, 'standard_name', 'time', 000)
     6590          CALL netcdf_create_att( id_set_fl, id_var_time_fl, 'axis', 'T', 000)
    69666591
    69676592          DO l = 1, num_leg
     
    73897014! Description:
    73907015! ------------
     7016!> Write attributes to file.
     7017!------------------------------------------------------------------------------!
     7018 SUBROUTINE netcdf_create_att_string( ncid, varid, name, value, err )
     7019
     7020    IMPLICIT NONE
     7021
     7022    CHARACTER(LEN=*), INTENT(IN) ::  name    !< attribute name
     7023    CHARACTER(LEN=*), INTENT(IN) ::  value   !< attribute value
     7024
     7025    INTEGER, INTENT(IN) ::  err              !< error id
     7026    INTEGER, INTENT(IN) ::  ncid             !< file id
     7027
     7028    INTEGER, INTENT(IN), OPTIONAL ::  varid  !< variable id
     7029
     7030#if defined( __netcdf )
     7031    IF ( PRESENT( varid ) )  THEN
     7032       nc_stat = NF90_PUT_ATT( ncid, varid, TRIM( name ), TRIM( value ) )
     7033    ELSE
     7034       nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( name ), TRIM( value ) )
     7035    ENDIF
     7036    CALL netcdf_handle_error( 'netcdf_create_att_string', err )
     7037#endif
     7038
     7039 END SUBROUTINE netcdf_create_att_string
     7040
     7041
     7042!------------------------------------------------------------------------------!
     7043! Description:
     7044! ------------
    73917045!> Write a set of global attributes to file.
    73927046!------------------------------------------------------------------------------!
    7393  SUBROUTINE netcdf_create_global_atts( ncid, error_no )
     7047 SUBROUTINE netcdf_create_global_atts( ncid, data_content, title, error_no )
     7048
     7049    USE control_parameters,  &
     7050        ONLY:  revision, run_date, run_time, run_zone, runnr, version
     7051       
     7052    USE netcdf_data_input_mod,  &
     7053        ONLY:  input_file_atts
    73947054
    73957055    IMPLICIT NONE
     7056
     7057    CHARACTER(LEN=*), INTENT(IN)  ::  data_content  !< describes the type of data in file
     7058    CHARACTER(LEN=*), INTENT(IN)  ::  title         !< file title
    73967059
    73977060    INTEGER, INTENT(IN)  ::  error_no  !< error number
     
    73997062
    74007063#if defined( __netcdf )
    7401     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions',  &
    7402                             'COARDS' )
     7064    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'title', TRIM( title ) )
    74037065    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
    7404     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat',  &
    7405                             init_model%latitude )
     7066    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions', 'CF-1.7' )
    74067067    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
    7407     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon',  &
    7408                             init_model%longitude )
     7068    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'creation_time', TRIM( run_date )//' '//TRIM( run_time )//' '//run_zone(1:3) )
    74097069    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
    7410     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x',  &
    7411                             init_model%origin_x )
     7070    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'data_content', TRIM(data_content) )
    74127071    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
    7413     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y',  &
    7414                             init_model%origin_y )
     7072    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'version', runnr+1 )
    74157073    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
    7416     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z',  &
    7417                             init_model%origin_z )
     7074
     7075    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_time', init_model%origin_time )
    74187076    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
    7419     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle',  &
    7420                             init_model%rotation_angle )
     7077    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat', init_model%latitude )
    74217078    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7079    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon', init_model%longitude )
     7080    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7081    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x', init_model%origin_x )
     7082    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7083    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y', init_model%origin_y )
     7084    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7085    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z', init_model%origin_z )
     7086    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7087    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', init_model%rotation_angle )
     7088    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7089
     7090    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'dependencies', '' )
     7091    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7092    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'history', '' )
     7093    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7094
     7095    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%author_char ), TRIM( input_file_atts%author ) )
     7096    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7097    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%contact_person_char ), TRIM( input_file_atts%contact_person ) )
     7098    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7099    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%institution_char ), TRIM( input_file_atts%institution ) )
     7100    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7101    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%acronym_char ), TRIM( input_file_atts%acronym ) )
     7102    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7103
     7104    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%campaign_char ), TRIM( input_file_atts%campaign ) )
     7105    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7106    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%location_char ), TRIM( input_file_atts%location ) )
     7107    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7108    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%site_char ), TRIM( input_file_atts%site ) )
     7109    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7110
     7111    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'source', TRIM( version )//' '//TRIM( revision ) )
     7112    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7113    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%references_char ), TRIM( input_file_atts%references ) )
     7114    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7115    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%keywords_char ), TRIM( input_file_atts%keywords ) )
     7116    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7117    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%licence_char ), TRIM( input_file_atts%licence ) )
     7118    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7119    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%comment_char ), TRIM( input_file_atts%comment ) )
     7120    CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no )
     7121
    74227122#endif
    74237123
     
    74937193
    74947194#endif
    7495 END SUBROUTINE netcdf_create_crs
     7195 END SUBROUTINE netcdf_create_crs
     7196
     7197
     7198!------------------------------------------------------------------------------!
     7199! Description:
     7200! ------------
     7201!> Define UTM coordinates and longitude and latitude in file.
     7202!------------------------------------------------------------------------------!
     7203 SUBROUTINE define_geo_coordinates( id_set, id_dim_x, id_dim_y, id_var_eutm, id_var_nutm, id_var_lat, id_var_lon )
     7204
     7205    IMPLICIT NONE
     7206
     7207    INTEGER ::  i                    !< loop index
     7208    INTEGER, INTENT(IN)  ::  id_set  !< file id
     7209
     7210    INTEGER(iwp), DIMENSION(0:1), INTENT(IN) ::  id_dim_x  !< dimension id of x and xu
     7211    INTEGER(iwp), DIMENSION(0:1), INTENT(IN) ::  id_dim_y  !< dimension id of y and yv
     7212
     7213    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_eutm  !< variable id for E_UTM coordinates
     7214    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_lat   !< variable id for latitude coordinates
     7215    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_lon   !< variable id for longitude coordinates
     7216    INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) ::  id_var_nutm  !< variable id for N_UTM coordinates
     7217
     7218#if defined( __netcdf )
     7219
     7220!
     7221!-- Define UTM coordinates
     7222    IF ( init_model%rotation_angle == 0.0_wp )  THEN
     7223       CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 )
     7224       CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 )
     7225       CALL netcdf_create_var( id_set, (/ id_dim_x(1) /), 'Eu_UTM', NF90_DOUBLE, id_var_eutm(1), 'm', 'easting', 000, 000, 000 )
     7226       CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'Nu_UTM', NF90_DOUBLE, id_var_nutm(1), 'm', 'northing', 000, 000, 000 )
     7227       CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'Ev_UTM', NF90_DOUBLE, id_var_eutm(2), 'm', 'easting', 000, 000, 000 )
     7228       CALL netcdf_create_var( id_set, (/ id_dim_y(1) /), 'Nv_UTM', NF90_DOUBLE, id_var_nutm(2), 'm', 'northing', 000, 000, 000 )
     7229    ELSE
     7230       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), &
     7231                               'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 )
     7232       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), &
     7233                               'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 )
     7234       CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), &
     7235                               'Eu_UTM', NF90_DOUBLE, id_var_eutm(1), 'm', 'easting', 000, 000, 000 )
     7236       CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), &
     7237                               'Nu_UTM', NF90_DOUBLE, id_var_nutm(1), 'm', 'northing', 000, 000, 000 )
     7238       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), &
     7239                               'Ev_UTM', NF90_DOUBLE, id_var_eutm(2), 'm', 'easting', 000, 000, 000 )
     7240       CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), &
     7241                               'Nv_UTM', NF90_DOUBLE, id_var_nutm(2), 'm', 'northing', 000, 000, 000 )
     7242    ENDIF
     7243!
     7244!-- Define geographic coordinates
     7245    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), 'lon', NF90_DOUBLE, id_var_lon(0), &
     7246                            'degrees_east', 'longitude', 000, 000, 000 )
     7247    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), 'lat', NF90_DOUBLE, id_var_lat(0), &
     7248                            'degrees_north', 'latitude', 000, 000, 000 )
     7249    CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), 'lonu', NF90_DOUBLE, id_var_lon(1), &
     7250                            'degrees_east', 'longitude', 000, 000, 000 )
     7251    CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), 'latu', NF90_DOUBLE, id_var_lat(1), &
     7252                            'degrees_north', 'latitude', 000, 000, 000 )
     7253    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), 'lonv', NF90_DOUBLE, id_var_lon(2), &
     7254                            'degrees_east', 'longitude', 000, 000, 000 )
     7255    CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), 'latv', NF90_DOUBLE, id_var_lat(2), &
     7256                            'degrees_north', 'latitude', 000, 000, 000 )
     7257
     7258    DO  i = 0, 2
     7259       CALL netcdf_create_att( id_set, id_var_eutm(i), 'standard_name', 'projection_x_coordinate', 000)
     7260       CALL netcdf_create_att( id_set, id_var_nutm(i), 'standard_name', 'projection_y_coordinate', 000)
     7261
     7262       CALL netcdf_create_att( id_set, id_var_lat(i), 'standard_name', 'latitude', 000)
     7263       CALL netcdf_create_att( id_set, id_var_lon(i), 'standard_name', 'longitude', 000)
     7264    ENDDO
     7265
     7266#endif
     7267 END SUBROUTINE define_geo_coordinates
    74967268
    74977269
Note: See TracChangeset for help on using the changeset viewer.