Changeset 12765
- Timestamp:
- 2020-04-17T14:45:04+02:00 (3 years ago)
- Location:
- NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/cfgs/SHARED/namelist_ref
r12530 r12765 94 94 ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present 95 95 ! ! in netcdf input files, as the start j-row for reading 96 / 97 !----------------------------------------------------------------------- 98 &namtile ! parameters of the tiling 99 !----------------------------------------------------------------------- 100 ln_tile = .false. ! Use tiling (T) or not (F) 101 nn_tile_i = 10 ! Length of tiles in i 102 nn_tile_j = 10 ! Length of tiles in j 96 103 / 97 104 !----------------------------------------------------------------------- -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/DOM/dom_oce.F90
r12489 r12765 72 72 ! ! = 7 bi-cyclic East-West AND North-South 73 73 LOGICAL, PUBLIC :: l_Iperio, l_Jperio ! should we explicitely take care I/J periodicity 74 75 ! Tiling namelist 76 LOGICAL, PUBLIC :: ln_tile 77 INTEGER :: nn_tile_i, nn_tile_j 74 78 75 79 ! ! domain MPP decomposition parameters -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/DOM/domain.F90
r12489 r12765 49 49 50 50 PUBLIC dom_init ! called by nemogcm.F90 51 PUBLIC dom_tile ! called by step.F90 51 52 PUBLIC domain_cfg ! called by nemogcm.F90 52 53 … … 122 123 CALL dom_glo ! global domain versus local domain 123 124 CALL dom_nam ! read namelist ( namrun, namdom ) 125 126 ! Initialise tile to full domain 127 CALL dom_tile(0) 128 124 129 ! 125 130 IF( lwxios ) THEN … … 270 275 271 276 277 SUBROUTINE dom_tile(kntile) 278 !!---------------------------------------------------------------------- 279 !! *** ROUTINE dom_tile *** 280 !! 281 !! ** Purpose : Set domain indices for specified tile 282 !! 283 !! ** Action : - ntile : current tile number 284 !! - ntsi, ntsj : start of internal part of domain 285 !! - 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 316 ENDIF 317 END SUBROUTINE dom_tile 318 319 272 320 SUBROUTINE dom_nam 273 321 !!---------------------------------------------------------------------- … … 278 326 !! ** input : - namrun namelist 279 327 !! - namdom namelist 328 !! - namtile namelist 280 329 !! - namnc4 namelist ! "key_netcdf4" only 281 330 !!---------------------------------------------------------------------- … … 290 339 & ln_cfmeta, ln_xios_read, nn_wxios 291 340 NAMELIST/namdom/ ln_linssh, rn_Dt, rn_atfp, ln_crs, ln_meshmask 341 NAMELIST/namtile/ ln_tile, nn_tile_i, nn_tile_j 292 342 #if defined key_netcdf4 293 343 NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip … … 417 467 r1_Dt = 1._wp / rDt 418 468 469 READ ( numnam_ref, namtile, IOSTAT = ios, ERR = 905 ) 470 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtile in reference namelist' ) 471 READ ( numnam_cfg, namtile, IOSTAT = ios, ERR = 906 ) 472 906 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtile in configuration namelist' ) 473 IF(lwm) WRITE( numond, namtile ) 474 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 487 IF(lwp) THEN 488 WRITE(numout,*) 489 WRITE(numout,*) ' Namelist : namtile --- tiling decomposition' 490 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 493 WRITE(numout,*) 494 IF( ln_tile ) THEN 495 WRITE(numout,*) ' The domain will be decomposed into', jpnijtile, 'tiles of size', nn_tile_i, 'x', nn_tile_j 496 ELSE 497 WRITE(numout,*) ' Domain tiling will NOT be used' 498 ENDIF 499 ENDIF 500 419 501 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 420 502 lrxios = ln_xios_read.AND.ln_rstart -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/TRA/traldf.F90
r12377 r12765 45 45 CONTAINS 46 46 47 SUBROUTINE tra_ldf( 47 SUBROUTINE tra_ldf(kt, Kbb, Kmm, pts, Krhs ) 48 48 !!---------------------------------------------------------------------- 49 49 !! *** ROUTINE tra_ldf *** … … 58 58 !!---------------------------------------------------------------------- 59 59 ! 60 IF( ln_timing ) CALL timing_start('tra_ldf') 60 IF( ntile == 1 ) THEN ! Do only on the first tile 61 ! TODO: TO BE TILED 62 IF( ln_timing ) CALL timing_start('tra_ldf') 63 ENDIF 61 64 ! 62 IF( l_trdtra ) THEN !* Save ta and sa trends 63 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 64 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 65 ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 65 IF( ntile == jpnijtile ) THEN ! Do only after all tiles finish 66 IF( l_trdtra ) THEN !* Save ta and sa trends 67 ! TODO: TO BE TILED 68 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 69 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 70 ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 71 ENDIF 66 72 ENDIF 67 73 ! … … 77 83 END SELECT 78 84 ! 79 IF( l_trdtra ) THEN !* save the horizontal diffusive trends for further diagnostics 80 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) 81 ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:) 82 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt ) 83 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds ) 84 DEALLOCATE( ztrdt, ztrds ) 85 IF( ntile == jpnijtile ) THEN ! Do only after all tiles finish 86 IF( l_trdtra ) THEN !* save the horizontal diffusive trends for further diagnostics 87 ! TODO: TO BE TILED 88 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) 89 ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:) 90 ! TODO: TO BE TILED 91 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt ) 92 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds ) 93 DEALLOCATE( ztrdt, ztrds ) 94 ENDIF 95 96 ! !* print mean trends (used for debugging) 97 ! TODO: TO BE TILED 98 IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf - Ta: ', mask1=tmask, & 99 & tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 100 ! 101 ! TODO: TO BE TILED 102 IF( ln_timing ) CALL timing_stop('tra_ldf') 85 103 ENDIF 86 ! !* print mean trends (used for debugging)87 IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf - Ta: ', mask1=tmask, &88 & tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' )89 !90 IF( ln_timing ) CALL timing_stop('tra_ldf')91 104 ! 92 105 END SUBROUTINE tra_ldf -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/TRA/traldf_iso.F90
r12489 r12765 36 36 PUBLIC tra_ldf_iso ! routine called by step.F90 37 37 38 LOGICAL :: l_ptr ! flag to compute poleward transport39 LOGICAL :: l_hst ! flag to compute heat transport40 41 38 !! * Substitutions 42 39 # include "do_loop_substitute.h90" … … 104 101 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pt_rhs ! tracer trend 105 102 ! 103 LOGICAL :: l_ptr ! flag to compute poleward transport 104 LOGICAL :: l_hst ! flag to compute heat transport 106 105 INTEGER :: ji, jj, jk, jn ! dummy loop indices 107 106 INTEGER :: ikt … … 110 109 REAL(wp) :: zmskv, zahv_w, zabe2, zcof2, zcoef4 ! - - 111 110 REAL(wp) :: zcoef0, ze3w_2, zsign ! - - 112 REAL(wp), DIMENSION( jpi,jpj) :: zdkt, zdk1t, z2d113 REAL(wp), DIMENSION( jpi,jpj,jpk) :: zdit, zdjt, zftu, zftv, ztfw111 REAL(wp), DIMENSION(IND_2D) :: zdkt, zdk1t, z2d 112 REAL(wp), DIMENSION(IND_2D,jpk) :: zdit, zdjt, zftu, zftv, ztfw 114 113 !!---------------------------------------------------------------------- 115 114 ! 116 115 IF( kpass == 1 .AND. kt == kit000 ) THEN 117 IF(lwp) WRITE(numout,*) 118 IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype 119 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 120 ! 121 akz (:,:,:) = 0._wp 122 ah_wslp2(:,:,:) = 0._wp 116 IF( ntile == 1 ) THEN ! Do only on the first tile 117 ! TODO: TO BE TILED 118 IF(lwp) WRITE(numout,*) 119 IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype 120 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 121 ENDIF 122 ! 123 DO_3D_11_11( 1, jpk ) 124 akz (ji,jj,jk) = 0._wp 125 ah_wslp2(ji,jj,jk) = 0._wp 126 END_3D 123 127 ENDIF 124 128 ! … … 179 183 ! 180 184 ELSE ! 33 flux set to zero with akz=ah_wslp2 ==>> computed in full implicit 181 akz(:,:,:) = ah_wslp2(:,:,:) 185 DO_3D_11_11( 1, jpk ) 186 akz(ji,jj,jk) = ah_wslp2(ji,jj,jk) 187 END_3D 182 188 ENDIF 183 189 ENDIF … … 219 225 DO jk = 1, jpkm1 ! Horizontal slab 220 226 ! 221 ! !== Vertical tracer gradient 222 zdk1t(:,:) = ( pt(:,:,jk,jn) - pt(:,:,jk+1,jn) ) * wmask(:,:,jk+1) ! level jk+1 223 ! 224 IF( jk == 1 ) THEN ; zdkt(:,:) = zdk1t(:,:) ! surface: zdkt(jk=1)=zdkt(jk=2) 225 ELSE ; zdkt(:,:) = ( pt(:,:,jk-1,jn) - pt(:,:,jk,jn) ) * wmask(:,:,jk) 226 ENDIF 227 DO_2D_11_11 228 ! !== Vertical tracer gradient 229 zdk1t(ji,jj) = ( pt(ji,jj,jk,jn) - pt(ji,jj,jk+1,jn) ) * wmask(ji,jj,jk+1) ! level jk+1 230 ! 231 IF( jk == 1 ) THEN ; zdkt(ji,jj) = zdk1t(ji,jj) ! surface: zdkt(jk=1)=zdkt(jk=2) 232 ELSE ; zdkt(ji,jj) = ( pt(ji,jj,jk-1,jn) - pt(ji,jj,jk,jn) ) * wmask(ji,jj,jk) 233 ENDIF 234 END_2D 235 ! 227 236 DO_2D_10_10 228 237 zabe1 = pahu(ji,jj,jk) * e2_e1u(ji,jj) * e3u(ji,jj,jk,Kmm) … … 312 321 END_3D 313 322 ! 314 IF( ( kpass == 1 .AND. ln_traldf_lap ) .OR. & !== first pass only ( laplacian) ==! 315 ( kpass == 2 .AND. ln_traldf_blp ) ) THEN !== 2nd pass (bilaplacian) ==! 316 ! 317 ! ! "Poleward" diffusive heat or salt transports (T-S case only) 318 ! note sign is reversed to give down-gradient diffusive transports ) 319 IF( l_ptr ) CALL dia_ptr_hst( jn, 'ldf', -zftv(:,:,:) ) 320 ! ! Diffusive heat transports 321 IF( l_hst ) CALL dia_ar5_hst( jn, 'ldf', -zftu(:,:,:), -zftv(:,:,:) ) 322 ! 323 ENDIF !== end pass selection ==! 323 IF( ntile == jpnijtile ) THEN ! Do only after all tiles finish 324 IF( ( kpass == 1 .AND. ln_traldf_lap ) .OR. & !== first pass only ( laplacian) ==! 325 ( kpass == 2 .AND. ln_traldf_blp ) ) THEN !== 2nd pass (bilaplacian) ==! 326 ! 327 ! ! "Poleward" diffusive heat or salt transports (T-S case only) 328 ! note sign is reversed to give down-gradient diffusive transports ) 329 ! TODO: TO BE TILED 330 IF( l_ptr ) CALL dia_ptr_hst( jn, 'ldf', -zftv(:,:,:) ) 331 ! ! Diffusive heat transports 332 ! TODO: TO BE TILED 333 IF( l_hst ) CALL dia_ar5_hst( jn, 'ldf', -zftu(:,:,:), -zftv(:,:,:) ) 334 ! 335 ENDIF !== end pass selection ==! 336 ENDIF 324 337 ! 325 338 ! ! =============== -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/do_loop_substitute.h90
r12377 r12765 55 55 ! 56 56 #endif 57 #define __kIs_ 258 #define __kJs_ 259 #define __kIsm1_ 160 #define __kJsm1_ 157 #define __kIs_ ntsi 58 #define __kJs_ ntsj 59 #define __kIsm1_ ntsim1 60 #define __kJsm1_ ntsjm1 61 61 62 #define __kIe_ jpim1 63 #define __kJe_ jpjm1 64 #define __kIep1_ jpi 65 #define __kJep1_ jpj 62 #define __kIe_ ntei 63 #define __kJe_ ntej 64 #define __kIep1_ nteip1 65 #define __kJep1_ ntejp1 66 67 #define IND_2D __kIsm1_:__kIep1_,__kJsm1_:__kJep1_ 66 68 67 69 #define DO_2D_00_00 DO jj = __kJs_, __kJe_ ; DO ji = __kIs_, __kIe_ -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/par_oce.F90
r12377 r12765 62 62 INTEGER, PUBLIC :: jpjmax! = ( jpjglo-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls !: maximum jpj 63 63 64 ! Tiling decomposition 65 INTEGER, PUBLIC :: jpnitile !: number of tiles following i 66 INTEGER, PUBLIC :: jpnjtile !: number of tiles following j 67 INTEGER, PUBLIC :: jpnijtile !: number of tiles in total (jpnitile x jpnjtile) 68 69 ! Tile indices 70 INTEGER, PUBLIC :: ntsi !: start of internal part of tile domain 71 INTEGER, PUBLIC :: ntsj ! 72 INTEGER, PUBLIC :: ntei !: end of internal part of tile domain 73 INTEGER, PUBLIC :: ntej ! 74 INTEGER, PUBLIC :: ntsim1 !: start of tile domain 75 INTEGER, PUBLIC :: ntsjm1 ! 76 INTEGER, PUBLIC :: nteip1 !: end of tile domain 77 INTEGER, PUBLIC :: ntejp1 ! 78 INTEGER, PUBLIC :: ntile !: current tile number 79 64 80 !!--------------------------------------------------------------------- 65 81 !! Active tracer parameters -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/step.F90
r12650 r12765 81 81 !! -8- Outputs and diagnostics 82 82 !!---------------------------------------------------------------------- 83 INTEGER :: ji, jj, jk ! dummy loop indice83 INTEGER :: ji, jj, jk, jtile ! dummy loop indice 84 84 INTEGER :: indic ! error indicator if < 0 85 85 !!gm kcall can be removed, I guess … … 264 264 IF( lrst_oce .AND. ln_zdfosm ) & 265 265 & CALL osm_rst ( kstp, Nnn, 'WRITE' ) ! write OSMOSIS outputs + ww (so must do here) to restarts 266 267 ! Loop over tile domains 268 DO jtile = 1, jpnijtile 269 IF( ln_tile ) CALL dom_tile( jtile ) 266 270 CALL tra_ldf ( kstp, Nbb, Nnn, ts, Nrhs ) ! lateral mixing 271 END DO 272 IF( ln_tile ) CALL dom_tile( 0 ) ! Revert to tile over full domain 267 273 268 274 CALL tra_zdf ( kstp, Nbb, Nnn, Nrhs, ts, Naa ) ! vertical mixing and after tracer fields -
NEMO/branches/UKMO/dev_r12745_HPC-02_Daley_Tiling_trial_public/src/OCE/step_oce.F90
r12377 r12765 62 62 USE domvvl ! variable vertical scale factors (dom_vvl_sf_nxt routine) 63 63 ! (dom_vvl_sf_swp routine) 64 USE domain , ONLY : dom_tile 64 65 65 66 USE ldfslp ! iso-neutral slopes (ldf_slp routine)
Note: See TracChangeset
for help on using the changeset viewer.