Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg	(revision 12960)
@@ -89,17 +89,13 @@
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
    !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   !
-   sn_wndi     = 'u_10.15JUNE2009_fill'       ,    6.        , 'U_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'  , 'Uwnd'   , ''
-   sn_wndj     = 'v_10.15JUNE2009_fill'       ,    6.        , 'V_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'  , 'Vwnd'   , ''
-   sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'SWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-   sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'LWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-   sn_tair     = 't_10.15JUNE2009_fill'       ,    6.        , 'T_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-   sn_humi     = 'q_10.15JUNE2009_fill'       ,    6.        , 'Q_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-   sn_prec     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'PRC_MOD1',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-   sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-   sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , ''
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
+   sn_wndi     = 'u_10.15JUNE2009_fill'       ,    6.        , 'U_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bicub'  , 'Uwnd'   , ''
+   sn_wndj     = 'v_10.15JUNE2009_fill'       ,    6.        , 'V_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bicub'  , 'Vwnd'   , ''
+   sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'SWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
+   sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'LWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
+   sn_tair     = 't_10.15JUNE2009_fill'       ,    6.        , 'T_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
+   sn_humi     = 'q_10.15JUNE2009_fill'       ,    6.        , 'Q_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
+   sn_prec     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'PRC_MOD1',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
+   sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
+   sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , ''
 /
 !-----------------------------------------------------------------------
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dom_oce.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dom_oce.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dom_oce.F90	(revision 12960)
@@ -93,4 +93,6 @@
    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mig0       !: local ==> global domain, excluding halos (Ni0glo), i-index
    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mjg0       !: local ==> global domain, excluding halos (Nj0glo), j-index
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mig0_oldcmp !: local ==> global domain, excluding halos (Ni0glo), i-index
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mjg0_oldcmp !: local ==> global domain, excluding halos (Nj0glo), j-index
    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mi0, mi1   !: global, including halos (jpiglo) ==> local domain i-index
    !                                                                !:    (mi0=1 and mi1=0 if global index not in local domain)
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domain.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domain.F90	(revision 12960)
@@ -215,5 +215,5 @@
       !!              - mig0, mjg0: local  domain indices ==> global domain, excluding halos, indices
       !!              - mi0 , mi1 : global domain indices ==> local  domain indices
-      !!              - mj0,, mj1   (global point not in the local domain ==> mi0>mi1 and/or mj0>mj1)
+      !!              - mj0 , mj1   (if global point not in the local domain ==> mi0>mi1 and/or mj0>mj1)
       !!----------------------------------------------------------------------
       INTEGER ::   ji, jj   ! dummy loop argument
@@ -228,11 +228,11 @@
       !                              ! local domain indices ==> global domain, excluding halos, indices
       !
+      mig0(:) = mig(:) - nn_hls
+      mjg0(:) = mjg(:) - nn_hls  
       ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data, 
       ! we must define mig0 and mjg0 as bellow.
       ! Once we decide to forget trunk compatibility, we must simply define mig0 and mjg0 as:
-!!$      mig0(:) = mig(:) - nn_hls
-!!$      mjg0(:) = mjg(:) - nn_hls  
-      mig0(:) = mig(:) - nn_hls + COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) )
-      mjg0(:) = mjg(:) - nn_hls + COUNT( (/ jperio == 2 .OR. jperio == 7 /) )
+      mig0_oldcmp(:) = mig0(:) + COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) )
+      mjg0_oldcmp(:) = mjg0(:) + COUNT( (/ jperio == 2 .OR. jperio == 7 /) )
       !
       !                              ! global domain, including halos, indices ==> local domain indices
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domvvl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domvvl.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domvvl.F90	(revision 12960)
@@ -261,6 +261,6 @@
             IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
                IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2
-                  ii0 = 103   ;   ii1 = 111       
-                  ij0 = 128   ;   ij1 = 135   ;   
+                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1      
+                  ij0 = 128 + nn_hls       ;   ij1 = 135 + nn_hls
                   frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp
                   frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dtatsd.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dtatsd.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dtatsd.F90	(revision 12960)
@@ -153,6 +153,6 @@
          IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN    ! some hand made alterations
             !
-            ij0 = 101   ;   ij1 = 109                       ! Reduced T & S in the Alboran Sea
-            ii0 = 141   ;   ii1 = 155
+            ij0 = 101 + nn_hls       ;   ij1 = 109 + nn_hls                       ! Reduced T & S in the Alboran Sea
+            ii0 = 141 + nn_hls - 1   ;   ii1 = 155 + nn_hls - 1
             DO jj = mj0(ij0), mj1(ij1)
                DO ji = mi0(ii0), mi1(ii1)
@@ -167,6 +167,6 @@
                END DO
             END DO
-            ij0 =  87   ;   ij1 =  96                          ! Reduced temperature in Red Sea
-            ii0 = 148   ;   ii1 = 160
+            ij0 =  87 + nn_hls       ;   ij1 =  96 + nn_hls                       ! Reduced temperature in Red Sea
+            ii0 = 148 + nn_hls - 1   ;   ii1 = 160 + nn_hls - 1
             sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ,  4:10 ) = 7.0_wp
             sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/iom.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/iom.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/iom.F90	(revision 12960)
@@ -119,4 +119,5 @@
       INTEGER ::   Nis0_save, Nie0_save    !:      and close boundaries in output files
       INTEGER ::   Njs0_save, Nje0_save    !:
+      INTEGER ::   Ni_0_save, Nj_0_save    !:
       LOGICAL ::   ll_closedef = .TRUE.
       !!----------------------------------------------------------------------
@@ -129,8 +130,11 @@
          Nis0_save = Nis0   ;   Nie0_save = Nie0
          Njs0_save = Njs0   ;   Nje0_save = Nje0
-         IF( nimpp           ==      1 ) Nis0 = 1
-         IF( nimpp + jpi - 1 == jpiglo ) Nie0 = jpi
-         IF( njmpp           ==      1 ) Njs0 = 1
-         IF( njmpp + jpj - 1 == jpjglo ) Nje0 = jpj
+         Ni_0_save = Ni_0   ;   Nj_0_save = Nj_0
+         IF( mig( 1 ) ==      1 ) Nis0 = 1
+         IF( mig(jpi) == jpiglo ) Nie0 = jpi
+         IF( mjg( 1 ) ==      1 ) Njs0 = 1
+         IF( mjg(jpj) == jpjglo ) Nje0 = jpj
+         Ni_0 = Nie0 - Nis0 + 1
+         Nj_0 = Nje0 - Njs0 + 1
       ENDIF
       IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef
@@ -150,10 +154,10 @@
 
       SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL
-      CASE ( 1)   ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(irefyear,irefmonth,irefday,00,00,00), &
-          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) )
-      CASE ( 0)   ; CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(irefyear,irefmonth,irefday,00,00,00), &
-          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) )
-      CASE (30)   ; CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(irefyear,irefmonth,irefday,00,00,00), &
-          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) )
+      CASE ( 1)   ;   CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(irefyear,irefmonth,irefday,0,0,0),   &
+          &                                                          start_date  = xios_date(   nyear,   nmonth,   nday,0,0,0) )
+      CASE ( 0)   ;   CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(irefyear,irefmonth,irefday,0,0,0),   &
+          &                                                          start_date  = xios_date(   nyear,   nmonth,   nday,0,0,0) )
+      CASE (30)   ;   CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(irefyear,irefmonth,irefday,0,0,0),   &
+          &                                                          start_date  = xios_date(   nyear,   nmonth,   nday,0,0,0) )
       END SELECT
 
@@ -284,4 +288,5 @@
          Nis0 = Nis0_save   ;   Nie0 = Nie0_save
          Njs0 = Njs0_save   ;   Nje0 = Nje0_save
+         Ni_0 = Ni_0_save   ;   Nj_0 = Nj_0_save
       ENDIF
 #endif
@@ -1162,5 +1167,5 @@
             ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown
                ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0 
-               IF( idom == jpdom_global )   istart(1:2) = (/ mig(Nis0)-nn_hls, mjg(Njs0)-nn_hls /)
+               IF( idom == jpdom_global )   istart(1:2) = (/ mig0(Nis0), mjg0(Njs0) /)
                icnt(1:2) = (/ Ni_0, Nj_0 /)
                IF( PRESENT(pv_r3d) ) THEN
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mppini.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mppini.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mppini.F90	(revision 12960)
@@ -8,6 +8,6 @@
    !!            8.0  !  1998-05  (M. Imbard, J. Escobar, L. Colombet )  SHMEM and MPI versions
    !!  NEMO      1.0  !  2004-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1
-   !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  add init_nfdcom
-   !!            3.   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication 
+   !!            3.4  !  2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  add init_nfdcom
+   !!            3.   !  2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication 
    !!            4.0  !  2016-06  (G. Madec)  use domain configuration file instead of bathymetry file
    !!            4.0  !  2017-06  (J.M. Molines, T. Lovato) merge of mppini and mppini_2
@@ -1055,6 +1055,12 @@
       !!                  ***  ROUTINE mpp_init_nboce  ***
       !!
