Index: trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 5407)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 5510)
@@ -59,4 +59,9 @@
    USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges
    USE icbstp          ! handle bergs, calving, themodynamics and transport
+#if defined key_bdy
+   USE bdyini          ! open boundary cond. setting       (bdy_init routine). clem: mandatory for LIM3
+   USE bdydta          ! open boundary cond. setting   (bdy_dta_init routine). clem: mandatory for LIM3
+#endif
+   USE bdy_par
 
    IMPLICIT NONE
@@ -354,4 +359,11 @@
 
                             CALL sbc_init   ! Forcings : surface module 
+                            
+      ! ==> clem: open boundaries init. is mandatory for LIM3 because ice BDY is not decoupled from  
+      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules. 
+      !           This is not clean and should be changed in the future. 
+      IF( lk_bdy        )   CALL     bdy_init
+      IF( lk_bdy        )   CALL bdy_dta_init
+      ! ==>
       
       IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler
@@ -502,5 +514,10 @@
       USE diawri    , ONLY: dia_wri_alloc
       USE dom_oce   , ONLY: dom_oce_alloc
-      USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass 
+#if defined key_bdy   
+      USE bdy_oce   , ONLY: bdy_oce_alloc
+      USE oce         ! clem: mandatory for LIM3 because needed for bdy arrays
+#else
+      USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass
+#endif
       !
       INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6
@@ -510,11 +527,16 @@
       ierr =        dia_wri_alloc   ()
       ierr = ierr + dom_oce_alloc   ()          ! ocean domain
-      ALLOCATE( snwice_mass(jpi,jpj)  , snwice_mass_b(jpi,jpj),             &
-         &      snwice_fmass(jpi,jpj), STAT= ierr1 )
+#if defined key_bdy
+      ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization)
+      ierr = ierr + oce_alloc       ()          ! (tsn...)
+#endif
+
+#if ! defined key_bdy
+       ALLOCATE( snwice_mass(jpi,jpj)  , snwice_mass_b(jpi,jpj),             &
+         &      snwice_fmass(jpi,jpj)  , STAT= ierr1 )
       !
       ! lim code currently uses surface temperature and salinity in tsn array for initialisation
-      ! and ub, vb arrays in ice dynamics
-      ! so allocate enough of arrays to use
-      !
+      ! and ub, vb arrays in ice dynamics, so allocate enough of arrays to use
+      ! clem: should not be needed. To be checked out
       jpm = MAX(jp_tem, jp_sal)
       ALLOCATE( tsn(jpi,jpj,1,jpm)  , STAT=ierr2 )
@@ -523,6 +545,6 @@
       ALLOCATE( tsb(jpi,jpj,1,jpm)  , STAT=ierr5 )
       ALLOCATE( sshn(jpi,jpj)       , STAT=ierr6 )
-
       ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 
+#endif
       !
       IF( lk_mpp    )   CALL mpp_sum( ierr )
Index: trunk/NEMOGCM/NEMO/SAS_SRC/step.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/step.F90	(revision 5407)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/step.F90	(revision 5510)
@@ -37,4 +37,9 @@
 
    USE timing           ! Timing            
+
+   USE bdy_par          ! clem: mandatory for LIM3
+#if defined key_bdy
+   USE bdydta           ! clem: mandatory for LIM3
+#endif
 
    IMPLICIT NONE
@@ -81,4 +86,12 @@
                              CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp
 
+      ! ==> clem: open boundaries is mandatory for LIM3 because ice BDY is not decoupled from  
+      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.
+      !           From SAS: ocean bdy data are wrong  (but we do not care) and ice bdy data are OK.  
+      !           This is not clean and should be changed in the future. 
+#if defined key_bdy
+      IF( lk_bdy     )       CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries
+#endif
+      ! ==>
                              CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
 
