Index: branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 6860)
+++ branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 6861)
@@ -386,4 +386,5 @@
 !              !  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      !
+   l_sasread   = .TRUE.   ! Read fields in a file if .TRUE. , or initlise to 0. in sbcssm.F90 if .FALSE.
    sn_usp      = 'sas_grid_U' ,    120           , 'vozocrtx' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , ''
    sn_vsp      = 'sas_grid_V' ,    120           , 'vomecrty' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , ''
Index: branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/DOM/domcfg.F90
===================================================================
--- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/DOM/domcfg.F90	(revision 6860)
+++ branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/DOM/domcfg.F90	(revision 6861)
@@ -56,7 +56,8 @@
          IF( jperio == 5 )   WRITE(numout,*) '      jperio= 5, north fold with F-point pivot'
          IF( jperio == 6 )   WRITE(numout,*) '      jperio= 6, cyclic east-west and north fold with F-point pivot'
-      ENDIF
-      !
-      IF( jperio <  0 .OR. jperio > 6 )   CALL ctl_stop( 'jperio is out of range' )
+         IF( jperio == 7 )   WRITE(numout,*) '      jperio= 7, cyclic east-west and north-south'
+      ENDIF
+      !
+      IF( jperio <  0 .OR. jperio > 7 )   CALL ctl_stop( 'jperio is out of range' )
       !
       CALL dom_glo                   ! global domain versus zoom and/or local domain
Index: branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 6860)
+++ branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 6861)
@@ -466,4 +466,6 @@
             idta( 1    , :    ) = 0                 ;      zdta( 1    , :    ) =  0._wp
             idta(jpidta, :    ) = 0                 ;      zdta(jpidta, :    ) =  0._wp
+         ELSEIF( jperio == 7 ) THEN
+!           Nothing to do here
          ELSE
             ih = 0                                  ;      zh = 0._wp
@@ -730,8 +732,8 @@
          IF( lk_mpp ) THEN
             IF( nbondi == -1 .OR. nbondi == 2 ) THEN
-               IF( jperio /= 1 )   mbathy(1,:) = 0
+               IF( jperio /= 1 .AND. jperio /= 7 )   mbathy(1,:) = 0
             ENDIF
             IF( nbondi == 1 .OR. nbondi == 2 ) THEN
-               IF( jperio /= 1 )   mbathy(nlci,:) = 0
+               IF( jperio /= 1 .AND. jperio /= 7 )   mbathy(nlci,:) = 0
             ENDIF
          ELSE
@@ -748,4 +750,9 @@
          mbathy( 1 ,:) = mbathy(jpim1,:)
          mbathy(jpi,:) = mbathy(  2  ,:)
+         IF (jperio == 7) THEN
+            IF(lwp) WRITE(numout,*)' north south boundary conditions on mbathy: jperio = ', jperio
+            mbathy( : ,1) = mbathy(:, jpjm1)
+            mbathy(:, jpj)= mbathy(:,2)
+         ENDIF
       ELSEIF( nperio == 2 ) THEN
          IF(lwp) WRITE(numout,*) '   equatorial boundary conditions on mbathy: nperio = ', nperio
@@ -779,5 +786,6 @@
       ENDIF
 
-      IF( lwp .AND. nprint == 1 ) THEN      ! control print
+!!      IF( lwp .AND. nprint == 1 ) THEN      ! control print
+      IF( lwp ) THEN
          WRITE(numout,*)
          WRITE(numout,*) ' bathymetric field :   number of non-zero T-levels '
Index: branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 6860)
+++ branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 6861)
@@ -405,7 +405,12 @@
                                          ptab(nlci-jpreci+1:jpi   ,:,:) = zland    ! north
          ENDIF
-         !                                   ! North-South boundaries (always closed)
-         IF( .NOT. cd_type == 'F' )   ptab(:,     1       :jprecj,:) = zland       ! south except F-point
-                                      ptab(:,nlcj-jprecj+1:jpj   ,:) = zland       ! north
+                                          ! North-south cyclic
+         IF ( nbondj == 2 .AND. jperio == 7 )    THEN !* cyclic north south only with no mpp split in latitude
+            ptab(:,1 , :) = ptab(:, jpjm1,:)
+            ptab(:,jpj,:) = ptab(:,     2,:)
+         ELSE   !                                   ! North-South boundaries (closed)
+            IF( .NOT. cd_type == 'F' )   ptab(:,     1       :jprecj,:) = zland       ! south except F-point
+            ptab(:,nlcj-jprecj+1:jpj   ,:) = zland       ! north
+         ENDIF
          !
       ENDIF