-      !! ** Purpose : check for a mpi domain decomposition knbi x knbj which
-      !!              subdomains contain at least 1 ocean point
+      !! ** Purpose : Check for a mpi domain decomposition knbi x knbj which
+      !!              subdomains, including 1 halo (even if nn_hls>1), contain
+      !!              at least 1 ocean point.
+      !!              We must indeed ensure that each subdomain that is a neighbour
+      !!              of a land subdomain as only land points on its boundary
+      !!              (inside the inner subdomain) with the land subdomain.
+      !!              This is needed to get the proper bondary conditions on
+      !!              a subdomain with a closed boundary.
       !!
       !! ** Method  : read knbj strips (of length Ni0glo) of the land-sea mask
@@ -1066,4 +1072,5 @@
       INTEGER, DIMENSION(knbi*knbj) ::   inboce_1d
       INTEGER :: idiv, iimax, ijmax, iarea
+      INTEGER :: inx, iny, inry, isty
       INTEGER :: ji, jn
       LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce                  ! lloce(i,j) = .true. if the point (i,j) is ocean 
@@ -1086,14 +1093,39 @@
       DO jn = 0, (knbj-1)/mppsize   ! if mppsize < knbj : more strips than mpi processes (because of potential land domains)
          !
-         iarea = (narea-1)/idiv + jn * mppsize   ! involed process number (starting counting at 0)
-         IF( MOD( narea-1, idiv ) == 0 .AND. iarea < knbj ) THEN   ! beware idiv can be = to 1
+         iarea = (narea-1)/idiv + jn * mppsize + 1                     ! involed process number (starting counting at 1)
+         IF( MOD( narea-1, idiv ) == 0 .AND. iarea <= knbj ) THEN      ! beware idiv can be = to 1
             !
             ALLOCATE( iimppt(knbi,knbj), ijmppt(knbi,knbj), ijpi(knbi,knbj), ijpj(knbi,knbj) )
             CALL basic_decomposition( Ni0glo, Nj0glo, 0, knbi, knbj, iimax, ijmax, iimppt, ijmppt, ijpi, ijpj )
             !
-            ALLOCATE( lloce(Ni0glo, ijpj(1,iarea+1)) )                       ! allocate the strip
-            CALL readbot_strip( ijmppt(1,iarea+1), ijpj(1,iarea+1), lloce )           ! read the strip
+            inx = Ni0glo + 2   ;   iny = ijpj(1,iarea) + 2             ! strip size + 1 halo on each direction (even if nn_hls>1)
+            ALLOCATE( lloce(inx, iny) )                                ! allocate the strip
+            inry = iny - COUNT( (/ iarea == 1, iarea == knbj /) )      ! number of point to read in y-direction
+            isty = 1 + COUNT( (/ iarea == 1 /) )                       ! read from the first or the second line?
+            CALL readbot_strip( ijmppt(1,iarea) - 2 + isty, inry, lloce(2:inx-1, isty:inry+isty-1) )   ! read the strip
+            ! 
+            IF( iarea == 1    ) THEN                                   ! the first line was not read
+               IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity
+                  CALL readbot_strip( Nj0glo, 1, lloce(2:inx-1, 1) )   !   read the last line -> first line of lloce
+               ELSE
+                  lloce(2:inx-1,  1) = .FALSE.                         !   closed boundary
+               ENDIF
+            ENDIF
+            IF( iarea == knbj ) THEN                                   ! the last line was not read
+               IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity
+                  CALL readbot_strip( 1, 1, lloce(2:inx-1,iny) )       !   read the first line -> last line of lloce
+               ELSE
+                  lloce(2:inx-1,iny) = .FALSE.                         !   closed boundary
+               ENDIF
+            ENDIF
+            !                                                          ! first and last column were not read
+            IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 ) THEN
+               lloce(1,:) = lloce(inx-1,:)   ;   lloce(inx,:) = lloce(2,:)   ! east-west periodocity
+            ELSE
+               lloce(1,:) = .FALSE.          ;   lloce(inx,:) = .FALSE.      ! closed boundary
+            ENDIF
+            !
             DO  ji = 1, knbi
-               inboce(ji,iarea+1) = COUNT( lloce(iimppt(ji,1):iimppt(ji,1)+ijpi(ji,1)-1,:) )   ! number of ocean point in subdomain
+               inboce(ji,iarea) = COUNT( lloce(iimppt(ji,1):iimppt(ji,1)+ijpi(ji,1)+1,:) )   ! lloce as 2 points more than Ni0glo
             END DO
             !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/fldread.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/fldread.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/fldread.F90	(revision 12960)
@@ -53,5 +53,5 @@
       LOGICAL              ::   ln_tint     ! time interpolation or not (T/F)
       LOGICAL              ::   ln_clim     ! climatology or not (T/F)
-      CHARACTER(len = 8)   ::   cltype      ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 8)   ::   clftyp      ! type of data file 'daily', 'monthly' or yearly'
       CHARACTER(len = 256) ::   wname       ! generic name of a NetCDF weights file to be used, blank if not
       CHARACTER(len = 34)  ::   vcomp       ! symbolic component name if a vector that needs rotation
@@ -69,12 +69,14 @@
       LOGICAL                         ::   ln_tint      ! time interpolation or not (T/F)
       LOGICAL                         ::   ln_clim      ! climatology or not (T/F)
-      CHARACTER(len = 8)              ::   cltype       ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 8)              ::   clftyp       ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 1)              ::   cltype       ! nature of grid-points: T, U, V...
+      REAL(wp)                        ::   zsgn         ! -1. the sign change across the north fold, =  1. otherwise
       INTEGER                         ::   num          ! iom id of the jpfld files to be read
       INTEGER , DIMENSION(2,2)        ::   nrec         ! before/after record (1: index, 2: second since Jan. 1st 00h of yr nit000)
       INTEGER                         ::   nbb          ! index of before values
       INTEGER                         ::   naa          ! index of after  values
-      INTEGER , ALLOCATABLE, DIMENSION(:      ) ::   nrecsec   ! 
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:  ) ::   fnow   ! input fields interpolated to now time step
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   fdta   ! 2 consecutive record of input fields
+      INTEGER , ALLOCATABLE, DIMENSION(:) ::   nrecsec   ! 
+      REAL(wp), POINTER, DIMENSION(:,:,:  ) ::   fnow   ! input fields interpolated to now time step
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   fdta   ! 2 consecutive record of input fields
       CHARACTER(len = 256)            ::   wgtname      ! current name of the NetCDF weight file acting as a key
       !                                                 ! into the WGTLIST structure
@@ -351,73 +353,38 @@
       INTEGER ::   iaa      ! shorter name for sdjf%naa
       INTEGER ::   iw       ! index into wgts array
-      INTEGER ::   ipdom    ! index of the domain
       INTEGER ::   idvar    ! variable ID
       INTEGER ::   idmspc   ! number of spatial dimensions
       LOGICAL ::   lmoor    ! C1D case: point data
-      !!---------------------------------------------------------------------
-      !
-      ipk = SIZE( sdjf%fnow, 3 )
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   dta_alias   ! short cut
+      !!---------------------------------------------------------------------
       iaa = sdjf%naa
       !
-      IF( ASSOCIATED(sdjf%imap) ) THEN
-         IF( sdjf%ln_tint ) THEN   ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,iaa), sdjf%nrec(1,iaa),   &
-            &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm )
-         ELSE                      ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fnow(:,:,:    ), sdjf%nrec(1,iaa),   &
-            &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm )
-         ENDIF
-      ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN
+      IF( sdjf%ln_tint ) THEN   ;   dta_alias => sdjf%fdta(:,:,:,iaa)
+      ELSE                      ;   dta_alias => sdjf%fnow(:,:,:    )
+      ENDIF
+      ipk = SIZE( dta_alias, 3 )
+      !
+      IF( ASSOCIATED(sdjf%imap) ) THEN              ! BDY case 
+         CALL fld_map( sdjf%num, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   &
+            &          sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm )
+      ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN   ! On-the-fly interpolation
          CALL wgt_list( sdjf, iw )
-         IF( sdjf%ln_tint ) THEN   ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, sdjf%fdta(:,:,:,iaa),   & 
-            &                                                                          sdjf%nrec(1,iaa), sdjf%lsmname )
-            CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,:,iaa), 'T', 1._wp, kfillmode = jpfillcopy )
-         ELSE                      ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, sdjf%fnow(:,:,:    ),   &
-            &                                                                          sdjf%nrec(1,iaa), sdjf%lsmname )
-            CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,:    ), 'T', 1._wp, kfillmode = jpfillcopy )
-         ENDIF
-      ELSE
-         IF( SIZE(sdjf%fnow, 1) == jpi ) THEN   ;   ipdom = jpdom_global
-         ELSE                                   ;   ipdom = jpdom_unknown
-         ENDIF
+         CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, dta_alias(:,:,:), sdjf%nrec(1,iaa), sdjf%lsmname )
+         CALL lbc_lnk( 'fldread', dta_alias(:,:,:), sdjf%cltype, sdjf%zsgn, kfillmode = jpfillcopy )
+      ELSE                                          ! default case
          ! C1D case: If product of spatial dimensions == ipk, then x,y are of
          ! size 1 (point/mooring data): this must be read onto the central grid point
          idvar  = iom_varid( sdjf%num, sdjf%clvar )
          idmspc = iom_file ( sdjf%num )%ndims( idvar )
