Index: NEMO/branches/2020/tickets_icb_1900/src/OCE/BDY/bdylib.F90
===================================================================
--- NEMO/branches/2020/tickets_icb_1900/src/OCE/BDY/bdylib.F90	(revision 13277)
+++ NEMO/branches/2020/tickets_icb_1900/src/OCE/BDY/bdylib.F90	(revision 13899)
@@ -44,5 +44,5 @@
       !!----------------------------------------------------------------------
       TYPE(OBC_INDEX),                     INTENT(in) ::   idx  ! OBC indices
-      REAL(wp), DIMENSION(:,:),            INTENT(in) ::   dta  ! OBC external data
+      REAL(wp), DIMENSION(:,:), POINTER,   INTENT(in) ::   dta  ! OBC external data
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   phia  ! tracer trend
       !!
@@ -73,5 +73,5 @@
       !!----------------------------------------------------------------------
       TYPE(OBC_INDEX),                     INTENT(in) ::   idx  ! OBC indices
-      REAL(wp), DIMENSION(:,:),            INTENT(in) ::   dta  ! OBC external data
+      REAL(wp), DIMENSION(:,:), POINTER,   INTENT(in) ::   dta  ! OBC external data
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   phia  ! tracer trend
       !!
@@ -100,10 +100,10 @@
       !!
       !!----------------------------------------------------------------------
-      TYPE(OBC_INDEX),                     INTENT(in) ::   idx  ! OBC indices
-      REAL(wp), DIMENSION(:,:),            INTENT(in) ::   dta  ! OBC external data
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   phib  ! before tracer field
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   phia  ! tracer trend
-      LOGICAL                 , OPTIONAL,  INTENT(in) ::   lrim0   ! indicate if rim 0 is treated
-      LOGICAL,                             INTENT(in) ::   ll_npo  ! switch for NPO version
+      TYPE(OBC_INDEX),                   INTENT(in   ) ::   idx  ! OBC indices
+      REAL(wp), DIMENSION(:,:), POINTER, INTENT(in   ) ::   dta  ! OBC external data
+      REAL(wp), DIMENSION(jpi,jpj,jpk),  INTENT(inout) ::   phib  ! before tracer field
+      REAL(wp), DIMENSION(jpi,jpj,jpk),  INTENT(inout) ::   phia  ! tracer trend
+      LOGICAL ,                          INTENT(in   ) ::   lrim0   ! indicate if rim 0 is treated
+      LOGICAL ,                          INTENT(in   ) ::   ll_npo  ! switch for NPO version
       !!
       INTEGER  ::   igrd                                    ! grid index
@@ -128,11 +128,11 @@
       !! References:  Marchesiello, McWilliams and Shchepetkin, Ocean Modelling vol. 3 (2001)    
       !!----------------------------------------------------------------------
-      TYPE(OBC_INDEX),          INTENT(in   ) ::   idx      ! BDY indices
-      INTEGER ,                 INTENT(in   ) ::   igrd     ! grid index
-      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   phib     ! model before 2D field
-      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   phia     ! model after 2D field (to be updated)
-      REAL(wp), DIMENSION(:)  , INTENT(in   ) ::   phi_ext  ! external forcing data
-      LOGICAL, OPTIONAL,        INTENT(in   ) ::   lrim0    ! indicate if rim 0 is treated
-      LOGICAL ,                 INTENT(in   ) ::   ll_npo   ! switch for NPO version
+      TYPE(OBC_INDEX),                   INTENT(in   ) ::   idx      ! BDY indices
+      INTEGER ,                          INTENT(in   ) ::   igrd     ! grid index
+      REAL(wp), DIMENSION(:,:),          INTENT(in   ) ::   phib     ! model before 2D field
+      REAL(wp), DIMENSION(:,:),          INTENT(inout) ::   phia     ! model after 2D field (to be updated)
+      REAL(wp), DIMENSION(:  ), POINTER, INTENT(in   ) ::   phi_ext  ! external forcing data
+      LOGICAL ,                          INTENT(in   ) ::   lrim0    ! indicate if rim 0 is treated
+      LOGICAL ,                          INTENT(in   ) ::   ll_npo   ! switch for NPO version
       !
       INTEGER  ::   jb                                     ! dummy loop indices
@@ -188,10 +188,7 @@
       END SELECT
       !
-      IF( PRESENT(lrim0) ) THEN
-         IF( lrim0 ) THEN   ;   ibeg = 1                       ;   iend = idx%nblenrim0(igrd)   ! rim 0
-         ELSE               ;   ibeg = idx%nblenrim0(igrd)+1   ;   iend = idx%nblenrim(igrd)    ! rim 1
-         END IF
-      ELSE                  ;   ibeg = 1                       ;   iend = idx%nblenrim(igrd)    ! both
-      END IF
+      IF( lrim0 ) THEN   ;   ibeg = 1                       ;   iend = idx%nblenrim0(igrd)   ! rim 0
+      ELSE               ;   ibeg = idx%nblenrim0(igrd)+1   ;   iend = idx%nblenrim(igrd)    ! rim 1
+      ENDIF
       !
       DO jb = ibeg, iend
