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 9830 for branches/UKMO/dev_r5518_GO6_package – NEMO

Ignore:
Timestamp:
2018-06-22T11:39:58+02:00 (6 years ago)
Author:
frrh
Message:

Merge revisions 9607:9721 of/branches/UKMO/dev_r5518_GO6_diag_bitcomp
into GO6 package branch.

This change ensures most 2D and 3D diagnostics produced by NEMO and MEDUSA
are bit reproducible on different PE decompositions.

Command used:
svn merge -r 9607:9721 svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/UKMO/dev_r5518_GO6_diag_bitcomp

Met Office GMED ticket 389 refers.

This change applies a mask to all duplicate grid points
output on diagnistic grids for T, U and V points. i.e. it masks
any wrap columns and duplicated grid points across the N-fold.
Fields affected are all "standard" NEMO diagnostics (scalar and
diaptr diagnostics are not on "normal" grids).

It also introduces some corrections/initialisations to achieve
PE decomposition bit comparison.

Most 2D or 3D fields are now bit comparable on different PE decompositions.
Only diaptr diagnostics can not be guaranteed bit reproducible
(due to their method of computation).

This change does nothing to CICE output.

Model evolution is unaffected.

Location:
branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90

    r9207 r9830  
    102102 
    103103      ! 
     104      z2d(:,:) = 0._wp 
    104105      z3d(:,:,:) = 0._wp 
    105106      IF( PRESENT( pvtr ) ) THEN 
     
    246247         ! 
    247248         IF( iom_use("zotemglo") ) THEN    ! i-mean i-k-surface  
     249            zmask(:,:,:) = 0._wp 
     250            zts(:,:,:,:) = 0._wp 
    248251            DO jk = 1, jpkm1 
    249252               DO jj = 1, jpj 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r8400 r9830  
    246246            z3d(:,:,jk) = wn(:,:,jk) * z2d(:,:) 
    247247         END DO 
     248         CALL lbc_lnk( z3d(:,:,:), 'W', 1. ) 
    248249         CALL iom_put( "w_masstr" , z3d )   
    249250         IF( iom_use('w_masstr2') )   CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) ) 
     
    334335            z2d(:,:) = z2d(:,:) + z3d(:,:,jk) 
    335336         END DO 
     337         CALL lbc_lnk( z3d(:,:,:), 'U', -1. ) 
    336338         CALL iom_put( "u_masstr", z3d )                  ! mass transport in i-direction 
     339         CALL lbc_lnk( z2d(:,:), 'U', -1. ) 
    337340         CALL iom_put( "u_masstr_vint", z2d )             ! mass transport in i-direction vertical sum 
    338341      ENDIF 
     
    370373            z3d(:,:,jk) = rau0 * vn(:,:,jk) * e1v(:,:) * fse3v(:,:,jk) * vmask(:,:,jk) 
    371374         END DO 
     375         CALL lbc_lnk( z3d(:,:,:), 'V', -1. ) 
    372376         CALL iom_put( "v_masstr", z3d )                  ! mass transport in j-direction 
    373377      ENDIF 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90

    r8427 r9830  
    254254   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bathy                              !: ocean depth (meters) 
    255255   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmask_i, umask_i, vmask_i, fmask_i !: interior domain T-point mask 
     256   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tmask_i_diag     !: partial mask for use in T diagnostic mask calc.  
     257   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: umask_i_diag     !: partial mask for use in U diagnostic mask calc.  
     258   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vmask_i_diag     !: partial mask for use in V diagnostic mask calc.  
    256259   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bmask                              !: land/ocean mask of barotropic stream function 
    257260 
     
    406409 
    407410      ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk),     &  
    408          &      vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk), STAT=ierr(11) ) 
     411         &      vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk),     & 
     412                tmask_i_diag(jpi,jpj,jpk),     & 
     413                umask_i_diag(jpi,jpj,jpk),     & 
     414                vmask_i_diag(jpi,jpj,jpk),     & 
     415                STAT=ierr(11) ) 
    409416 
    410417      ALLOCATE( wmask(jpi,jpj,jpk) , wumask(jpi,jpj,jpk), wvmask(jpi,jpj,jpk) , STAT=ierr(12) ) 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90

    r8280 r9830  
     1 
    12MODULE dommsk 
    23   !!====================================================================== 
     
    3031   USE dynspg_oce      ! choice/control of key cpp for surface pressure gradient 
    3132   USE wrk_nemo        ! Memory allocation 
     33   USE domwri 
    3234   USE timing          ! Timing 
    3335 
     
    138140      REAL(wp) ::  zphi_drake_passage, zshlat_antarc 
    139141      REAL(wp), POINTER, DIMENSION(:,:) ::  zwf 
     142      REAL(wp) :: uvt(jpi,jpj)   ! dummy array for masking purposes. 
    140143      !! 
    141144      NAMELIST/namlbc/ rn_shlat, ln_vorlat 
     
    223226      ! -------------------- 
    224227      tmask_i(:,:) = ssmask(:,:)            ! (ISH) tmask_i = 1 even on the ice shelf 
     228 
    225229      iif = jpreci                         ! ??? 
    226230      iil = nlci - jpreci + 1 
     
    246250         ENDIF 
    247251      ENDIF 
     252 
     253 
    248254      IF( jperio == 5 .OR. jperio == 6 ) THEN      ! F-point pivot 
    249255         tpol(     1    :jpiglo) = 0._wp 
     
    263269                  &            * tmask(ji,jj+1,jk) * tmask(ji+1,jj+1,jk) 
    264270            END DO 
    265          END DO 
     271         END DO  
    266272      END DO 
    267273      ! (ISF) MIN(1,SUM(umask)) is here to check if you have effectively at least 1 wet u point 
     
    282288      CALL lbc_lnk( vmask_i, 'V', 1._wp ) 
    283289      CALL lbc_lnk( fmask_i, 'F', 1._wp ) 
     290 
     291 
     292      ! Set up mask for diagnostics on T points, to exclude duplicate 
     293      ! data points in wrap and N-fold regions.  
     294      CALL dom_uniq( uvt, 'T' ) 
     295      DO jk = 1, jpk 
     296         tmask_i_diag(:,:,jk) = tmask(:,:,jk) * uvt(:,:) 
     297      END DO 
     298 
     299      ! Set up mask for diagnostics on U points, to exclude duplicate 
     300      ! data points in wrap and N-fold regions.  
     301      umask_i_diag(:,:,:) = 1.0 
     302      umask_i_diag(2:jpim1,:,:) = tmask(2:jpim1,:,:) + tmask(3:jpi,:,:) 
     303      CALL lbc_lnk( umask_i_diag, 'U', 1. ) 
     304 
     305      ! Now mask out any duplicate points 
     306      CALL dom_uniq( uvt, 'U' ) 
     307      DO jk = 1, jpk 
     308         umask_i_diag(:,:,jk) = umask_i_diag(:,:,jk) * uvt(:,:) 
     309      END DO 
     310 
     311 
     312      ! Set up mask for diagnostics on V points, to exclude duplicate 
     313      ! data points in wrap and N-fold regions.  
     314      vmask_i_diag(:,:,:) = 1.0 
     315      vmask_i_diag(:,2:jpjm1,:) = tmask(:,2:jpjm1,:) + tmask(:,3:jpj,:) 
     316      CALL lbc_lnk( vmask_i_diag, 'V', 1. ) 
     317 
     318      ! Now mask out any duplicate points 
     319      CALL dom_uniq( uvt, 'V' ) 
     320      DO jk = 1, jpk 
     321         vmask_i_diag(:,:,jk) = vmask_i_diag(:,:,jk) * uvt(:,:) 
     322      END DO 
     323 
     324 
    284325 
    285326      ! 3. Ocean/land mask at wu-, wv- and w points  
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90

    r9321 r9830  
    2626   PRIVATE 
    2727 
    28    PUBLIC dom_wri        ! routine called by inidom.F90 
     28   PUBLIC dom_wri, dom_uniq  ! routines called by inidom.F90 and iom.F90 
    2929 
    3030   !! * Substitutions 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r9321 r9830  
    14001400      IF ( ln_mskland ) THEN 
    14011401         ! mask land points, keep values on coast line -> specific mask for U, V and W points 
     1402 
     1403 
    14021404         SELECT CASE ( cdgrd ) 
    1403          CASE('T')   ;   zmask(:,:,:)       = tmask(:,:,:) 
    1404          CASE('U')   ;   zmask(2:jpim1,:,:) = tmask(2:jpim1,:,:) + tmask(3:jpi,:,:)   ;   CALL lbc_lnk( zmask, 'U', 1. ) 
    1405          CASE('V')   ;   zmask(:,2:jpjm1,:) = tmask(:,2:jpjm1,:) + tmask(:,3:jpj,:)   ;   CALL lbc_lnk( zmask, 'V', 1. ) 
    1406          CASE('W')   ;   zmask(:,:,2:jpk  ) = tmask(:,:,1:jpkm1) + tmask(:,:,2:jpk)   ;   zmask(:,:,1) = tmask(:,:,1) 
    1407          END SELECT 
     1405         ! The masks applied here are specifically used to mask out duplicate  
     1406         ! data points in wrap columns and N-fold rows in order to ensure bit  
     1407         ! reproducibility of diagnostics which have not undergone an explicit 
     1408         ! lbc_lnk prior to writing. Such fields are prone to junk values at  
     1409         ! duplicate points since those points are often excluded from the  
     1410         ! core field computation process.  
     1411         CASE('T')    
     1412            zmask(:,:,:) = tmask_i_diag(:,:,:) 
     1413         CASE('U')       
     1414            zmask(:,:,:) = umask_i_diag(:,:,:) 
     1415    CASE('V')    
     1416            zmask(:,:,:) = vmask_i_diag(:,:,:) 
     1417         CASE('W')    
     1418            zmask(:,:,2:jpk  ) = tmask_i_diag(:,:,1:jpkm1) + tmask_i_diag(:,:,2:jpk)    
     1419            zmask(:,:,1) = tmask_i_diag(:,:,1) 
     1420        END SELECT 
    14081421         ! 
    14091422#if ! defined key_xios2 
Note: See TracChangeset for help on using the changeset viewer.