-         IF( iom_file( sdjf%num )%luld( idvar ) )   idmspc = idmspc - 1
-         lmoor  = (  idmspc == 0 .OR. PRODUCT( iom_file( sdjf%num )%dimsz( 1:MAX(idmspc,1) ,idvar ) ) == ipk  )
-         !
-         SELECT CASE( ipk )
-         CASE(1)
-            IF( lk_c1d .AND. lmoor ) THEN
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, sdjf%clvar, sdjf%fdta(2,2,1,iaa), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,1,iaa),'T',1., kfillmode = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, sdjf%clvar, sdjf%fnow(2,2,1    ), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,1    ),'T',1., kfillmode = jpfillcopy )
-               ENDIF
-            ELSE
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,1,iaa), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,1    ), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ENDIF
-            ENDIF
-         CASE DEFAULT
-            IF(lk_c1d .AND. lmoor ) THEN
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fdta(2,2,:,iaa), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,:,iaa),'T',1., kfillmode = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fnow(2,2,:   ), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,:   ),'T',1., kfillmode = jpfillcopy )
-               ENDIF
-            ELSE
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,:,iaa), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,:    ), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ENDIF
-            ENDIF
-         END SELECT
+         IF( iom_file( sdjf%num )%luld( idvar ) )   idmspc = idmspc - 1   ! id of the last spatial dimension
+         lmoor  = (  idmspc == 0 .OR. PRODUCT( iom_file( sdjf%num )%dimsz( 1:MAX(idmspc,1) ,idvar ) ) == ipk  )    
+         !
+         IF( lk_c1d .AND. lmoor ) THEN
+            CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, dta_alias(2,2,:), sdjf%nrec(1,iaa) )   ! jpdom_unknown -> no lbc_lnk
+            CALL lbc_lnk( 'fldread', dta_alias(:,:,:), 'T', 1., kfillmode = jpfillcopy )
+         ELSE
+            CALL iom_get( sdjf%num,  jpdom_global, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   &
+               &          sdjf%cltype, sdjf%zsgn, kfill = jpfillcopy )
+         ENDIF
       ENDIF
       !
@@ -458,10 +425,10 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zdta_read_z  ! work space local data requiring vertical interpolation
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zdta_read_dz ! work space local data requiring vertical interpolation
-      CHARACTER(LEN=1),DIMENSION(3)             ::   clgrid
+      CHARACTER(LEN=1),DIMENSION(3)             ::   cltype
       LOGICAL                                   ::   lluld        ! is the variable using the unlimited dimension
       LOGICAL                                   ::   llzint       ! local value of ldzint
       !!---------------------------------------------------------------------
       !
-      clgrid = (/'t','u','v'/)
+      cltype = (/'t','u','v'/)
       !
       ipi = SIZE( pdta, 1 )
@@ -498,12 +465,12 @@
          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
