Ignore:
Timestamp:
Mar 5, 2009 3:33: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/init_grid.f90

    r240 r254  
    22
    33!------------------------------------------------------------------------------!
    4 ! Actual revisions:
     4! Current revisions:
    55! -----------------
     6! Output of messages replaced by message handling routine.
    67! new topography case 'single_street_canyon'
    78!
     
    7879!-- Compute height of u-levels from constant grid length and dz stretch factors
    7980    IF ( dz == -1.0 )  THEN
    80        IF ( myid == 0 )  PRINT*,'+++ init_grid:  missing dz'
    81        CALL local_stop
     81       message_string = 'missing dz'
     82       CALL message( 'init_grid', 'PA0200', 1, 2, 0, 6, 0 )
    8283    ELSEIF ( dz <= 0.0 )  THEN
    83        IF ( myid == 0 )  PRINT*,'+++ init_grid:  dz=',dz,' <= 0.0'
    84        CALL local_stop
     84       WRITE( message_string, * ) 'dz=',dz,' <= 0.0'
     85       CALL message( 'init_grid', 'PA0201', 1, 2, 0, 6, 0 )
    8586    ENDIF
    8687
     
    309310       IF ( l_grid(k) > 1.5 * dx * wall_adjustment_factor .OR.  &
    310311            l_grid(k) > 1.5 * dy * wall_adjustment_factor )  THEN
    311           IF ( myid == 0 )  THEN
    312              PRINT*, '+++ WARNING: grid anisotropy exceeds '// &
    313                            'threshold given by only local'
    314              PRINT*, '             horizontal reduction of near_wall '// &
    315                            'mixing length l_wall'
    316              PRINT*, '             starting from height level k = ', k, '.'
    317           ENDIF
     312          WRITE( message_string, * ) 'grid anisotropy exceeds ', &
     313                                     'threshold given by only local', &
     314                                     ' &horizontal reduction of near_wall ', &
     315                                     'mixing length l_wall', &
     316                                     ' &starting from height level k = ', k, '.'
     317          CALL message( 'init_grid', 'PA0202', 0, 1, 0, 6, 0 )
    318318          EXIT
    319319       ENDIF
     
    367367          IF ( ( bxl < 1 ) .OR. ( bxr > nx-1 ) .OR. ( bxr < bxl+3 ) .OR.  &
    368368               ( bys < 1 ) .OR. ( byn > ny-1 ) .OR. ( byn < bys+3 ) )  THEN
    369              IF ( myid == 0 )  THEN
    370                 PRINT*, '+++ init_grid: inconsistent building parameters:'
    371                 PRINT*, '               bxl=', bxl, 'bxr=', bxr, 'bys=', bys, &
    372                                       'byn=', byn, 'nx=', nx, 'ny=', ny
    373              ENDIF
    374              CALL local_stop
     369             WRITE( message_string, * ) 'inconsistent building parameters:', &
     370                                        '& bxl=', bxl, 'bxr=', bxr, 'bys=', bys, &
     371                                        'byn=', byn, 'nx=', nx, 'ny=', ny
     372             CALL message( 'init_grid', 'PA0203', 1, 2, 0, 6, 0 )
    375373          ENDIF
    376374
     
    405403
    406404          ELSE
    407              IF ( myid == 0 )  THEN
    408                 PRINT*, '+++ user_init_grid: no street canyon width given'
    409              ENDIF
    410              CALL local_stop
     405             
     406             message_string = 'no street canyon width given'
     407             CALL message( 'init_grid', 'PA0204', 1, 2, 0, 6, 0 )
     408 
    411409          ENDIF
    412410
     
    418416             IF ( ( cxl < 1 ) .OR. ( cxr > nx-1 ) .OR. ( cwx < 3 ) .OR.  &
    419417               ( ch < 3 ) )  THEN
    420                 IF ( myid == 0 )  THEN
    421                    PRINT*, '+++ user_init_grid: inconsistent canyon parameters:'
    422                    PRINT*, '                    cxl=', cxl, 'cxr=', cxr,  &
    423                                               'cwx=', cwx,  &
    424                                               'ch=', ch, 'nx=', nx, 'ny=', ny
    425                 ENDIF
    426                 CALL local_stop
     418                WRITE( message_string, * ) 'inconsistent canyon parameters:', &
     419                                           '&cxl=', cxl, 'cxr=', cxr,  &
     420                                           'cwx=', cwx,  &
     421                                           'ch=', ch, 'nx=', nx, 'ny=', ny
     422                CALL message( 'init_grid', 'PA0205', 1, 2, 0, 6, 0 )
    427423             ENDIF
    428424          ELSEIF ( canyon_width_y /= 9999999.9 )  THEN
    429425             IF ( ( cys < 1 ) .OR. ( cyn > ny-1 ) .OR. ( cwy < 3 ) .OR.  &
    430426               ( ch < 3 ) )  THEN
    431                 IF ( myid == 0 )  THEN
    432                    PRINT*, '+++ user_init_grid: inconsistent canyon parameters:'
    433                    PRINT*, '                    cys=', cys, 'cyn=', cyn,  &
    434                                               'cwy=', cwy,  &
    435                                               'ch=', ch, 'nx=', nx, 'ny=', ny
    436                 ENDIF
    437                 CALL local_stop
     427                WRITE( message_string, * ) 'inconsistent canyon parameters:', &
     428                                           '&cys=', cys, 'cyn=', cyn,  &
     429                                           'cwy=', cwy,  &
     430                                           'ch=', ch, 'nx=', nx, 'ny=', ny
     431                CALL message( 'init_grid', 'PA0206', 1, 2, 0, 6, 0 )
    438432             ENDIF
    439433          ENDIF
    440434          IF ( canyon_width_x /= 9999999.9 .AND. canyon_width_y /= 9999999.9 )  &
    441435               THEN
    442              IF ( myid == 0 )  THEN
    443                 PRINT*, '+++ user_init_grid: inconsistent canyon parameters:'
    444                 PRINT*, '                    street canyon can only be oriented'
    445                 PRINT*, '                    either in x- or in y-direction'
    446              ENDIF
    447              CALL local_stop
     436             message_string = 'inconsistent canyon parameters:' // &
     437                              '&street canyon can only be oriented' // &
     438                              '&either in x- or in y-direction'
     439             CALL message( 'init_grid', 'PA0207', 1, 2, 0, 6, 0 )
    448440          ENDIF
    449441
     
    480472     
    481473          GOTO 12
    482 
    483  10       IF ( myid == 0 )  THEN
    484              PRINT*, '+++ init_grid: file TOPOGRAPHY_DATA does not exist'
    485           ENDIF
    486           CALL local_stop
    487 
    488  11       IF ( myid == 0 )  THEN
    489              PRINT*, '+++ init_grid: errors in file TOPOGRAPHY_DATA'
    490           ENDIF
    491           CALL local_stop
     474         
     475 10       message_string = 'file TOPOGRAPHY_DATA does not exist'
     476          CALL message( 'init_grid', 'PA0208', 1, 2, 0, 6, 0 )
     477
     478 11       message_string = 'errors in file TOPOGRAPHY_DATA'
     479          CALL message( 'init_grid', 'PA0209', 1, 2, 0, 6, 0 )
    492480
    493481 12       CLOSE( 90 )
     
    519507!--    Consistency checks
    520508       IF ( MINVAL( nzb_local ) < 0  .OR.  MAXVAL( nzb_local ) > nz + 1 )  THEN
    521           IF ( myid == 0 )  THEN
    522              PRINT*, '+++ init_grid: nzb_local values are outside the', &
    523                           'model domain'
    524              PRINT*, '               MINVAL( nzb_local ) = ', MINVAL(nzb_local)
    525              PRINT*, '               MAXVAL( nzb_local ) = ', MAXVAL(nzb_local)
    526           ENDIF
    527           CALL local_stop
     509          WRITE( message_string, * ) 'nzb_local values are outside the', &
     510                                     'model domain', &
     511                                     '&MINVAL( nzb_local ) = ', MINVAL(nzb_local), &
     512                                     '&MAXVAL( nzb_local ) = ', MAXVAL(nzb_local)
     513          CALL message( 'init_grid', 'PA0210', 1, 2, 0, 6, 0 )
    528514       ENDIF
    529515
     
    531517          IF ( ANY( nzb_local(:,-1) /= nzb_local(:,nx)   )  .OR. &
    532518               ANY( nzb_local(:,0)  /= nzb_local(:,nx+1) ) )  THEN
    533              IF ( myid == 0 )  THEN
    534                 PRINT*, '+++ init_grid: nzb_local does not fulfill cyclic', &
    535                         '               boundary condition in x-direction'
    536              ENDIF
    537              CALL local_stop
     519             message_string = 'nzb_local does not fulfill cyclic' // &
     520                              ' boundary condition in x-direction'
     521             CALL message( 'init_grid', 'PA0211', 1, 2, 0, 6, 0 )
    538522          ENDIF
    539523       ENDIF
     
    541525          IF ( ANY( nzb_local(-1,:) /= nzb_local(ny,:)   )  .OR. &
    542526               ANY( nzb_local(0,:)  /= nzb_local(ny+1,:) ) )  THEN
    543              IF ( myid == 0 )  THEN
    544                 PRINT*, '+++ init_grid: nzb_local does not fulfill cyclic', &
    545                         '               boundary condition in y-direction'
    546              ENDIF
    547              CALL local_stop
     527             message_string = 'nzb_local does not fulfill cyclic' // &
     528                              ' boundary condition in y-direction'
     529             CALL message( 'init_grid', 'PA0212', 1, 2, 0, 6, 0 )
    548530          ENDIF
    549531       ENDIF
Note: See TracChangeset for help on using the changeset viewer.