Changeset 3041 for palm/trunk


Ignore:
Timestamp:
May 25, 2018 10:39:54 AM (6 years ago)
Author:
gronemeier
Message:

Add read of global attributes of static driver

File:
1 edited

Legend:

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

    r3037 r3041  
    2020! Current revisions:
    2121! -----------------
    22 ! 
    23 ! 
     22!
     23!
    2424! Former revisions:
    2525! -----------------
    2626! $Id$
     27! Add data type for global file attributes
     28! Add read of global attributes of static driver
     29!
     30! 3037 2018-05-24 10:39:29Z gronemeier
    2731! renamed 'depth' to 'zsoil'
    2832!
     
    220224
    221225    TYPE init_type
     226
     227       CHARACTER(LEN=23) ::  origin_time !< reference time of input data
    222228
    223229       INTEGER(iwp) ::  lod_msoil !< level of detail - soil moisture
     
    246252       LOGICAL ::  from_file_w      = .FALSE. !< flag indicating whether w is already initialized from file
    247253
    248 
    249254       REAL(wp) ::  fill_msoil       !< fill value for soil moisture
    250255       REAL(wp) ::  fill_pt          !< fill value for pt
     
    256261       REAL(wp) ::  latitude         !< latitude of the southern model boundary
    257262       REAL(wp) ::  longitude        !< longitude of the western model boundary
     263       REAL(wp) ::  origin_x         !< x position of the western model boundary
     264       REAL(wp) ::  origin_y         !< y position of the northern model boundary
     265       REAL(wp) ::  origin_z         !< reference height of input data
     266       REAL(wp) ::  rotation_angle   !< rotation angle of input data
    258267
    259268       REAL(wp), DIMENSION(:), ALLOCATABLE ::  msoil_init   !< initial vertical profile of soil moisture
     
    370379    END TYPE pars
    371380!
     381!-- Define type for global file attributes
     382!-- Please refer to the PALM data standard for a detailed description of each
     383!-- attribute.
     384    TYPE global_atts_type
     385       CHARACTER(LEN=12 ) ::  acronym                            !< acronym of institution
     386       CHARACTER(LEN=7)   ::  acronym_char = 'acronym'           !< name of attribute
     387       CHARACTER(LEN=200) ::  author                             !< first name, last name, email adress
     388       CHARACTER(LEN=6)   ::  author_char = 'author'             !< name of attribute
     389       CHARACTER(LEN=12 ) ::  campaign                           !< name of campaign
     390       CHARACTER(LEN=8)   ::  campaign_char = 'campaign'         !< name of attribute
     391       CHARACTER(LEN=200) ::  comment                            !< comment to data
     392       CHARACTER(LEN=7)   ::  comment_char = 'comment'           !< name of attribute
     393       CHARACTER(LEN=200) ::  contact_person                     !< first name, last name, email adress
     394       CHARACTER(LEN=14)  ::  contact_person_char = 'contact_person'  !< name of attribute
     395       CHARACTER(LEN=200) ::  conventions = 'CF-1.7'             !< netCDF convention
     396       CHARACTER(LEN=11)  ::  conventions_char = 'Conventions'   !< name of attribute
     397       CHARACTER(LEN=23 ) ::  creation_time                      !< creation time of data set
     398       CHARACTER(LEN=13)  ::  creation_time_char = 'creation_time'  !< name of attribute
     399       CHARACTER(LEN=16 ) ::  data_content                       !< content of data set
     400       CHARACTER(LEN=12)  ::  data_content_char = 'data_content' !< name of attribute
     401       CHARACTER(LEN=200) ::  dependencies                       !< dependencies of data set
     402       CHARACTER(LEN=12)  ::  dependencies_char = 'dependencies' !< name of attribute
     403       CHARACTER(LEN=200) ::  history                            !< information about data processing
     404       CHARACTER(LEN=7)   ::  history_char = 'history'           !< name of attribute
     405       CHARACTER(LEN=200) ::  institution                        !< name of responsible institution
     406       CHARACTER(LEN=11)  ::  institution_char = 'institution'   !< name of attribute
     407       CHARACTER(LEN=200) ::  keywords                           !< keywords of data set
     408       CHARACTER(LEN=8)   ::  keywords_char = 'keywords'         !< name of attribute
     409       CHARACTER(LEN=200) ::  license                            !< license of data set
     410       CHARACTER(LEN=7)   ::  license_char = 'license'           !< name of attribute
     411       CHARACTER(LEN=200) ::  location                           !< place which refers to data set
     412       CHARACTER(LEN=8)   ::  location_char = 'location'         !< name of attribute
     413       CHARACTER(LEN=10)  ::  origin_lat_char = 'origin_lat'     !< name of attribute
     414       CHARACTER(LEN=10)  ::  origin_lon_char = 'origin_lon'     !< name of attribute
     415       CHARACTER(LEN=23 ) ::  origin_time                        !< reference time
     416       CHARACTER(LEN=11)  ::  origin_time_char = 'origin_time'   !< name of attribute
     417       CHARACTER(LEN=8)   ::  origin_x_char = 'origin_x'         !< name of attribute
     418       CHARACTER(LEN=8)   ::  origin_y_char = 'origin_y'         !< name of attribute
     419       CHARACTER(LEN=8)   ::  origin_z_char = 'origin_z'         !< name of attribute
     420       CHARACTER(LEN=12)  ::  palm_version_char = 'palm_version' !< name of attribute
     421       CHARACTER(LEN=200) ::  references                         !< literature referring to data set
     422       CHARACTER(LEN=10)  ::  references_char = 'references'     !< name of attribute
     423       CHARACTER(LEN=14)  ::  rotation_angle_char = 'rotation_angle'  !< name of attribute
     424       CHARACTER(LEN=12 ) ::  site                               !< name of model domain
     425       CHARACTER(LEN=4)   ::  site_char = 'site'                 !< name of attribute
     426       CHARACTER(LEN=200) ::  source                             !< source of data set
     427       CHARACTER(LEN=6)   ::  source_char = 'source'             !< name of attribute
     428       CHARACTER(LEN=200) ::  title                              !< title of data set
     429       CHARACTER(LEN=5)   ::  title_char = 'title'               !< name of attribute
     430       CHARACTER(LEN=7)   ::  version_char = 'version'           !< name of attribute
     431
     432       INTEGER(iwp) ::  version              !< version of data set
     433
     434       REAL(wp) ::  origin_lat               !< latitude of lower left corner
     435       REAL(wp) ::  origin_lon               !< longitude of lower left corner
     436       REAL(wp) ::  origin_x                 !< easting (UTM coordinate) of lower left corner
     437       REAL(wp) ::  origin_y                 !< northing (UTM coordinate) of lower left corner
     438       REAL(wp) ::  origin_z                 !< reference height
     439       REAL(wp) ::  palm_version             !< PALM version of data set
     440       REAL(wp) ::  rotation_angle           !< rotation angle of coordinate system of data set
     441    END TYPE global_atts_type
     442!
    372443!-- Define variables
    373444    TYPE(dims_xy)    ::  dim_static  !< data structure for x, y-dimension in static input file
     
    421492    CHARACTER(LEN=3)  ::  char_lod  = 'lod'         !< name of level-of-detail attribute in NetCDF file
    422493
    423     CHARACTER(LEN=10) ::  char_fill = '_FillValue'  !< name of fill value attribute in NetCDF file
    424     CHARACTER(LEN=10) ::  char_lon  = 'origin_lon'  !< name of global attribute for longitude in NetCDF file
    425     CHARACTER(LEN=10) ::  char_lat  = 'origin_lat'  !< name of global attribute for latitude in NetCDF file
     494    CHARACTER(LEN=10) ::  char_fill = '_FillValue'        !< name of fill value attribute in NetCDF file
    426495
    427496    CHARACTER(LEN=100) ::  input_file_static  = 'PIDS_STATIC'  !< Name of file which comprises static input data
     
    434503
    435504    LOGICAL ::  collective_read = .FALSE.      !< Enable NetCDF collective read
     505
     506    TYPE(global_atts_type) ::  input_file_atts !< global attributes of input file
    436507
    437508    SAVE
     
    578649                                  TRIM( coupling_char ), id_mod )
    579650!
    580 !--          Read global attribute for latitude and longitude
    581              CALL get_attribute( id_mod, char_lat,                             &
    582                                  init_model%latitude, .TRUE. )
    583 
    584              CALL get_attribute( id_mod, char_lon,                             &
    585                                  init_model%longitude, .TRUE. )
     651!--          Read global attributes
     652             CALL get_attribute( id_mod, input_file_atts%origin_lat_char,      &
     653                                 input_file_atts%origin_lat, .TRUE. )
     654
     655             CALL get_attribute( id_mod, input_file_atts%origin_lon_char,      &
     656                                 input_file_atts%origin_lon, .TRUE. )
     657
     658             CALL get_attribute( id_mod, input_file_atts%origin_time_char,     &
     659                                 input_file_atts%origin_time, .TRUE. )
     660
     661             CALL get_attribute( id_mod, input_file_atts%origin_x_char,        &
     662                                 input_file_atts%origin_x, .TRUE. )
     663
     664             CALL get_attribute( id_mod, input_file_atts%origin_y_char,        &
     665                                 input_file_atts%origin_y, .TRUE. )
     666
     667             CALL get_attribute( id_mod, input_file_atts%origin_z_char,        &
     668                                 input_file_atts%origin_z, .TRUE. )
     669
     670             CALL get_attribute( id_mod, input_file_atts%rotation_angle_char,  &
     671                                 input_file_atts%rotation_angle, .TRUE. )
     672
    586673!
    587674!--          Finally, close input file
    588675             CALL close_input_file( id_mod )
     676!
     677!--          Copy lon/lat values
     678             init_model%latitude = input_file_atts%origin_lat
     679             init_model%longitude = input_file_atts%origin_lon
    589680#endif
    590681          ENDIF
Note: See TracChangeset for help on using the changeset viewer.