Changeset 8377


Ignore:
Timestamp:
2017-07-26T15:48:43+02:00 (4 years ago)
Author:
frrh
Message:

Prevent attempt to compute meaningless mean values in trcrst when appropriate
time level data is not available. Output "N/A" instead.
I'm not convinced this is a complete solution. fse3t_a may be undefined
when it is used following a restart in which case there's more to do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_fix_NaNs/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r8280 r8377  
    745745      !!--------------------------------------------------------------------- 
    746746      INTEGER  :: jk, jn 
     747      CHARACTER (LEN=18) :: text_zmean 
    747748      REAL(wp) :: ztraf, zmin, zmax, zmean, areasf 
    748749      REAL(wp), DIMENSION(jpi,jpj) :: zvol 
     
    761762         CALL mpp_max( zmax )      ! max over the global domain 
    762763      END IF 
    763       zmean  = ztraf / areasf 
    764       IF(lwp) WRITE(numout,9002) TRIM( names ), zmean, zmin, zmax 
    765       ! 
    766       IF(lwp) WRITE(numout,*) 
    767 9002  FORMAT(' tracer name :',a10,'    mean :',e18.10,'    min :',e18.10, & 
     764 
     765      text_zmean = "N/A" 
     766      ! Avoid divide by zero when this routine is called from parts of the code 
     767      ! which may not have necessary time level variables to calculate areasf. 
     768      IF  (areasf > 0.0) THEN  
     769         zmean = ztraf / areasf 
     770         WRITE(text_zmean,'(e18.10)') zmean 
     771      ENDIF 
     772 
     773      IF(lwp) WRITE(numout,9002) TRIM( names ), text_zmean, zmin, zmax 
     774 
     775  9002  FORMAT(' tracer name :',A,'    mean :',A,'    min :',e18.10, & 
    768776      &      '    max :',e18.10 ) 
    769777      ! 
Note: See TracChangeset for help on using the changeset viewer.