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 11194 for NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src – NEMO

Ignore:
Timestamp:
2019-06-27T16:51:16+02:00 (5 years ago)
Author:
smasson
Message:

dev_r10984_HPC-13 : reorganization of lbclnk, part 1: bugfix following [11192], see #2285

Location:
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/IOM/iom.F90

    r11192 r11194  
    19791979      ! Cell vertices on boundries 
    19801980      DO jn = 1, 4 
    1981          CALL lbc_lnk( 'iom', z_bnds(jn,:,:,1), cdgrd, 1., pval=999._wp ) 
    1982          CALL lbc_lnk( 'iom', z_bnds(jn,:,:,2), cdgrd, 1., pval=999._wp ) 
     1981         CALL lbc_lnk( 'iom', z_bnds(jn,:,:,1), cdgrd, 1., pfillval=999._wp ) 
     1982         CALL lbc_lnk( 'iom', z_bnds(jn,:,:,2), cdgrd, 1., pfillval=999._wp ) 
    19831983      END DO 
    19841984      ! 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/LBC/lbclnk.F90

    r11192 r11194  
    6767!$AGRIF_END_DO_NOT_TREAT 
    6868#endif 
     69 
     70   INTEGER, PUBLIC, PARAMETER ::   jpfillnothing = 1 
     71   INTEGER, PUBLIC, PARAMETER ::   jpfillcst     = 2 
     72   INTEGER, PUBLIC, PARAMETER ::   jpfillcopy    = 3 
     73   INTEGER, PUBLIC, PARAMETER ::   jpfillperio   = 4 
     74   INTEGER, PUBLIC, PARAMETER ::   jpfillmpi     = 5 
     75 
    6976   !!---------------------------------------------------------------------- 
    7077   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    144151   !! 
    145152   !!   * Argument : dummy argument use in mpp_lnk_... routines 
    146    !!                ptab   :   array or pointer of arrays on which the boundary condition is applied 
    147    !!                cd_nat :   nature of array grid-points 
    148    !!                psgn   :   sign used across the north fold boundary 
    149    !!                kfld   :   optional, number of pt3d arrays 
    150    !!                cd_mpp :   optional, fill the overlap area only 
    151    !!                pval   :   optional, background value (used at closed boundaries) 
     153   !!                ptab      :   array or pointer of arrays on which the boundary condition is applied 
     154   !!                cd_nat    :   nature of array grid-points 
     155   !!                psgn      :   sign used across the north fold boundary 
     156   !!                kfld      :   optional, number of pt3d arrays 
     157   !!                kfillmode :   optional, method to be use to fill the halos (see jpfill* variables) 
     158   !!                pfillval  :   optional, background value (used with jpfillcopy) 
    152159   !!---------------------------------------------------------------------- 
    153160   ! 
     
    195202   !! 
    196203   !!   * Argument : dummy argument use in mpp_nfd_... routines 
    197    !!                ptab   :   array or pointer of arrays on which the boundary condition is applied 
    198    !!                cd_nat :   nature of array grid-points 
    199    !!                psgn   :   sign used across the north fold boundary 
    200    !!                kfld   :   optional, number of pt3d arrays 
    201    !!                cd_mpp :   optional, fill the overlap area only 
    202    !!                pval   :   optional, background value (used at closed boundaries) 
     204   !!                ptab      :   array or pointer of arrays on which the boundary condition is applied 
     205   !!                cd_nat    :   nature of array grid-points 
     206   !!                psgn      :   sign used across the north fold boundary 
     207   !!                kfld      :   optional, number of pt3d arrays 
     208   !!                kfillmode :   optional, method to be use to fill the halos (see jpfill* variables) 
     209   !!                pfillval  :   optional, background value (used with jpfillcopy) 
    203210   !!---------------------------------------------------------------------- 
    204211   ! 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/LBC/lib_mpp.F90

    r11192 r11194  
    172172   LOGICAL, PUBLIC ::   ln_nnogather                !: namelist control of northfold comms 
    173173   LOGICAL, PUBLIC ::   l_north_nogather = .FALSE.  !: internal control of northfold comms 
    174  
    175    INTEGER, PUBLIC, PARAMETER ::   jpfillnothing = 1 
    176    INTEGER, PUBLIC, PARAMETER ::   jpfillcst     = 2 
    177    INTEGER, PUBLIC, PARAMETER ::   jpfillcopy    = 3 
    178    INTEGER, PUBLIC, PARAMETER ::   jpfillperio   = 4 
    179    INTEGER, PUBLIC, PARAMETER ::   jpfillmpi     = 5 
    180174    
    181175   !!---------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/LBC/mpp_lnk_generic.h90

    r11192 r11194  
    100100      ! 
    101101      IF(               llcom_ea ) THEN   ;   ifill_ea = jpfillmpi 
    102       ELSE                                ;   ifill_ea = ifill_we 
     102      ELSEIF(           l_Iperio ) THEN   ;   ifill_ea = jpfillperio 
     103      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_ea = kfillmode 
     104      ELSE                                ;   ifill_ea = jpfillcst 
    103105      END IF 
    104106      ! 
     
    110112      ! 
    111113      IF(               llcom_no ) THEN   ;   ifill_no = jpfillmpi 
    112       ELSE                                ;   ifill_no = ifill_so   ! warning will be potentially changed if lldo_nfd = T 
     114      ELSEIF(           l_Jperio ) THEN   ;   ifill_no = jpfillperio 
     115      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_no = kfillmode 
     116      ELSE                                ;   ifill_no = jpfillcst 
    113117      END IF 
    114118      ! 
     
    125129      ! -------------------------------------------------- ! 
    126130      ! 
    127       ! these echanges are made for jj = nn_hls+1 to jpj-nn_hls 
    128       isize = nn_hls * ( jpj - 2*nn_hls ) * ipk * ipl * ipf       
     131      ! Must exchange the whole column (from 1 to jpj) to get the corners if we have no south/north neighbourg 
     132      isize = nn_hls * jpj * ipk * ipl * ipf       
    129133 
    130134      ! Allocate local temporary arrays to be sent/received. Fill arrays to be sent 
    131135      IF( ifill_we == jpfillmpi ) THEN   ! copy western side of the inner mpi domain in local temporary array to be sent by MPI 
    132136         ! 
    133          ALLOCATE( zsnd_we(nn_hls,jpj-2*nn_hls,ipk,ipl,ipf), zrcv_we(nn_hls,jpj-2*nn_hls,ipk,ipl,ipf) ) 
     137         ALLOCATE( zsnd_we(nn_hls,jpj,ipk,ipl,ipf), zrcv_we(nn_hls,jpj,ipk,ipl,ipf) ) 
    134138         ishift = nn_hls 
    135          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
    136             zsnd_we(ji,jj-nn_hls,jk,jl,jf) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)   ! nn_hls + 1 -> 2*nn_hls 
     139         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
     140            zsnd_we(ji,jj,jk,jl,jf) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)   ! nn_hls + 1 -> 2*nn_hls 
    137141         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
    138142      ENDIF 
     
    140144      IF( ifill_ea == jpfillmpi ) THEN   ! copy eastern side of the inner mpi domain in local temporary array to be sent by MPI 
    141145         ! 
    142          ALLOCATE( zsnd_ea(nn_hls,jpj-2*nn_hls,ipk,ipl,ipf), zrcv_ea(nn_hls,jpj-2*nn_hls,ipk,ipl,ipf) ) 
     146         ALLOCATE( zsnd_ea(nn_hls,jpj,ipk,ipl,ipf), zrcv_ea(nn_hls,jpj,ipk,ipl,ipf) ) 
    143147         ishift = jpi - 2 * nn_hls 
    144          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
    145             zsnd_ea(ji,jj-nn_hls,jk,jl,jf) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)   ! jpi - 2*nn_hls + 1 -> jpi - nn_hls 
     148         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
     149            zsnd_ea(ji,jj,jk,jl,jf) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)   ! jpi - 2*nn_hls + 1 -> jpi - nn_hls 
    146150         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
    147151      ENDIF 
     
    169173      CASE ( jpfillnothing )               ! no filling  
    170174      CASE ( jpfillmpi   )                 ! use data received by MPI  
    171          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
    172             ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_we(ji,jj-nn_hls,jk,jl,jf)   ! 1 -> nn_hls 
     175         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
     176            ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_we(ji,jj,jk,jl,jf)   ! 1 -> nn_hls 
    173177         END DO;   END DO   ;   END DO   ;   END DO   ;   END DO 
    174178      CASE ( jpfillperio )                 ! use east-weast periodicity 
    175179         ishift2 = jpi - 2 * nn_hls 
    176          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
     180         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    177181            ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf) 
    178182         END DO;   END DO   ;   END DO   ;   END DO   ;   END DO 
     
    180184         DO jf = 1, ipf                               ! number of arrays to be treated 
    181185            IF( .NOT. NAT_IN(jf) == 'F' ) THEN        ! do nothing for F point 
    182                DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
     186               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    183187                  ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf) 
    184188               END DO   ;   END DO   ;   END DO   ;   END DO 
     
    188192         DO jf = 1, ipf                               ! number of arrays to be treated 
    189193            IF( .NOT. NAT_IN(jf) == 'F' ) THEN        ! do nothing for F point 
    190                DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
     194               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    191195                  ARRAY_IN(ji,jj,jk,jl,jf) = zland 
    192196               END DO;   END DO   ;   END DO   ;   END DO 
     
    201205      CASE ( jpfillnothing )               ! no filling  
    202206      CASE ( jpfillmpi   )                 ! use data received by MPI  
    203          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
    204             ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv_ea(ji,jj-nn_hls,jk,jl,jf)   ! jpi - nn_hls + 1 -> jpi 
     207         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
     208            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv_ea(ji,jj,jk,jl,jf)   ! jpi - nn_hls + 1 -> jpi 
    205209         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
    206210      CASE ( jpfillperio )                 ! use east-weast periodicity 
    207211         ishift2 = nn_hls 
    208          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
     212         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    209213            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf) 
    210214         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
    211215      CASE ( jpfillcopy  )                 ! filling with inner domain values 
    212          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
     216         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    213217            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf) 
    214218         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
    215219      CASE ( jpfillcst   )                 ! filling with constant value 
    216          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls+1, jpj-nn_hls   ;   DO ji = 1, nn_hls 
     220         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    217221            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland 
    218222         END DO;   END DO   ;   END DO   ;   END DO   ;   END DO 
Note: See TracChangeset for help on using the changeset viewer.