Index: /trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 412)
+++ /trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 413)
@@ -33,4 +33,5 @@
    USE prtctl          ! Print control
    USE in_out_manager  ! I/O manager
+   USE solmat          ! matrix construction for elliptic solvers
    USE agrif_opa_interp
 
@@ -132,4 +133,5 @@
       z2dt = 2. * rdt                                       ! time step: leap-frog
       IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt       ! time step: Euler if restart from rest
+      IF( neuler == 0 .AND. kt == nit000+1 ) CALL sol_mat(kt)
       z2dtg  = grav * z2dt
       zraur  = 1. / rauw
@@ -175,5 +177,4 @@
 
       CALL Agrif_dyn( kt )
-
 #endif
 #if defined key_orca_r2
@@ -240,19 +241,15 @@
 
 #if defined key_agrif
-
-       If (.NOT.AGRIF_ROOT()) THEN
-
+      IF( .NOT. AGRIF_ROOT() ) THEN
          ! add contribution of gradient of after barotropic transport divergence 
-        IF ((nbondi == -1).OR.(nbondi == 2)) gcb(3,:) = gcb(3,:) &
-                        -znugdt * z2dt*laplacu(2,:)*gcdprc(3,:)*hu(2,:)*e2u(2,:)
-        IF ((nbondi == 1).OR.(nbondi == 2))  gcb(nlci-2,:) = gcb(nlci-2,:) &
-                       +znugdt * z2dt*laplacu(nlci-2,:)*gcdprc(nlci-2,:)*hu(nlci-2,:)*e2u(nlci-2,:)
-        IF ((nbondj == -1).OR.(nbondj == 2)) gcb(:,3) = gcb(:,3) &
-                       -znugdt * z2dt*laplacv(:,2)*gcdprc(:,3)*hv(:,2)*e1v(:,2)
-        IF ((nbondj == 1).OR.(nbondj == 2))  gcb(:,nlcj-2) = gcb(:,nlcj-2) &
-                       +znugdt * z2dt*laplacv(:,nlcj-2)*gcdprc(:,nlcj-2)*hv(:,nlcj-2)*e1v(:,nlcj-2)
-
-       ENDIF
-
+         IF( (nbondi == -1) .OR. (nbondi == 2) ) gcb(3,:) = gcb(3,:) &
+            &            -znugdt * z2dt*laplacu(2,:)*gcdprc(3,:)*hu(2,:)*e2u(2,:)
+         IF( (nbondi ==  1) .OR. (nbondi == 2) )  gcb(nlci-2,:) = gcb(nlci-2,:) &
+            &           +znugdt * z2dt*laplacu(nlci-2,:)*gcdprc(nlci-2,:)*hu(nlci-2,:)*e2u(nlci-2,:)
+         IF( (nbondj == -1) .OR. (nbondj == 2) ) gcb(:,3) = gcb(:,3) &
+            &           -znugdt * z2dt*laplacv(:,2)*gcdprc(:,3)*hv(:,2)*e1v(:,2)
+         IF( (nbondj ==  1) .OR. (nbondj == 2) )  gcb(:,nlcj-2) = gcb(:,nlcj-2) &
+            &           +znugdt * z2dt*laplacv(:,nlcj-2)*gcdprc(:,nlcj-2)*hv(:,nlcj-2)*e1v(:,nlcj-2)
+      ENDIF
 #endif
 
@@ -316,10 +313,10 @@
 
 #if defined key_agrif      
-      IF (.NOT. Agrif_Root()) THEN
-      ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface
-        IF ((nbondi == -1).OR.(nbondi == 2)) spgu(2,:) = znugdt * z2dt * laplacu(2,:) * umask(2,:,1)
-        IF ((nbondi == 1).OR.(nbondi == 2)) spgu(nlci-2,:) = znugdt * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)
-        IF ((nbondj == -1).OR.(nbondj == 2)) spgv(:,2) = znugdt * z2dt * laplacv(:,2) * vmask(:,2,1)
-        IF ((nbondj == 1).OR.(nbondj == 2)) spgv(:,nlcj-2) = znugdt * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)
+      IF( .NOT. Agrif_Root() ) THEN
+         ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface
+         IF( (nbondi == -1) .OR. (nbondi == 2) ) spgu(2,:) = znugdt * z2dt * laplacu(2,:) * umask(2,:,1)
+         IF( (nbondi ==  1) .OR. (nbondi == 2) ) spgu(nlci-2,:) = znugdt * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)
+         IF( (nbondj == -1) .OR. (nbondj == 2) ) spgv(:,2) = znugdt * z2dt * laplacv(:,2) * vmask(:,2,1)
+         IF( (nbondj ==  1) .OR. (nbondj == 2) ) spgv(:,nlcj-2) = znugdt * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)
       ENDIF
 #endif      