+            IF( ipk == jpk .AND. iom_varid(knum,'gdep'//cltype(kgrd)) /= -1 .AND. iom_varid(knum,'e3'//cltype(kgrd)) /= -1 ) THEN
                
                ALLOCATE( zdta_read(ipi,ipj,ipkb), zdta_read_z(ipi,ipj,ipkb), zdta_read_dz(ipi,ipj,ipkb) )
                 
                CALL fld_map_core( zz_read, kmap, zdta_read )
-               CALL iom_get ( knum, jpdom_unknown, 'gdep'//clgrid(kgrd), zz_read )   ! read only once? Potential temporal evolution?
+               CALL iom_get ( knum, jpdom_unknown, 'gdep'//cltype(kgrd), zz_read )   ! read only once? Potential temporal evolution?
                CALL fld_map_core( zz_read, kmap, zdta_read_z )
-               CALL iom_get ( knum, jpdom_unknown,   'e3'//clgrid(kgrd), zz_read )   ! read only once? Potential temporal evolution?
+               CALL iom_get ( knum, jpdom_unknown,   'e3'//cltype(kgrd), zz_read )   ! read only once? Potential temporal evolution?
                CALL fld_map_core( zz_read, kmap, zdta_read_dz )
                
@@ -515,6 +482,6 @@
                IF( ipk /= jpk ) CALL ctl_stop( 'fld_map : this should be an impossible case...' )
                WRITE(ctmp1,*) 'fld_map : vertical interpolation for bdy variable '//TRIM(cdvar)//' requires ' 
-               IF( iom_varid(knum, 'gdep'//clgrid(kgrd)) == -1 ) CALL ctl_stop( ctmp1//'gdep'//clgrid(kgrd)//' variable' )
-               IF( iom_varid(knum,   'e3'//clgrid(kgrd)) == -1 ) CALL ctl_stop( ctmp1//  'e3'//clgrid(kgrd)//' variable' )
+               IF( iom_varid(knum, 'gdep'//cltype(kgrd)) == -1 ) CALL ctl_stop( ctmp1//'gdep'//cltype(kgrd)//' variable' )
+               IF( iom_varid(knum,   'e3'//cltype(kgrd)) == -1 ) CALL ctl_stop( ctmp1//  'e3'//cltype(kgrd)//' variable' )
 
             ENDIF
@@ -739,4 +706,5 @@
       CHARACTER (LEN=100)          ::   clcomp       ! dummy weight name
       REAL(wp), DIMENSION(jpi,jpj) ::   utmp, vtmp   ! temporary arrays for vector rotation
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   dta_u, dta_v    ! short cut
       !!---------------------------------------------------------------------
       !
@@ -758,14 +726,11 @@
                   END DO
                   IF( iv > 0 ) THEN   ! fields ju and iv are two components which need to be rotated together
+                     IF( sd(ju)%ln_tint ) THEN   ;   dta_u => sd(ju)%fdta(:,:,:,jn)   ;   dta_v => sd(iv)%fdta(:,:,:,jn) 
+                     ELSE                        ;   dta_u => sd(ju)%fnow(:,:,:   )   ;   dta_v => sd(iv)%fnow(:,:,:   )
+                     ENDIF
                      DO jk = 1, SIZE( sd(ju)%fnow, 3 )
-                        IF( sd(ju)%ln_tint )THEN
-                           CALL rot_rep( sd(ju)%fdta(:,:,jk,jn), sd(iv)%fdta(:,:,jk,jn), 'T', 'en->i', utmp(:,:) )
-                           CALL rot_rep( sd(ju)%fdta(:,:,jk,jn), sd(iv)%fdta(:,:,jk,jn), 'T', 'en->j', vtmp(:,:) )
-                           sd(ju)%fdta(:,:,jk,jn) = utmp(:,:)   ;   sd(iv)%fdta(:,:,jk,jn) = vtmp(:,:)
-                        ELSE 
-                           CALL rot_rep( sd(ju)%fnow(:,:,jk   ), sd(iv)%fnow(:,:,jk   ), 'T', 'en->i', utmp(:,:) )
-                           CALL rot_rep( sd(ju)%fnow(:,:,jk   ), sd(iv)%fnow(:,:,jk   ), 'T', 'en->j', vtmp(:,:) )
-                           sd(ju)%fnow(:,:,jk   ) = utmp(:,:)   ;   sd(iv)%fnow(:,:,jk   ) = vtmp(:,:)
-                        ENDIF
+                        CALL rot_rep( dta_u(:,:,jk), dta_v(:,:,jk), 'T', 'en->i', utmp(:,:) )
+                        CALL rot_rep( dta_u(:,:,jk), dta_v(:,:,jk), 'T', 'en->j', vtmp(:,:) )
+                        dta_u(:,:,jk) = utmp(:,:)   ;   dta_v(:,:,jk) = vtmp(:,:)
                      END DO
                      sd(ju)%rotn(jn) = .TRUE.               ! vector was rotated 
@@ -813,12 +778,12 @@
 
       ! current file parameters
-      IF( sdjf%cltype(1:4) == 'week' ) THEN          ! find the day of the beginning of the current week
-         isecwk = ksec_week( sdjf%cltype(6:8) )     ! seconds between the beginning of the week and half of current time step
-         llprevmt = isecwk > nsec_month               ! longer time since beginning of the current week than the current month
+      IF( sdjf%clftyp(1:4) == 'week' ) THEN         ! find the day of the beginning of the current week
+         isecwk = ksec_week( sdjf%clftyp(6:8) )     ! seconds between the beginning of the week and half of current time step
+         llprevmt = isecwk > nsec_month             ! longer time since beginning of the current week than the current month
          llprevyr = llprevmt .AND. nmonth == 1
          iyr = nyear  - COUNT((/llprevyr/))
          imt = nmonth - COUNT((/llprevmt/)) + 12 * COUNT((/llprevyr/))
          idy = nday + nmonth_len(nmonth-1) * COUNT((/llprevmt/)) - isecwk / idaysec
-         isecwk = nsec_year - isecwk              ! seconds between 00h jan 1st of current year and current week beginning
+         isecwk = nsec_year - isecwk                ! seconds between 00h jan 1st of current year and current week beginning
       ELSE
          iyr = nyear
@@ -830,16 +795,16 @@
       ! previous file parameters
       IF( llprev ) THEN
-         IF( sdjf%cltype(1:4) == 'week'    ) THEN     ! find the day of the beginning of previous week
-            isecwk = isecwk + 7 * idaysec         ! seconds between the beginning of previous week and half of the time step
-            llprevmt = isecwk > nsec_month            ! longer time since beginning of the previous week than the current month
+         IF( sdjf%clftyp(1:4) == 'week'    ) THEN   ! find the day of the beginning of previous week
+            isecwk = isecwk + 7 * idaysec           ! seconds between the beginning of previous week and half of the time step
+            llprevmt = isecwk > nsec_month          ! longer time since beginning of the previous week than the current month
             llprevyr = llprevmt .AND. nmonth == 1
             iyr = nyear  - COUNT((/llprevyr/))
             imt = nmonth - COUNT((/llprevmt/)) + 12 * COUNT((/llprevyr/))
             idy = nday + nmonth_len(nmonth-1) * COUNT((/llprevmt/)) - isecwk / idaysec
-            isecwk = nsec_year - isecwk           ! seconds between 00h jan 1st of current year and previous week beginning
+            isecwk = nsec_year - isecwk             ! seconds between 00h jan 1st of current year and previous week beginning
          ELSE
-            idy = nday   - COUNT((/ sdjf%cltype == 'daily'                 /))
-            imt = nmonth - COUNT((/ sdjf%cltype == 'monthly' .OR. idy == 0 /))
-            iyr = nyear  - COUNT((/ sdjf%cltype == 'yearly'  .OR. imt == 0 /))
+            idy = nday   - COUNT((/ sdjf%clftyp == 'daily'                 /))
+            imt = nmonth - COUNT((/ sdjf%clftyp == 'monthly' .OR. idy == 0 /))
+            iyr = nyear  - COUNT((/ sdjf%clftyp == 'yearly'  .OR. imt == 0 /))
             IF( idy == 0 ) idy = nmonth_len(imt)
             IF( imt == 0 ) imt = 12
@@ -850,6 +815,6 @@
       ! next file parameters
       IF( llnext ) THEN
-         IF( sdjf%cltype(1:4) == 'week'    ) THEN     ! find the day of the beginning of next week
-            isecwk = 7 * idaysec - isecwk         ! seconds between half of the time step and the beginning of next week
+         IF( sdjf%clftyp(1:4) == 'week'    ) THEN   ! find the day of the beginning of next week
+            isecwk = 7 * idaysec - isecwk           ! seconds between half of the time step and the beginning of next week
             llnextmt = isecwk > ( nmonth_len(nmonth)*idaysec - nsec_month )   ! larger than the seconds to the end of the month
             llnextyr = llnextmt .AND. nmonth == 12
@@ -857,9 +822,9 @@
             imt = nmonth + COUNT((/llnextmt/)) - 12 * COUNT((/llnextyr/))
             idy = nday - nmonth_len(nmonth) * COUNT((/llnextmt/)) + isecwk / idaysec + 1
-            isecwk = nsec_year + isecwk           ! seconds between 00h jan 1st of current year and next week beginning
+            isecwk = nsec_year + isecwk             ! seconds between 00h jan 1st of current year and next week beginning
          ELSE
-            idy = nday   + COUNT((/ sdjf%cltype == 'daily'                                 /))
-            imt = nmonth + COUNT((/ sdjf%cltype == 'monthly' .OR. idy > nmonth_len(nmonth) /))
-            iyr = nyear  + COUNT((/ sdjf%cltype == 'yearly'  .OR. imt == 13                /))
+            idy = nday   + COUNT((/ sdjf%clftyp == 'daily'                                 /))
+            imt = nmonth + COUNT((/ sdjf%clftyp == 'monthly' .OR. idy > nmonth_len(nmonth) /))
+            iyr = nyear  + COUNT((/ sdjf%clftyp == 'yearly'  .OR. imt == 13                /))
             IF( idy > nmonth_len(nmonth) )   idy = 1
             IF( imt == 13                )   imt = 1
@@ -878,11 +843,11 @@
       IF    ( NINT(sdjf%freqh) == -12 ) THEN            ;   ireclast = 1    ! yearly mean: consider only 1 record
       ELSEIF( NINT(sdjf%freqh) ==  -1 ) THEN                                ! monthly mean:
-         IF(     sdjf%cltype      == 'monthly' ) THEN   ;   ireclast = 1    !  consider that the file has  1 record
+         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   ireclast = 1    !  consider that the file has  1 record
          ELSE                                           ;   ireclast = 12   !  consider that the file has 12 record
          ENDIF
       ELSE                                                                  ! higher frequency mean (in hours)
-         IF(     sdjf%cltype      == 'monthly' ) THEN   ;   ireclast = NINT( 24. * REAL(nmonth_len(indexmt), wp) / sdjf%freqh )
-         ELSEIF( sdjf%cltype(1:4) == 'week'    ) THEN   ;   ireclast = NINT( 24. * 7.                            / sdjf%freqh )
-         ELSEIF( sdjf%cltype      == 'daily'   ) THEN   ;   ireclast = NINT( 24.                                 / sdjf%freqh )
+         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   ireclast = NINT( 24. * REAL(nmonth_len(indexmt), wp) / sdjf%freqh )
+         ELSEIF( sdjf%clftyp(1:4) == 'week'    ) THEN   ;   ireclast = NINT( 24. * 7.                            / sdjf%freqh )
+         ELSEIF( sdjf%clftyp      == 'daily'   ) THEN   ;   ireclast = NINT( 24.                                 / sdjf%freqh )
          ELSE                                           ;   ireclast = NINT( 24. * REAL( nyear_len(indexyr), wp) / sdjf%freqh )
          ENDIF
@@ -902,5 +867,5 @@
          sdjf%nrecsec(1) = sdjf%nrecsec(0) + nyear_len( indexyr ) * idaysec
       ELSEIF( NINT(sdjf%freqh) ==  -1 ) THEN                                     ! monthly mean:
-         IF(     sdjf%cltype      == 'monthly' ) THEN                            !    monthly file
+         IF(     sdjf%clftyp      == 'monthly' ) THEN                            !    monthly file
             sdjf%nrecsec(0   ) = nsec1jan000 + nmonth_beg(indexmt  )
             sdjf%nrecsec(1   ) = nsec1jan000 + nmonth_beg(indexmt+1)
@@ -910,7 +875,7 @@
          ENDIF
       ELSE                                                                       ! higher frequency mean (in hours)
-         IF(     sdjf%cltype      == 'monthly' ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt)
-         ELSEIF( sdjf%cltype(1:4) == 'week'    ) THEN   ;   istart = nsec1jan000 + isecwk
-         ELSEIF( sdjf%cltype      == 'daily'   ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) + ( idy - 1 ) * idaysec
+         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt)
+         ELSEIF( sdjf%clftyp(1:4) == 'week'    ) THEN   ;   istart = nsec1jan000 + isecwk
+         ELSEIF( sdjf%clftyp      == 'daily'   ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) + ( idy - 1 ) * idaysec
          ELSEIF( indexyr          == 0         ) THEN   ;   istart = nsec1jan000 - nyear_len( 0 ) * idaysec
          ELSEIF( indexyr          == 2         ) THEN   ;   istart = nsec1jan000 + nyear_len( 1 ) * idaysec
@@ -1008,5 +973,7 @@
          sdf(jf)%ln_tint    = sdf_n(jf)%ln_tint
          sdf(jf)%ln_clim    = sdf_n(jf)%ln_clim
-         sdf(jf)%cltype     = sdf_n(jf)%cltype
+         sdf(jf)%clftyp     = sdf_n(jf)%clftyp
+         sdf(jf)%cltype     = 'T'   ! by default don't do any call to lbc_lnk in iom_get
+         sdf(jf)%zsgn       = 1.    ! by default don't do change signe across the north fold
          sdf(jf)%num        = -1
          sdf(jf)%nbb        = 1  ! start with before data in 1
@@ -1018,7 +985,7 @@
          sdf(jf)%vcomp      = sdf_n(jf)%vcomp
          sdf(jf)%rotn(:)    = .TRUE.   ! pretend to be rotated -> won't try to rotate data before the first call to fld_get
-         IF( sdf(jf)%cltype(1:4) == 'week' .AND. nn_leapy == 0  )   &
+         IF( sdf(jf)%clftyp(1:4) == 'week' .AND. nn_leapy == 0  )   &
             &   CALL ctl_stop('fld_clopn: weekly file ('//TRIM(sdf(jf)%clrootname)//') needs nn_leapy = 1')
-         IF( sdf(jf)%cltype(1:4) == 'week' .AND. sdf(jf)%ln_clim )   &
+         IF( sdf(jf)%clftyp(1:4) == 'week' .AND. sdf(jf)%ln_clim )   &
             &   CALL ctl_stop('fld_clopn: weekly file ('//TRIM(sdf(jf)%clrootname)//') needs ln_clim = .FALSE.')
          sdf(jf)%nreclast   = -1 ! Set to non zero default value to avoid errors, is updated to meaningful value during fld_clopn
@@ -1046,5 +1013,5 @@
             WRITE(numout,*) '         weights: '        , TRIM( sdf(jf)%wgtname    ),   &
                &                  '   pairing: '        , TRIM( sdf(jf)%vcomp      ),   &
-               &                  '   data type: '      ,       sdf(jf)%cltype      ,   &
+               &                  '   data type: '      ,       sdf(jf)%clftyp      ,   &
                &                  '   land/sea mask:'   , TRIM( sdf(jf)%lsmname    )
             call flush(numout)
@@ -1202,6 +1169,5 @@
             CALL iom_get ( inum, jpdom_global, clname, data_tmp(:,:), cd_type = 'Z' )   !  no call to lbc_lnk
             DO_2D_00_00
-!!$               isrc = NINT(data_tmp(ji,jj)) - 1
-               isrc = INT(data_tmp(ji,jj)) - 1
+               isrc = NINT(data_tmp(ji,jj)) - 1
                ref_wgts(nxt_wgt)%data_jpi(ji,jj,jn) = 1 + MOD(isrc,  ref_wgts(nxt_wgt)%ddims(1))
                ref_wgts(nxt_wgt)%data_jpj(ji,jj,jn) = 1 +     isrc / ref_wgts(nxt_wgt)%ddims(1)
@@ -1589,10 +1555,10 @@
       IF( .NOT. sdjf%ln_clim ) THEN   
                                          WRITE(clname, '(a,"_y",i4.4)' ) TRIM( sdjf%clrootname ), kyear    ! add year
-         IF( sdjf%cltype /= 'yearly' )   WRITE(clname, '(a, "m",i2.2)' ) TRIM( clname          ), kmonth   ! add month
+         IF( sdjf%clftyp /= 'yearly' )   WRITE(clname, '(a, "m",i2.2)' ) TRIM( clname          ), kmonth   ! add month
       ELSE
          ! build the new filename if climatological data
-         IF( sdjf%cltype /= 'yearly' )   WRITE(clname, '(a,"_m",i2.2)' ) TRIM( sdjf%clrootname ), kmonth   ! add month
-      ENDIF
-      IF(    sdjf%cltype == 'daily' .OR. sdjf%cltype(1:4) == 'week' ) &
+         IF( sdjf%clftyp /= 'yearly' )   WRITE(clname, '(a,"_m",i2.2)' ) TRIM( sdjf%clrootname ), kmonth   ! add month
+      ENDIF
+      IF(    sdjf%clftyp == 'daily' .OR. sdjf%clftyp(1:4) == 'week' ) &
          &                               WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname          ), kday     ! add day
 
@@ -1618,5 +1584,5 @@
          IF( cl_week(ijul) == TRIM(cdday) ) EXIT
       END DO
-      IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%cltype(6:8): '//TRIM(cdday) )
+      IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%clftyp(6:8): '//TRIM(cdday) )
       !
       ishift = ijul * NINT(rday)
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/sbcrnf.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/sbcrnf.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/sbcrnf.F90	(revision 12960)
@@ -353,5 +353,5 @@
          rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname )
          IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year 
-            IF( sn_dep_rnf%cltype == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month 
+            IF( sn_dep_rnf%clftyp == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month 
          ENDIF
          CALL iom_open ( rn_dep_file, inum )                             ! open file
@@ -518,5 +518,5 @@
       cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname )
       IF( .NOT. sn_cnf%ln_clim ) THEN   ;   WRITE(cl_rnfile, '(a,"_y",i4)' ) TRIM( cl_rnfile ), nyear    ! add year
-         IF( sn_cnf%cltype == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month
+         IF( sn_cnf%clftyp == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_fmask.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_fmask.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_fmask.F90	(revision 12960)
@@ -68,14 +68,18 @@
             !
             IF(lwp) WRITE(numout,*) '      Gibraltar '
-            ij0 = 101+1   ;   ij1 = 101+1           ! Gibraltar strait  : partial slip (pfmsk=0.5)
-            ii0 = 139   ;   ii1 = 140   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp
-            ij0 = 102+1   ;   ij1 = 102+1
-            ii0 = 139   ;   ii1 = 140   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp
+            ij0 = 101 + nn_hls       ;   ij1 = 101 + nn_hls           ! Gibraltar strait  : partial slip (pfmsk=0.5)
+            ii0 = 139 + nn_hls - 1   ;   ii1 = 140 + nn_hls - 1
+            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp
+            ij0 = 102 + nn_hls       ;   ij1 = 102 + nn_hls
+            ii0 = 139 + nn_hls - 1   ;   ii1 = 140 + nn_hls - 1
+            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp
             !
             IF(lwp) WRITE(numout,*) '      Bab el Mandeb '
-            ij0 =  87+1   ;   ij1 =  88+1           ! Bab el Mandeb : partial slip (pfmsk=1)
-            ii0 = 160   ;   ii1 = 160   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp
-            ij0 =  88+1   ;   ij1 =  88+1
-            ii0 = 159   ;   ii1 = 159   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp
+            ij0 =  87 + nn_hls       ;   ij1 =  88  + nn_hls          ! Bab el Mandeb : partial slip (pfmsk=1)
+            ii0 = 160  + nn_hls - 1  ;   ii1 = 160 + nn_hls - 1
+            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp
+            ij0 =  88 + nn_hls       ;   ij1 =  88 + nn_hls
+            ii0 = 159 + nn_hls - 1   ;   ii1 = 159 + nn_hls - 1
+            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp
             !
             ! We keep this as an example but it is instable in this case 
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/ZDF/zdfiwm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/ZDF/zdfiwm.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/ZDF/zdfiwm.F90	(revision 12960)
@@ -139,8 +139,27 @@
       !!----------------------------------------------------------------------
       !
-      !                       !* Set to zero the 1st and last vertical levels of appropriate variables
-      zemx_iwm (:,:,1) = 0._wp   ;   zemx_iwm (:,:,jpk) = 0._wp
-      zav_ratio(:,:,1) = 0._wp   ;   zav_ratio(:,:,jpk) = 0._wp
-      zav_wave (:,:,1) = 0._wp   ;   zav_wave (:,:,jpk) = 0._wp
+      !                       
+      ! Set to zero the 1st and last vertical levels of appropriate variables
+      IF( iom_use("emix_iwm") ) THEN
+         DO_2D_00_00
+            zemx_iwm (ji,jj,1) = 0._wp   ;   zemx_iwm (ji,jj,jpk) = 0._wp
+         END_2D
+         zemx_iwm (           1:nn_hls,:,:) = 0._wp   ;   zemx_iwm (:,           1:nn_hls,:) = 0._wp
+         zemx_iwm (jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   zemx_iwm (:,jpj-nn_hls+1:   jpj,:) = 0._wp
+      ENDIF
+      IF( iom_use("av_ratio") ) THEN
+         DO_2D_00_00
+            zav_ratio(ji,jj,1) = 0._wp   ;   zav_ratio(ji,jj,jpk) = 0._wp
+         END_2D
+         zav_ratio(           1:nn_hls,:,:) = 0._wp   ;   zav_ratio(:,           1:nn_hls,:) = 0._wp
+         zav_ratio(jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   zav_ratio(:,jpj-nn_hls+1:   jpj,:) = 0._wp
+      ENDIF
+      IF( iom_use("av_wave") ) THEN
+         DO_2D_00_00
+            zav_wave (ji,jj,1) = 0._wp   ;   zav_wave (ji,jj,jpk) = 0._wp
+         END_2D
+         zav_wave(           1:nn_hls,:,:) = 0._wp   ;   zav_wave(:,           1:nn_hls,:) = 0._wp
+         zav_wave(jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   zav_wave(:,jpj-nn_hls+1:   jpj,:) = 0._wp
+      ENDIF
       !
       !                       ! ----------------------------- !
@@ -150,5 +169,5 @@
       !                       !* Critical slope mixing: distribute energy over the time-varying ocean depth,
       !                                                 using an exponential decay from the seafloor.
-      DO_2D_11_11
+      DO_2D_00_00
          zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1)       ! depth of the ocean
          zfact(ji,jj) = rho0 * (  1._wp - EXP( -zhdep(ji,jj) / hcri_iwm(ji,jj) )  )
@@ -156,5 +175,5 @@
       END_2D
 !!gm gde3w ==>>>  check for ssh taken into account.... seem OK gde3w_n=gdept(:,:,:,Kmm) - ssh(:,:,Kmm)
-      DO_3D_11_11( 2, jpkm1 )
+      DO_3D_00_00( 2, jpkm1 )
          IF ( zfact(ji,jj) == 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN   ! optimization
             zemx_iwm(ji,jj,jk) = 0._wp
@@ -176,31 +195,35 @@
       CASE ( 1 )               ! Dissipation scales as N (recommended)
          !
-         zfact(:,:) = 0._wp
-         DO jk = 2, jpkm1              ! part independent of the level
-            zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk)
-         END DO
-         !
-         DO_2D_11_11
+         DO_2D_00_00
+            zfact(ji,jj) = 0._wp
+         END_2D
+         DO_3D_00_00( 2, jpkm1 )       ! part independent of the level
+            zfact(ji,jj) = zfact(ji,jj) + e3w(ji,jj,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(ji,jj,jk) )  ) * wmask(ji,jj,jk)
+         END_3D
+         !
+         DO_2D_00_00
             IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = epyc_iwm(ji,jj) / ( rho0 * zfact(ji,jj) )
          END_2D
          !
-         DO jk = 2, jpkm1              ! complete with the level-dependent part
-            zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zfact(:,:) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk)
-         END DO
+         DO_3D_00_00( 2, jpkm1 )       ! complete with the level-dependent part
+            zemx_iwm(ji,jj,jk) = zemx_iwm(ji,jj,jk) + zfact(ji,jj) * SQRT(  MAX( 0._wp, rn2(ji,jj,jk) )  ) * wmask(ji,jj,jk)
+         END_3D
          !
       CASE ( 2 )               ! Dissipation scales as N^2
          !
-         zfact(:,:) = 0._wp
-         DO jk = 2, jpkm1              ! part independent of the level
-            zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk)
-         END DO
-         !
-         DO_2D_11_11
+         DO_2D_00_00
+            zfact(ji,jj) = 0._wp
+         END_2D
+         DO_3D_00_00( 2, jpkm1 )       ! part independent of the level
+            zfact(ji,jj) = zfact(ji,jj) + e3w(ji,jj,jk,Kmm) * MAX( 0._wp, rn2(ji,jj,jk) ) * wmask(ji,jj,jk)
+         END_3D
+         !
+         DO_2D_00_00
             IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = epyc_iwm(ji,jj) / ( rho0 * zfact(ji,jj) )
          END_2D
          !
-         DO jk = 2, jpkm1              ! complete with the level-dependent part
-            zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zfact(:,:) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk)
-         END DO
+         DO_3D_00_00( 2, jpkm1 )       ! complete with the level-dependent part
+            zemx_iwm(ji,jj,jk) = zemx_iwm(ji,jj,jk) + zfact(ji,jj) * MAX( 0._wp, rn2(ji,jj,jk) ) * wmask(ji,jj,jk)
+         END_3D
          !
       END SELECT
@@ -209,26 +232,24 @@
       !                        !* ocean depth as proportional to rn2 * exp(-z_wkb/rn_hbot)
       !
-      zwkb (:,:,:) = 0._wp
-      zfact(:,:)   = 0._wp
-      DO jk = 2, jpkm1
-         zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk)
-         zwkb(:,:,jk) = zfact(:,:)
-      END DO
-!!gm even better:
-!      DO jk = 2, jpkm1
-!         zwkb(:,:) = zwkb(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  )
-!      END DO
-!      zfact(:,:) = zwkb(:,:,jpkm1)
-!!gm or just use zwkb(k=jpk-1) instead of zfact...
-!!gm
-      !
-      DO_3D_11_11( 2, jpkm1 )
+      DO_2D_00_00
+         zwkb(ji,jj,1) = 0._wp
+      END_2D
+      DO_3D_00_00( 2, jpkm1 )
+         zwkb(ji,jj,jk) = zwkb(ji,jj,jk-1) + e3w(ji,jj,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(ji,jj,jk) )  ) * wmask(ji,jj,jk)
+      END_3D
+      DO_2D_00_00
+         zfact(ji,jj) = zwkb(ji,jj,jpkm1)
+      END_2D
+      !
+      DO_3D_00_00( 2, jpkm1 )
          IF( zfact(ji,jj) /= 0 )   zwkb(ji,jj,jk) = zhdep(ji,jj) * ( zfact(ji,jj) - zwkb(ji,jj,jk) )   &
             &                                     * wmask(ji,jj,jk) / zfact(ji,jj)
       END_3D
-      zwkb(:,:,1) = zhdep(:,:) * wmask(:,:,1)
-      !
-      DO_3D_11_11( 2, jpkm1 )
-         IF ( rn2(ji,jj,jk) <= 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN   ! optimization
+      DO_2D_00_00
+         zwkb (ji,jj,1) = zhdep(ji,jj) * wmask(ji,jj,1)
+      END_2D
+      !
+      DO_3D_00_00( 2, jpkm1 )
+         IF ( rn2(ji,jj,jk) <= 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN   ! optimization: EXP coast a lot
             zweight(ji,jj,jk) = 0._wp
          ELSE
@@ -238,40 +259,45 @@
       END_3D
       !
-      zfact(:,:) = 0._wp
-      DO jk = 2, jpkm1              ! part independent of the level
-         zfact(:,:) = zfact(:,:) + zweight(:,:,jk)
-      END DO
-      !
-      DO_2D_11_11
+      DO_2D_00_00
+         zfact(ji,jj) = 0._wp
+      END_2D
+      DO_3D_00_00( 2, jpkm1 )       ! part independent of the level
+         zfact(ji,jj) = zfact(ji,jj) + zweight(ji,jj,jk)
+      END_3D
+      !
+      DO_2D_00_00
          IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = ebot_iwm(ji,jj) / ( rho0 * zfact(ji,jj) )
       END_2D
       !
-      DO jk = 2, jpkm1              ! complete with the level-dependent part
-         zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zweight(:,:,jk) * zfact(:,:) * wmask(:,:,jk)   &
-            &                                / ( gde3w(:,:,jk) - gde3w(:,:,jk-1) )
-!!gm  use of e3t(:,:,:,Kmm) just above?
-      END DO
+      DO_3D_00_00( 2, jpkm1 )       ! complete with the level-dependent part
+         zemx_iwm(ji,jj,jk) = zemx_iwm(ji,jj,jk) + zweight(ji,jj,jk) * zfact(ji,jj) * wmask(ji,jj,jk)   &
+            &                                                        / ( gde3w(ji,jj,jk) - gde3w(ji,jj,jk-1) )
+!!gm  use of e3t(ji,jj,:,Kmm) just above?
+      END_3D
       !
 !!gm  this is to be replaced by just a constant value znu=1.e-6 m2/s
       ! Calculate molecular kinematic viscosity
-      znu_t(:,:,:) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * ts(:,:,:,jp_tem,Kmm) + 0.00694_wp * ts(:,:,:,jp_tem,Kmm) * ts(:,:,:,jp_tem,Kmm)  &
-         &                                  + 0.02305_wp * ts(:,:,:,jp_sal,Kmm)  ) * tmask(:,:,:) * r1_rho0
-      DO jk = 2, jpkm1
-         znu_w(:,:,jk) = 0.5_wp * ( znu_t(:,:,jk-1) + znu_t(:,:,jk) ) * wmask(:,:,jk)
-      END DO
+      DO_3D_00_00( 1, jpkm1 )
+         znu_t(ji,jj,jk) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * ts(ji,jj,jk,jp_tem,Kmm)   &
+            &                                     + 0.00694_wp * ts(ji,jj,jk,jp_tem,Kmm) * ts(ji,jj,jk,jp_tem,Kmm)  &
+            &                                     + 0.02305_wp * ts(ji,jj,jk,jp_sal,Kmm)  ) * tmask(ji,jj,jk) * r1_rho0
+      END_3D
+      DO_3D_00_00( 2, jpkm1 )
+         znu_w(ji,jj,jk) = 0.5_wp * ( znu_t(ji,jj,jk-1) + znu_t(ji,jj,jk) ) * wmask(ji,jj,jk)
+      END_3D
 !!gm end
       !
       ! Calculate turbulence intensity parameter Reb
-      DO jk = 2, jpkm1
-         zReb(:,:,jk) = zemx_iwm(:,:,jk) / MAX( 1.e-20_wp, znu_w(:,:,jk) * rn2(:,:,jk) )
-      END DO
+      DO_3D_00_00( 2, jpkm1 )
+         zReb(ji,jj,jk) = zemx_iwm(ji,jj,jk) / MAX( 1.e-20_wp, znu_w(ji,jj,jk) * rn2(ji,jj,jk) )
+      END_3D
       !
       ! Define internal wave-induced diffusivity
-      DO jk = 2, jpkm1
-         zav_wave(:,:,jk) = znu_w(:,:,jk) * zReb(:,:,jk) * r1_6   ! This corresponds to a constant mixing efficiency of 1/6
-      END DO
+      DO_3D_00_00( 2, jpkm1 )
+         zav_wave(ji,jj,jk) = znu_w(ji,jj,jk) * zReb(ji,jj,jk) * r1_6   ! This corresponds to a constant mixing efficiency of 1/6
+      END_3D
       !
       IF( ln_mevar ) THEN              ! Variable mixing efficiency case : modify zav_wave in the
-         DO_3D_11_11( 2, jpkm1 )
+         DO_3D_00_00( 2, jpkm1 )
             IF( zReb(ji,jj,jk) > 480.00_wp ) THEN
                zav_wave(ji,jj,jk) = 3.6515_wp * znu_w(ji,jj,jk) * SQRT( zReb(ji,jj,jk) )
@@ -282,12 +308,12 @@
       ENDIF
       !
-      DO jk = 2, jpkm1                 ! Bound diffusivity by molecular value and 100 cm2/s
-         zav_wave(:,:,jk) = MIN(  MAX( 1.4e-7_wp, zav_wave(:,:,jk) ), 1.e-2_wp  ) * wmask(:,:,jk)
-      END DO
+      DO_3D_00_00( 2, jpkm1 )          ! Bound diffusivity by molecular value and 100 cm2/s
+         zav_wave(ji,jj,jk) = MIN(  MAX( 1.4e-7_wp, zav_wave(ji,jj,jk) ), 1.e-2_wp  ) * wmask(ji,jj,jk)
+      END_3D
       !
       IF( kt == nit000 ) THEN        !* Control print at first time-step: diagnose the energy consumed by zav_wave
          zztmp = 0._wp
 !!gm used of glosum 3D....
-         DO_3D_11_11( 2, jpkm1 )
+         DO_3D_00_00( 2, jpkm1 )
             zztmp = zztmp + e3w(ji,jj,jk,Kmm) * e1e2t(ji,jj)   &
                &          * MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj)
@@ -311,5 +337,5 @@
       IF( ln_tsdiff ) THEN          !* Option for differential mixing of salinity and temperature
          ztmp1 = 0.505_wp + 0.495_wp * TANH( 0.92_wp * ( LOG10( 1.e-20_wp ) - 0.60_wp ) )
-         DO_3D_11_11( 2, jpkm1 )
+         DO_3D_00_00( 2, jpkm1 )
             ztmp2 = zReb(ji,jj,jk) * 5._wp * r1_6
             IF ( ztmp2 > 1.e-20_wp .AND. wmask(ji,jj,jk) == 1._wp ) THEN
@@ -320,16 +346,16 @@
          END_3D
          CALL iom_put( "av_ratio", zav_ratio )
-         DO jk = 2, jpkm1           !* update momentum & tracer diffusivity with wave-driven mixing
-            p_avs(:,:,jk) = p_avs(:,:,jk) + zav_wave(:,:,jk) * zav_ratio(:,:,jk)
-            p_avt(:,:,jk) = p_avt(:,:,jk) + zav_wave(:,:,jk)
-            p_avm(:,:,jk) = p_avm(:,:,jk) + zav_wave(:,:,jk)
-         END DO
+         DO_3D_00_00( 2, jpkm1 )    !* update momentum & tracer diffusivity with wave-driven mixing
+            p_avs(ji,jj,jk) = p_avs(ji,jj,jk) + zav_wave(ji,jj,jk) * zav_ratio(ji,jj,jk)
+            p_avt(ji,jj,jk) = p_avt(ji,jj,jk) + zav_wave(ji,jj,jk)
+            p_avm(ji,jj,jk) = p_avm(ji,jj,jk) + zav_wave(ji,jj,jk)
+         END_3D
          !
       ELSE                          !* update momentum & tracer diffusivity with wave-driven mixing
-         DO jk = 2, jpkm1
-            p_avs(:,:,jk) = p_avs(:,:,jk) + zav_wave(:,:,jk)
-            p_avt(:,:,jk) = p_avt(:,:,jk) + zav_wave(:,:,jk)
-            p_avm(:,:,jk) = p_avm(:,:,jk) + zav_wave(:,:,jk)
-         END DO
+         DO_3D_00_00( 2, jpkm1 )
+            p_avs(ji,jj,jk) = p_avs(ji,jj,jk) + zav_wave(ji,jj,jk)
+            p_avt(ji,jj,jk) = p_avt(ji,jj,jk) + zav_wave(ji,jj,jk)
+            p_avm(ji,jj,jk) = p_avm(ji,jj,jk) + zav_wave(ji,jj,jk)
+         END_3D
       ENDIF
 
@@ -341,11 +367,26 @@
       IF( iom_use("bflx_iwm") .OR. iom_use("pcmap_iwm") ) THEN
          ALLOCATE( z2d(jpi,jpj) , z3d(jpi,jpj,jpk) )
-         z3d(:,:,:) = MAX( 0._wp, rn2(:,:,:) ) * zav_wave(:,:,:)
-         z2d(:,:) = 0._wp
-         DO jk = 2, jpkm1
-            z2d(:,:) = z2d(:,:) + e3w(:,:,jk,Kmm) * z3d(:,:,jk) * wmask(:,:,jk)
-         END DO
-         z2d(:,:) = rho0 * z2d(:,:)
-         CALL iom_put( "bflx_iwm", z3d )
+         ! Initialisation for iom_put
+         DO_2D_00_00
+            z3d(ji,jj,1) = 0._wp   ;   z3d(ji,jj,jpk) = 0._wp
+         END_2D
+         z3d(           1:nn_hls,:,:) = 0._wp   ;   z3d(:,           1:nn_hls,:) = 0._wp
+         z3d(jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   z3d(:,jpj-nn_hls+1:   jpj,:) = 0._wp
+         z2d(           1:nn_hls,:  ) = 0._wp   ;   z2d(:,           1:nn_hls  ) = 0._wp
+         z2d(jpi-nn_hls+1:jpi   ,:  ) = 0._wp   ;   z2d(:,jpj-nn_hls+1:   jpj  ) = 0._wp
+
+         DO_3D_00_00( 2, jpkm1 )
+            z3d(ji,jj,jk) = MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk)
+         END_3D
+         DO_2D_00_00
+            z2d(ji,jj) = 0._wp
+         END_2D
+         DO_3D_00_00( 2, jpkm1 ) 
+            z2d(ji,jj) = z2d(ji,jj) + e3w(ji,jj,jk,Kmm) * z3d(ji,jj,jk) * wmask(ji,jj,jk)
+         END_3D
+         DO_2D_00_00
+            z2d(ji,jj) = rho0 * z2d(ji,jj)
+         END_2D
+         CALL iom_put(  "bflx_iwm", z3d )
          CALL iom_put( "pcmap_iwm", z2d )
          DEALLOCATE( z2d , z3d )
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OFF/dtadyn.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OFF/dtadyn.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OFF/dtadyn.F90	(revision 12960)
@@ -65,5 +65,5 @@
    INTEGER  , SAVE      ::   jf_uwd         ! index of u-transport
    INTEGER  , SAVE      ::   jf_vwd         ! index of v-transport
-   INTEGER  , SAVE      ::   jf_wwd         ! index of v-transport
+   INTEGER  , SAVE      ::   jf_wwd         ! index of w-transport
    INTEGER  , SAVE      ::   jf_avt         ! index of Kz
    INTEGER  , SAVE      ::   jf_mld         ! index of mixed layer deptht
@@ -283,4 +283,8 @@
       !                                         ! fill sf with slf_i and control print
       CALL fld_fill( sf_dyn, slf_d, cn_dir, 'dta_dyn_init', 'Data in file', 'namdta_dyn' )
+      sf_dyn(jf_uwd)%cltype = 'U'   ;   sf_dyn(jf_uwd)%zsgn = -1._wp  
+      sf_dyn(jf_vwd)%cltype = 'V'   ;   sf_dyn(jf_vwd)%zsgn = -1._wp  
+      sf_dyn(jf_ubl)%cltype = 'U'   ;   sf_dyn(jf_ubl)%zsgn =  1._wp  
+      sf_dyn(jf_vbl)%cltype = 'V'   ;   sf_dyn(jf_vbl)%zsgn =  1._wp  
       !
       ! Open file for each variable to get his number of dimension
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OFF/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OFF/nemogcm.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OFF/nemogcm.F90	(revision 12960)
@@ -278,7 +278,7 @@
       !
       IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file
-         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ELSE                                ! user-defined namelist
-         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAO/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAO/nemogcm.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAO/nemogcm.F90	(revision 12960)
@@ -207,7 +207,7 @@
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
-         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ELSE                              ! user-defined namelist
-         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAS/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAS/nemogcm.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAS/nemogcm.F90	(revision 12960)
@@ -329,7 +329,7 @@
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
-         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ELSE                              ! user-defined namelist
-         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAS/sbcssm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAS/sbcssm.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/SAS/sbcssm.F90	(revision 12960)
@@ -290,4 +290,6 @@
             !                                         ! fill sf with slf_i and control print
             CALL fld_fill( sf_ssm_3d, slf_3d, cn_dir, 'sbc_ssm_init', '3D Data in file', 'namsbc_ssm' )
+            sf_ssm_3d(jf_usp)%cltype = 'U'   ;   sf_ssm_3d(jf_usp)%zsgn = -1._wp
+            sf_ssm_3d(jf_vsp)%cltype = 'V'   ;   sf_ssm_3d(jf_vsp)%zsgn = -1._wp
          ENDIF
          !
@@ -306,4 +308,8 @@
             !
             CALL fld_fill( sf_ssm_2d, slf_2d, cn_dir, 'sbc_ssm_init', '2D Data in file', 'namsbc_ssm' )
+            IF( .NOT. ln_3d_uve ) THEN
+               sf_ssm_2d(jf_usp)%cltype = 'U'   ;   sf_ssm_2d(jf_usp)%zsgn = -1._wp
+               sf_ssm_2d(jf_vsp)%cltype = 'V'   ;   sf_ssm_2d(jf_vsp)%zsgn = -1._wp
+            ENDIF
          ENDIF
          !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/TOP/trcini.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/TOP/trcini.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/TOP/trcini.F90	(revision 12960)
@@ -93,4 +93,6 @@
       INTEGER             ::  jk, jn  ! dummy loop indices
       CHARACTER (len=25) :: charout
+      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: zzmsk
+      CHARACTER (len=25), DIMENSION(jptra) :: clseb  
       !!----------------------------------------------------------------------
       !
@@ -128,4 +130,9 @@
          CALL prt_ctl_trc_info( charout )
          CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kmm), mask=tmask, clinfo=ctrcnm )
+         DO jn = 1, jptra
+            zzmsk(:,:,:,jn) = tmask(:,:,:)
+            WRITE(clseb(jn),'(a,i2.2)') 'seb ', jn
+         END DO
+         CALL prt_ctl_trc( tab4d=zzmsk, mask=tmask, clinfo=clseb )
       ENDIF
 9000  FORMAT('      tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10)
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -76,6 +76,6 @@
       DO_2D_11_11
          
-         zti = REAL( mig0(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0(jj) - 1, wp )   ! start at j=0 in the global grid without halos
+         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
+         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
          
          plamt(ji,jj) = zti
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_istate.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_istate.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_istate.F90	(revision 12960)
@@ -70,10 +70,10 @@
       ! Once we decide to forget trunk compatibility, we must simply define z2d as:
 !!$      DO_2D_00_00
-!!$         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
+!!$         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
 !!$      END_2D
       igloi = Ni0glo + 2 * COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) )
       igloj = Nj0glo + 2 * COUNT( (/ jperio == 2 .OR. jperio == 7 /) ) + 1 * COUNT( (/ jperio >= 4 .AND. jperio <= 6 /) )
       DO_2D_00_00
-         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * igloi, wp ) / REAL( igloi * igloj, wp ) )
+         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * igloi, wp ) / REAL( igloi * igloj, wp ) )
       END_2D
       !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_sbc.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_sbc.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_sbc.F90	(revision 12960)
@@ -110,10 +110,10 @@
       ! Once we decide to forget trunk compatibility, we must simply define z2d as:
 !!$      DO_2D_00_00
-!!$         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
+!!$         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
 !!$      END_2D
       igloi = Ni0glo + 2 * COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) )
       igloj = Nj0glo + 2 * COUNT( (/ jperio == 2 .OR. jperio == 7 /) ) + 1 * COUNT( (/ jperio >= 4 .AND. jperio <= 6 /) )
       DO_2D_00_00
-         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * igloi, wp ) / REAL( igloi * igloj, wp ) )
+         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * igloi, wp ) / REAL( igloi * igloj, wp ) )
       END_2D
       utau_ice(:,:) = 0.1_wp + z2d(:,:)
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/domvvl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/domvvl.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/domvvl.F90	(revision 12960)
@@ -450,9 +450,9 @@
             ELSE
                ijk_max = MAXLOC( ze3t(:,:,:) )
