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 3609 for branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90 – NEMO

Ignore:
Timestamp:
2012-11-19T16:51:17+01:00 (11 years ago)
Author:
acc
Message:

Branch dev_NOC_2012_r3555. #1006. Step 4: Merge in changes from 2012/dev_r3337_NOCS10_ICB (ICeBergs) branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r3294 r3609  
    6767   PUBLIC   mppobc, mpp_ini_ice, mpp_ini_znl 
    6868   PUBLIC   mppsize 
     69   PUBLIC   mppsend, mpprecv                          ! needed by ICB routines 
    6970   PUBLIC   lib_mpp_alloc   ! Called in nemogcm.F90 
    7071 
     
    143144 
    144145   ! Type of send : standard, buffered, immediate 
    145    CHARACTER(len=1) ::   cn_mpi_send = 'S'    ! type od mpi send/recieve (S=standard, B=bsend, I=isend) 
    146    LOGICAL          ::   l_isend = .FALSE.   ! isend use indicator (T if cn_mpi_send='I') 
    147    INTEGER          ::   nn_buffer = 0       ! size of the buffer in case of mpi_bsend  
     146   CHARACTER(len=1)         ::   cn_mpi_send = 'S'    ! type od mpi send/recieve (S=standard, B=bsend, I=isend) 
     147   LOGICAL         , PUBLIC ::   l_isend = .FALSE.   ! isend use indicator (T if cn_mpi_send='I') 
     148   INTEGER                  ::   nn_buffer = 0       ! size of the buffer in case of mpi_bsend  
    148149       
    149150   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tampon  ! buffer in case of bsend 
     
    159160   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2ew, t2we   ! 2d for east-west & west-east 
    160161   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2p1, t2p2   ! 2d for north fold 
    161    REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   tr2ns, tr2sn ! 2d for north-south & south-north + extra outer halo 
    162    REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   tr2ew, tr2we ! 2d for east-west   & west-east   + extra outer halo 
    163162 
    164163   ! Arrays used in mpp_lbc_north_3d() 
     
    207206         &      t2ew(jpj,jpreci    ,2)   , t2we(jpj,jpreci    ,2)   ,                                            & 
    208207         &      t2p1(jpi,jprecj    ,2)   , t2p2(jpi,jprecj    ,2)   ,                                            & 
    209          ! 
    210          &      tr2ns(1-jpr2di:jpi+jpr2di,jprecj+jpr2dj,2) ,                                                     & 
    211          &      tr2sn(1-jpr2di:jpi+jpr2di,jprecj+jpr2dj,2) ,                                                     & 
    212          &      tr2ew(1-jpr2dj:jpj+jpr2dj,jpreci+jpr2di,2) ,                                                     & 
    213          &      tr2we(1-jpr2dj:jpj+jpr2dj,jpreci+jpr2di,2) ,                                                     & 
    214208         ! 
    215209         &      ztab(jpiglo,4,jpk) , znorthloc(jpi,4,jpk) , znorthgloio(jpi,4,jpk,jpni) ,                        & 
     
    947941 
    948942 
    949    SUBROUTINE mpp_lnk_2d_e( pt2d, cd_type, psgn ) 
     943   SUBROUTINE mpp_lnk_2d_e( pt2d, cd_type, psgn, jpri, jprj ) 
    950944      !!---------------------------------------------------------------------- 
    951945      !!                  ***  routine mpp_lnk_2d_e  *** 
     
    958952      !!                    nlci   : first dimension of the local subdomain 
    959953      !!                    nlcj   : second dimension of the local subdomain 
    960       !!                    jpr2di : number of rows for extra outer halo 
    961       !!                    jpr2dj : number of columns for extra outer halo 
     954      !!                    jpr : number of rows for extra outer halo 
     955      !!                    jpr : number of columns for extra outer halo 
    962956      !!                    nbondi : mark for "east-west local boundary" 
    963957      !!                    nbondj : mark for "north-south local boundary" 
     
    968962      !! 
    969963      !!---------------------------------------------------------------------- 
    970       REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), INTENT(inout) ::   pt2d     ! 2D array with extra halo 
    971       CHARACTER(len=1)                                            , INTENT(in   ) ::   cd_type  ! nature of ptab array grid-points 
    972       !                                                                                         ! = T , U , V , F , W and I points 
    973       REAL(wp)                                                    , INTENT(in   ) ::   psgn     ! =-1 the sign change across the 
    974       !!                                                                                        ! north boundary, =  1. otherwise 
     964      INTEGER                                             , INTENT(in   ) ::   jpri 
     965      INTEGER                                             , INTENT(in   ) ::   jprj 
     966      REAL(wp), DIMENSION(1-jpri:jpi+jpri,1-jprj:jpj+jprj), INTENT(inout) ::   pt2d     ! 2D array with extra halo 
     967      CHARACTER(len=1)                                    , INTENT(in   ) ::   cd_type  ! nature of ptab array grid-points 
     968      !                                                                                 ! = T , U , V , F , W and I points 
     969      REAL(wp)                                            , INTENT(in   ) ::   psgn     ! =-1 the sign change across the 
     970      !!                                                                                ! north boundary, =  1. otherwise 
    975971      INTEGER  ::   jl   ! dummy loop indices 
    976972      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
     
    978974      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    979975      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    980       !!---------------------------------------------------------------------- 
    981  
    982       ipreci = jpreci + jpr2di      ! take into account outer extra 2D overlap area 
    983       iprecj = jprecj + jpr2dj 
     976      !! 
     977      REAL(wp), DIMENSION(1-jpri:jpi+jpri,jprecj+jprj,2) :: r2dns 
     978      REAL(wp), DIMENSION(1-jpri:jpi+jpri,jprecj+jprj,2) :: r2dsn 
     979      REAL(wp), DIMENSION(1-jprj:jpj+jprj,jpreci+jpri,2) :: r2dwe 
     980      REAL(wp), DIMENSION(1-jprj:jpj+jprj,jpreci+jpri,2) :: r2dew 
     981      !!---------------------------------------------------------------------- 
     982 
     983      ipreci = jpreci + jpri      ! take into account outer extra 2D overlap area 
     984      iprecj = jprecj + jprj 
    984985 
    985986 
     
    989990      ! 
    990991      !                                      !* North-South boundaries (always colsed) 
    991       IF( .NOT. cd_type == 'F' )   pt2d(:,  1-jpr2dj   :  jprecj  ) = 0.e0    ! south except at F-point 
    992                                    pt2d(:,nlcj-jprecj+1:jpj+jpr2dj) = 0.e0    ! north 
     992      IF( .NOT. cd_type == 'F' )   pt2d(:,  1-jprj   :  jprecj  ) = 0.e0    ! south except at F-point 
     993                                   pt2d(:,nlcj-jprecj+1:jpj+jprj) = 0.e0    ! north 
    993994                                 
    994995      !                                      ! East-West boundaries 
    995996      !                                           !* Cyclic east-west 
    996997      IF( nbondi == 2 .AND. (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) ) THEN 
    997          pt2d(1-jpr2di:     1    ,:) = pt2d(jpim1-jpr2di:  jpim1 ,:)       ! east 
    998          pt2d(   jpi  :jpi+jpr2di,:) = pt2d(     2      :2+jpr2di,:)       ! west 
     998         pt2d(1-jpri:     1    ,:) = pt2d(jpim1-jpri:  jpim1 ,:)       ! east 
     999         pt2d(   jpi  :jpi+jpri,:) = pt2d(     2      :2+jpri,:)       ! west 
    9991000         ! 
    10001001      ELSE                                        !* closed 
    1001          IF( .NOT. cd_type == 'F' )   pt2d(  1-jpr2di   :jpreci    ,:) = 0.e0    ! south except at F-point 
    1002                                       pt2d(nlci-jpreci+1:jpi+jpr2di,:) = 0.e0    ! north 
     1002         IF( .NOT. cd_type == 'F' )   pt2d(  1-jpri   :jpreci    ,:) = 0.e0    ! south except at F-point 
     1003                                      pt2d(nlci-jpreci+1:jpi+jpri,:) = 0.e0    ! north 
    10031004      ENDIF 
    10041005      ! 
     
    10091010         ! 
    10101011         SELECT CASE ( jpni ) 
    1011          CASE ( 1 )     ;   CALL lbc_nfd        ( pt2d(1:jpi,1:jpj+jpr2dj), cd_type, psgn, pr2dj=jpr2dj ) 
     1012         CASE ( 1 )     ;   CALL lbc_nfd        ( pt2d(1:jpi,1:jpj+jprj), cd_type, psgn, pr2dj=jprj ) 
    10121013         CASE DEFAULT   ;   CALL mpp_lbc_north_e( pt2d                    , cd_type, psgn               ) 
    10131014         END SELECT  
     
    10211022      SELECT CASE ( nbondi )      ! Read Dirichlet lateral conditions 
    10221023      CASE ( -1, 0, 1 )                ! all exept 2 (i.e. close case) 
    1023          iihom = nlci-nreci-jpr2di 
     1024         iihom = nlci-nreci-jpri 
    10241025         DO jl = 1, ipreci 
    1025             tr2ew(:,jl,1) = pt2d(jpreci+jl,:) 
    1026             tr2we(:,jl,1) = pt2d(iihom +jl,:) 
     1026            r2dew(:,jl,1) = pt2d(jpreci+jl,:) 
     1027            r2dwe(:,jl,1) = pt2d(iihom +jl,:) 
    10271028         END DO 
    10281029      END SELECT 
    10291030      ! 
    10301031      !                           ! Migrations 
    1031       imigr = ipreci * ( jpj + 2*jpr2dj) 
     1032      imigr = ipreci * ( jpj + 2*jprj) 
    10321033      ! 
    10331034      SELECT CASE ( nbondi ) 
    10341035      CASE ( -1 ) 
    1035          CALL mppsend( 2, tr2we(1-jpr2dj,1,1), imigr, noea, ml_req1 ) 
    1036          CALL mpprecv( 1, tr2ew(1-jpr2dj,1,2), imigr, noea ) 
     1036         CALL mppsend( 2, r2dwe(1-jprj,1,1), imigr, noea, ml_req1 ) 
     1037         CALL mpprecv( 1, r2dew(1-jprj,1,2), imigr, noea ) 
    10371038         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10381039      CASE ( 0 ) 
    1039          CALL mppsend( 1, tr2ew(1-jpr2dj,1,1), imigr, nowe, ml_req1 ) 
    1040          CALL mppsend( 2, tr2we(1-jpr2dj,1,1), imigr, noea, ml_req2 ) 
    1041          CALL mpprecv( 1, tr2ew(1-jpr2dj,1,2), imigr, noea ) 
    1042          CALL mpprecv( 2, tr2we(1-jpr2dj,1,2), imigr, nowe ) 
     1040         CALL mppsend( 1, r2dew(1-jprj,1,1), imigr, nowe, ml_req1 ) 
     1041         CALL mppsend( 2, r2dwe(1-jprj,1,1), imigr, noea, ml_req2 ) 
     1042         CALL mpprecv( 1, r2dew(1-jprj,1,2), imigr, noea ) 
     1043         CALL mpprecv( 2, r2dwe(1-jprj,1,2), imigr, nowe ) 
    10431044         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10441045         IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 
    10451046      CASE ( 1 ) 
    1046          CALL mppsend( 1, tr2ew(1-jpr2dj,1,1), imigr, nowe, ml_req1 ) 
    1047          CALL mpprecv( 2, tr2we(1-jpr2dj,1,2), imigr, nowe ) 
     1047         CALL mppsend( 1, r2dew(1-jprj,1,1), imigr, nowe, ml_req1 ) 
     1048         CALL mpprecv( 2, r2dwe(1-jprj,1,2), imigr, nowe ) 
    10481049         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10491050      END SELECT 
     
    10551056      CASE ( -1 ) 
    10561057         DO jl = 1, ipreci 
    1057             pt2d(iihom+jl,:) = tr2ew(:,jl,2) 
     1058            pt2d(iihom+jl,:) = r2dew(:,jl,2) 
    10581059         END DO 
    10591060      CASE ( 0 ) 
    10601061         DO jl = 1, ipreci 
    1061             pt2d(jl-jpr2di,:) = tr2we(:,jl,2) 
    1062             pt2d( iihom+jl,:) = tr2ew(:,jl,2) 
     1062            pt2d(jl-jpri,:) = r2dwe(:,jl,2) 
     1063            pt2d( iihom+jl,:) = r2dew(:,jl,2) 
    10631064         END DO 
    10641065      CASE ( 1 ) 
    10651066         DO jl = 1, ipreci 
    1066             pt2d(jl-jpr2di,:) = tr2we(:,jl,2) 
     1067            pt2d(jl-jpri,:) = r2dwe(:,jl,2) 
    10671068         END DO 
    10681069      END SELECT 
     
    10741075      ! 
    10751076      IF( nbondj /= 2 ) THEN      ! Read Dirichlet lateral conditions 
    1076          ijhom = nlcj-nrecj-jpr2dj 
     1077         ijhom = nlcj-nrecj-jprj 
    10771078         DO jl = 1, iprecj 
    1078             tr2sn(:,jl,1) = pt2d(:,ijhom +jl) 
    1079             tr2ns(:,jl,1) = pt2d(:,jprecj+jl) 
     1079            r2dsn(:,jl,1) = pt2d(:,ijhom +jl) 
     1080            r2dns(:,jl,1) = pt2d(:,jprecj+jl) 
    10801081         END DO 
    10811082      ENDIF 
    10821083      ! 
    10831084      !                           ! Migrations 
    1084       imigr = iprecj * ( jpi + 2*jpr2di ) 
     1085      imigr = iprecj * ( jpi + 2*jpri ) 
    10851086      ! 
    10861087      SELECT CASE ( nbondj ) 
    10871088      CASE ( -1 ) 
    1088          CALL mppsend( 4, tr2sn(1-jpr2di,1,1), imigr, nono, ml_req1 ) 
    1089          CALL mpprecv( 3, tr2ns(1-jpr2di,1,2), imigr, nono ) 
     1089         CALL mppsend( 4, r2dsn(1-jpri,1,1), imigr, nono, ml_req1 ) 
     1090         CALL mpprecv( 3, r2dns(1-jpri,1,2), imigr, nono ) 
    10901091         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10911092      CASE ( 0 ) 
    1092          CALL mppsend( 3, tr2ns(1-jpr2di,1,1), imigr, noso, ml_req1 ) 
    1093          CALL mppsend( 4, tr2sn(1-jpr2di,1,1), imigr, nono, ml_req2 ) 
    1094          CALL mpprecv( 3, tr2ns(1-jpr2di,1,2), imigr, nono ) 
    1095          CALL mpprecv( 4, tr2sn(1-jpr2di,1,2), imigr, noso ) 
     1093         CALL mppsend( 3, r2dns(1-jpri,1,1), imigr, noso, ml_req1 ) 
     1094         CALL mppsend( 4, r2dsn(1-jpri,1,1), imigr, nono, ml_req2 ) 
     1095         CALL mpprecv( 3, r2dns(1-jpri,1,2), imigr, nono ) 
     1096         CALL mpprecv( 4, r2dsn(1-jpri,1,2), imigr, noso ) 
    10961097         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10971098         IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 
    10981099      CASE ( 1 ) 
    1099          CALL mppsend( 3, tr2ns(1-jpr2di,1,1), imigr, noso, ml_req1 ) 
    1100          CALL mpprecv( 4, tr2sn(1-jpr2di,1,2), imigr, noso ) 
     1100         CALL mppsend( 3, r2dns(1-jpri,1,1), imigr, noso, ml_req1 ) 
     1101         CALL mpprecv( 4, r2dsn(1-jpri,1,2), imigr, noso ) 
    11011102         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    11021103      END SELECT 
     
    11081109      CASE ( -1 ) 
    11091110         DO jl = 1, iprecj 
    1110             pt2d(:,ijhom+jl) = tr2ns(:,jl,2) 
     1111            pt2d(:,ijhom+jl) = r2dns(:,jl,2) 
    11111112         END DO 
    11121113      CASE ( 0 ) 
    11131114         DO jl = 1, iprecj 
    1114             pt2d(:,jl-jpr2dj) = tr2sn(:,jl,2) 
    1115             pt2d(:,ijhom+jl ) = tr2ns(:,jl,2) 
     1115            pt2d(:,jl-jprj) = r2dsn(:,jl,2) 
     1116            pt2d(:,ijhom+jl ) = r2dns(:,jl,2) 
    11161117         END DO 
    11171118      CASE ( 1 )  
    11181119         DO jl = 1, iprecj 
    1119             pt2d(:,jl-jpr2dj) = tr2sn(:,jl,2) 
     1120            pt2d(:,jl-jprj) = r2dsn(:,jl,2) 
    11201121         END DO 
    11211122      END SELECT 
Note: See TracChangeset for help on using the changeset viewer.