430 | | |
431 | | ''' 6. sette/sette.sh ''' |
| 428 | ''' 6. Tidy up icb modules so that the existing nn_verbose_level parameter can be used to turn off icebergs.stat files ''' |
| 429 | |
| 430 | The icb modules already contain their own mechanism for controlling the verbosity of the icebergs.stat file reporting. This is done via the nn_verbose_level name list parameter which is set to a default value of 1. Output is minimal for nn_verbose_level=0 but is not switched off completely. Thus the icebergs.stat files are always created even when not required. This is particularly annoying at larger processor counts. Only a little work is required to ensure that nn_verbose_level=0 runs silently and does not create the unwanted files: |
| 431 | |
| 432 | {{{ |
| 433 | Changes required in: |
| 434 | OCE/ICB/icbdia.F90 |
| 435 | OCE/ICB/icbdyn.F90 |
| 436 | OCE/ICB/icbini.F90 |
| 437 | OCE/ICB/icblbc.F90 |
| 438 | OCE/ICB/icbstp.F90 |
| 439 | OCE/ICB/icbutl.F90 |
| 440 | }}} |
| 441 | {{{#!diff |
| 442 | Index: OCE/ICB/icbdia.F90 |
| 443 | =================================================================== |
| 444 | --- OCE/ICB/icbdia.F90 (revision 10539) |
| 445 | +++ OCE/ICB/icbdia.F90 (working copy) |
| 446 | @@ -326,8 +326,10 @@ |
| 447 | CALL report_consistant( 'bot interface','kg','sent',calving_out_net, & |
| 448 | & 'returned',calving_ret_net) |
| 449 | ENDIF |
| 450 | - WRITE( numicb, '("calved by class = ",i6,20(",",i6))') (nbergs_calved_by_class(ik),ik=1,nclasses) |
| 451 | - IF( nspeeding_tickets > 0 ) WRITE( numicb, '("speeding tickets issued = ",i6)') nspeeding_tickets |
| 452 | + IF (nn_verbose_level > 0) THEN |
| 453 | + WRITE( numicb, '("calved by class = ",i6,20(",",i6))') (nbergs_calved_by_class(ik),ik=1,nclasses) |
| 454 | + IF( nspeeding_tickets > 0 ) WRITE( numicb, '("speeding tickets issued = ",i6)') nspeeding_tickets |
| 455 | + ENDIF |
| 456 | ! |
| 457 | nbergs_start = nbergs_end |
| 458 | stored_start = stored_end |
| 459 | @@ -436,11 +438,13 @@ |
| 460 | IF( kt == nit000 ) THEN |
| 461 | stored_start = SUM( berg_grid%stored_ice(:,:,:) ) |
| 462 | CALL mpp_sum( 'icbdia', stored_start ) |
| 463 | - WRITE(numicb,'(a,es13.6,a)') 'icb_dia_income: initial stored mass=',stored_start,' kg' |
| 464 | ! |
| 465 | stored_heat_start = SUM( berg_grid%stored_heat(:,:) ) |
| 466 | CALL mpp_sum( 'icbdia', stored_heat_start ) |
| 467 | - WRITE(numicb,'(a,es13.6,a)') 'icb_dia_income: initial stored heat=',stored_heat_start,' J' |
| 468 | + IF (nn_verbose_level > 0) THEN |
| 469 | + WRITE(numicb,'(a,es13.6,a)') 'icb_dia_income: initial stored mass=',stored_start,' kg' |
| 470 | + WRITE(numicb,'(a,es13.6,a)') 'icb_dia_income: initial stored heat=',stored_heat_start,' J' |
| 471 | + ENDIF |
| 472 | ENDIF |
| 473 | ! |
| 474 | calving_rcv_net = calving_rcv_net + SUM( berg_grid%calving(:,:) ) * berg_dt |
| 475 | @@ -514,6 +518,7 @@ |
| 476 | INTEGER, INTENT(in), OPTIONAL :: kbergs |
| 477 | !!---------------------------------------------------------------------- |
| 478 | ! |
| 479 | + IF (nn_verbose_level == 0) RETURN |
| 480 | IF( PRESENT(kbergs) ) THEN |
| 481 | WRITE(numicb,100) cd_budgetstr // ' state:', & |
| 482 | & cd_startstr // ' start', pstartval, cd_budgetunits, & |
| 483 | @@ -538,6 +543,7 @@ |
| 484 | REAL(wp), INTENT(in) :: pstartval, pendval |
| 485 | !!---------------------------------------------------------------------- |
| 486 | ! |
| 487 | + IF (nn_verbose_level == 0) RETURN |
| 488 | WRITE(numicb,200) cd_budgetstr // ' check:', & |
| 489 | & cd_startstr, pstartval, cd_budgetunits, & |
| 490 | & cd_endstr, pendval, cd_budgetunits, & |
| 491 | @@ -557,6 +563,7 @@ |
| 492 | REAL(wp) :: zval |
| 493 | !!---------------------------------------------------------------------- |
| 494 | ! |
| 495 | + IF (nn_verbose_level == 0) RETURN |
| 496 | zval = ( ( pendval - pstartval ) - ( pinval - poutval ) ) / & |
| 497 | & MAX( 1.e-30, MAX( ABS( pendval - pstartval ) , ABS( pinval - poutval ) ) ) |
| 498 | ! |
| 499 | @@ -577,6 +584,7 @@ |
| 500 | INTEGER , INTENT(in) :: pstartval, pendval |
| 501 | !!---------------------------------------------------------------------- |
| 502 | ! |
| 503 | + IF (nn_verbose_level == 0) RETURN |
| 504 | WRITE(numicb,100) cd_budgetstr // ' state:', & |
| 505 | & cd_startstr // ' start', pstartval, & |
| 506 | & cd_endstr // ' end', pendval, & |
| 507 | @@ -594,6 +602,7 @@ |
| 508 | INTEGER, INTENT(in) :: pinval, poutval, pstartval, pendval |
| 509 | !!---------------------------------------------------------------------- |
| 510 | ! |
| 511 | + IF (nn_verbose_level == 0) RETURN |
| 512 | WRITE(numicb,200) cd_budgetstr // ' budget:', & |
| 513 | & cd_instr // ' in', pinval, & |
| 514 | & cd_outstr // ' out', poutval, & |
| 515 | Index: OCE/ICB/icbdyn.F90 |
| 516 | =================================================================== |
| 517 | --- OCE/ICB/icbdyn.F90 (revision 10539) |
| 518 | +++ OCE/ICB/icbdyn.F90 (working copy) |
| 519 | @@ -370,10 +370,12 @@ |
| 520 | ENDIF |
| 521 | ENDIF |
| 522 | ! ! check the speed and acceleration limits |
| 523 | - IF( ABS( zuveln ) > pp_vel_lim .OR. ABS( zvveln ) > pp_vel_lim ) & |
| 524 | - WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive velocity' |
| 525 | - IF( ABS( pax ) > pp_accel_lim .OR. ABS( pay ) > pp_accel_lim ) & |
| 526 | - WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive acceleration' |
| 527 | + IF (nn_verbose_level > 0) THEN |
| 528 | + IF( ABS( zuveln ) > pp_vel_lim .OR. ABS( zvveln ) > pp_vel_lim ) & |
| 529 | + WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive velocity' |
| 530 | + IF( ABS( pax ) > pp_accel_lim .OR. ABS( pay ) > pp_accel_lim ) & |
| 531 | + WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive acceleration' |
| 532 | + ENDIF |
| 533 | ! |
| 534 | END SUBROUTINE icb_accel |
| 535 | |
| 536 | Index: OCE/ICB/icbini.F90 |
| 537 | =================================================================== |
| 538 | --- OCE/ICB/icbini.F90 (revision 10539) |
| 539 | +++ OCE/ICB/icbini.F90 (working copy) |
| 540 | @@ -77,7 +77,9 @@ |
| 541 | ! ! open ascii output file or files for iceberg status information |
| 542 | ! ! note that we choose to do this on all processors since we cannot |
| 543 | ! ! predict where icebergs will be ahead of time |
| 544 | - CALL ctl_opn( numicb, 'icebergs.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
| 545 | + IF( nn_verbose_level > 0) THEN |
| 546 | + CALL ctl_opn( numicb, 'icebergs.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
| 547 | + ENDIF |
| 548 | |
| 549 | ! set parameters (mostly from namelist) |
| 550 | ! |
| 551 | @@ -240,8 +242,10 @@ |
| 552 | ENDIF |
| 553 | CALL iom_close( inum ) ! close file |
| 554 | ! |
| 555 | - WRITE(numicb,*) |
| 556 | - WRITE(numicb,*) ' calving read in a file' |
| 557 | + IF( nn_verbose_level > 0) THEN |
| 558 | + WRITE(numicb,*) |
| 559 | + WRITE(numicb,*) ' calving read in a file' |
| 560 | + ENDIF |
| 561 | ALLOCATE( sf_icb(1), STAT=istat1 ) ! Create sf_icb structure (calving) |
| 562 | ALLOCATE( sf_icb(1)%fnow(jpi,jpj,1), STAT=istat2 ) |
| 563 | ALLOCATE( sf_icb(1)%fdta(jpi,jpj,1,2), STAT=istat3 ) |
| 564 | @@ -335,7 +339,9 @@ |
| 565 | ! |
| 566 | ibergs = icb_utl_count() |
| 567 | CALL mpp_sum('icbini', ibergs) |
| 568 | - WRITE(numicb,'(a,i6,a)') 'diamonds, icb_ini_gen: ',ibergs,' were generated' |
| 569 | + IF( nn_verbose_level > 0) THEN |
| 570 | + WRITE(numicb,'(a,i6,a)') 'diamonds, icb_ini_gen: ',ibergs,' were generated' |
| 571 | + ENDIF |
| 572 | ! |
| 573 | END SUBROUTINE icb_ini_gen |
| 574 | |
| 575 | Index: OCE/ICB/icblbc.F90 |
| 576 | =================================================================== |
| 577 | --- OCE/ICB/icblbc.F90 (revision 10539) |
| 578 | +++ OCE/ICB/icblbc.F90 (working copy) |
| 579 | @@ -639,7 +639,7 @@ |
| 580 | |
| 581 | zsbergs(0) = narea |
| 582 | zsbergs(1) = nicbfldnsend(jn) |
| 583 | - !IF ( nicbfldnsend(jn) .GT. 0) write(numicb,*) 'ICB sending ',nicbfldnsend(jn),' to ', ifldproc |
| 584 | + !IF ( nicbfldnsend(jn) .GT. 0 .AND. nn_verbose_level > 0 ) write(numicb,*) 'ICB sending ',nicbfldnsend(jn),' to ', ifldproc |
| 585 | CALL mppsend( 21, zsbergs(0:1), 2, ifldproc-1, nicbfldreq(jn)) |
| 586 | ENDIF |
| 587 | ! |
| 588 | @@ -655,10 +655,10 @@ |
| 589 | DO jjn = 1,jpni |
| 590 | IF( nicbfldproc(jjn) .eq. INT(znbergs(1)) ) EXIT |
| 591 | END DO |
| 592 | - IF( jjn .GT. jpni ) write(numicb,*) 'ICB ERROR' |
| 593 | + IF( jjn .GT. jpni .AND. nn_verbose_level > 0 ) write(numicb,*) 'ICB ERROR' |
| 594 | nicbfldexpect(jjn) = INT( znbergs(2) ) |
| 595 | - !IF ( nicbfldexpect(jjn) .GT. 0) write(numicb,*) 'ICB expecting ',nicbfldexpect(jjn),' from ', nicbfldproc(jjn) |
| 596 | - !CALL FLUSH(numicb) |
| 597 | + !IF ( nicbfldexpect(jjn) .GT. 0 .AND. nn_verbose_level > 0 ) write(numicb,*) 'ICB expecting ',nicbfldexpect(jjn),' from ', nicbfldproc(jjn) |
| 598 | + !IF (nn_verbose_level > 0) CALL FLUSH(numicb) |
| 599 | ENDIF |
| 600 | ! |
| 601 | END DO |
| 602 | @@ -910,7 +910,7 @@ |
| 603 | DEALLOCATE(old) |
| 604 | ENDIF |
| 605 | old => new |
| 606 | - !WRITE( numicb,*) 'icb_increase_ibuffer',narea,' increased to',inew_size |
| 607 | + !IF (nn_verbose_level > 0) WRITE( numicb,*) 'icb_increase_ibuffer',narea,' increased to',inew_size |
| 608 | ENDIF |
| 609 | ! |
| 610 | END SUBROUTINE icb_increase_ibuffer |
| 611 | Index: OCE/ICB/icbstp.F90 |
| 612 | =================================================================== |
| 613 | --- OCE/ICB/icbstp.F90 (revision 10539) |
| 614 | +++ OCE/ICB/icbstp.F90 (working copy) |
| 615 | @@ -162,8 +162,10 @@ |
| 616 | |
| 617 | IF(lwp) WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea |
| 618 | ! |
| 619 | - CALL flush( numicb ) |
| 620 | - CLOSE( numicb ) |
| 621 | + IF( nn_verbose_level > 0 ) THEN |
| 622 | + CALL flush( numicb ) |
| 623 | + CLOSE( numicb ) |
| 624 | + ENDIF |
| 625 | ! |
| 626 | END SUBROUTINE icb_end |
| 627 | |
| 628 | Index: OCE/ICB/icbutl.F90 |
| 629 | =================================================================== |
| 630 | --- OCE/ICB/icbutl.F90 (revision 10539) |
| 631 | +++ OCE/ICB/icbutl.F90 (working copy) |
| 632 | @@ -624,6 +624,7 @@ |
| 633 | INTEGER :: kt ! timestep number |
| 634 | !!---------------------------------------------------------------------- |
| 635 | ! |
| 636 | + IF (nn_verbose_level == 0) RETURN |
| 637 | pt => berg%current_point |
| 638 | WRITE(numicb, 9200) kt, berg%number(1), & |
| 639 | pt%xi, pt%yj, pt%lon, pt%lat, pt%uvel, pt%vvel, & |
| 640 | @@ -648,6 +649,7 @@ |
| 641 | TYPE(iceberg), POINTER :: this |
| 642 | !!---------------------------------------------------------------------- |
| 643 | ! |
| 644 | + IF (nn_verbose_level == 0) RETURN |
| 645 | this => first_berg |
| 646 | IF( ASSOCIATED(this) ) THEN |
| 647 | WRITE(numicb,'(a," pe=(",i3,")")' ) cd_label, narea |
| 648 | }}} |
| 649 | |
| 650 | ''' 7. sette/sette.sh ''' |