Ignore:
Timestamp:
Jun 25, 2020 9:53:58 AM (4 years ago)
Author:
raasch
Message:

further re-formatting to follow the PALM coding standard

File:
1 edited

Legend:

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

    r4559 r4577  
    2424! -----------------
    2525! $Id$
     26! further re-formatting to follow the PALM coding standard
     27!
     28! 4559 2020-06-11 08:51:48Z raasch
    2629! file re-formatted to follow the PALM coding standard
    2730!
     
    6467
    6568
    66     CHARACTER(LEN=*), PARAMETER ::  config_file_name = 'BINARY_TO_NETCDF_CONFIG'  !< name of config
    67                                                                                   !< file
    68     CHARACTER(LEN=*), PARAMETER ::  file_prefix = 'BIN_'                          !< file prefix for
    69                                                                                   !< binary files
    70     CHARACTER(LEN=*), PARAMETER ::  mode_binary = 'binary'                        !< string to
    71                                                                                   !< select operation mode of module
     69    CHARACTER(LEN=*), PARAMETER ::  config_file_name = 'BINARY_TO_NETCDF_CONFIG'  !< name of config file
     70    CHARACTER(LEN=*), PARAMETER ::  file_prefix = 'BIN_'                          !< file prefix for binary files
     71    CHARACTER(LEN=*), PARAMETER ::  mode_binary = 'binary'                        !< string to select operation mode of module
    7272
    7373    INTEGER, PARAMETER ::  charlen = 100  !< maximum length of character variables
    7474
    75     CHARACTER(LEN=charlen)      ::  file_suffix = ''             !< file suffix added to each file
    76                                                                  !< name
    77     CHARACTER(LEN=800)          ::  internal_error_message = ''  !< string containing the last error
    78                                                                  !< message
     75    CHARACTER(LEN=charlen)      ::  file_suffix = ''             !< file suffix added to each file name
     76    CHARACTER(LEN=800)          ::  internal_error_message = ''  !< string containing the last error message
    7977    CHARACTER(LEN=800)          ::  temp_string                  !< dummy string
    8078
    81     INTEGER ::  binary_file_lowest_unit = 1000  !< lowest unit number of all binary files created by
    82                                                 !< this module
     79    INTEGER ::  binary_file_lowest_unit = 1000  !< lowest unit number of all binary files created by this module
    8380    INTEGER ::  config_file_unit                !< unit number of config file
    8481    INTEGER ::  debug_output_unit               !< Fortran Unit Number of the debug-output file
    8582    INTEGER ::  global_id_in_file = -1          !< value of global ID within a file
    86     INTEGER ::  master_rank                     !< master rank for tasks to be executed by single PE
    87                                                 !< only
     83    INTEGER ::  master_rank                     !< master rank for tasks to be executed by single PE only
    8884    INTEGER ::  next_available_unit             !< next unit number available for new file
    89     INTEGER ::  output_group_comm               !< MPI communicator addressing all MPI ranks which
    90                                                 !< participate in output
     85    INTEGER ::  output_group_comm               !< MPI communicator addressing all MPI ranks which participate in output
    9186
    9287    INTEGER, DIMENSION(:), ALLOCATABLE ::  files_highest_variable_id  !< highest assigned ID of
     
    194189 SUBROUTINE binary_open_file( mode, file_name, file_id, return_value )
    195190
     191    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_open_file'  !< name of this routine
     192
    196193    CHARACTER(LEN=charlen)             ::  bin_filename = ''  !< actual name of binary file
    197     CHARACTER(LEN=7)                   ::  my_rank_char       !< string containing value of my_rank
    198                                                               !< with leading zeros
     194    CHARACTER(LEN=7)                   ::  my_rank_char       !< string containing value of my_rank with leading zeros
    199195
    200196    CHARACTER(LEN=charlen), INTENT(IN) ::  file_name          !< name of file
    201197    CHARACTER(LEN=*),       INTENT(IN) ::  mode               !< operation mode
    202 
    203     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_open_file'  !< name of this routine
    204198
    205199    INTEGER              ::  my_rank       !< MPI rank of local processor
     
    256250          ENDIF
    257251
    258           OPEN( config_file_unit, FILE = TRIM( config_file_name ) // TRIM( file_suffix ),          &
    259                 FORM = 'UNFORMATTED', STATUS = 'NEW', IOSTAT=return_value )
     252          OPEN( config_file_unit, FILE=TRIM( config_file_name ) // TRIM( file_suffix ),          &
     253                FORM='UNFORMATTED', STATUS='NEW', IOSTAT=return_value )
    260254
    261255          IF ( return_value == 0 )  THEN
     
    290284!
    291285!--    Remove any pre-existing file
    292        INQUIRE( FILE = TRIM( bin_filename ), EXIST = file_exists )
     286       INQUIRE( FILE=TRIM( bin_filename ), EXIST=file_exists )
    293287
    294288       IF ( file_exists )  THEN
     
    304298!--    Open binary file
    305299       CALL internal_message( 'debug', routine_name // ': open file ' // TRIM( bin_filename ) )
    306        OPEN ( next_available_unit, FILE = TRIM( bin_filename ), FORM = 'UNFORMATTED',              &
    307               STATUS = 'NEW', IOSTAT = return_value )
     300       OPEN ( next_available_unit, FILE=TRIM( bin_filename ), FORM='UNFORMATTED', STATUS='NEW',    &
     301              IOSTAT=return_value )
    308302
    309303       IF ( return_value == 0 )  THEN
     
    355349                                    return_value )
    356350
     351
     352    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_write_attribute'  !< name of this routine
     353
    357354    CHARACTER(LEN=charlen)                       ::  attribute_type        !< data type of attribute
    358355    CHARACTER(LEN=charlen)                       ::  output_string         !< output string
     
    361358    CHARACTER(LEN=charlen), INTENT(IN), OPTIONAL ::  value_char            !< value of attribute
    362359
    363     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_write_attribute'  !< name of this routine
    364360
    365361    INTEGER, INTENT(IN)  ::  file_id       !< file ID
     
    429425                                   dimension_type, dimension_length, return_value )
    430426
     427    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_init_dimension'  !< name of this routine
     428
    431429    CHARACTER(LEN=charlen)             ::  output_string   !< output string
    432430
     
    434432    CHARACTER(LEN=charlen), INTENT(IN) ::  dimension_type  !< data type of dimension
    435433    CHARACTER(LEN=*),       INTENT(IN) ::  mode            !< operation mode
    436 
    437     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_init_dimension'  !< name of this routine
    438434
    439435    INTEGER, INTENT(IN)  ::  dimension_length  !< length of dimension
     
    481477 SUBROUTINE binary_init_variable( mode, file_id, variable_id, variable_name, variable_type,        &
    482478                                  dimension_ids, is_global, return_value )
     479    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_init_variable'  !< name of this routine
    483480
    484481    CHARACTER(LEN=charlen)             ::  output_string   !< output string
     
    487484    CHARACTER(LEN=charlen), INTENT(IN) ::  variable_type   !< data type of variable
    488485
    489     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_init_variable'  !< name of this routine
    490 
    491486    INTEGER, INTENT(IN)  ::  file_id       !< file ID
     487    INTEGER, INTENT(OUT) ::  return_value  !< return value
    492488    INTEGER, INTENT(OUT) ::  variable_id   !< variable ID
    493     INTEGER, INTENT(OUT) ::  return_value  !< return value
    494489
    495490    INTEGER, DIMENSION(:), INTENT(IN) ::  dimension_ids  !< list of dimension IDs used by variable
     
    530525 SUBROUTINE binary_stop_file_header_definition( file_id, return_value )
    531526
     527    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_stop_file_header_definition'  !< name of this routine
     528
    532529    CHARACTER(LEN=charlen) ::  output_string  !< output string
    533 
    534     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_stop_file_header_definition'  !< name of
    535                                                                                          !< this routine
    536530
    537531    INTEGER, INTENT(IN)  ::  file_id       !< file ID
     
    568562                           return_value )
    569563
     564
     565    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_write_variable'  !< name of this routine
     566
    570567    CHARACTER(LEN=charlen) ::  output_string  !< output string
    571 
    572     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_write_variable'  !< name of this routine
    573568
    574569    CHARACTER(LEN=1), POINTER,             INTENT(IN), OPTIONAL                   ::  values_char_0d  !< output variable
     
    790785 SUBROUTINE binary_finalize( file_id, return_value )
    791786
     787    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_finalize'  !< name of this routine
     788
    792789    CHARACTER(LEN=charlen) ::  output_string  !< output string
    793 
    794     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_finalize'  !< name of this routine
    795790
    796791    INTEGER, INTENT(IN)  ::  file_id       !< file ID
Note: See TracChangeset for help on using the changeset viewer.