-               ijk_max(1) = mig0(ijk_max(1))
-               ijk_max(2) = mjg0(ijk_max(2))
+               ijk_max(1) = mig0_oldcmp(ijk_max(1))
+               ijk_max(2) = mjg0_oldcmp(ijk_max(2))
                ijk_min = MINLOC( ze3t(:,:,:) )
-               ijk_min(1) = mig0(ijk_min(1))
-               ijk_min(2) = mjg0(ijk_min(2))
+               ijk_min(1) = mig0_oldcmp(ijk_min(1))
+               ijk_min(2) = mjg0_oldcmp(ijk_min(2))
             ENDIF
             IF (lwp) THEN
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -91,6 +91,6 @@
          
       DO_2D_11_11         
-         zti = REAL( mig0(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0(jj) - 1, wp )   ! start at j=0 in the global grid without halos
+         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
+         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
          
          plamt(ji,jj) = zlam0 + rn_dx *   zti
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV1D/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV1D/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV1D/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -79,6 +79,6 @@
 
       DO_2D_11_11
-         zti = REAL( mig0(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0(jj) - 1, wp )   ! start at j=0 in the global grid without halos
+         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
+         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
          
          plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -91,6 +91,6 @@
 
       DO_2D_11_11
-         zti = REAL( mig0(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0(jj) - 1, wp )   ! start at j=0 in the global grid without halos
+         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
+         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
          
          plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -91,6 +91,6 @@
 
       DO_2D_11_11
-         zti = REAL( mig0(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0(jj) - 1, wp )   ! start at j=0 in the global grid without halos
+         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
+         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
          
          plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ISOMIP/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ISOMIP/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ISOMIP/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -79,12 +79,12 @@
       DO_2D_11_11
          !                       ! longitude   (west coast at lon=0°)
-         plamt(ji,jj) = rn_e1deg * (  - 0.5 + REAL( mig0(ji)-1 , wp )  )  
-         plamu(ji,jj) = rn_e1deg * (          REAL( mig0(ji)-1 , wp )  )
+         plamt(ji,jj) = rn_e1deg * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )  
+         plamu(ji,jj) = rn_e1deg * (          REAL( mig0_oldcmp(ji)-1 , wp )  )
          plamv(ji,jj) = plamt(ji,jj)
          plamf(ji,jj) = plamu(ji,jj)
          !                       ! latitude   (south coast at lat= 81°)
-         pphit(ji,jj) = rn_e2deg * (  - 0.5 + REAL( mjg0(jj)-1 , wp )  ) - 80._wp
+         pphit(ji,jj) = rn_e2deg * (  - 0.5 + REAL( mjg0_oldcmp(jj)-1 , wp )  ) - 80._wp
          pphiu(ji,jj) = pphit(ji,jj)
-         pphiv(ji,jj) = rn_e2deg * (          REAL( mjg0(jj)-1 , wp )  ) - 80_wp
+         pphiv(ji,jj) = rn_e2deg * (          REAL( mjg0_oldcmp(jj)-1 , wp )  ) - 80_wp
          pphif(ji,jj) = pphiv(ji,jj)
       END_2D
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -76,12 +76,12 @@
       DO_2D_11_11
          !                       ! longitude
-         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0(ji)-1 , wp )  )  
-         plamu(ji,jj) = zfact * (          REAL( mig0(ji)-1 , wp )  )
+         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )  
+         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-1 , wp )  )
          plamv(ji,jj) = plamt(ji,jj)
          plamf(ji,jj) = plamu(ji,jj)
          !                       ! latitude
