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

Changeset 15300


Ignore:
Timestamp:
2021-09-29T09:25:34+02:00 (3 years ago)
Author:
smasson
Message:

trunk: improve BENCH for reproducibility tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/tests/BENCH/MY_SRC/usrdef_hgr.F90

    r14223 r15300  
    6262      ! 
    6363      INTEGER  ::   ji, jj         ! dummy loop indices 
     64      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! 2D workspace 
    6465      REAL(wp) ::   zres, zf0 
    6566      REAL(wp) ::   zti, ztj       ! local scalars 
     
    7273      IF(lwp) WRITE(numout,*) '          given by rn_dx and rn_dy'  
    7374      ! 
     75      ! define unique value on each point of the inner global domain. z2d ranging from 0.05 to -0.05 
     76      ! 
     77      DO_2D( 0, 0, 0, 0 )   !  +/- 0.5 
     78         z2d(ji,jj) = 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) 
     79      END_2D 
     80      ! 
    7481      ! Position coordinates (in grid points) 
    7582      !                          ========== 
    76       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
     83      DO_2D( 0, 0, 0, 0 ) 
    7784          
    78          zti = REAL( mig0(ji), wp ) - 0.5_wp  ! start at i=0.5 in the global grid without halos 
    79          ztj = REAL( mjg0(jj), wp ) - 0.5_wp  ! start at j=0.5 in the global grid without halos 
     85         zti = REAL( mig0(ji), wp ) - 0.5_wp   ! start at i=0.5 in the global grid without halos 
     86         ztj = REAL( mjg0(jj), wp ) - 0.5_wp   ! start at j=0.5 in the global grid without halos 
    8087          
    81          plamt(ji,jj) = zti 
    82          plamu(ji,jj) = zti + 0.5_wp 
    83          plamv(ji,jj) = zti 
    84          plamf(ji,jj) = zti + 0.5_wp 
     88         plamt(ji,jj) =   zti            * (1. + 1.0e-5 * z2d(ji,jj) ) 
     89         plamu(ji,jj) = ( zti + 0.5_wp ) * (1. + 2.0e-5 * z2d(ji,jj) ) 
     90         plamv(ji,jj) =   zti            * (1. + 3.0e-5 * z2d(ji,jj) ) 
     91         plamf(ji,jj) = ( zti + 0.5_wp ) * (1. + 4.0e-5 * z2d(ji,jj) ) 
    8592          
    86          pphit(ji,jj) = ztj 
    87          pphiu(ji,jj) = ztj 
    88          pphiv(ji,jj) = ztj + 0.5_wp 
    89          pphif(ji,jj) = ztj + 0.5_wp 
     93         pphit(ji,jj) =   ztj            * (1. + 1.5e-5 * z2d(ji,jj) )          
     94         pphiu(ji,jj) =   ztj            * (1. + 2.5e-5 * z2d(ji,jj) )          
     95         pphiv(ji,jj) = ( ztj + 0.5_wp ) * (1. + 3.5e-5 * z2d(ji,jj) ) 
     96         pphif(ji,jj) = ( ztj + 0.5_wp ) * (1. + 4.5e-5 * z2d(ji,jj) ) 
    9097 
    9198      END_2D 
     
    93100      ! Horizontal scale factors (in meters) 
    94101      !                              ====== 
    95       zres = 1.e+5   !  100km 
    96       pe1t(:,:) = zres  ;   pe2t(:,:) = zres  
    97       pe1u(:,:) = zres  ;   pe2u(:,:) = zres 
    98       pe1v(:,:) = zres  ;   pe2v(:,:) = zres 
    99       pe1f(:,:) = zres  ;   pe2f(:,:) = zres  
    100  
     102      DO_2D( 0, 0, 0, 0 ) 
     103         zres = 1.e+5   !  100km 
     104         pe1t(ji,jj) = zres * (1. + 1.0e-5 * z2d(ji,jj) )  ;   pe2t(ji,jj) = zres * (1. + 1.5e-5 * z2d(ji,jj) ) 
     105         pe1u(ji,jj) = zres * (1. + 2.0e-5 * z2d(ji,jj) )  ;   pe2u(ji,jj) = zres * (1. + 2.5e-5 * z2d(ji,jj) ) 
     106         pe1v(ji,jj) = zres * (1. + 3.0e-5 * z2d(ji,jj) )  ;   pe2v(ji,jj) = zres * (1. + 3.5e-5 * z2d(ji,jj) ) 
     107         pe1f(ji,jj) = zres * (1. + 4.0e-5 * z2d(ji,jj) )  ;   pe2f(ji,jj) = zres * (1. + 4.5e-5 * z2d(ji,jj) ) 
     108      END_2D 
    101109      !                             ! NO reduction of grid size in some straits  
    102110      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_hgr routine 
     
    109117      ! 
    110118      zf0 = 2._wp * omega * SIN( rad * 45 )   ! constant coriolis factor corresponding to 45°N 
    111       pff_f(:,:) = zf0 
    112       pff_t(:,:) = zf0 
     119      DO_2D( 0, 0, 0, 0 ) 
     120         pff_f(ji,jj) = zf0 * (1. + 1.0e-5 * z2d(ji,jj) ) 
     121         pff_t(ji,jj) = zf0 * (1. + 2.0e-5 * z2d(ji,jj) ) 
     122      END_2D 
     123      ! 
     124      ! calls lbc_lnk done in dom_hgr 
    113125      ! 
    114126   END SUBROUTINE usr_def_hgr 
Note: See TracChangeset for help on using the changeset viewer.