Changeset 14537 for NEMO/branches/2021
- Timestamp:
- 2021-02-23T15:18:28+01:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/ASM/asminc.F90
r14090 r14537 26 26 USE par_oce ! Ocean space and time domain variables 27 27 USE dom_oce ! Ocean space and time domain 28 ! TEMP: [tiling] This change not necessary after extended haloes development 28 29 USE domtile 29 30 USE domvvl ! domain: variable volume level … … 519 520 ! 520 521 INTEGER :: ji, jj, jk 521 INTEGER :: it , itile522 INTEGER :: it 522 523 REAL(wp) :: zincwgt ! IAU weight for current time step 523 524 REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: fzptnz ! 3d freezing point values … … 541 542 zincwgt = wgtiau(it) / rn_Dt ! IAU weight for the current time step 542 543 ! 543 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile544 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 544 545 IF(lwp) THEN 545 546 WRITE(numout,*) … … 578 579 ENDIF 579 580 ! 580 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile581 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 581 582 IF ( kt == nitiaufin_r + 1 ) THEN ! For bias crcn to work 582 583 DEALLOCATE( t_bkginc ) … … 625 626 626 627 ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from zps_hde*) 627 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only for the full domain 628 itile = ntile 629 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Use full domain 628 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only for the full domain 629 IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='asminc' ) ! Use full domain 630 630 631 631 IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav) & … … 636 636 & rhd, gru , grv , grui, grvi ) ! of t, s, rd at the last ocean level 637 637 638 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = itile) ! Revert to tile domain638 IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='asminc' ) ! Revert to tile domain 639 639 ENDIF 640 640 641 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile641 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 642 642 DEALLOCATE( t_bkginc ) 643 643 DEALLOCATE( s_bkginc ) … … 683 683 zincwgt = wgtiau(it) / rn_Dt ! IAU weight for the current time step 684 684 ! 685 IF(lwp) THEN686 WRITE(numout,*)687 WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)688 WRITE(numout,*) '~~~~~~~~~~~~'689 ENDIF685 IF(lwp) THEN 686 WRITE(numout,*) 687 WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it) 688 WRITE(numout,*) '~~~~~~~~~~~~' 689 ENDIF 690 690 ! 691 691 ! Update the dynamic tendencies … … 695 695 END DO 696 696 ! 697 IF ( kt == nitiaufin_r ) THEN 698 DEALLOCATE( u_bkginc ) 699 DEALLOCATE( v_bkginc ) 697 IF ( kt == nitiaufin_r ) THEN 698 DEALLOCATE( u_bkginc ) 699 DEALLOCATE( v_bkginc ) 700 ENDIF 701 ! 700 702 ENDIF 701 !702 ENDIF703 703 ! !----------------------------------------- 704 704 ELSEIF ( ln_asmdin ) THEN ! Direct Initialization … … 754 754 zincwgt = wgtiau(it) / rn_Dt ! IAU weight for the current time step 755 755 ! 756 IF(lwp) THEN757 WRITE(numout,*)758 WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &759 & kt,' with IAU weight = ', wgtiau(it)760 WRITE(numout,*) '~~~~~~~~~~~~'761 ENDIF756 IF(lwp) THEN 757 WRITE(numout,*) 758 WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', & 759 & kt,' with IAU weight = ', wgtiau(it) 760 WRITE(numout,*) '~~~~~~~~~~~~' 761 ENDIF 762 762 ! 763 763 ! Save the tendency associated with the IAU weighted SSH increment … … 770 770 ! 771 771 ! test on ssh_bkginc needed as ssh_asm_inc is called twice by time step 772 IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc )772 IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc ) 773 773 ! 774 774 #if defined key_asminc … … 832 832 ALLOCATE( ztim(jpi,jpj) ) 833 833 ztim(:,:) = ssh_iau(:,:) / ( ht(:,:) + 1.0 - ssmask(:,:) ) 834 DO jk = 1, jpkm1834 DO jk = 1, jpkm1 835 835 phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk) 836 END DO836 END DO 837 837 ! 838 838 DEALLOCATE(ztim) … … 876 876 ! note this is not a tendency so should not be divided by rn_Dt (as with the tracer and other increments) 877 877 ! 878 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile878 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 879 879 IF(lwp) THEN 880 880 WRITE(numout,*) … … 920 920 #endif 921 921 ! 922 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile922 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 923 923 IF ( kt == nitiaufin_r ) THEN 924 924 DEALLOCATE( seaice_bkginc ) … … 979 979 END_2D 980 980 #endif 981 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile981 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 982 982 IF ( .NOT. PRESENT(kindic) ) THEN 983 983 DEALLOCATE( seaice_bkginc ) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/BDY/bdytra.F90
r14072 r14537 157 157 INTEGER :: ib_bdy ! Loop index 158 158 !!---------------------------------------------------------------------- 159 IF( ntile /= 0.AND. ntile /= 1 ) RETURN ! Do only for the full domain159 IF( l_istiled .AND. ntile /= 1 ) RETURN ! Do only for the full domain 160 160 ! 161 161 IF( ln_timing ) CALL timing_start('bdy_tra_dmp') -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DIA/diaptr.F90
r14229 r14537 93 93 94 94 ! Calculate diagnostics only when zonal integrals have finished 95 IF( ntile == 0.OR. ntile == nijtile ) CALL dia_ptr_iom(kt, Kmm, pvtr)95 IF( .NOT. l_istiled .OR. ntile == nijtile ) CALL dia_ptr_iom(kt, Kmm, pvtr) 96 96 ENDIF 97 97 … … 317 317 ! 318 318 IF( iom_use( 'uocetr_vsum_cumul' ) ) THEN 319 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = 0 )! Use full domain319 IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='diaptr' ) ! Use full domain 320 320 CALL iom_get_var( 'uocetr_vsum_op', z2d ) ! get uocetr_vsum_op from xml 321 321 z2d(:,:) = ptr_ci_2d( z2d(:,:) ) 322 322 CALL iom_put( 'uocetr_vsum_cumul', z2d ) 323 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = nijtile )! Revert to tile domain323 IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='diaptr' ) ! Revert to tile domain 324 324 ENDIF 325 325 ! … … 589 589 590 590 #if ! defined key_mpi_off 591 IF( ntile == 0.OR. ntile == nijtile ) THEN591 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN 592 592 ish1d(1) = jpj*nbasin 593 593 ish2d(1) = jpj ; ish2d(2) = nbasin … … 627 627 628 628 #if ! defined key_mpi_off 629 IF( ntile == 0.OR. ntile == nijtile ) THEN629 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN 630 630 ish1d(1) = jpj*jpk*nbasin 631 631 ish3d(1) = jpj ; ish3d(2) = jpk ; ish3d(3) = nbasin -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/dom_oce.F90
r14223 r14537 78 78 INTEGER :: nn_ltile_i, nn_ltile_j 79 79 80 ! Domain tiling (all tiles)80 ! Domain tiling 81 81 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntsi_a !: start of internal part of tile domain 82 82 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntsj_a ! 83 83 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntei_a !: end of internal part of tile domain 84 84 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntej_a ! 85 LOGICAL, PUBLIC :: l_istiled ! whether tiling is currently active or not 85 86 86 87 ! !: domain MPP decomposition parameters -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domain.F90
r14255 r14537 133 133 ! !== Reference coordinate system ==! 134 134 ! 135 CALL dom_glo 136 CALL dom_nam 137 CALL dom_tile ( ntsi, ntsj, ntei, ntej )! Tile domain135 CALL dom_glo ! global domain versus local domain 136 CALL dom_nam ! read namelist ( namrun, namdom ) 137 CALL dom_tile_init ! Tile domain 138 138 139 139 ! -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domtile.F90
r14090 r14537 13 13 ! 14 14 USE prtctl ! Print control (prt_ctl_info routine) 15 USE lib_mpp , ONLY : ctl_stop, ctl_warn 15 16 USE in_out_manager ! I/O manager 16 17 … … 18 19 PRIVATE 19 20 20 PUBLIC dom_tile ! called by step.F90 21 PUBLIC dom_tile ! called by step.F90 22 PUBLIC dom_tile_start ! called by various 23 PUBLIC dom_tile_stop ! " " 24 PUBLIC dom_tile_init ! called by domain.F90 25 26 LOGICAL, ALLOCATABLE, DIMENSION(:) :: l_tilefin ! whether a tile is finished or not 21 27 22 28 !!---------------------------------------------------------------------- … … 27 33 CONTAINS 28 34 29 SUBROUTINE dom_tile( ktsi, ktsj, ktei, ktej, ktile ) 35 SUBROUTINE dom_tile_init 36 !!---------------------------------------------------------------------- 37 !! *** ROUTINE dom_tile_init *** 38 !! 39 !! ** Purpose : Initialise tile domain variables 40 !! 41 !! ** Action : - ntsi, ntsj : start of internal part of domain 42 !! - ntei, ntej : end of internal part of domain 43 !! - ntile : current tile number 44 !! - nijtile : total number of tiles 45 !! - nthl, nthr : modifier on DO loop macro bound offset (left, right) 46 !! - nthb, ntht : " " (bottom, top) 47 !! - l_istiled : whether tiling is currently active or not 48 !! - l_tilefin : whether a tile is finished or not 49 !!---------------------------------------------------------------------- 50 INTEGER :: jt ! dummy loop argument 51 INTEGER :: iitile, ijtile ! Local integers 52 !!---------------------------------------------------------------------- 53 ntile = 0 ! Initialise to full domain 54 nijtile = 1 55 ntsi = Nis0 56 ntsj = Njs0 57 ntei = Nie0 58 ntej = Nje0 59 nthl = 0 60 nthr = 0 61 nthb = 0 62 ntht = 0 63 l_istiled = .FALSE. 64 65 IF( ln_tile ) THEN ! Calculate tile domain indices 66 iitile = Ni_0 / nn_ltile_i ! Number of tiles 67 ijtile = Nj_0 / nn_ltile_j 68 IF( MOD( Ni_0, nn_ltile_i ) /= 0 ) iitile = iitile + 1 69 IF( MOD( Nj_0, nn_ltile_j ) /= 0 ) ijtile = ijtile + 1 70 71 nijtile = iitile * ijtile 72 ALLOCATE( ntsi_a(0:nijtile), ntsj_a(0:nijtile), ntei_a(0:nijtile), ntej_a(0:nijtile), l_tilefin(nijtile) ) 73 74 l_tilefin(:) = .FALSE. 75 76 ntsi_a(0) = Nis0 ! Full domain 77 ntsj_a(0) = Njs0 78 ntei_a(0) = Nie0 79 ntej_a(0) = Nje0 80 81 DO jt = 1, nijtile ! Tile domains 82 ntsi_a(jt) = Nis0 + nn_ltile_i * MOD(jt - 1, iitile) 83 ntsj_a(jt) = Njs0 + nn_ltile_j * ((jt - 1) / iitile) 84 ntei_a(jt) = MIN(ntsi_a(jt) + nn_ltile_i - 1, Nie0) 85 ntej_a(jt) = MIN(ntsj_a(jt) + nn_ltile_j - 1, Nje0) 86 ENDDO 87 ENDIF 88 89 IF(lwp) THEN ! control print 90 WRITE(numout,*) 91 WRITE(numout,*) 'dom_tile : Domain tiling decomposition' 92 WRITE(numout,*) '~~~~~~~~' 93 IF( ln_tile ) THEN 94 WRITE(numout,*) iitile, 'tiles in i' 95 WRITE(numout,*) ' Starting indices' 96 WRITE(numout,*) ' ', (ntsi_a(jt), jt=1, iitile) 97 WRITE(numout,*) ' Ending indices' 98 WRITE(numout,*) ' ', (ntei_a(jt), jt=1, iitile) 99 WRITE(numout,*) ijtile, 'tiles in j' 100 WRITE(numout,*) ' Starting indices' 101 WRITE(numout,*) ' ', (ntsj_a(jt), jt=1, nijtile, iitile) 102 WRITE(numout,*) ' Ending indices' 103 WRITE(numout,*) ' ', (ntej_a(jt), jt=1, nijtile, iitile) 104 ELSE 105 WRITE(numout,*) 'No domain tiling' 106 WRITE(numout,*) ' i indices =', ntsi, ':', ntei 107 WRITE(numout,*) ' j indices =', ntsj, ':', ntej 108 ENDIF 109 ENDIF 110 END SUBROUTINE dom_tile_init 111 112 113 SUBROUTINE dom_tile( ktsi, ktsj, ktei, ktej, ktile, ldhold, cstr ) 30 114 !!---------------------------------------------------------------------- 31 115 !! *** ROUTINE dom_tile *** 32 116 !! 33 !! ** Purpose : Set t ile domain variables117 !! ** Purpose : Set the current tile and its domain indices 34 118 !! 35 119 !! ** Action : - ktsi, ktsj : start of internal part of domain 36 120 !! - ktei, ktej : end of internal part of domain 37 !! - ntile : current tile number 38 !! - nijtile : total number of tiles 121 !! - nthl, nthr : modifier on DO loop macro bound offset (left, right) 122 !! - nthb, ntht : " " (bottom, top) 123 !! - ktile : set the current tile number (ntile) 39 124 !!---------------------------------------------------------------------- 40 125 INTEGER, INTENT(out) :: ktsi, ktsj, ktei, ktej ! Tile domain indices 41 INTEGER, INTENT(in), OPTIONAL :: ktile ! Tile number 42 INTEGER :: jt ! dummy loop argument 43 INTEGER :: iitile, ijtile ! Local integers 44 CHARACTER (len=11) :: charout 45 !!---------------------------------------------------------------------- 46 IF( PRESENT(ktile) .AND. ln_tile ) THEN 47 ntile = ktile ! Set domain indices for tile 48 ktsi = ntsi_a(ktile) 49 ktsj = ntsj_a(ktile) 50 ktei = ntei_a(ktile) 51 ktej = ntej_a(ktile) 52 126 INTEGER, INTENT(in) :: ktile ! Tile number 127 LOGICAL, INTENT(in), OPTIONAL :: ldhold ! Pause/resume (.true.) or set (.false.) current tile 128 ! TEMP: [tiling] DEBUG 129 CHARACTER(len=*), INTENT(in), OPTIONAL :: cstr 130 CHARACTER(len=23) :: clstr 131 LOGICAL :: llhold 132 CHARACTER(len=11) :: charout 133 !!---------------------------------------------------------------------- 134 llhold = .FALSE. 135 IF( PRESENT(ldhold) ) llhold = ldhold 136 clstr = '' 137 IF( PRESENT(cstr) ) clstr = TRIM(' ('//TRIM(cstr)//')') 138 139 IF( .NOT. ln_tile ) CALL ctl_stop('Cannot use dom_tile with ln_tile = .false.') 140 IF( .NOT. llhold ) THEN 141 IF( .NOT. l_istiled ) THEN 142 CALL ctl_warn('Cannot call dom_tile when tiling is inactive'//clstr) 143 RETURN 144 ENDIF 145 146 IF( ntile /= 0 ) l_tilefin(ntile) = .TRUE. ! If setting a new tile, the current tile is complete 147 148 ntile = ktile ! Set the new tile 53 149 IF(sn_cfctl%l_prtctl) THEN 54 WRITE(charout, FMT="('ntile =', I4)") ktile150 WRITE(charout, FMT="('ntile =', I4)") ntile 55 151 CALL prt_ctl_info( charout ) 56 152 ENDIF 57 ELSE 58 ntile = 0 ! Initialise to full domain 59 nijtile = 1 60 ktsi = Nis0 61 ktsj = Njs0 62 ktei = Nie0 63 ktej = Nje0 64 65 IF( ln_tile ) THEN ! Calculate tile domain indices 66 iitile = Ni_0 / nn_ltile_i ! Number of tiles 67 ijtile = Nj_0 / nn_ltile_j 68 IF( MOD( Ni_0, nn_ltile_i ) /= 0 ) iitile = iitile + 1 69 IF( MOD( Nj_0, nn_ltile_j ) /= 0 ) ijtile = ijtile + 1 70 71 nijtile = iitile * ijtile 72 ALLOCATE( ntsi_a(0:nijtile), ntsj_a(0:nijtile), ntei_a(0:nijtile), ntej_a(0:nijtile) ) 73 74 ntsi_a(0) = ktsi ! Full domain 75 ntsj_a(0) = ktsj 76 ntei_a(0) = ktei 77 ntej_a(0) = ktej 78 79 DO jt = 1, nijtile ! Tile domains 80 ntsi_a(jt) = Nis0 + nn_ltile_i * MOD(jt - 1, iitile) 81 ntsj_a(jt) = Njs0 + nn_ltile_j * ((jt - 1) / iitile) 82 ntei_a(jt) = MIN(ntsi_a(jt) + nn_ltile_i - 1, Nie0) 83 ntej_a(jt) = MIN(ntsj_a(jt) + nn_ltile_j - 1, Nje0) 84 ENDDO 85 ENDIF 86 87 IF(lwp) THEN ! control print 88 WRITE(numout,*) 89 WRITE(numout,*) 'dom_tile : Domain tiling decomposition' 90 WRITE(numout,*) '~~~~~~~~' 91 IF( ln_tile ) THEN 92 WRITE(numout,*) iitile, 'tiles in i' 93 WRITE(numout,*) ' Starting indices' 94 WRITE(numout,*) ' ', (ntsi_a(jt), jt=1, iitile) 95 WRITE(numout,*) ' Ending indices' 96 WRITE(numout,*) ' ', (ntei_a(jt), jt=1, iitile) 97 WRITE(numout,*) ijtile, 'tiles in j' 98 WRITE(numout,*) ' Starting indices' 99 WRITE(numout,*) ' ', (ntsj_a(jt), jt=1, nijtile, iitile) 100 WRITE(numout,*) ' Ending indices' 101 WRITE(numout,*) ' ', (ntej_a(jt), jt=1, nijtile, iitile) 102 ELSE 103 WRITE(numout,*) 'No domain tiling' 104 WRITE(numout,*) ' i indices =', ktsi, ':', ktei 105 WRITE(numout,*) ' j indices =', ktsj, ':', ktej 106 ENDIF 107 ENDIF 108 ENDIF 153 ENDIF 154 155 ktsi = ntsi_a(ktile) ! Set the domain indices 156 ktsj = ntsj_a(ktile) 157 ktei = ntei_a(ktile) 158 ktej = ntej_a(ktile) 159 160 ! Calculate the modifying factor on DO loop bounds (1 = do not work on halo of a tile that has already been processed) 161 nthl = 0 ; nthr = 0 ; nthb = 0 ; ntht = 0 162 IF( ktsi > Nis0 ) THEN ; IF( l_tilefin(ktile - 1 ) ) nthl = 1 ; ENDIF ! Left adjacent tile 163 IF( ktei < Nie0 ) THEN ; IF( l_tilefin(ktile + 1 ) ) nthr = 1 ; ENDIF ! Right " " 164 IF( ktsj > Njs0 ) THEN ; IF( l_tilefin(ktile - nn_ltile_i) ) nthb = 1 ; ENDIF ! Bottom " " 165 IF( ktej < Nje0 ) THEN ; IF( l_tilefin(ktile + nn_ltile_i) ) ntht = 1 ; ENDIF ! Top " " 109 166 END SUBROUTINE dom_tile 110 167 168 169 SUBROUTINE dom_tile_start( ldhold, cstr ) 170 !!---------------------------------------------------------------------- 171 !! *** ROUTINE dom_tile_start *** 172 !! 173 !! ** Purpose : Start or resume the use of tiling 174 !! 175 !! ** Method : dom_tile_start & dom_tile_stop are used to declare a tiled region of code. 176 !! 177 !! Tiling is active/inactive (l_istiled = .true./.false.) within/outside of this code region. 178 !! After enabling tiling, no tile will initially be set (the full domain will be used) and dom_tile must 179 !! be called to set a specific tile to work on. Furthermore, all tiles will be marked as incomplete 180 !! (ln_tilefin(:) = .false.). 181 !! 182 !! Tiling can be paused/resumed within the tiled code region by calling dom_tile_stop/dom_tile_start 183 !! with ldhold = .true.. This can be used to temporarily revert back to using the full domain. 184 !! 185 !! CALL dom_tile_start ! Enable tiling 186 !! CALL dom_tile(ntsi, ntei, ntsj, ntej, ktile=n) ! Set current tile "n" 187 !! ... 188 !! CALL dom_tile_stop(.TRUE.) ! Pause tiling (temporarily disable) 189 !! ... 190 !! CALL dom_tile_start(.TRUE.) ! Resume tiling 191 !! CALL dom_tile_stop ! Disable tiling 192 !!---------------------------------------------------------------------- 193 LOGICAL, INTENT(in), OPTIONAL :: ldhold ! Resume (.true.) or start (.false.) 194 LOGICAL :: llhold 195 ! TEMP: [tiling] DEBUG 196 CHARACTER(len=*), INTENT(in), OPTIONAL :: cstr 197 CHARACTER(len=23) :: clstr 198 !!---------------------------------------------------------------------- 199 llhold = .FALSE. 200 IF( PRESENT(ldhold) ) llhold = ldhold 201 clstr = '' 202 IF( PRESENT(cstr) ) clstr = TRIM(' ('//TRIM(cstr)//')') 203 204 IF( .NOT. ln_tile ) CALL ctl_stop('Cannot resume/start tiling as ln_tile = .false.') 205 IF( l_istiled ) THEN 206 CALL ctl_warn('Cannot resume/start tiling as it is already active'//clstr) 207 RETURN 208 ! TODO: This warning will always be raised outside a tiling loop (cannot check for pause rather than stop) 209 ELSE IF( llhold .AND. ntile == 0 ) THEN 210 CALL ctl_warn('Cannot resume tiling as it is not paused'//clstr) 211 RETURN 212 ENDIF 213 214 ! Whether resumed or started, the tiling is made active. If resumed, the domain indices for the current tile are used. 215 IF( llhold ) CALL dom_tile(ntsi, ntsj, ntei, ntej, ktile=ntile, ldhold=.TRUE., cstr='dom_tile_start'//clstr) 216 l_istiled = .TRUE. 217 END SUBROUTINE dom_tile_start 218 219 220 SUBROUTINE dom_tile_stop( ldhold, cstr ) 221 !!---------------------------------------------------------------------- 222 !! *** ROUTINE dom_tile_stop *** 223 !! 224 !! ** Purpose : End or pause the use of tiling 225 !! 226 !! ** Method : See dom_tile_start 227 !!---------------------------------------------------------------------- 228 LOGICAL, INTENT(in), OPTIONAL :: ldhold ! Pause (.true.) or stop (.false.) 229 LOGICAL :: llhold 230 ! TEMP: [tiling] DEBUG 231 CHARACTER(len=*), INTENT(in), OPTIONAL :: cstr 232 CHARACTER(len=23) :: clstr 233 !!---------------------------------------------------------------------- 234 llhold = .FALSE. 235 IF( PRESENT(ldhold) ) llhold = ldhold 236 clstr = '' 237 IF( PRESENT(cstr) ) clstr = TRIM(' ('//TRIM(cstr)//')') 238 239 IF( .NOT. ln_tile ) CALL ctl_stop('Cannot pause/stop tiling as ln_tile = .false.') 240 IF( .NOT. l_istiled ) THEN 241 CALL ctl_warn('Cannot pause/stop tiling as it is inactive'//clstr) 242 RETURN 243 ENDIF 244 245 ! Whether paused or stopped, the tiling is made inactive and the full domain indices are used. 246 ! If stopped, there is no active tile (ntile = 0) and the finished tile indicators are reset 247 CALL dom_tile(ntsi, ntsj, ntei, ntej, ktile=0, ldhold=llhold, cstr='dom_tile_stop'//clstr) 248 IF( .NOT. llhold ) l_tilefin(:) = .FALSE. 249 l_istiled = .FALSE. 250 END SUBROUTINE dom_tile_stop 111 251 !!====================================================================== 112 252 END MODULE domtile -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/dtatsd.F90
r14189 r14537 141 141 INTEGER :: ji, jj, jk, jl, jkk ! dummy loop indicies 142 142 INTEGER :: ik, il0, il1, ii0, ii1, ij0, ij1 ! local integers 143 INTEGER :: itile144 143 INTEGER, DIMENSION(jpts), SAVE :: irec_b, irec_n 145 144 REAL(wp):: zl, zi ! local scalars … … 147 146 !!---------------------------------------------------------------------- 148 147 ! 149 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only for the full domain 150 itile = ntile 151 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Use full domain 148 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only for the full domain 149 IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='dtatsd' ) ! Use full domain 152 150 CALL fld_read( kt, 1, sf_tsd ) !== read T & S data at kt time step ==! 153 151 ! … … 195 193 ENDIF 196 194 !!gm end 197 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = itile) ! Revert to tile domain195 IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='dtatsd' ) ! Revert to tile domain 198 196 ENDIF 199 197 ! … … 205 203 IF( ln_sco ) THEN !== s- or mixed s-zps-coordinate ==! 206 204 ! 207 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile205 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 208 206 IF( kt == nit000 .AND. lwp )THEN 209 207 WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/LDF/ldftra.F90
r14201 r14537 739 739 !!---------------------------------------------------------------------- 740 740 ! 741 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile741 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 742 742 IF( kt == kit000 ) THEN 743 743 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traadv.F90
r14189 r14537 105 105 106 106 ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support) 107 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile107 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 108 108 ALLOCATE( zuu(jpi,jpj,jpk), zvv(jpi,jpj,jpk), zww(jpi,jpj,jpk) ) 109 109 ENDIF … … 113 113 IF( ln_tile ) THEN 114 114 IF( ntile == 1 ) THEN 115 CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = 0)115 CALL dom_tile_stop( ldhold=.TRUE., cstr='traadv' ) 116 116 ELSE 117 117 lskip = .TRUE. … … 157 157 ! 158 158 ! TEMP: [tiling] This change not necessary if using XIOS (subdomain support) 159 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile159 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 160 160 CALL iom_put( "uocetr_eff", zuu ) ! output effective transport 161 161 CALL iom_put( "vocetr_eff", zvv ) … … 226 226 227 227 ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_adv_*) and if XIOS has subdomain support (ldf_eiv_dia) 228 IF( ln_tile .AND. ntile == 0 ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1 ) 229 228 IF( ln_tile .AND. .NOT. l_istiled ) CALL dom_tile_start( ldhold=.TRUE., cstr='traadv' ) 230 229 ENDIF 231 230 ! ! print mean trends (used for debugging) … … 234 233 235 234 ! TEMP: [tiling] This change not necessary if using XIOS (subdomain support) 236 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only for the full domain235 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only for the full domain 237 236 DEALLOCATE( zuu, zvv, zww ) 238 237 ENDIF -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_cen.F90
r14072 r14537 82 82 !!---------------------------------------------------------------------- 83 83 ! 84 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile84 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 85 85 IF( kt == kit000 ) THEN 86 86 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_fct.F90
r14189 r14537 95 95 !!---------------------------------------------------------------------- 96 96 ! 97 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile97 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 98 98 IF( kt == kit000 ) THEN 99 99 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_mus.F90
r14072 r14537 93 93 !!---------------------------------------------------------------------- 94 94 ! 95 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile95 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 96 96 IF( kt == kit000 ) THEN 97 97 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_qck.F90
r14215 r14537 96 96 !!---------------------------------------------------------------------- 97 97 ! 98 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile98 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 99 99 IF( kt == kit000 ) THEN 100 100 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_ubs.F90
r14072 r14537 103 103 !!---------------------------------------------------------------------- 104 104 ! 105 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile105 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 106 106 IF( kt == kit000 ) THEN 107 107 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbl.F90
r14215 r14537 127 127 & tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 128 128 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only on the last tile 129 130 129 CALL iom_put( "ahu_bbl", ahu_bbl ) ! bbl diffusive flux i-coef 130 CALL iom_put( "ahv_bbl", ahv_bbl ) ! bbl diffusive flux j-coef 131 131 ENDIF 132 132 ! … … 139 139 CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_adv - Ta: ', mask1=tmask, & 140 140 & tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 141 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile141 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 142 142 ! lateral boundary conditions ; just need for outputs 143 143 CALL lbc_lnk_multi( 'trabbl', utr_bbl, 'U', 1.0_wp , vtr_bbl, 'V', 1.0_wp ) 144 145 144 CALL iom_put( "uoce_bbl", utr_bbl ) ! bbl i-transport 145 CALL iom_put( "voce_bbl", vtr_bbl ) ! bbl j-transport 146 146 ENDIF 147 147 ! … … 238 238 INTEGER :: iis , iid , ijs , ijd ! local integers 239 239 INTEGER :: ikus, ikud, ikvs, ikvd ! - - 240 INTEGER :: isi, isj ! - -241 240 REAL(wp) :: zbtr, ztra ! local scalars 242 241 REAL(wp) :: zu_bbl, zv_bbl ! - - 243 242 !!---------------------------------------------------------------------- 244 !245 IF( ntsi == Nis0 ) THEN ; isi = 1 ; ELSE ; isi = 0 ; ENDIF ! Avoid double-counting when using tiling246 IF( ntsj == Njs0 ) THEN ; isj = 1 ; ELSE ; isj = 0 ; ENDIF247 243 ! ! =========== 248 244 DO jn = 1, kjpt ! tracer loop 249 245 ! ! =========== 250 DO_2D ( isi, 0, isj, 0 ) ! CAUTION start from i=1 to update i=2 when cyclic east-west246 DO_2D_OVR( 1, 0, 1, 0 ) ! CAUTION start from i=1 to update i=2 when cyclic east-west 251 247 IF( utr_bbl(ji,jj) /= 0.e0 ) THEN ! non-zero i-direction bbl advection 252 248 ! down-slope i/k-indices (deep) & up-slope i/k indices (shelf) … … 340 336 !!---------------------------------------------------------------------- 341 337 ! 342 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile338 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 343 339 IF( kt == kit000 ) THEN 344 340 IF(lwp) WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traisf.F90
r14072 r14537 47 47 IF( ln_timing ) CALL timing_start('tra_isf') 48 48 ! 49 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile49 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 50 50 IF( kt == nit000 ) THEN 51 51 IF(lwp) WRITE(numout,*) … … 79 79 ! 80 80 IF ( ln_isfdebug ) THEN 81 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only for the full domain81 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only for the full domain 82 82 CALL debug('tra_isf: pts(:,:,:,:,Krhs) T', pts(:,:,:,1,Krhs)) 83 83 CALL debug('tra_isf: pts(:,:,:,:,Krhs) S', pts(:,:,:,2,Krhs)) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traldf.F90
r14189 r14537 76 76 IF( ln_tile ) THEN 77 77 IF( ntile == 1 ) THEN 78 CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = 0)78 CALL dom_tile_stop( ldhold=.TRUE., cstr='traldf' ) 79 79 ELSE 80 80 lskip = .TRUE. … … 105 105 106 106 ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*) 107 IF( ln_tile .AND. ntile == 0 ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1)107 IF( ln_tile .AND. .NOT. l_istiled ) CALL dom_tile_start( ldhold=.TRUE., cstr='traldf' ) 108 108 ENDIF 109 109 ! !* print mean trends (used for debugging) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traldf_iso.F90
r14072 r14537 141 141 ! 142 142 IF( kpass == 1 .AND. kt == kit000 ) THEN 143 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile143 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 144 144 IF(lwp) WRITE(numout,*) 145 145 IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype … … 153 153 ENDIF 154 154 ! 155 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile155 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 156 156 l_hst = .FALSE. 157 157 l_ptr = .FALSE. -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traldf_lap_blp.F90
r14215 r14537 103 103 ! 104 104 INTEGER :: ji, jj, jk, jn ! dummy loop indices 105 INTEGER :: isi, iei, isj, iej ! local integers106 105 REAL(wp) :: zsign ! local scalars 107 106 REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: ztu, ztv, zaheeu, zaheev 108 107 !!---------------------------------------------------------------------- 109 108 ! 110 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile109 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 111 110 IF( kt == nit000 .AND. lwp ) THEN 112 111 WRITE(numout,*) … … 126 125 ELSE ; zsign = -1._wp 127 126 ENDIF 128 129 IF( ntsi == Nis0 ) THEN ; isi = nn_hls - 1 ; ELSE ; isi = 0 ; ENDIF ! Avoid double-counting when using tiling130 IF( ntsj == Njs0 ) THEN ; isj = nn_hls - 1 ; ELSE ; isj = 0 ; ENDIF131 IF( ntei == Nie0 ) THEN ; iei = nn_hls - 1 ; ELSE ; iei = 0 ; ENDIF132 IF( ntej == Nje0 ) THEN ; iej = nn_hls - 1 ; ELSE ; iej = 0 ; ENDIF133 127 134 128 DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 ) !== First derivative (gradient) ==! … … 158 152 ENDIF 159 153 ! 160 DO_3D ( isi, iei, isj, iej, 1, jpkm1 )!== Second derivative (divergence) added to the general tracer trends ==!154 DO_3D_OVR( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 ) !== Second derivative (divergence) added to the general tracer trends ==! 161 155 pt_rhs(ji,jj,jk,jn) = pt_rhs(ji,jj,jk,jn) + ( ztu(ji,jj,jk) - ztu(ji-1,jj,jk) & 162 156 & + ztv(ji,jj,jk) - ztv(ji,jj-1,jk) ) & … … 211 205 !!--------------------------------------------------------------------- 212 206 ! 213 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile207 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 214 208 IF( kt == kit000 .AND. lwp ) THEN 215 209 WRITE(numout,*) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traldf_triad.F90
r14215 r14537 126 126 !!---------------------------------------------------------------------- 127 127 ! 128 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile128 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 129 129 IF( kpass == 1 .AND. kt == kit000 ) THEN 130 130 IF(lwp) WRITE(numout,*) … … 219 219 ! 220 220 ! TEMP: [tiling] These changes not necessary if XIOS has subdomain support 221 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only for the full domain221 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only for the full domain 222 222 IF( ln_ldfeiv_dia .AND. cdtype == 'TRA' ) THEN 223 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = 0)223 IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='traldf_triad' ) 224 224 225 225 zpsi_uw(:,:,:) = 0._wp … … 238 238 CALL ldf_eiv_dia( zpsi_uw, zpsi_vw, Kmm ) 239 239 240 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile)240 IF( ln_tile .AND. .NOT. l_istiled ) CALL dom_tile_start( ldhold=.TRUE., cstr='traldf_triad' ) 241 241 ENDIF 242 242 ENDIF -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/tranpc.F90
r14215 r14537 81 81 LOGICAL, PARAMETER :: l_LB_debug = .FALSE. ! set to true if you want to follow what is 82 82 INTEGER :: ilc1, jlc1, klc1, nncpu ! actually happening in a water column at point "ilc1, jlc1" 83 INTEGER :: isi, isj, iei, iej84 83 LOGICAL :: lp_monitor_point = .FALSE. ! in CPU domain "nncpu" 85 84 !!---------------------------------------------------------------------- … … 105 104 CALL bn2 ( pts(:,:,:,:,Kaa), zab, zn2, Kmm ) ! after Brunt-Vaisala (given on W-points) 106 105 ! 107 IF( ntile == 0 .OR. ntile == 1 ) nnpcc = 0 ! Do only on the first tile 108 ! 109 IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF ! Avoid double-counting when using tiling 110 IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF 111 IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF 112 IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF 113 ! 114 DO_2D( isi, iei, isj, iej ) ! interior column only 106 IF( .NOT. l_istiled .OR. ntile == 1 ) nnpcc = 0 ! Do only on the first tile 107 ! 108 DO_2D_OVR( 0, 0, 0, 0 ) ! interior column only 115 109 ! 116 110 IF( tmask(ji,jj,2) == 1 ) THEN ! At least 2 ocean points … … 319 313 ENDIF 320 314 ! 321 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only for the full domain315 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only for the full domain 322 316 IF( lwp .AND. l_LB_debug ) THEN 323 317 WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', nnpcc -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traqsr.F90
r14215 r14537 108 108 ! 109 109 INTEGER :: ji, jj, jk ! dummy loop indices 110 INTEGER :: irgb , isi, iei, isj, iej! local integers110 INTEGER :: irgb ! local integers 111 111 REAL(wp) :: zchl, zcoef, z1_2 ! local scalars 112 112 REAL(wp) :: zc0 , zc1 , zc2 , zc3 ! - - … … 121 121 IF( ln_timing ) CALL timing_start('tra_qsr') 122 122 ! 123 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile123 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 124 124 IF( kt == nit000 ) THEN 125 125 IF(lwp) WRITE(numout,*) … … 137 137 ! ! before qsr induced heat content ! 138 138 ! !-----------------------------------! 139 IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF ! Avoid double-counting when using tiling140 IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF141 IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF142 IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF143 144 139 IF( kt == nit000 ) THEN !== 1st time step ==! 145 140 IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN ! read in restart 146 141 z1_2 = 0.5_wp 147 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile142 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 148 143 IF(lwp) WRITE(numout,*) ' nit000-1 qsr tracer content forcing field read in the restart file' 149 144 CALL iom_get( numror, jpdom_auto, 'qsr_hc_b', qsr_hc_b ) ! before heat content trend due to Qsr flux … … 151 146 ELSE ! No restart or Euler forward at 1st time step 152 147 z1_2 = 1._wp 153 DO_3D ( isi, iei, isj, iej, 1, jpk )148 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) 154 149 qsr_hc_b(ji,jj,jk) = 0._wp 155 150 END_3D … … 157 152 ELSE !== Swap of qsr heat content ==! 158 153 z1_2 = 0.5_wp 159 DO_3D ( isi, iei, isj, iej, 1, jpk )154 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) 160 155 qsr_hc_b(ji,jj,jk) = qsr_hc(ji,jj,jk) 161 156 END_3D … … 168 163 CASE( np_BIO ) !== bio-model fluxes ==! 169 164 ! 170 DO_3D ( isi, iei, isj, iej, 1, nksr )165 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 1, nksr ) 171 166 qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( etot3(ji,jj,jk) - etot3(ji,jj,jk+1) ) 172 167 END_3D … … 179 174 ! 180 175 IF( nqsr == np_RGBc ) THEN !* Variable Chlorophyll 181 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only for the full domain182 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = 0 )! Use full domain176 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only for the full domain 177 IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='traqsr' ) ! Use full domain 183 178 CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step 184 IF( ln_tile ) CALL dom_tile ( ntsi, ntsj, ntei, ntej, ktile = 1) ! Revert to tile domain179 IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='traqsr' ) ! Revert to tile domain 185 180 ENDIF 186 181 ! … … 190 185 ! most expensive calculations) 191 186 ! 192 DO_2D ( isi, iei, isj, iej)187 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 193 188 ! zlogc = log(zchl) 194 189 zlogc = LOG ( MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) ) … … 209 204 210 205 ! 211 DO_3D ( isi, iei, isj, iej, 1, nksr + 1 )206 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 1, nksr + 1 ) 212 207 ! zchl = ALOG( ze0(ji,jj) ) 213 208 zlogc = ze0(ji,jj) … … 239 234 ! 240 235 zcoef = ( 1. - rn_abs ) / 3._wp !* surface equi-partition in R-G-B 241 DO_2D ( isi, iei, isj, iej)236 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 242 237 ze0(ji,jj) = rn_abs * qsr(ji,jj) 243 238 ze1(ji,jj) = zcoef * qsr(ji,jj) … … 250 245 ! 251 246 ! !* interior equi-partition in R-G-B depending on vertical profile of Chl 252 DO_3D ( isi, iei, isj, iej, 2, nksr + 1 )247 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 2, nksr + 1 ) 253 248 ze3t = e3t(ji,jj,jk-1,Kmm) 254 249 irgb = NINT( ztmp3d(ji,jj,jk) ) … … 264 259 END_3D 265 260 ! 266 DO_3D ( isi, iei, isj, iej, 1, nksr ) !* now qsr induced heat content261 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 1, nksr ) !* now qsr induced heat content 267 262 qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( ztmp3d(ji,jj,jk) - ztmp3d(ji,jj,jk+1) ) 268 263 END_3D … … 274 269 zz0 = rn_abs * r1_rho0_rcp ! surface equi-partition in 2-bands 275 270 zz1 = ( 1. - rn_abs ) * r1_rho0_rcp 276 DO_3D ( isi, iei, isj, iej, 1, nksr ) !* now qsr induced heat content271 DO_3D_OVR( nn_hls, nn_hls, nn_hls, nn_hls, 1, nksr ) !* now qsr induced heat content 277 272 zc0 = zz0 * EXP( -gdepw(ji,jj,jk ,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk ,Kmm)*xsi1r ) 278 273 zc1 = zz0 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi1r ) … … 292 287 ! 293 288 ! sea-ice: store the 1st ocean level attenuation coefficient 294 DO_2D ( isi, iei, isj, iej)289 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 295 290 IF( qsr(ji,jj) /= 0._wp ) THEN ; fraqsr_1lev(ji,jj) = qsr_hc(ji,jj,1) / ( r1_rho0_rcp * qsr(ji,jj) ) 296 291 ELSE ; fraqsr_1lev(ji,jj) = 1._wp … … 299 294 ! 300 295 ! TEMP: [tiling] This change not necessary and working array can use A2D(nn_hls) if using XIOS (subdomain support) 301 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only for the full domain296 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only for the full domain 302 297 IF( iom_use('qsr3d') ) THEN ! output the shortwave Radiation distribution 303 298 ALLOCATE( zetot(jpi,jpj,jpk) ) … … 311 306 ENDIF 312 307 ! 313 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile308 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 314 309 IF( lrst_oce ) THEN ! write in the ocean restart file 315 310 CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc ) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trasbc.F90
r14215 r14537 77 77 ! 78 78 INTEGER :: ji, jj, jk, jn ! dummy loop indices 79 INTEGER :: ikt, ikb , isi, iei, isj, iej! local integers79 INTEGER :: ikt, ikb ! local integers 80 80 REAL(wp) :: zfact, z1_e3t, zdep, ztim ! local scalar 81 81 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds … … 84 84 IF( ln_timing ) CALL timing_start('tra_sbc') 85 85 ! 86 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile86 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 87 87 IF( kt == nit000 ) THEN 88 88 IF(lwp) WRITE(numout,*) … … 98 98 ENDIF 99 99 ! 100 IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF ! Avoid double-counting when using tiling101 IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF102 IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF103 IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF104 105 100 !!gm This should be moved into sbcmod.F90 module ? (especially now that ln_traqsr is read in namsbc namelist) 106 101 IF( .NOT.ln_traqsr ) THEN ! no solar radiation penetration 107 DO_2D ( isi, iei, isj, iej)102 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 108 103 qns(ji,jj) = qns(ji,jj) + qsr(ji,jj) ! total heat flux in qns 109 104 qsr(ji,jj) = 0._wp ! qsr set to zero … … 118 113 IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN ! Restart: read in restart file 119 114 zfact = 0.5_wp 120 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile115 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 121 116 IF(lwp) WRITE(numout,*) ' nit000-1 sbc tracer content field read in the restart file' 122 117 sbc_tsc(:,:,:) = 0._wp … … 126 121 ELSE ! No restart or restart not found: Euler forward time stepping 127 122 zfact = 1._wp 128 DO_2D ( isi, iei, isj, iej)123 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 129 124 sbc_tsc(ji,jj,:) = 0._wp 130 125 sbc_tsc_b(ji,jj,:) = 0._wp … … 133 128 ELSE !* other time-steps: swap of forcing fields 134 129 zfact = 0.5_wp 135 DO_2D ( isi, iei, isj, iej)130 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 136 131 sbc_tsc_b(ji,jj,:) = sbc_tsc(ji,jj,:) 137 132 END_2D 138 133 ENDIF 139 134 ! !== Now sbc tracer content fields ==! 140 DO_2D ( isi, iei, isj, iej)135 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 141 136 sbc_tsc(ji,jj,jp_tem) = r1_rho0_rcp * qns(ji,jj) ! non solar heat flux 142 137 sbc_tsc(ji,jj,jp_sal) = r1_rho0 * sfx(ji,jj) ! salt flux due to freezing/melting 143 138 END_2D 144 139 IF( ln_linssh ) THEN !* linear free surface 145 DO_2D ( isi, iei, isj, iej) !==>> add concentration/dilution effect due to constant volume cell140 DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) !==>> add concentration/dilution effect due to constant volume cell 146 141 sbc_tsc(ji,jj,jp_tem) = sbc_tsc(ji,jj,jp_tem) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_tem,Kmm) 147 142 sbc_tsc(ji,jj,jp_sal) = sbc_tsc(ji,jj,jp_sal) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_sal,Kmm) 148 143 END_2D !==>> output c./d. term 149 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile144 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 150 145 IF( iom_use('emp_x_sst') ) CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) ) 151 146 IF( iom_use('emp_x_sss') ) CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) ) … … 160 155 END DO 161 156 ! 162 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile157 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 163 158 IF( lrst_oce ) THEN !== write sbc_tsc in the ocean restart file ==! 164 159 CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem) ) … … 186 181 ENDIF 187 182 188 IF( ntile == 0.OR. ntile == nijtile ) THEN ! Do only on the last tile189 IF( iom_use('rnf_x_sst') ) CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) ) ! runoff term on sst190 IF( iom_use('rnf_x_sss') ) CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) ) ! runoff term on sss183 IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN ! Do only on the last tile 184 IF( iom_use('rnf_x_sst') ) CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) ) ! runoff term on sst 185 IF( iom_use('rnf_x_sss') ) CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) ) ! runoff term on sss 191 186 ENDIF 192 187 -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trazdf.F90
r14189 r14537 64 64 ! 65 65 IF( kt == nit000 ) THEN 66 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile66 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 67 67 IF(lwp)WRITE(numout,*) 68 68 IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRD/trdini.F90
r14090 r14537 93 93 CALL ctl_warn('Tiling is not yet implemented for the trends diagnostics; ln_tile is forced to FALSE') 94 94 ln_tile = .FALSE. 95 CALL dom_tile ( ntsi, ntsj, ntei, ntej )95 CALL dom_tile_init 96 96 ENDIF 97 97 -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/do_loop_substitute.h90
r14215 r14537 59 59 #endif 60 60 61 #define DO_2D(L, R, B, T) DO jj = ntsj-(B), ntej+(T) ; DO ji = ntsi-(L), ntei+(R) 61 #define DO_2D(L, R, B, T) DO jj = ntsj-(B), ntej+(T) ; DO ji = ntsi-(L), ntei+(R) 62 ! NOTE: This easily exceeds 132 characters. ifort compiles OK, but it is against the NEMO coding standard. 63 ! TODO: To consider alternatives (and revise name) 64 #define DO_2D_OVR(L, R, B, T) DO_2D(L-(L+R)*nthl, R-(R+L)*nthr, B-(B+T)*nthb, T-(T+B)*ntht) 62 65 #define A1Di(H) ntsi-H:ntei+H 63 66 #define A1Dj(H) ntsj-H:ntej+H … … 70 73 #define KJPT : 71 74 72 #define DO_3D(L, R, B, T, ks, ke) DO jk = ks, ke ; DO_2D(L, R, B, T) 75 #define DO_3D(L, R, B, T, ks, ke) DO jk = ks, ke ; DO_2D(L, R, B, T) 76 #define DO_3D_OVR(L, R, B, T, ks, ke) DO jk = ks, ke ; DO_2D_OVR(L, R, B, T) 73 77 74 #define DO_3DS(L, R, B, T, ks, ke, ki) DO jk = ks, ke, ki ; DO_2D(L, R, B, T) 78 #define DO_3DS(L, R, B, T, ks, ke, ki) DO jk = ks, ke, ki ; DO_2D(L, R, B, T) 79 #define DO_3DS_OVR(L, R, B, T, ks, ke, ki) DO jk = ks, ke, ki ; DO_2D_OVR(L, R, B, T) 75 80 76 81 #define END_2D END DO ; END DO -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/module_example.F90
r14041 r14537 102 102 !!-------------------------------------------------------------------- 103 103 ! 104 IF( ntile == 0.OR. ntile == 1 ) THEN ! Do only on the first tile104 IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ! Do only on the first tile 105 105 IF( kt == nit000 ) CALL exa_mpl_init ! Initialization (first time-step only) 106 106 … … 177 177 IF( exa_mpl_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'exa_mpl_init : unable to allocate arrays' ) 178 178 ! ! Parameter control 179 IF( ln_tile .AND. ntile > 0) CALL ctl_stop( 'exa_mpl_init: tiling is not supported in this module by default, see manual for how to adapt your code' )179 IF( ln_tile ) CALL ctl_stop( 'exa_mpl_init: tiling is not supported in this module by default, see manual for how to adapt your code' ) 180 180 IF( ln_opt ) CALL ctl_stop( 'exa_mpl_init: this work and option xxx are incompatible' ) 181 181 IF( nn_opt == 2 ) CALL ctl_stop( 'STOP', 'exa_mpl_init: this work and option yyy may cause problems' ) -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/par_oce.F90
r14072 r14537 72 72 INTEGER, PUBLIC :: ntei !: end of internal part of tile domain 73 73 INTEGER, PUBLIC :: ntej ! 74 INTEGER, PUBLIC :: nthl, nthr !: Modifier on DO loop macro bound offset (left, right) 75 INTEGER, PUBLIC :: nthb, ntht !: " " (bottom, top) 74 76 75 77 !!--------------------------------------------------------------------- -
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/timing.F90
r14229 r14537 109 109 110 110 s_timer%l_tdone = .FALSE. 111 IF( ntile == 0.OR. ntile == 1 ) s_timer%niter = s_timer%niter + 1 ! All tiles count as one iteration111 IF( .NOT. l_istiled .OR. ntile == 1 ) s_timer%niter = s_timer%niter + 1 ! All tiles count as one iteration 112 112 s_timer%t_cpu = 0. 113 113 s_timer%t_clock = 0.
Note: See TracChangeset
for help on using the changeset viewer.