@@ -614,9 +619,15 @@
                                                    pt2d_array(ii)%pt2d(nlci-jpreci+1 : jpi   ,:) = zland    ! north
             ENDIF
-            !                                   ! North-South boundaries (always closed)
+                                                ! Noth-South boundaries
+            IF ( nbondj == 2 .AND. jperio == 7 )    THEN !* cyclic north south
+               pt2d_array(ii)%pt2d(:, 1 ) =   pt2d_array(ii)%pt2d(:, jpjm1 )
+               pt2d_array(ii)%pt2d(:, jpj ) =   pt2d_array(ii)%pt2d(:, 2 )          
+            ELSE   !             
+               !                                   ! North-South boundaries (closed)
                IF( .NOT. type_array(ii) == 'F' )   pt2d_array(ii)%pt2d(:,             1:jprecj ) = zland    ! south except F-point
                                                    pt2d_array(ii)%pt2d(:, nlcj-jprecj+1:jpj    ) = zland    ! north
             !
-         ENDIF
+            ENDIF
+           ENDIF
       END DO
 
@@ -896,8 +907,13 @@
                                          pt2d(nlci-jpreci+1:jpi   ,:) = zland    ! north
          ENDIF
-         !                                   ! North-South boundaries (always closed)
+                                            ! North-South boudaries
+         IF ( nbondj == 2 .AND. jperio == 7 )    THEN !* cyclic north south
+            pt2d(:,  1 ) = pt2d(:,jpjm1)
+            pt2d(:, jpj) = pt2d(:,    2)
+         ELSE    
+         !                                   ! North-South boundaries (closed)
             IF( .NOT. cd_type == 'F' )   pt2d(:,     1       :jprecj) = zland    !south except F-point
                                          pt2d(:,nlcj-jprecj+1:jpj   ) = zland    ! north
-         !
+         ENDIF     
       ENDIF
 
@@ -1081,12 +1097,17 @@
                                        ptab2(nlci-jpreci+1:jpi   ,:,:) = 0.e0
       ENDIF
-
-
-      !                                      ! North-South boundaries
+                                            ! North-South boundaries
+      IF ( nbondj == 2 .AND. jperio == 7 )    THEN !* cyclic north south
+         ptab1(:,     1       ,:) = ptab1(: ,  jpjm1 , :)
+         ptab1(:,   jpj       ,:) = ptab1(: ,      2 , :)
+         ptab2(:,     1       ,:) = ptab2(: ,  jpjm1 , :)
+         ptab2(:,   jpj       ,:) = ptab2(: ,      2 , :)
+      ELSE     
+      !                                      ! North-South boundaries closed
       IF( .NOT. cd_type1 == 'F' )   ptab1(:,     1       :jprecj,:) = 0.e0    ! south except at F-point
       IF( .NOT. cd_type2 == 'F' )   ptab2(:,     1       :jprecj,:) = 0.e0
                                     ptab1(:,nlcj-jprecj+1:jpj   ,:) = 0.e0    ! north
                                     ptab2(:,nlcj-jprecj+1:jpj   ,:) = 0.e0
-
+      ENDIF     
 
       ! 2. East and west directions exchange
@@ -1277,8 +1298,15 @@
       ! Order matters Here !!!!
       !
-      !                                      !* North-South boundaries (always colsed)
+                                           ! North-South cyclic
+      IF ( nbondj == 2 .AND. jperio == 7 )    THEN !* cyclic north south
+         pt2d(: ,  1-jprj   :  1  )      = pt2d ( :, jpjm1-jprj:jpjm1)
+         pt2d(:, jpj  :jpj+jprj) = pt2d ( :, 2      :2+jprj)
+      ELSE
+        
+      !                                      !* North-South boundaries (closed)
       IF( .NOT. cd_type == 'F' )   pt2d(:,  1-jprj   :  jprecj  ) = 0.e0    ! south except at F-point
                                    pt2d(:,nlcj-jprecj+1:jpj+jprj) = 0.e0    ! north