Index: /trunk/NEMO/OPA_SRC/DYN/dynspg_flt_jki.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DYN/dynspg_flt_jki.F90	(revision 412)
+++ /trunk/NEMO/OPA_SRC/DYN/dynspg_flt_jki.F90	(revision 413)
@@ -37,4 +37,5 @@
    USE prtctl          ! Print control
    USE in_out_manager  ! I/O manager
+   USE solmat          ! matrix construction for elliptic solvers
    USE agrif_opa_interp
 
@@ -138,4 +139,5 @@
       ! time step: Euler if restart from rest
       IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt
+      IF( neuler == 0 .AND. kt == nit000+1 ) CALL sol_mat(kt)
       ! coefficients
       z2dtg  = grav * z2dt
@@ -183,5 +185,4 @@
 
       CALL Agrif_dyn( kt )
-
 #endif
 #if defined key_orca_r2
@@ -246,19 +247,15 @@
 
 #if defined key_agrif
-
-       If (.NOT.AGRIF_ROOT()) THEN
-
+      IF( .NOT. AGRIF_ROOT() ) THEN
          ! add contribution of gradient of after barotropic transport divergence 
-        IF ((nbondi == -1).OR.(nbondi == 2)) gcb(3,:) = gcb(3,:) &
-                        -znugdt * z2dt*laplacu(2,:)*gcdprc(3,:)*hu(2,:)*e2u(2,:)
-        IF ((nbondi == 1).OR.(nbondi == 2))  gcb(nlci-2,:) = gcb(nlci-2,:) &
-                       +znugdt * z2dt*laplacu(nlci-2,:)*gcdprc(nlci-2,:)*hu(nlci-2,:)*e2u(nlci-2,:)
-        IF ((nbondj == -1).OR.(nbondj == 2)) gcb(:,3) = gcb(:,3) &
-                       -znugdt * z2dt*laplacv(:,2)*gcdprc(:,3)*hv(:,2)*e1v(:,2)
-        IF ((nbondj == 1).OR.(nbondj == 2))  gcb(:,nlcj-2) = gcb(:,nlcj-2) &
-                       +znugdt * z2dt*laplacv(:,nlcj-2)*gcdprc(:,nlcj-2)*hv(:,nlcj-2)*e1v(:,nlcj-2)
-
-       ENDIF
-
+        IF( (nbondi == -1) .OR. (nbondi == 2) ) gcb(3,:) = gcb(3,:) &
+           &            -znugdt * z2dt*laplacu(2,:)*gcdprc(3,:)*hu(2,:)*e2u(2,:)
+        IF( (nbondi ==  1) .OR. (nbondi == 2) )  gcb(nlci-2,:) = gcb(nlci-2,:) &
+           &           +znugdt * z2dt*laplacu(nlci-2,:)*gcdprc(nlci-2,:)*hu(nlci-2,:)*e2u(nlci-2,:)
+        IF( (nbondj == -1) .OR. (nbondj == 2) ) gcb(:,3) = gcb(:,3) &
+           &           -znugdt * z2dt*laplacv(:,2)*gcdprc(:,3)*hv(:,2)*e1v(:,2)
+        IF( (nbondj ==  1) .OR. (nbondj == 2) )  gcb(:,nlcj-2) = gcb(:,nlcj-2) &
+           &           +znugdt * z2dt*laplacv(:,nlcj-2)*gcdprc(:,nlcj-2)*hv(:,nlcj-2)*e1v(:,nlcj-2)
+      ENDIF
 #endif
 
@@ -336,10 +333,10 @@
          
 #if defined key_agrif      
