Changeset 11940
- Timestamp:
- 2019-11-20T22:48:28+01:00 (3 years ago)
- Location:
- NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE/LBC/lbclnk.F90
r11799 r11940 13 13 !! - ! 2017-04 (G. Madec) remove duplicated routines (lbc_lnk_2d_9, lbc_lnk_2d_multiple, lbc_lnk_3d_gather) 14 14 !! - ! 2017-05 (G. Madec) create generic.h90 files to generate all lbc and north fold routines 15 !! - ! 2019 (S. Mocavero, I. Epicoco - CMCC) create generic.h90 files to introduce MPI3 neighbourhood collectives 16 15 17 !!---------------------------------------------------------------------- 16 18 !! define the generic interfaces of lib_mpp routines … … 36 38 MODULE PROCEDURE lbc_lnk_2d_multi, lbc_lnk_3d_multi, lbc_lnk_4d_multi 37 39 END INTERFACE 40 INTERFACE lbc_lnk_nc_multi 41 MODULE PROCEDURE lbc_lnk_nc_2d, lbc_lnk_nc_3d, lbc_lnk_nc_4d 42 END INTERFACE 43 INTERFACE lbc_lnk_nc 44 MODULE PROCEDURE mpp_lnk_nc_2d, mpp_lnk_nc_3d, mpp_lnk_nc_4d 45 END INTERFACE 38 46 ! 39 47 INTERFACE lbc_lnk_icb … … 46 54 END INTERFACE 47 55 48 PUBLIC lbc_lnk ! ocean/ice lateral boundary conditions 49 PUBLIC lbc_lnk_multi ! modified ocean/ice lateral boundary conditions 50 PUBLIC lbc_lnk_icb ! iceberg lateral boundary conditions 56 PUBLIC lbc_lnk ! ocean/ice lateral boundary conditions 57 PUBLIC lbc_lnk_multi ! modified ocean/ice lateral boundary conditions 58 PUBLIC lbc_lnk_icb ! iceberg lateral boundary conditions 59 PUBLIC lbc_lnk_nc_multi ! modified ocean/ice lateral boundary conditions 51 60 52 61 #if defined key_mpp_mpi … … 163 172 # undef ROUTINE_LNK 164 173 # undef MULTI 174 # undef DIM_4d 175 176 !!---------------------------------------------------------------------- 177 !! *** routine lbc_lnk_nc_(2,3,4)d *** 178 !! 179 !! * Argument : dummy argument use in lbc_lnk_nc_... routines 180 !! ptab : array or pointer of arrays on which the boundary 181 !condition is applied 182 !! cd_nat : nature of array grid-points 183 !! psgn : sign used across the north fold boundary 184 !! kfld : optional, number of pt3d arrays 185 !! cd_mpp : optional, fill the overlap area only 186 !! pval : optional, background value (used at closed 187 !boundaries) 188 !!---------------------------------------------------------------------- 189 ! 190 ! !== 2D array and array of 2D pointer ==! 191 ! 192 # define DIM_2d 193 # define ROUTINE_NC_LOAD load_ptr_nc_2d 194 # define ROUTINE_MULTI_NC lbc_lnk_nc_2d 195 # include "lbc_lnk_nc_generic.h90" 196 # undef ROUTINE_MULTI_NC 197 # undef ROUTINE_NC_LOAD 198 # undef DIM_2d 199 ! 200 ! !== 3D array and array of 3D pointer ==! 201 ! 202 # define DIM_3d 203 # define ROUTINE_NC_LOAD load_ptr_nc_3d 204 # define ROUTINE_MULTI_NC lbc_lnk_nc_3d 205 # include "lbc_lnk_nc_generic.h90" 206 # undef ROUTINE_MULTI_NC 207 # undef ROUTINE_NC_LOAD 208 # undef DIM_3d 209 ! 210 ! !== 4D array and array of 4D pointer ==! 211 ! 212 # define DIM_4d 213 # define ROUTINE_NC_LOAD load_ptr_nc_4d 214 # define ROUTINE_MULTI_NC lbc_lnk_nc_4d 215 # include "lbc_lnk_nc_generic.h90" 216 # undef ROUTINE_LOAD 217 # undef ROUTINE_NC_LOAD 218 # undef DIM_4d 219 220 !!---------------------------------------------------------------------- 221 !! *** routine mpp_nc_(2,3,4)d *** 222 !! 223 !! * Argument : dummy argument use in mpp_nc_... routines 224 !! ptab : array or pointer of arrays on which the boundary condition is applied 225 !! cd_nat : nature of array grid-points 226 !! psgn : sign used across the north fold boundary 227 !! kfld : optional, number of pt3d arrays 228 !! cd_mpp : optional, fill the overlap area only 229 !! pval : optional, background value (used at closed boundaries) 230 !!---------------------------------------------------------------------- 231 ! 232 ! !== 2D array and array of 2D pointer ==! 233 ! 234 # define DIM_2d 235 # define ROUTINE_NC mpp_lnk_nc_2d 236 # include "mpp_nc_generic.h90" 237 # undef ROUTINE_NC 238 # undef DIM_2d 239 ! 240 ! !== 3D array and array of 3D pointer ==! 241 ! 242 # define DIM_3d 243 # define ROUTINE_NC mpp_lnk_nc_3d 244 # include "mpp_nc_generic.h90" 245 # undef ROUTINE_NC 246 # undef DIM_3d 247 ! 248 ! !== 4D array and array of 4D pointer ==! 249 ! 250 # define DIM_4d 251 # define ROUTINE_NC mpp_lnk_nc_4d 252 # include "mpp_nc_generic.h90" 253 # undef ROUTINE_NC 165 254 # undef DIM_4d 166 255 -
NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE/LBC/lib_mpp.F90
r11799 r11940 25 25 !! 4.0 ! 2017 (G. Madec) automatique allocation of array argument (use any 3rd dimension) 26 26 !! - ! 2017 (G. Madec) create generic.h90 files to generate all lbc and north fold routines 27 !! - ! 2019 (S. Mocavero, I. Epicoco - CMCC) add MPI3 neighbourhood collectives 27 28 !!---------------------------------------------------------------------- 28 29 … … 50 51 !! mpp_ini_north : initialisation of north fold 51 52 !! mpp_lbc_north_icb : alternative to mpp_nfd for extra outer halo with icebergs 53 !! mpp_ini_nc : initialisation of MPI3 neighbourhood collectives communicator 52 54 !!---------------------------------------------------------------------- 53 55 USE dom_oce ! ocean space and time domain … … 64 66 PUBLIC mppscatter, mppgather 65 67 PUBLIC mpp_ini_znl 68 PUBLIC mpp_ini_nc 66 69 PUBLIC mppsend, mpprecv ! needed by TAM and ICB routines 67 70 PUBLIC mpp_report … … 132 135 INTEGER, PUBLIC :: north_root !: number (in the comm_opa) of proc 0 in the northern comm 133 136 INTEGER, PUBLIC, DIMENSION(:), ALLOCATABLE, SAVE :: nrank_north !: dimension ndim_rank_north 137 138 ! variables used for MPI3 neighbourhood collectives 139 INTEGER, PUBLIC :: mpi_nc_com ! MPI3 neighbourhood collectives communicator 140 INTEGER, PUBLIC, DIMENSION(:), ALLOCATABLE :: nranks 134 141 135 142 ! Communications summary report … … 800 807 801 808 END SUBROUTINE mpp_ini_znl 809 810 SUBROUTINE mpp_ini_nc 811 !!---------------------------------------------------------------------- 812 !! *** routine mpp_ini_nc *** 813 !! 814 !! ** Purpose : Initialize special communicator for MPI3 neighbourhood 815 !! collectives 816 !! 817 !! ** Method : - Create a cartesian communicator starting from the 818 !processes 819 !! distribution along i and j directions 820 ! 821 !! ** output 822 !! mpi_nc_com = MPI3 neighbourhood collectives communicator 823 !! 824 !!---------------------------------------------------------------------- 825 INTEGER, DIMENSION(2) :: ipdims 826 LOGICAL, PARAMETER :: ireord = .FALSE. 827 LOGICAL :: nperiod_nc ( 2 ) = .FALSE. 828 INTEGER :: mpi_nc_com_re, igroup, iprc, ingroup, iii, jjj 829 INTEGER :: ierr 830 831 #if defined key_mpp_mpi 832 ipdims(1) = jpni 833 ipdims(2) = jpnj 834 nperiod_nc(1) = .TRUE. 835 836 iprc = jpni*jpnj 837 838 ! Create a group from mpi_comm_oce 839 CALL MPI_Comm_group(mpi_comm_oce, igroup, ierr) 840 841 ! Create a group to reorder MPI rank 842 CALL MPI_Group_incl(igroup, iprc, nranks, ingroup, ierr) 843 844 ! Create reordered communicator 845 CALL MPI_Comm_create(mpi_comm_oce, ingroup, mpi_nc_com_re, ierr) 846 847 ! Create the cartesian communicator 848 CALL MPI_Cart_create(mpi_nc_com_re, 2, ipdims, nperiod_nc, ireord, mpi_nc_com, ierr) 849 DEALLOCATE (nranks) 850 #endif 851 END SUBROUTINE mpp_ini_nc 802 852 803 853 -
NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE/LBC/mppini.F90
r11799 r11940 38 38 INTEGER :: numbot = -1 ! 'bottom_level' local logical unit 39 39 INTEGER :: numbdy = -1 ! 'bdy_msk' local logical unit 40 40 41 41 !!---------------------------------------------------------------------- 42 42 !! NEMO/OCE 4.0 , NEMO Consortium (2018) … … 464 464 END DO 465 465 nfipproc(:,:) = ipproc(:,:) 466 467 ! compute rank for MPI3 neighbourhood colectives 468 ALLOCATE(nranks(jpni*jpnj)) 469 icont = 1 470 DO ji = 1, jpni 471 DO jj = 1, jpnj 472 nranks(icont) = ipproc(ji,jj) 473 icont = icont + 1 474 END DO 475 END DO 466 476 467 477 ! neighbour treatment: change ibondi, ibondj if next to a land zone … … 694 704 ENDIF 695 705 ENDIF 706 707 CALL mpp_ini_nc 696 708 ! 697 709 CALL mpp_init_ioipsl ! Prepare NetCDF output file (if necessary) -
NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE/TRA/traadv_fct.F90
r11411 r11940 89 89 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zwinf, zwdia, zwsup 90 90 LOGICAL :: ll_zAimp ! flag to apply adaptive implicit vertical advection 91 91 92 !!---------------------------------------------------------------------- 92 93 ! … … 254 255 END DO 255 256 END DO 256 CALL lbc_lnk_multi( 'traadv_fct', zltu, 'T', 1. , zltv, 'T', 1. ) ! Lateral boundary cond. (unchanged sgn) 257 258 IF(jpnij .eq. jpni*jpnj) THEN 259 CALL lbc_lnk_nc_multi( 'traadv_fct', zltu, 'T', 1. , zltv, 'T', 1. ) ! Lateral boundary cond. (unchanged sgn) 260 ELSE 261 CALL lbc_lnk_multi( 'traadv_fct', zltu, 'T', 1. , zltv, 'T', 1. ) ! Lateral boundary cond. (unchanged sgn) 262 END IF 257 263 ! 258 264 DO jk = 1, jpkm1 ! Horizontal advective fluxes … … 279 285 END DO 280 286 END DO 281 CALL lbc_lnk_multi( 'traadv_fct', ztu, 'U', -1. , ztv, 'V', -1. ) ! Lateral boundary cond. (unchanged sgn) 287 288 IF(jpnij .eq. jpni*jpnj) THEN 289 CALL lbc_lnk_nc_multi( 'traadv_fct', ztu, 'U', -1. , ztv, 'V', -1. ) ! Lateral boundary cond. (unchanged sgn) 290 ELSE 291 CALL lbc_lnk_multi( 'traadv_fct', ztu, 'U', -1. , ztv, 'V', -1. ) ! Lateral boundary cond. (unchanged sgn) 292 END IF 282 293 ! 283 294 DO jk = 1, jpkm1 ! Horizontal advective fluxes … … 351 362 END IF 352 363 ! 353 CALL lbc_lnk_multi( 'traadv_fct', zwi, 'T', 1., zwx, 'U', -1. , zwy, 'V', -1., zwz, 'W', 1. ) 364 IF(jpnij .eq. jpni*jpnj) THEN 365 CALL lbc_lnk_nc_multi( 'traadv_fct', zwi, 'T', 1., zwx, 'U', -1. , zwy, 'V', -1., zwz, 'W', 1. ) 366 ELSE 367 CALL lbc_lnk_multi( 'traadv_fct', zwi, 'T', 1., zwx, 'U', -1. , zwy, 'V', -1., zwz, 'W', 1. ) 368 END IF 354 369 ! 355 370 ! !== monotonicity algorithm ==! … … 413 428 ENDIF 414 429 ! 430 415 431 END DO ! end of tracer loop 416 432 ! … … 426 442 ! 427 443 END SUBROUTINE tra_adv_fct 428 429 444 430 445 SUBROUTINE nonosc( pbef, paa, pbb, pcc, paft, p2dt ) … … 498 513 END DO 499 514 END DO 500 CALL lbc_lnk_multi( 'traadv_fct', zbetup, 'T', 1. , zbetdo, 'T', 1. ) ! lateral boundary cond. (unchanged sign) 501 515 IF(jpnij .eq. jpni*jpnj) THEN 516 CALL lbc_lnk_nc_multi( 'traadv_fct', zbetup, 'T', 1. , zbetdo, 'T', 1. ) ! lateral boundary cond. (unchanged sign) 517 ELSE 518 CALL lbc_lnk_multi( 'traadv_fct', zbetup, 'T', 1. , zbetdo, 'T', 1. ) ! lateral boundary cond. (unchanged sign) 519 END IF 502 520 ! 3. monotonic flux in the i & j direction (paa & pbb) 503 521 ! ---------------------------------------- … … 524 542 END DO 525 543 END DO 526 CALL lbc_lnk_multi( 'traadv_fct', paa, 'U', -1. , pbb, 'V', -1. ) ! lateral boundary condition (changed sign) 544 IF(jpnij .eq. jpni*jpnj) THEN 545 CALL lbc_lnk_nc_multi( 'traadv_fct', paa, 'U', -1. , pbb, 'V', -1. ) ! lateral boundary condition (changed sign) 546 ELSE 547 CALL lbc_lnk_multi( 'traadv_fct', paa, 'U', -1. , pbb, 'V', -1. ) ! lateral boundary condition (changed sign) 548 END IF 527 549 ! 528 550 END SUBROUTINE nonosc
Note: See TracChangeset
for help on using the changeset viewer.