-
+      ENDIF
+                                
       !                                      ! East-West boundaries
       !                                           !* Cyclic east-west
Index: branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90
===================================================================
--- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 6860)
+++ branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 6861)
@@ -79,4 +79,6 @@
           &              'the domain is lay out for distributed memory computing! ' )
 
+      IF( jperio == 7 ) CALL ctl_stop( ' jperio = 7 needs distributed memory computing ',   &
+          &              ' with 1 process. Add key_mpp_mpi in the list of active cpp keys ' )
    END SUBROUTINE mpp_init
 
@@ -382,5 +384,5 @@
       ! w a r n i n g  narea (zone) /= nproc (processors)!
 
-      IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) THEN
+      IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 ) THEN
          IF( jpni == 1 )THEN
             nbondi = 2
@@ -449,4 +451,6 @@
       ENDIF
 
+      IF( jperio == 7 .AND. ( jpni /= 1 .OR. jpnj /= 1 ) ) &
+         &                  CALL ctl_stop( ' mpp_init: error jperio = 7 works only with jpni = jpnj = 1' )
       IF( nperio == 1 .AND. jpni /= 1 ) CALL ctl_stop( ' mpp_init: error on cyclicity' )
 
Index: branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
===================================================================
--- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 6860)
+++ branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 6861)
@@ -39,4 +39,5 @@
    LOGICAL              ::   ln_3d_uve     !: specify whether input velocity data is 3D
    LOGICAL              ::   ln_read_frq   !: specify whether we must read frq or not
+   LOGICAL              ::   l_sasread     !: Ice intilisation: read a file (.TRUE.) or anaytical initilaistion in namelist &namsbc_sas
    LOGICAL              ::   l_initdone = .false.
    INTEGER     ::   nfld_3d
@@ -82,4 +83,5 @@
       IF( nn_timing == 1 )  CALL timing_start( 'sbc_ssm')
 
+  IF ( l_sasread ) THEN
       IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d )      !==   read data at kt time step   ==!
       IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d )      !==   read data at kt time step   ==!
@@ -99,4 +101,12 @@
       ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1)    ! sea surface height
       IF( ln_read_frq )   frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1)    ! sea surface height
+
+   ELSE
+      sst_m(:,:) = 0.
+      sss_m(:,:) = 0.
+      ssu_m(:,:) = 0.
+      ssv_m(:,:) = 0.
+      ssh_m(:,:) = 0.
+   ENDIF
       !
       IF ( nn_ice == 1 ) THEN
@@ -155,7 +165,7 @@
       TYPE(FLD_N) :: sn_ssh, sn_e3t, sn_frq
       !
-      NAMELIST/namsbc_sas/cn_dir, ln_3d_uve, ln_read_frq, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq
-      !!----------------------------------------------------------------------
-      
+      NAMELIST/namsbc_sas/l_sasread, cn_dir, ln_3d_uve, ln_read_frq, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq
+      !!----------------------------------------------------------------------
+
       IF( ln_rstart .AND. nn_components == jp_iam_sas ) RETURN
       
@@ -176,4 +186,5 @@
          WRITE(numout,*) '~~~~~~~~~~~ '
          WRITE(numout,*) '   Namelist namsbc_sas'
+         WRITE(numout,*) '      Initialisation using an input file  = ',l_sasread 
          WRITE(numout,*) '      Are we supplying a 3D u,v and e3 field                             ln_3d_uve   = ', ln_3d_uve
          WRITE(numout,*) '      Are we reading frq (fraction of qsr absorbed in the 1st T level)   ln_read_frq = ', ln_read_frq
@@ -204,4 +215,5 @@
          nn_closea = 0
       ENDIF
+      IF (l_sasread) THEN
       ! 
       !! following code is a bit messy, but distinguishes between when u,v are 3d arrays and
@@ -285,7 +297,9 @@
       IF( nfld_2d > 0 ) DEALLOCATE( slf_2d, STAT=ierr )
 
+   ENDIF
+ 
       CALL sbc_ssm( nit000 )   ! need to define ss?_m arrays used in limistate
       IF( .NOT. ln_read_frq )   frq_m(:,:) = 1.
-      l_initdone = .TRUE.
+      l_initdone = .TRUE.    
       !
    END SUBROUTINE sbc_ssm_init
