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 7694 – NEMO

Changeset 7694


Ignore:
Timestamp:
2017-02-17T16:50:52+01:00 (7 years ago)
Author:
frrh
Message:

Protect expensive global sums of all tracers from being performed
unconditionally with a rtl (ln_ctl). This code is only relevant for
debugging or other circumstances where the user needs to know
global tracer sums for bit comarison purposes.

In normal run conditions, this calculation is redundant.

File:
1 edited

Legend:

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

    r7693 r7694  
    129129      ENDIF 
    130130      ! 
    131       ztrai = 0._wp                                                   !  content of all tracers 
    132       DO jn = 1, jptra 
    133          ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   ) 
    134       END DO 
    135       IF( lwp ) WRITE(numstr,9300) kt,  ztrai / areatot 
    136 9300  FORMAT(i10,e18.10) 
     131      IF (ln_ctl) THEN 
     132         ! The following code is very expensive since it involves multiple 
     133         ! reproducible global sums over all tracer fields and is potentially  
     134         ! called on every timestep. The results it produces are purely for 
     135         ! informational purposes and do not affect model evolution. 
     136         ! Hence we restrict its use by protecting it with the ln_ctl RTL 
     137         ! which should normally only be used under debugging conditions 
     138         ! and not in operational runs.  
     139         ztrai = 0._wp                                                   !  content of all tracers 
     140         DO jn = 1, jptra 
     141            ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:)   ) 
     142         END DO 
     143         IF( lwp ) WRITE(numstr,9300) kt,  ztrai / areatot 
     1449300     FORMAT(i10,e18.10) 
     145      ENDIF 
    137146      ! 
    138147      IF( nn_timing == 1 )   CALL timing_stop('trc_stp') 
Note: See TracChangeset for help on using the changeset viewer.