-         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0(jj)-1 , wp )  )
+         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0_oldcmp(jj)-1 , wp )  )
          pphiu(ji,jj) = pphit(ji,jj)
-         pphiv(ji,jj) = zfact * (          REAL( mjg0(jj)-1 , wp )  )
+         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  )
          pphif(ji,jj) = pphiv(ji,jj)
       END_2D
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -76,12 +76,12 @@
       DO_2D_11_11
          !                       ! longitude
-         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0(ji)-1 , wp )  )  
-         plamu(ji,jj) = zfact * (          REAL( mig0(ji)-1 , wp )  )
+         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )  
+         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-1 , wp )  )
          plamv(ji,jj) = plamt(ji,jj)
          plamf(ji,jj) = plamu(ji,jj)
          !                       ! latitude
-         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0(jj)-1 , wp )  )
+         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0_oldcmp(jj)-1 , wp )  )
          pphiu(ji,jj) = pphit(ji,jj)
-         pphiv(ji,jj) = zfact * (          REAL( mjg0(jj)-1 , wp )  )
+         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  )
          pphif(ji,jj) = pphiv(ji,jj)
       END_2D
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/STATION_ASF/MY_SRC/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 12960)
@@ -231,7 +231,7 @@
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
-         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ELSE                              ! user-defined namelist
-         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/domvvl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/domvvl.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/domvvl.F90	(revision 12960)
@@ -450,9 +450,9 @@
             ELSE
                ijk_max = MAXLOC( ze3t(:,:,:) )