-      IF (.NOT. Agrif_Root()) THEN
-      ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface
-        IF ((nbondi == -1).OR.(nbondi == 2)) spgu(2,:) = znugdt * z2dt * laplacu(2,:) * umask(2,:,1)
-        IF ((nbondi == 1).OR.(nbondi == 2)) spgu(nlci-2,:) = znugdt * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)
-        IF ((nbondj == -1).OR.(nbondj == 2)) spgv(:,2) = znugdt * z2dt * laplacv(:,2) * vmask(:,2,1)
-        IF ((nbondj == 1).OR.(nbondj == 2)) spgv(:,nlcj-2) = znugdt * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)
+      IF( .NOT. Agrif_Root() ) THEN
+         ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface
+         IF( (nbondi == -1) .OR. (nbondi == 2) ) spgu(2,:) = znugdt * z2dt * laplacu(2,:) * umask(2,:,1)
+         IF( (nbondi ==  1) .OR. (nbondi == 2) ) spgu(nlci-2,:) = znugdt * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)
+         IF( (nbondj == -1) .OR. (nbondj == 2) ) spgv(:,2) = znugdt * z2dt * laplacv(:,2) * vmask(:,2,1)
+         IF( (nbondj ==  1) .OR. (nbondj == 2) ) spgv(:,nlcj-2) = znugdt * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)
       ENDIF
 #endif
Index: /trunk/NEMO/OPA_SRC/SOL/solmat.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SOL/solmat.F90	(revision 412)
+++ /trunk/NEMO/OPA_SRC/SOL/solmat.F90	(revision 413)
@@ -19,4 +19,5 @@
    USE lbclnk          ! lateral boudary conditions
    USE lib_mpp         ! distributed memory computing
+   USE in_out_manager  ! I/O manager
 
    IMPLICIT NONE
@@ -33,5 +34,5 @@
 CONTAINS
 
-   SUBROUTINE sol_mat
+   SUBROUTINE sol_mat( kt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE sol_mat  ***
@@ -67,4 +68,7 @@
       !!   9.0  !  05-11  (V. Garnier) Surface pressure gradient organization
       !!----------------------------------------------------------------------
+      !! * Arguments
+      INTEGER, INTENT(in) :: kt
+
       !! * Local declarations
       INTEGER ::   ji, jj                    ! dummy loop indices
@@ -93,5 +97,9 @@
       gcdmat(:,:) = 0.e0
       
-      z2dt = 2. * rdt
+      IF( neuler == 0 .AND. kt == nit000 ) THEN
+         z2dt = rdt
+      ELSE
+         z2dt = 2. * rdt
+      ENDIF
 
 #if defined key_dynspg_flt && ! defined key_obc
Index: /trunk/NEMO/OPA_SRC/SOL/solver.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SOL/solver.F90	(revision 412)
+++ /trunk/NEMO/OPA_SRC/SOL/solver.F90	(revision 413)
@@ -31,5 +31,5 @@
 CONTAINS
 
-   SUBROUTINE solver_init
+   SUBROUTINE solver_init( kt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE solver_init  ***
@@ -77,4 +77,7 @@
       !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization
       !!----------------------------------------------------------------------
+      !! * Arguments
+      INTEGER, INTENT(in) :: kt
+
       !! * Local declarations
       INTEGER :: ji, jj   ! dummy loop indices
@@ -232,5 +235,5 @@
       ! ------------------------------------------
 
-      CALL sol_mat
+      CALL sol_mat( kt )
 
 
Index: /trunk/NEMO/OPA_SRC/opa.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/opa.F90	(revision 412)
+++ /trunk/NEMO/OPA_SRC/opa.F90	(revision 413)
@@ -310,11 +310,12 @@
       IF( lk_obc    )   CALL obc_init       ! Open boundaries 
 
+      CALL day( nit000 )                    ! Calendar
+
+      CALL istate_init                      ! ocean initial state (Dynamics and tracers)
+
       IF( lk_dynspg_flt .OR. lk_dynspg_rl ) THEN
-      CALL solver_init                      ! Elliptic solver
-      ENDIF
-
-      CALL day( nit000 )                    ! Calendar
-
-      CALL istate_init                      ! ocean initial state (Dynamics and tracers)
+         CALL solver_init( nit000 )         ! Elliptic solver
+      ENDIF
+
 !!add
                        CALL eos( tb, sb, rhd, rhop )        ! before potential and in situ densities
