New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 7701 for branches/UKMO/dev_r5518_MEDUSA_optim_RH/NEMOGCM/NEMO/TOP_SRC/trcstp.F90 – NEMO

Ignore:
Timestamp:
2017-02-20T11:07:50+01:00 (7 years ago)
Author:
frrh
Message:

Improve control of numstr unit.

In addition to only producing output, and doing the
related global sums when we really need them, we
need to restrict it to one instance on the master PE
in all circumstances and to explicitly close it at the
end of the run. (Currently if lwp = true you get a separate
file for every PE containing identical information and none
of the tracer.stat files are explicitly closed.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_MEDUSA_optim_RH/NEMOGCM/NEMO/TOP_SRC/trcstp.F90

    r7694 r7701  
    5555      !!              Update the passive tracers 
    5656      !!------------------------------------------------------------------- 
     57 
     58      USE dom_oce, ONLY: narea  
     59 
    5760      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index 
    5861      INTEGER               ::  jk, jn  ! dummy loop indices 
     
    136139         ! Hence we restrict its use by protecting it with the ln_ctl RTL 
    137140         ! which should normally only be used under debugging conditions 
    138          ! and not in operational runs.  
    139          ztrai = 0._wp                                                   !  content of all tracers 
     141         ! and not in operational runs. We also need to restrict output  
     142         ! to the master PE since there's no point duplicating the same results 
     143         ! on all processors.     
     144         ztrai = 0._wp                                !  content of all tracers 
    140145         DO jn = 1, jptra 
    141146            ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   ) 
    142147         END DO 
    143          IF( lwp ) WRITE(numstr,9300) kt,  ztrai / areatot 
     148         IF (narea == 1) WRITE(numstr,9300) kt,  ztrai / areatot 
    1441499300     FORMAT(i10,e18.10) 
    145150      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.