-               ijk_max(1) = mig0(ijk_max(1))
-               ijk_max(2) = mjg0(ijk_max(2))
+               ijk_max(1) = mig0_oldcmp(ijk_max(1))
+               ijk_max(2) = mjg0_oldcmp(ijk_max(2))
                ijk_min = MINLOC( ze3t(:,:,:) )
-               ijk_min(1) = mig0(ijk_min(1))
-               ijk_min(2) = mjg0(ijk_min(2))
+               ijk_min(1) = mig0_oldcmp(ijk_min(1))
+               ijk_min(2) = mjg0_oldcmp(ijk_min(2))
             ENDIF
             IF (lwp) THEN
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -91,6 +91,6 @@
          
       DO_2D_11_11
-         zti = REAL( mig0(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0(jj) - 1, wp )   ! start at j=0 in the global grid without halos
+         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
+         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
          
          plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/WAD/MY_SRC/usrdef_hgr.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/WAD/MY_SRC/usrdef_hgr.F90	(revision 12959)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/WAD/MY_SRC/usrdef_hgr.F90	(revision 12960)
@@ -76,12 +76,12 @@
       DO_2D_11_11
          !                       ! longitude
-         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0(ji)-1 , wp )  )  
-         plamu(ji,jj) = zfact * (          REAL( mig0(ji)-1 , wp )  )
+         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )  
+         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-1 , wp )  )
          plamv(ji,jj) = plamt(ji,jj)
          plamf(ji,jj) = plamu(ji,jj)
          !                       ! latitude
-         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0(jj)-1 , wp )  )
+         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0_oldcmp(jj)-1 , wp )  )
          pphiu(ji,jj) = pphit(ji,jj)
-         pphiv(ji,jj) = zfact * (          REAL( mjg0(jj)-1 , wp )  )
+         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  )
          pphif(ji,jj) = pphiv(ji,jj)
       END_2D
