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 12879 for NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/DOM – NEMO

Ignore:
Timestamp:
2020-05-06T14:38:01+02:00 (4 years ago)
Author:
hadcv
Message:

Changes following feedback

Location:
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/DOM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/DOM/dom_oce.F90

    r12765 r12879  
    7575   ! Tiling namelist 
    7676   LOGICAL, PUBLIC ::   ln_tile 
    77    INTEGER         ::   nn_tile_i, nn_tile_j 
     77   INTEGER         ::   nn_ltile_i, nn_ltile_j 
    7878 
    7979   !                                 !  domain MPP decomposition parameters 
  • NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/DOM/domain.F90

    r12765 r12879  
    4949 
    5050   PUBLIC   dom_init     ! called by nemogcm.F90 
    51    PUBLIC   dom_tile     ! called by step.F90 
    5251   PUBLIC   domain_cfg   ! called by nemogcm.F90 
    5352 
     
    123122      CALL dom_glo                     ! global domain versus local domain 
    124123      CALL dom_nam                     ! read namelist ( namrun, namdom ) 
    125  
    126       ! Initialise tile to full domain 
    127       CALL dom_tile(0) 
     124      CALL dom_tile                    ! Tile domains 
    128125 
    129126      ! 
     
    275272 
    276273 
    277    SUBROUTINE dom_tile(kntile) 
     274   SUBROUTINE dom_tile 
    278275      !!---------------------------------------------------------------------- 
    279276      !!                     ***  ROUTINE dom_tile  *** 
    280277      !! 
    281       !! ** Purpose :   Set domain indices for specified tile 
    282       !! 
    283       !! ** Action  : - ntile          : current tile number 
    284       !!              - ntsi, ntsj     : start of internal part of domain 
     278      !! ** Purpose :   Set tile domain variables 
     279      !! 
     280      !! ** Action  : - ntsi, ntsj     : start of internal part of domain 
    285281      !!              - ntei, ntej     : end of internal part of domain 
    286       !!              - ntsim1, ntsjm1 : start of domain 
    287       !!              - nteip1, ntejp1 : end of domain 
    288       !!---------------------------------------------------------------------- 
    289       INTEGER   , INTENT(in ) :: kntile               ! Tile number 
    290       INTEGER                 :: iitile, ijtile       ! Tile number in i and j 
    291       !!---------------------------------------------------------------------- 
    292  
    293       IF( ln_tile .AND. kntile > 0 ) THEN          ! Tile domain 
    294          iitile = 1 + MOD( kntile - 1, jpnitile ) 
    295          ijtile = 1 + (kntile - 1) / jpnitile 
    296  
    297          ntile = kntile 
    298          ntsi = 2 + (iitile - 1) * nn_tile_i 
    299          ntsj = 2 + (ijtile - 1) * nn_tile_j 
    300          ntei = MIN(ntsi + nn_tile_i - 1, jpim1)   ! Size of last tile limited by full domain 
    301          ntej = MIN(ntsj + nn_tile_j - 1, jpjm1)   ! 
    302          ntsim1 = ntsi - 1 
    303          ntsjm1 = ntsj - 1 
    304          nteip1 = ntei + 1 
    305          ntejp1 = ntej + 1 
    306       ELSE                                         ! Full domain 
    307          ntile = 1 
    308          ntsi = 2 
    309          ntsj = 2 
    310          ntei = jpim1 
    311          ntej = jpjm1 
    312          ntsim1 = 1 
    313          ntsjm1 = 1 
    314          nteip1 = jpi 
    315          ntejp1 = jpj 
     282      !!              - nijtile        : total number of tiles 
     283      !!---------------------------------------------------------------------- 
     284      INTEGER ::   jt               ! dummy loop argument 
     285      INTEGER ::   iitile, ijtile   ! Local integers 
     286      !!---------------------------------------------------------------------- 
     287      ntile = 0                     ! Initialise to full domain indices 
     288 
     289      IF( ln_tile ) THEN            ! Set tile decomposition 
     290         iitile = (jpi - 2 * nn_hls) / nn_ltile_i 
     291         ijtile = (jpj - 2 * nn_hls) / nn_ltile_j 
     292         IF( MOD( jpi - 2 * nn_hls, nn_ltile_i ) /= 0 ) iitile = iitile + 1 
     293         IF( MOD( jpj - 2 * nn_hls, nn_ltile_j ) /= 0 ) ijtile = ijtile + 1 
     294 
     295         nijtile = iitile * ijtile 
     296         ALLOCATE( ntsi(0:nijtile), ntsj(0:nijtile), ntei(0:nijtile), ntej(0:nijtile) ) 
     297      ELSE 
     298         nijtile = 1 
     299         ALLOCATE( ntsi(0:0), ntsj(0:0), ntei(0:0), ntej(0:0) ) 
     300      ENDIF 
     301 
     302      ntsi(0) = 1 + nn_hls          ! Full domain 
     303      ntsj(0) = 1 + nn_hls 
     304      ntei(0) = jpi - nn_hls 
     305      ntej(0) = jpj - nn_hls 
     306 
     307      IF( ln_tile ) THEN            ! Tile domains 
     308         DO jt = 1, nijtile 
     309            ntsi(jt) = ntsi(0) + nn_ltile_i * MOD(jt - 1, iitile) 
     310            ntsj(jt) = ntsj(0) + nn_ltile_j * ((jt - 1) / iitile) 
     311            ntei(jt) = MIN(ntsi(jt) + nn_ltile_i - 1, ntei(0)) 
     312            ntej(jt) = MIN(ntsj(jt) + nn_ltile_j - 1, ntej(0)) 
     313         ENDDO 
     314      ENDIF 
     315 
     316      IF(lwp) THEN                  ! control print 
     317         WRITE(numout,*) 
     318         WRITE(numout,*) 'dom_tile : Domain tiling decomposition' 
     319         WRITE(numout,*) '~~~~~~~~' 
     320         IF( ln_tile ) THEN 
     321            WRITE(numout,*) iitile, 'tiles in i' 
     322            WRITE(numout,*) '    Starting indices' 
     323            WRITE(numout,*) '        ', (ntsi(jt), jt=1, iitile) 
     324            WRITE(numout,*) '    Ending indices' 
     325            WRITE(numout,*) '        ', (ntei(jt), jt=1, iitile) 
     326            WRITE(numout,*) ijtile, 'tiles in j' 
     327            WRITE(numout,*) '    Starting indices' 
     328            WRITE(numout,*) '        ', (ntsj(jt), jt=1, nijtile, iitile) 
     329            WRITE(numout,*) '    Ending indices' 
     330            WRITE(numout,*) '        ', (ntej(jt), jt=1, nijtile, iitile) 
     331         ELSE 
     332            WRITE(numout,*) 'No domain tiling' 
     333            WRITE(numout,*) '    i indices =', ntsi(0), ':', ntei(0) 
     334            WRITE(numout,*) '    j indices =', ntsj(0), ':', ntej(0) 
     335         ENDIF 
    316336      ENDIF 
    317337   END SUBROUTINE dom_tile 
     
    339359         &             ln_cfmeta, ln_xios_read, nn_wxios 
    340360      NAMELIST/namdom/ ln_linssh, rn_Dt, rn_atfp, ln_crs, ln_meshmask 
    341       NAMELIST/namtile/ ln_tile, nn_tile_i, nn_tile_j 
     361      NAMELIST/namtile/ ln_tile, nn_ltile_i, nn_ltile_j 
    342362#if defined key_netcdf4 
    343363      NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip 
     
    473493      IF(lwm) WRITE( numond, namtile ) 
    474494 
    475       ! Set tile decomposition 
    476       IF( ln_tile ) THEN 
    477          jpnitile = (jpi - 2) / nn_tile_i 
    478          jpnjtile = (jpj - 2) / nn_tile_j 
    479          IF( MOD( jpi - 2, nn_tile_i ) /= 0 ) jpnitile = jpnitile + 1 
    480          IF( MOD( jpj - 2, nn_tile_j ) /= 0 ) jpnjtile = jpnjtile + 1 
    481       ELSE 
    482          jpnitile = 1 
    483          jpnjtile = 1 
    484       ENDIF 
    485       jpnijtile = jpnitile * jpnjtile 
    486  
    487495      IF(lwp) THEN 
    488496         WRITE(numout,*) 
    489          WRITE(numout,*)    '   Namelist : namtile   ---   tiling decomposition' 
     497         WRITE(numout,*)    '   Namelist : namtile   ---   Domain tiling decomposition' 
    490498         WRITE(numout,*)    '      Tiling (T) or not (F)                ln_tile   = ', ln_tile 
    491          WRITE(numout,*)    '      Length of tile in i                  nn_tile_i = ', nn_tile_i 
    492          WRITE(numout,*)    '      Length of tile in j                  nn_tile_j = ', nn_tile_j 
     499         WRITE(numout,*)    '      Length of tile in i                  nn_ltile_i = ', nn_ltile_i 
     500         WRITE(numout,*)    '      Length of tile in j                  nn_ltile_j = ', nn_ltile_j 
    493501         WRITE(numout,*) 
    494502         IF( ln_tile ) THEN 
    495             WRITE(numout,*) '      The domain will be decomposed into', jpnijtile, 'tiles of size', nn_tile_i, 'x', nn_tile_j 
     503            WRITE(numout,*) '      The domain will be decomposed into tiles of size', nn_ltile_i, 'x', nn_ltile_j 
    496504         ELSE 
    497505            WRITE(numout,*) '      Domain tiling will NOT be used' 
Note: See TracChangeset for help on using the changeset viewer.