Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/AMM12/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/AMM12/EXPREF/namelist_cfg	(revision 11267)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/AMM12/EXPREF/namelist_cfg	(revision 11268)
@@ -187,6 +187,9 @@
 &nambdy_dta    !  open boundaries - external data                       
 !-----------------------------------------------------------------------
-   ln_full_vel = .false.
-
+   ln_zinterp  = .false.      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+   !                          !  automatically defined to T if the number of vertical levels in bdy dta /= jpk
+   ln_full_vel = .false.      !  T if [uv]3d are "full" velocities and not only its baroclinic components
+   !                          !  in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed
+   !
    cn_dir  =    './bdydta/'
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SHARED/namelist_ref	(revision 11267)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SHARED/namelist_ref	(revision 11268)
@@ -605,5 +605,5 @@
    ln_dyn3d_dmp  =.false.     !  open boundary condition for baroclinic velocities
    rn_time_dmp   =  1.        !  Damping time scale in days
-   rn_time_dmp_out = 1.        !  Outflow damping time scale
+   rn_time_dmp_out = 1.       !  Outflow damping time scale
    nn_rimwidth   = 10         !  width of the relaxation zone
    ln_vol        = .false.    !  total volume correction (see nn_volctl parameter)
@@ -613,6 +613,9 @@
 &nambdy_dta    !  open boundaries - external data                       (see nam_bdy)
 !-----------------------------------------------------------------------
-   ln_full_vel = .false.      !  ???
-
+   ln_zinterp  = .false.      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+   !                          !  automatically defined to T if the number of vertical levels in bdy dta /= jpk
+   ln_full_vel = .false.      !  T if [uv]3d are "full" velocities and not only its baroclinic components
+   !                          !  in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed
+   !
    cn_dir      = 'bdydta/'    !  root directory for the BDY data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SPITZ12/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SPITZ12/EXPREF/namelist_cfg	(revision 11267)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SPITZ12/EXPREF/namelist_cfg	(revision 11268)
@@ -181,6 +181,9 @@
 &nambdy_dta    !  open boundaries - external data                       (see nam_bdy)
 !-----------------------------------------------------------------------
-   ln_full_vel = .false.      !  ???
-
+   ln_zinterp  = .false.      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+   !                          !  automatically defined to T if the number of vertical levels in bdy dta /= jpk
+   ln_full_vel = .false.      !  T if [uv]3d are "full" velocities and not only its baroclinic components
+   !                          !  in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed
+   !
    cn_dir  =  './'
 !              !  file name      ! frequency (hours) ! variable  ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydta.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydta.F90	(revision 11267)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydta.F90	(revision 11268)
@@ -331,5 +331,6 @@
       LOGICAL                                ::   ln_full_vel   ! =T => full velocities in 3D boundary data
       !                                                         ! =F => baroclinic velocities in 3D boundary data
-      INTEGER                                ::   ipk,ipl           !
+      LOGICAL                                ::   ln_zinterp    ! =T => requires a vertical interpolation of the bdydta
+      INTEGER                                ::   ipk,ipl       !
       INTEGER                                ::   idvar         ! variable ID
       INTEGER                                ::   indims        ! number of dimensions of the variable
@@ -348,5 +349,5 @@
       NAMELIST/nambdy_dta/ cn_dir, bn_tem, bn_sal, bn_u3d, bn_v3d, bn_ssh, bn_u2d, bn_v2d 
       NAMELIST/nambdy_dta/ bn_a_i, bn_h_i, bn_h_s
-      NAMELIST/nambdy_dta/ ln_full_vel
+      NAMELIST/nambdy_dta/ ln_full_vel, ln_zinterp
       !!---------------------------------------------------------------------------
       !
@@ -361,5 +362,6 @@
       ENDIF
       bf(:,:)%clrootname = 'NOT USED'   ! default definition used as a flag in fld_read to do nothing.
-      bf(:,:)%ltotvel = .FALSE.         ! default definition
+      bf(:,:)%lzint      = .FALSE.      ! default definition
+      bf(:,:)%ltotvel    = .FALSE.      ! default definition
  
       ! Read namelists
