Ignore:
Timestamp:
Mar 11, 2009 3:17:42 PM (15 years ago)
Author:
heinze
Message:

Output of messages replaced by message handling routine

File:
1 edited

Legend:

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

    r226 r257  
    22
    33!------------------------------------------------------------------------------!
    4 ! Actual revisions:
     4! Current revisions:
    55! -----------------
    6 !
     6! Output of messages replaced by message handling routine.
     7!
    78!
    89! Former revisions:
     
    138139!
    139140!--             Array bound exceeded
    140                 PRINT*, '+++ read_3d_binary: data from subdomain of previous', &
    141                              ' run mapped more than 1000 times'
    142 #if defined( __parallel )
    143                 CALL MPI_ABORT( comm2d, 9999, ierr )
    144 #else
    145                 STOP
    146 #endif
     141                message_string = 'data from subdomain of previous' // &
     142                                 ' run mapped more than 1000 times'
     143                CALL message( 'read_3d_binary', 'PA0284', 2, 2, 0, 6, 0 )
     144 
    147145             ENDIF
    148146
     
    206204    IF ( files_to_be_opened /= 1  .OR.  numprocs /= numprocs_previous_run ) &
    207205    THEN
    208        PRINT*, '*** number of PEs or virtual PE-grid changed in restart run'
    209        PRINT*, '    PE', myid, ' will read from files ', &
    210                file_list(1:files_to_be_opened)
     206       WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed in ',     &
     207                                  'restart run&  PE', myid, ' will read from files ', &
     208                                  file_list(1:files_to_be_opened)
     209       CALL message( 'read_3d_binary', 'PA0285', 0, 0, 0, 6, 0 )
    211210    ENDIF
    212211
     
    238237       binary_version = '3.1'
    239238       IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
    240           IF ( myid == 0 )  THEN
    241              PRINT*, '+++ init_3d_model: version mismatch concerning data ', &
    242                      'from prior run'
    243              PRINT*, '        version on file    = "', TRIM( version_on_file ),&
    244                      '"'
    245              PRINT*, '        version in program = "', TRIM( binary_version ), &
    246                      '"'
    247           ENDIF
    248           CALL local_stop
     239          WRITE( message_string, * ) 'version mismatch concerning data ',                    &
     240                                     'from prior run',                                       &
     241                                     '&version on file    = "', TRIM( version_on_file ), '"',&
     242                                     '&version in program = "', TRIM( binary_version ), '"'
     243          CALL message( 'read_3d_binary', 'PA0286', 1, 2, 0, 6, 0 )
    249244       ENDIF
    250245
     
    256251
    257252       IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) )  THEN
    258           PRINT*, '+++ read_3d_binary: problem with index bound nxl on ', &
    259                        ' restart file "', myid_char, '"'
    260           PRINT*, '                    nxl = ', nxl_on_file, ' but it should be'
    261           PRINT*, '                    = ', hor_index_bounds_previous_run(1,j)
    262           PRINT*, '                    from the index bound information array'
    263 #if defined( __parallel )
    264           CALL MPI_ABORT( comm2d, 9999, ierr )
    265 #else
    266           CALL local_stop
    267 #endif
     253          WRITE( message_string, * ) 'problem with index bound nxl on ',          &
     254                                     'restart file "', myid_char, '"',            &
     255                                     '&nxl = ', nxl_on_file, ' but it should be', &
     256                                     '&= ', hor_index_bounds_previous_run(1,j),   &
     257                                     '&from the index bound information array'
     258          CALL message( 'read_3d_binary', 'PA0287', 2, 2, 0, 6, 0 )
    268259       ENDIF
    269260
    270261       IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) )  THEN
    271           PRINT*, '+++ read_3d_binary: problem with index bound nxr on ', &
    272                        ' restart file "', myid_char, '"'
    273           PRINT*, '                    nxr = ', nxr_on_file, ' but it should be'
    274           PRINT*, '                    = ', hor_index_bounds_previous_run(2,j)
    275           PRINT*, '                    from the index bound information array'
    276 #if defined( __parallel )
    277           CALL MPI_ABORT( comm2d, 9999, ierr )
    278 #else
    279           CALL local_stop
    280 #endif
     262           WRITE( message_string, * ) 'problem with index bound nxr on ',          &
     263                                      'restart file "', myid_char, '"'  ,          &
     264                                      '&nxr = ', nxr_on_file, ' but it should be', &
     265                                      '&= ', hor_index_bounds_previous_run(2,j),   &
     266                                      '&from the index bound information array'
     267          CALL message( 'read_3d_binary', 'PA0288', 2, 2, 0, 6, 0 )
     268
    281269       ENDIF
    282270
    283271       IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) )  THEN
    284           PRINT*, '+++ read_3d_binary: problem with index bound nys on ', &
    285                        ' restart file "', myid_char, '"'
    286           PRINT*, '                    nys = ', nys_on_file, ' but it should be'
    287           PRINT*, '                    = ', hor_index_bounds_previous_run(3,j)
    288           PRINT*, '                    from the index bound information array'
    289 #if defined( __parallel )
    290           CALL MPI_ABORT( comm2d, 9999, ierr )
    291 #else
    292           CALL local_stop
    293 #endif
     272          WRITE( message_string, * ) 'problem with index bound nys on ',          &
     273                                     'restart file "', myid_char, '"',            &
     274                                     '&nys = ', nys_on_file, ' but it should be', &
     275                                     '&= ', hor_index_bounds_previous_run(3,j),   &
     276                                     '&from the index bound information array'
     277          CALL message( 'read_3d_binary', 'PA0289', 2, 2, 0, 6, 0 )
    294278       ENDIF
    295279
    296280       IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) )  THEN
    297           PRINT*, '+++ read_3d_binary: problem with index bound nyn on ', &
    298                        ' restart file "', myid_char, '"'
    299           PRINT*, '                    nyn = ', nyn_on_file, ' but it should be'
    300           PRINT*, '                    = ', hor_index_bounds_previous_run(4,j)
    301           PRINT*, '                    from the index bound information array'
    302 #if defined( __parallel )
    303           CALL MPI_ABORT( comm2d, 9999, ierr )
    304 #else
    305           CALL local_stop
    306 #endif
     281          WRITE( message_string, * ) 'problem with index bound nyn on ',          &
     282                                     'restart file "', myid_char, '"',            &
     283                                     '&nyn = ', nyn_on_file, ' but it should be', &
     284                                     '&= ', hor_index_bounds_previous_run(4,j),   &
     285                                     '&from the index bound information array'
     286          CALL message( 'read_3d_binary', 'PA0290', 2, 2, 0, 6, 0 )
    307287       ENDIF
    308288
    309289       IF ( nzb_on_file /= nzb )  THEN
    310           PRINT*, '+++ read_3d_binary: mismatch between actual data and data '
    311           PRINT*, '                    from prior run on PE ', myid
    312           PRINT*, '                    nzb on file = ', nzb_on_file
    313           PRINT*, '                    nzb         = ', nzb
    314           CALL local_stop
     290          WRITE( message_string, * ) 'mismatch between actual data and data ', &
     291                                     '&from prior run on PE ', myid,           &
     292                                     '&nzb on file = ', nzb_on_file,           &
     293                                     '&nzb         = ', nzb
     294          CALL message( 'read_3d_binary', 'PA0291', 1, 2, 0, 6, 0 ) 
    315295       ENDIF
    316296
    317297       IF ( nzt_on_file /= nzt )  THEN
    318           PRINT*, '+++ read_3d_binary: mismatch between actual data and data '
    319           PRINT*, '                    from prior run on PE ', myid
    320           PRINT*, '                    nzt on file = ', nzt_on_file
    321           PRINT*, '                    nzt         = ', nzt
    322           CALL local_stop
     298          WRITE( message_string, * ) 'mismatch between actual data and data ', &
     299                                     '&from prior run on PE ', myid,           &
     300                                     '&nzt on file = ', nzt_on_file,           &
     301                                     '&nzt         = ', nzt
     302          CALL message( 'read_3d_binary', 'PA0292', 1, 2, 0, 6, 0 ) 
    323303       ENDIF
    324304
     
    634614                   IF ( k == 1 )  THEN
    635615                      IF ( nx_on_file /= nx )  THEN
    636                          IF ( myid == 0 )  THEN
    637                             PRINT*, '+++ WARNING: read_3d_binary: spectrum_x', &
    638                                          ' on restart file ignored because'
    639                             PRINT*, '    total numbers of grid points (nx) ', &
    640                                          'do not match'
    641                          ENDIF
     616                         message_string = 'read_3d_binary: spectrum_x ' //         &
     617                                          'on restart file ignored because' //     &
     618                                          '&total numbers of grid points (nx) ' // &
     619                                          'do not match'
     620                         CALL message( 'read_3d_binary', 'PA0293', 0, 1, 0, 6, 0 ) 
    642621                         READ ( 13 )  rdummy
    643622                      ELSE
     
    649628                   IF ( k == 1 )  THEN
    650629                      IF ( ny_on_file /= ny )  THEN
    651                          IF ( myid == 0 )  THEN
    652                             PRINT*, '+++ WARNING: read_3d_binary: spectrum_y', &
    653                                          ' on restart file ignored because'
    654                             PRINT*, '    total numbers of grid points (ny) ', &
    655                                          'do not match'
    656                          ENDIF
     630                         message_string = 'read_3d_binary: spectrum_y ' //        &
     631                                          'on restart file ignored because' //    &
     632                                          '&total numbers of grid points (ny) '// &
     633                                          'do not match'
     634                         CALL message( 'read_3d_binary', 'PA0294', 0, 1, 0, 6, 0 ) 
    657635                         READ ( 13 )  rdummy
    658636                      ELSE
     
    944922
    945923                CASE DEFAULT
    946                    PRINT*, '+++ read_3d_binary: unknown field named "', &
    947                            TRIM( field_chr ), '" found in'
    948                    PRINT*, '                    data from prior run on PE ',myid
    949                    CALL local_stop
    950 
     924                   WRITE( message_string, * ) 'unknown field named "', &
     925                                              TRIM( field_chr ), '" found in', &
     926                                              '&data from prior run on PE ',myid
     927                    CALL message( 'read_3d_binary', 'PA0295', 1, 2, 0, 6, 0 ) 
     928                   
    951929             END SELECT
    952930
Note: See TracChangeset for help on using the changeset viewer.