Index: /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90	(revision 4757)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90	(revision 4758)
@@ -418,7 +418,4 @@
       DO ib_bdy = 1,nb_bdy
 
-         ! line below should be simplified (runoff case)
-!! CHANUT: TO BE SORTED OUT
-!!         IF (( nn_dyn2d_dta(ib_bdy) .ge. 2 ).AND.(nn_tra(ib_bdy).NE.4)) THEN
          IF ( nn_dyn2d_dta(ib_bdy) .ge. 2 ) THEN
 
@@ -453,12 +450,12 @@
             IF ( PRESENT(kit) ) THEN
                IF ( lk_first_btstp ) THEN ! Save slow varying open boundary data:
-                  dta_bdy_s(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy(ib_bdy)%ssh(1:ilen0(1))
-                  dta_bdy_s(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy(ib_bdy)%u2d(1:ilen0(2))
-                  dta_bdy_s(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy(ib_bdy)%v2d(1:ilen0(3))
+                  IF ( dta_bdy(ib_bdy)%ll_ssh ) dta_bdy_s(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy(ib_bdy)%ssh(1:ilen0(1))
+                  IF ( dta_bdy(ib_bdy)%ll_u2d ) dta_bdy_s(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy(ib_bdy)%u2d(1:ilen0(2))
+                  IF ( dta_bdy(ib_bdy)%ll_v2d ) dta_bdy_s(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy(ib_bdy)%v2d(1:ilen0(3))
 
                ELSE ! Initialize arrays from slow varying open boundary data:            
-                  dta_bdy(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy_s(ib_bdy)%ssh(1:ilen0(1))
-                  dta_bdy(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy_s(ib_bdy)%u2d(1:ilen0(2))
-                  dta_bdy(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy_s(ib_bdy)%v2d(1:ilen0(3))
+                  IF ( dta_bdy(ib_bdy)%ll_ssh ) dta_bdy(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy_s(ib_bdy)%ssh(1:ilen0(1))
+                  IF ( dta_bdy(ib_bdy)%ll_u2d ) dta_bdy(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy_s(ib_bdy)%u2d(1:ilen0(2))
+                  IF ( dta_bdy(ib_bdy)%ll_v2d ) dta_bdy(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy_s(ib_bdy)%v2d(1:ilen0(3))
                ENDIF
             ENDIF
@@ -471,25 +468,31 @@
                z_sist = zramp * SIN( z_sarg )
                !
-               igrd=1                              ! SSH on tracer grid
-               DO ib = 1, ilen0(igrd)
-                  dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + &
-                     &                      ( tides(ib_bdy)%ssh(ib,itide,1)*z_cost + &
-                     &                        tides(ib_bdy)%ssh(ib,itide,2)*z_sist )
-               END DO
-               !
-               igrd=2                              ! U grid
-               DO ib = 1, ilen0(igrd)
-                  dta_bdy(ib_bdy)%u2d(ib) = dta_bdy(ib_bdy)%u2d(ib) + &
-                     &                      ( tides(ib_bdy)%u(ib,itide,1)*z_cost + &
-                     &                        tides(ib_bdy)%u(ib,itide,2)*z_sist )
-               END DO
-               !
-               igrd=3                              ! V grid
-               DO ib = 1, ilen0(igrd) 
-                  dta_bdy(ib_bdy)%v2d(ib) = dta_bdy(ib_bdy)%v2d(ib) + &
-                     &                      ( tides(ib_bdy)%v(ib,itide,1)*z_cost + &
-                     &                        tides(ib_bdy)%v(ib,itide,2)*z_sist )
-               END DO
-            END DO
+               IF ( dta_bdy(ib_bdy)%ll_ssh ) THEN
+                  igrd=1                              ! SSH on tracer grid
+                  DO ib = 1, ilen0(igrd)
+                     dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + &
+                        &                      ( tides(ib_bdy)%ssh(ib,itide,1)*z_cost + &
+                        &                        tides(ib_bdy)%ssh(ib,itide,2)*z_sist )
+                  END DO
+               ENDIF
+               !
+               IF ( dta_bdy(ib_bdy)%ll_u2d ) THEN
+                  igrd=2                              ! U grid
+                  DO ib = 1, ilen0(igrd)
+                     dta_bdy(ib_bdy)%u2d(ib) = dta_bdy(ib_bdy)%u2d(ib) + &
+                        &                      ( tides(ib_bdy)%u(ib,itide,1)*z_cost + &
+                        &                        tides(ib_bdy)%u(ib,itide,2)*z_sist )
+                  END DO
+               ENDIF
+               !
+               IF ( dta_bdy(ib_bdy)%ll_v2d ) THEN
+                  igrd=3                              ! V grid
+                  DO ib = 1, ilen0(igrd) 
+                     dta_bdy(ib_bdy)%v2d(ib) = dta_bdy(ib_bdy)%v2d(ib) + &
+                        &                      ( tides(ib_bdy)%v(ib,itide,1)*z_cost + &
+                        &                        tides(ib_bdy)%v(ib,itide,2)*z_sist )
+                  END DO
+               ENDIF
+            END DO             
          END IF
       END DO
