Changeset 4577 for palm/trunk/SOURCE/data_output_binary_module.f90
- Timestamp:
- Jun 25, 2020 9:53:58 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/data_output_binary_module.f90
r4559 r4577 24 24 ! ----------------- 25 25 ! $Id$ 26 ! further re-formatting to follow the PALM coding standard 27 ! 28 ! 4559 2020-06-11 08:51:48Z raasch 26 29 ! file re-formatted to follow the PALM coding standard 27 30 ! … … 64 67 65 68 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 72 72 73 73 INTEGER, PARAMETER :: charlen = 100 !< maximum length of character variables 74 74 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 79 77 CHARACTER(LEN=800) :: temp_string !< dummy string 80 78 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 83 80 INTEGER :: config_file_unit !< unit number of config file 84 81 INTEGER :: debug_output_unit !< Fortran Unit Number of the debug-output file 85 82 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 88 84 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 91 86 92 87 INTEGER, DIMENSION(:), ALLOCATABLE :: files_highest_variable_id !< highest assigned ID of … … 194 189 SUBROUTINE binary_open_file( mode, file_name, file_id, return_value ) 195 190 191 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_open_file' !< name of this routine 192 196 193 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 199 195 200 196 CHARACTER(LEN=charlen), INTENT(IN) :: file_name !< name of file 201 197 CHARACTER(LEN=*), INTENT(IN) :: mode !< operation mode 202 203 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_open_file' !< name of this routine204 198 205 199 INTEGER :: my_rank !< MPI rank of local processor … … 256 250 ENDIF 257 251 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 ) 260 254 261 255 IF ( return_value == 0 ) THEN … … 290 284 ! 291 285 !-- Remove any pre-existing file 292 INQUIRE( FILE = TRIM( bin_filename ), EXIST =file_exists )286 INQUIRE( FILE=TRIM( bin_filename ), EXIST=file_exists ) 293 287 294 288 IF ( file_exists ) THEN … … 304 298 !-- Open binary file 305 299 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 ) 308 302 309 303 IF ( return_value == 0 ) THEN … … 355 349 return_value ) 356 350 351 352 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_write_attribute' !< name of this routine 353 357 354 CHARACTER(LEN=charlen) :: attribute_type !< data type of attribute 358 355 CHARACTER(LEN=charlen) :: output_string !< output string … … 361 358 CHARACTER(LEN=charlen), INTENT(IN), OPTIONAL :: value_char !< value of attribute 362 359 363 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_write_attribute' !< name of this routine364 360 365 361 INTEGER, INTENT(IN) :: file_id !< file ID … … 429 425 dimension_type, dimension_length, return_value ) 430 426 427 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_init_dimension' !< name of this routine 428 431 429 CHARACTER(LEN=charlen) :: output_string !< output string 432 430 … … 434 432 CHARACTER(LEN=charlen), INTENT(IN) :: dimension_type !< data type of dimension 435 433 CHARACTER(LEN=*), INTENT(IN) :: mode !< operation mode 436 437 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_init_dimension' !< name of this routine438 434 439 435 INTEGER, INTENT(IN) :: dimension_length !< length of dimension … … 481 477 SUBROUTINE binary_init_variable( mode, file_id, variable_id, variable_name, variable_type, & 482 478 dimension_ids, is_global, return_value ) 479 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_init_variable' !< name of this routine 483 480 484 481 CHARACTER(LEN=charlen) :: output_string !< output string … … 487 484 CHARACTER(LEN=charlen), INTENT(IN) :: variable_type !< data type of variable 488 485 489 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_init_variable' !< name of this routine490 491 486 INTEGER, INTENT(IN) :: file_id !< file ID 487 INTEGER, INTENT(OUT) :: return_value !< return value 492 488 INTEGER, INTENT(OUT) :: variable_id !< variable ID 493 INTEGER, INTENT(OUT) :: return_value !< return value494 489 495 490 INTEGER, DIMENSION(:), INTENT(IN) :: dimension_ids !< list of dimension IDs used by variable … … 530 525 SUBROUTINE binary_stop_file_header_definition( file_id, return_value ) 531 526 527 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_stop_file_header_definition' !< name of this routine 528 532 529 CHARACTER(LEN=charlen) :: output_string !< output string 533 534 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_stop_file_header_definition' !< name of535 !< this routine536 530 537 531 INTEGER, INTENT(IN) :: file_id !< file ID … … 568 562 return_value ) 569 563 564 565 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_write_variable' !< name of this routine 566 570 567 CHARACTER(LEN=charlen) :: output_string !< output string 571 572 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_write_variable' !< name of this routine573 568 574 569 CHARACTER(LEN=1), POINTER, INTENT(IN), OPTIONAL :: values_char_0d !< output variable … … 790 785 SUBROUTINE binary_finalize( file_id, return_value ) 791 786 787 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_finalize' !< name of this routine 788 792 789 CHARACTER(LEN=charlen) :: output_string !< output string 793 794 CHARACTER(LEN=*), PARAMETER :: routine_name = 'binary_finalize' !< name of this routine795 790 796 791 INTEGER, INTENT(IN) :: file_id !< file ID
Note: See TracChangeset
for help on using the changeset viewer.