@@ -275,5 +272,5 @@
            &                    - (1.-zsign_ups) * zry * ( phib(iijp1,ijjp1) - phib(ii   ,ij    ) ) &
            &                    + zwgt * ( phi_ext(jb) - phib(ii,ij) ) ) / ( 1. + zrx ) 
-         end if
+         endif
          phia(ii,ij) = phia(ii,ij) * zmask(ii,ij)
       END DO
@@ -293,11 +290,11 @@
       !! References:  Marchesiello, McWilliams and Shchepetkin, Ocean Modelling vol. 3 (2001)    
       !!----------------------------------------------------------------------
-      TYPE(OBC_INDEX),            INTENT(in   ) ::   idx      ! BDY indices
-      INTEGER ,                   INTENT(in   ) ::   igrd     ! grid index
-      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   phib     ! model before 3D field
-      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   phia     ! model after 3D field (to be updated)
-      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   phi_ext  ! external forcing data
-      LOGICAL, OPTIONAL,          INTENT(in   ) ::   lrim0    ! indicate if rim 0 is treated
-      LOGICAL ,                   INTENT(in   ) ::   ll_npo   ! switch for NPO version
+      TYPE(OBC_INDEX),                     INTENT(in   ) ::   idx      ! BDY indices
+      INTEGER ,                            INTENT(in   ) ::   igrd     ! grid index
+      REAL(wp), DIMENSION(:,:,:),          INTENT(in   ) ::   phib     ! model before 3D field
+      REAL(wp), DIMENSION(:,:,:),          INTENT(inout) ::   phia     ! model after 3D field (to be updated)
+      REAL(wp), DIMENSION(:,:  ), POINTER, INTENT(in   ) ::   phi_ext  ! external forcing data
+      LOGICAL ,                            INTENT(in   ) ::   lrim0    ! indicate if rim 0 is treated
+      LOGICAL ,                            INTENT(in   ) ::   ll_npo   ! switch for NPO version
       !
       INTEGER  ::   jb, jk                                 ! dummy loop indices
@@ -353,10 +350,7 @@
       END SELECT
       !
-      IF( PRESENT(lrim0) ) THEN
-         IF( lrim0 ) THEN   ;   ibeg = 1                       ;   iend = idx%nblenrim0(igrd)   ! rim 0
-         ELSE               ;   ibeg = idx%nblenrim0(igrd)+1   ;   iend = idx%nblenrim(igrd)    ! rim 1
-         END IF
-      ELSE                  ;   ibeg = 1                       ;   iend = idx%nblenrim(igrd)    ! both
-      END IF
+      IF( lrim0 ) THEN   ;   ibeg = 1                       ;   iend = idx%nblenrim0(igrd)   ! rim 0
+      ELSE               ;   ibeg = idx%nblenrim0(igrd)+1   ;   iend = idx%nblenrim(igrd)    ! rim 1
+      ENDIF
       !
       DO jk = 1, jpk
@@ -441,5 +435,5 @@
               &                       - (1.-zsign_ups) * zry * ( phib(iijp1,ijjp1,jk) - phib(ii   ,ij   ,jk) ) &
               &                       + zwgt * ( phi_ext(jb,jk) - phib(ii,ij,jk) ) ) / ( 1. + zrx ) 
-            end if
+            endif
             phia(ii,ij,jk) = phia(ii,ij,jk) * zmask(ii,ij,jk)
          END DO
@@ -466,5 +460,5 @@
       REAL(wp), DIMENSION(:,:,:), INTENT(inout)  ::   phia     ! model after 3D field (to be updated), must be masked
       TYPE(OBC_INDEX),            INTENT(in   )  ::   idx      ! OBC indices
-      LOGICAL, OPTIONAL,          INTENT(in   )  ::   lrim0    ! indicate if rim 0 is treated
+      LOGICAL ,                   INTENT(in   )  ::   lrim0    ! indicate if rim 0 is treated
       !! 
       REAL(wp) ::   zweight
@@ -486,10 +480,7 @@
       END SELECT
       !
-      IF( PRESENT(lrim0) ) THEN
-         IF( lrim0 ) THEN   ;   ibeg = 1                       ;   iend = idx%nblenrim0(igrd)   ! rim 0
-         ELSE               ;   ibeg = idx%nblenrim0(igrd)+1   ;   iend = idx%nblenrim(igrd)    ! rim 1
-         END IF
-      ELSE                  ;   ibeg = 1                       ;   iend = idx%nblenrim(igrd)    ! both
-      END IF
+      IF( lrim0 ) THEN   ;   ibeg = 1                       ;   iend = idx%nblenrim0(igrd)   ! rim 0
+      ELSE               ;   ibeg = idx%nblenrim0(igrd)+1   ;   iend = idx%nblenrim(igrd)    ! rim 1
+      ENDIF
       !
       DO ib = ibeg, iend
