Changeset 8389


Ignore:
Timestamp:
2017-07-27T16:45:56+02:00 (4 years ago)
Author:
frrh
Message:

Reinstate original use of fse3t_a, having ensured contents will be initialised
immediately upon allocation evevn if no physical values area available.

Location:
branches/UKMO/dev_r5518_fix_NaNs/NEMOGCM/NEMO
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_fix_NaNs/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90

    r6486 r8389  
    355355         &      gdept_0 (jpi,jpj,jpk) , e3t_0(jpi,jpj,jpk) , e3u_0 (jpi,jpj,jpk) ,                         & 
    356356         &      gdepw_0 (jpi,jpj,jpk) , e3w_0(jpi,jpj,jpk) , e3vw_0(jpi,jpj,jpk) , e3uw_0(jpi,jpj,jpk) , STAT=ierr(4) ) 
     357 
     358      ! Initilaise key variables at risk of being intercepted before properly set up.  
     359      e3t_0(:,:,:) = 0.0 
    357360         ! 
    358361#if defined key_vvl 
     
    368371         &      ehu_b    (jpi,jpj)    , ehv_b  (jpi,jpj),                                                     & 
    369372         &      ehur_b   (jpi,jpj)    , ehvr_b (jpi,jpj),                                  STAT=ierr(5) )                           
     373 
     374      ! Initilaise key variables at risk of being intercepted before properly set up.  
     375      e3t_n(:,:,:) = 0.0 
    370376#endif 
    371377         ! 
  • branches/UKMO/dev_r5518_fix_NaNs/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r8386 r8389  
    751751 
    752752      IF( lwp )  WRITE(numout,*) 'STAT- ', names 
    753       ! 
    754       ! RSRH The following should use fse3t_n not fse3t_a which  
    755       ! will be undefined at the start of a run! Just because it  
    756       ! doesn't crash on certain platforms doesn't make it universally  
    757       ! safe or portable!  
    758       zvol(:,:) = e1e2t(:,:) * fse3t_n(:,:,1) * tmask(:,:,1) 
     753       
     754      ! fse3t_a will be undefined at the start of a run, but this routine 
     755      ! may be called at any stage! Hence we MUST make sure it is  
     756      ! initialised to zero when allocated to enable us to test for  
     757      ! zero content here and avoid potentially dangerous and non-portable  
     758      ! operations (e.g. divide by zero, global sums of junk values etc.)    
     759      zvol(:,:) = e1e2t(:,:) * fse3t_a(:,:,1) * tmask(:,:,1) 
    759760      ztraf = glob_sum( dgtr(:,:) * zvol(:,:) ) 
    760761      !! areasf = glob_sum(e1e2t(:,:) * tmask(:,:,1) ) 
Note: See TracChangeset for help on using the changeset viewer.