@@ -521,7 +523,8 @@
                   CALL fld_fill( bf_alias, bn_alias, cn_dir, 'bdy_dta', cl3//' '//ctmp1, ctmp2 )   ! use namelist info
                   IF( bf_alias(1)%ln_tint ) ALLOCATE( bf_alias(1)%fdta( iszdim, 1, ipk, 2 ) )
-                  bf_alias(1)%imap => idx_bdy(jbdy)%nbmap(1:iszdim,igrd)      ! associate the mapping used for this bdy
-                  bf_alias(1)%igrd = igrd                                     ! used only for vertical integration of 3D arrays
+                  bf_alias(1)%imap    => idx_bdy(jbdy)%nbmap(1:iszdim,igrd)   ! associate the mapping used for this bdy
+                  bf_alias(1)%igrd    = igrd                                  ! used only for vertical integration of 3D arrays
                   bf_alias(1)%ltotvel = ln_full_vel                           ! T if u3d is full velocity
+                  bf_alias(1)%lzint   = ln_zinterp                            ! T if it requires a vertical interpolation
                ENDIF
 
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/SBC/fldread.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/SBC/fldread.F90	(revision 11267)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/SBC/fldread.F90	(revision 11268)
@@ -86,4 +86,5 @@
       INTEGER, POINTER, DIMENSION(:)  ::   imap         !   Array of integer pointers to 1D arrays
       LOGICAL                         ::   ltotvel      !   total velocity or not (T/F)
+      LOGICAL                         ::   lzint        !   T if it requires a vertical interpolation
    END TYPE FLD
 
@@ -616,8 +617,8 @@
       !
       IF( ASSOCIATED(sdjf%imap) ) THEN
-         IF( sdjf%ln_tint ) THEN   ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,2),                &
-            &                                        sdjf%nrec_a(1), sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel )
-         ELSE                      ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fnow(:,:,:  ),                &
-            &                                        sdjf%nrec_a(1), sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel )
+         IF( sdjf%ln_tint ) THEN   ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1),   &
+            &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint )
+         ELSE                      ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fnow(:,:,:  ), sdjf%nrec_a(1),   &
+            &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint )
          ENDIF
       ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN
@@ -676,5 +677,5 @@
 
    
-   SUBROUTINE fld_map( knum, cdvar, pdta, krec, kmap, kgrd, kbdy, ldtotvel )
+   SUBROUTINE fld_map( knum, cdvar, pdta, krec, kmap, kgrd, kbdy, ldtotvel, ldzint )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE fld_map  ***
@@ -691,5 +692,6 @@
       INTEGER, OPTIONAL         , INTENT(in   ) ::   kgrd         ! grid type (t, u, v)
       INTEGER, OPTIONAL         , INTENT(in   ) ::   kbdy         ! bdy number
-      LOGICAL, OPTIONAL         , INTENT(in   ) ::   ldtotvel     ! true if toal ( = barotrop + barocline) velocity
+      LOGICAL, OPTIONAL         , INTENT(in   ) ::   ldtotvel     ! true if total ( = barotrop + barocline) velocity
+      LOGICAL, OPTIONAL         , INTENT(in   ) ::   ldzint       ! true if 3D variable requires a vertical interpolation
       !!
       INTEGER                                   ::   ipi          ! length of boundary data on local process
@@ -707,4 +709,5 @@
       CHARACTER(LEN=1),DIMENSION(3)             ::   clgrid
       LOGICAL                                   ::   lluld        ! is the variable using the unlimited dimension
+      LOGICAL                                   ::   llzint       ! local value of ldzint
       !!---------------------------------------------------------------------
       !
@@ -714,4 +717,7 @@
       ipj = SIZE( pdta, 2 )   ! must be equal to 1
       ipk = SIZE( pdta, 3 )
+      !
+      llzint = .FALSE.
+      IF( PRESENT(ldzint) )   llzint = ldzint
       !
       idvar = iom_varid( knum, cdvar, kndims = indims, kdimsz = idimsz, lduld = lluld  )
@@ -739,5 +745,5 @@
          CALL iom_get ( knum, jpdom_unknown, cdvar, zz_read(:,:,:), krec )   ! call iom_get with a 3D file
          !
-         IF( ipkb /= ipk ) THEN   ! boundary data not on model vertical grid : vertical interpolation
+         IF( ipkb /= ipk .OR. llzint ) THEN   ! boundary data not on model vertical grid : vertical interpolation
             !
             IF( ipk == jpk .AND. iom_varid(knum,'gdep'//clgrid(kgrd)) /= -1 .AND. iom_varid(knum,'e3'//clgrid(kgrd)) /= -1 ) THEN
@@ -1179,4 +1185,5 @@
          sdf(jf)%imap       => NULL()
          sdf(jf)%ltotvel    = .FALSE.
+         sdf(jf)%lzint      = .FALSE.
       END DO
       !
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/WAD/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/WAD/EXPREF/namelist_cfg	(revision 11267)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/WAD/EXPREF/namelist_cfg	(revision 11268)
@@ -180,4 +180,10 @@
 &nambdy_dta    !  open boundaries - external data                       
 !-----------------------------------------------------------------------
+   ln_zinterp  = .false.      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+   !                          !  automatically defined to T if the number of vertical levels in bdy dta /= jpk
+   ln_full_vel = .false.      !  T if [uv]3d are "full" velocities and not only its baroclinic components
+   !                          !  in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed
+   !
+   cn_dir  =  './'
 !              !  file name      ! frequency (hours) ! variable  ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
 !              !                 !  (if <0  months)  !   name    !  (logical)   !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      !
@@ -185,6 +191,4 @@
    bn_u2d =     'bdyuv_tc7'  ,         1.       , 'ubdy'  ,     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , ''
    bn_v2d =     'bdyuv_tc7'  ,         1.       , 'vbdy'  ,     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , ''
-   cn_dir      =    './'   !  root directory for the location of the bulk files
-   ln_full_vel = .false.        !
 /
 !-----------------------------------------------------------------------
