Ignore:
Timestamp:
Jun 25, 2020 3:43:32 PM (4 years ago)
Author:
gronemeier
Message:

message.f90:

  • bugfix : do not save input values from last call of routines debug_message and location_message
  • changes: layout changes according to PALM coding standards

time_integration.f90:

  • bugfix: removed unused variables
File:
1 edited

Legend:

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

    r4536 r4578  
    2020! Current revisions:
    2121! -----------------
    22 ! 
    23 ! 
     22!
     23!
    2424! Former revisions:
    2525! -----------------
    2626! $Id$
     27! bugfix : do not save input values from last call of routines debug_message and location_message
     28! changes: layout changes according to PALM coding standards
     29!
     30! 4536 2020-05-17 17:24:13Z raasch
    2731! location message format changed
    28 ! 
     32!
    2933! 4360 2020-01-07 11:25:50Z suehring
    3034! Corrected "Former revisions" section
    31 ! 
     35!
    3236! 4097 2019-07-15 11:59:11Z suehring
    3337! Avoid overlong lines - limit is 132 characters per line
    34 ! 
     38!
    3539! 3987 2019-05-22 09:52:13Z kanani
    3640! Improved formatting of job logfile output,
    3741! changed output of DEBUG file
    38 ! 
     42!
    3943! 3885 2019-04-11 11:29:34Z kanani
    40 ! Changes related to global restructuring of location messages and introduction 
     44! Changes related to global restructuring of location messages and introduction
    4145! of additional debug messages
    42 ! 
     46!
    4347! 3655 2019-01-07 16:51:22Z knoop
    4448! Minor formating changes
     
    6064 SUBROUTINE message( routine_name, message_identifier, requested_action, &
    6165                     message_level, output_on_pe, file_id, flush_file )
    62  
     66
    6367    USE control_parameters,                                                    &
    6468        ONLY:  abort_mode, message_string
     
    121125    header_string_2 = 'ID: ' // message_identifier // &
    122126                      '  generated by routine: ' // TRIM( routine_name )
    123  
     127
    124128    information_string_1 = 'Further information can be found at'
    125129    IF(message_identifier(1:2) == 'NC') THEN
     
    130134                              '/app/errmsg#' // message_identifier
    131135    ENDIF
    132    
     136
    133137
    134138!
     
    173177          WRITE( *, '(20X,A)' )  TRIM( message_string )
    174178          WRITE( *, '(20X,A)' )  ''
    175           WRITE( *, '(20X,A)' )  TRIM( information_string_1 ) 
    176           WRITE( *, '(20X,A)' )  TRIM( information_string_2 ) 
     179          WRITE( *, '(20X,A)' )  TRIM( information_string_1 )
     180          WRITE( *, '(20X,A)' )  TRIM( information_string_2 )
    177181          WRITE( *, '(20X,A)' )  ''
    178182
     
    193197          WRITE( file_id, '(4X,A)' )  TRIM( message_string )
    194198          WRITE( file_id, '(4X,A)' )  ''
    195           WRITE( file_id, '(4X,A)' )  TRIM( information_string_1 ) 
    196           WRITE( file_id, '(4X,A)' )  TRIM( information_string_2 ) 
     199          WRITE( file_id, '(4X,A)' )  TRIM( information_string_1 )
     200          WRITE( file_id, '(4X,A)' )  TRIM( information_string_2 )
    197201          WRITE( file_id, '(4X,A)' )  ''
    198202!
     
    227231!> Prints out the given location on stdout
    228232!--------------------------------------------------------------------------------------------------!
    229  
    230233 SUBROUTINE location_message( location, message_type )
    231 
    232234
    233235    USE, INTRINSIC ::  ISO_FORTRAN_ENV,                                                            &
    234236        ONLY:  OUTPUT_UNIT
    235237
    236     USE pegrid
     238    USE pegrid,                                                                                    &
     239        ONLY:  myid
    237240
    238241    USE pmc_interface,                                                                             &
     
    241244    IMPLICIT NONE
    242245
    243     CHARACTER(LEN=*)  ::  location      !< text to be output on stdout
    244     CHARACTER(LEN=60) ::  location_string = ' '  !<
    245     CHARACTER(LEN=*)  ::  message_type  !< attribute marking 'start' or 'end' of routine
    246     CHARACTER(LEN=11) ::  message_type_string = ' '  !<
    247     CHARACTER(LEN=10) ::  system_time   !< system clock time
    248     CHARACTER(LEN=10) ::  time
     246    CHARACTER(LEN=*)  ::  location             !< text to be output on stdout
     247    CHARACTER(LEN=60) ::  location_trimmed     !< trimmed text to be output on stdout
     248    CHARACTER(LEN=*)  ::  message_type         !< type of message; supported values: 'start', 'finished'
     249    CHARACTER(LEN=10) ::  message_type_string  !< formatted message-type string for output
     250    CHARACTER(LEN=8)  ::  system_time          !< formatted system clock time
     251    CHARACTER(LEN=10) ::  time                 !< current time of system
     252
    249253!
    250254!-- Output for nested runs only on the root domain
     
    254258!
    255259!--    Get system time for debug info output (helpful to estimate the required computing time for
    256 !--    specific parts of code
     260!--    specific parts of code)
    257261       CALL date_and_time( TIME=time )
    258        system_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
    259 !
    260 !--    Write pre-string depending on message_type
    261        IF ( TRIM( message_type ) == 'start' )     WRITE( message_type_string, * ) '-', TRIM( message_type ), '----'
    262        IF ( TRIM( message_type ) == 'finished' )  WRITE( message_type_string, * ) '-', TRIM( message_type ), '-'
    263 !
    264 !--    Write dummy location_string in order to allow left-alignment of text despite the fixed (=A60)
    265 !--    format.
    266        WRITE( location_string, * )  TRIM( location )
     262       system_time = time(1:2) // ':' // time(3:4) // ':' // time(5:6)
     263!
     264!--    Write message-type string depending on message_type
     265       message_type_string = REPEAT( '-', 10 )
     266       IF ( TRIM( message_type ) == 'start' )                                                      &
     267          message_type_string(2:) = TRIM( message_type ) // '----'
     268       IF ( TRIM( message_type ) == 'finished' )                                                   &
     269          message_type_string(2:) = TRIM( message_type ) // '-'
     270!
     271!--    Trim location text to a maximum of 60 chars
     272!--    Note: if the length is set within the write format, the string is right-aligned; to trim and
     273!--    left-align the output, we need to use this detour
     274       WRITE( location_trimmed, '(A)' )  ADJUSTL( TRIM( location ) )
    267275!
    268276!--    Write and flush debug location or info message to file
    269        WRITE( OUTPUT_UNIT, 200 )  TRIM( system_time ), TRIM( message_type_string ),                &
    270                                   TRIM( location_string )
     277       WRITE( OUTPUT_UNIT, 200 )  system_time, message_type_string, TRIM( location_trimmed )
    271278       FLUSH( OUTPUT_UNIT )
    272279!
    273280!--    Message formats
    274 200    FORMAT ( 3X, A, 3x, A, 2X, A )
     281200    FORMAT ( 3X, A, 3x, A, 3X, A )
    275282
    276283    ENDIF
     
    285292!> for each PE on each domain.
    286293!--------------------------------------------------------------------------------------------------!
    287 
    288294 SUBROUTINE debug_message( debug_string, message_type )
    289 
    290295
    291296    USE control_parameters,                                                                        &
     
    294299    IMPLICIT NONE
    295300
    296 
    297     CHARACTER(LEN=*)   ::  debug_string        !< debug message to be output on unit 9
    298     CHARACTER(LEN=*)   ::  message_type        !< 'start', 'end', 'info'
    299     CHARACTER(LEN=10)  ::  message_type_string = ' '  !<
    300     CHARACTER(LEN=10)  ::  system_time         !< system clock time
    301     CHARACTER(LEN=10)  ::  time
     301    CHARACTER(LEN=*)  ::  debug_string         !< debug message to be output to debug_output_unit
     302    CHARACTER(LEN=*)  ::  message_type         !< type of message; supported values: 'start', 'end', 'info'
     303    CHARACTER(LEN=7)  ::  message_type_string  !< formatted message-type string for output
     304    CHARACTER(LEN=8)  ::  system_time          !< formatted system clock time
     305    CHARACTER(LEN=10) ::  time                 !< current time of system
    302306
    303307    INTEGER, PARAMETER ::  debug_output_unit = 9
     
    305309!
    306310!-- Get system time for debug info output (helpful to estimate the required computing time for
    307 !-- specific parts of code
     311!-- specific parts of code)
    308312    CALL date_and_time( TIME=time )
    309     system_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
    310 !
    311 !-- Write pre-string depending on message_type
    312     IF ( TRIM( message_type ) == 'start' )  WRITE( message_type_string, * ) '-', TRIM( message_type ), '-'
    313     IF ( TRIM( message_type ) == 'end' )    WRITE( message_type_string, * ) '-', TRIM( message_type ), '---'
    314     IF ( TRIM( message_type ) == 'info' )   WRITE( message_type_string, * ) '-', TRIM( message_type ), '--'
     313    system_time = time(1:2) // ':' // time(3:4) // ':' // time(5:6)
     314!
     315!-- Write message-type string depending on message_type
     316    message_type_string = REPEAT( '-', 7 )
     317    IF ( TRIM( message_type ) == 'start' )  message_type_string(2:) = TRIM( message_type ) // '-'
     318    IF ( TRIM( message_type ) == 'end' )    message_type_string(2:) = TRIM( message_type ) // '---'
     319    IF ( TRIM( message_type ) == 'info' )   message_type_string(2:) = TRIM( message_type ) // '--'
    315320!
    316321!-- Write and flush debug location or info message to file
    317     WRITE( debug_output_unit, 201 )    TRIM( system_time ), time_since_reference_point, &
    318                                        TRIM( message_type_string ), TRIM( debug_string )
     322    WRITE( debug_output_unit, 201 )    system_time, time_since_reference_point, &
     323                                       message_type_string, TRIM( debug_string )
    319324    FLUSH( debug_output_unit )
    320 
    321325!
    322326!-- Message formats
    323327201 FORMAT ( 'System time: ', A, ' | simulated time (s): ', F12.3, ' | ', A, ' ', A )
    324 
    325328
    326329 END SUBROUTINE debug_message
     
    332335!> Abort routine for failures durin reading of namelists
    333336!------------------------------------------------------------------------------!
    334  
    335337 SUBROUTINE parin_fail_message( location, line )
    336338
Note: See TracChangeset for help on using the changeset viewer.