Index: branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obc_oce.F90
===================================================================
--- branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obc_oce.F90	(revision 2830)
+++ branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obc_oce.F90	(revision 2831)
@@ -69,8 +69,16 @@
    !                                                        !  = 1 the volume will be constant during all the integration.
    INTEGER, DIMENSION(jp_obc) ::   nn_dyn2d                 ! Choice of boundary condition for barotropic variables (U,V,SSH)
+   INTEGER, DIMENSION(jp_obc) ::   nn_dyn2d_dta      	    !: = 0 use the initial state as obc dta ; 
+                                                            !: = 1 read it in a NetCDF file
    INTEGER, DIMENSION(jp_obc) ::   nn_dyn3d                 ! Choice of boundary condition for baroclinic velocities 
+   INTEGER, DIMENSION(jp_obc) ::   nn_dyn3d_dta      	    !: = 0 use the initial state as obc dta ; 
+                                                            !: = 1 read it in a NetCDF file
    INTEGER, DIMENSION(jp_obc) ::   nn_tra                   ! Choice of boundary condition for active tracers (T and S)
+   INTEGER, DIMENSION(jp_obc) ::   nn_tra_dta      	    !: = 0 use the initial state as obc dta ; 
+                                                            !: = 1 read it in a NetCDF file
 #if defined key_lim2
    INTEGER, DIMENSION(jp_obc) ::   nn_ice_lim2              ! Choice of boundary condition for sea ice variables 
+   INTEGER, DIMENSION(jp_obc) ::   nn_ice_lim2_dta          !: = 0 use the initial state as obc dta ; 
+                                                            !: = 1 read it in a NetCDF file
 #endif
    !
@@ -100,4 +108,6 @@
    !!----------------------------------------------------------------------
 
+   INTEGER,  DIMENSION(jp_obc)                     ::   nn_dta            !: =0 => *all* data is set to initial conditions
+                                                                          !: =1 => some data to be read in from data files
    REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET ::   dta_global        !: workspace for reading in global data arrays
    TYPE(OBC_INDEX), DIMENSION(jp_obc), TARGET      ::   idx_obc           !: obc indices (local process)
Index: branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90
===================================================================
--- branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90	(revision 2830)
+++ branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90	(revision 2831)
@@ -80,7 +80,6 @@
       END IF
 
-      ! for nn_dtactl = 0, initialise data arrays once for all
-      ! from initial conditions
-      !-------------------------------------------------------
+      ! Initialise data arrays once for all from initial conditions where required
+      !---------------------------------------------------------------------------
       IF( kt .eq. nit000 .and. .not. PRESENT(jit) ) THEN
 
@@ -101,110 +100,108 @@
          
          DO ib_obc = 1, nb_obc
-            IF( nn_dtactl(ib_obc) .eq. 0 ) THEN
-
-               nblen => idx_obc(ib_obc)%nblen
-               nblenrim => idx_obc(ib_obc)%nblenrim
-
-               IF( nn_dyn2d(ib_obc) .gt. 0 ) THEN 
-                  IF( nn_dyn2d(ib_obc) .eq. jp_frs ) THEN
-                     ilen1(:) = nblen(:)
-                  ELSE
-                     ilen1(:) = nblenrim(:)
-                  ENDIF
-                  igrd = 1
-                  DO ib = 1, ilen1(igrd)
+
+            nblen => idx_obc(ib_obc)%nblen
+            nblenrim => idx_obc(ib_obc)%nblenrim
+
+            IF( nn_dyn2d(ib_obc) .gt. 0 .and. nn_dyn2d_dta(ib_obc) .eq. 0 ) THEN 
+               IF( nn_dyn2d(ib_obc) .eq. jp_frs ) THEN
+                  ilen1(:) = nblen(:)
+               ELSE
+                  ilen1(:) = nblenrim(:)
+               ENDIF
+               igrd = 1
+               DO ib = 1, ilen1(igrd)
+                  ii = idx_obc(ib_obc)%nbi(ib,igrd)
+                  ij = idx_obc(ib_obc)%nbj(ib,igrd)
+                  dta_obc(ib_obc)%ssh(ib) = sshn(ii,ij) * tmask(ii,ij,1)         
+               END DO 
+               igrd = 2
+               DO ib = 1, ilen1(igrd)
+                  ii = idx_obc(ib_obc)%nbi(ib,igrd)
+                  ij = idx_obc(ib_obc)%nbj(ib,igrd)
+                  dta_obc(ib_obc)%u2d(ib) = pu2d(ii,ij) * umask(ii,ij,1)         
+               END DO 
+               igrd = 3
+               DO ib = 1, ilen1(igrd)
+                  ii = idx_obc(ib_obc)%nbi(ib,igrd)
+                  ij = idx_obc(ib_obc)%nbj(ib,igrd)
+                  dta_obc(ib_obc)%v2d(ib) = pv2d(ii,ij) * vmask(ii,ij,1)         
+               END DO 
+            ENDIF
+
+            IF( nn_dyn3d(ib_obc) .gt. 0 .and. nn_dyn3d_dta(ib_obc) .eq. 0 ) THEN 
+               IF( nn_dyn3d(ib_obc) .eq. jp_frs ) THEN
+                  ilen1(:) = nblen(:)
+               ELSE
+                  ilen1(:) = nblenrim(:)
+               ENDIF
+               igrd = 2 
+               DO ib = 1, ilen1(igrd)
+                  DO ik = 1, jpkm1
                      ii = idx_obc(ib_obc)%nbi(ib,igrd)
                      ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                     dta_obc(ib_obc)%ssh(ib) = sshn(ii,ij) * tmask(ii,ij,1)         
-                  END DO 
-                  igrd = 2
-                  DO ib = 1, ilen1(igrd)
+                     dta_obc(ib_obc)%u3d(ib,ik) =  ( un(ii,ij,ik) - pu2d(ii,ij) ) * umask(ii,ij,ik)         
+                  END DO
+               END DO 
+               igrd = 3 
+               DO ib = 1, ilen1(igrd)
+                  DO ik = 1, jpkm1
                      ii = idx_obc(ib_obc)%nbi(ib,igrd)
                      ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                     dta_obc(ib_obc)%u2d(ib) = pu2d(ii,ij) * umask(ii,ij,1)         
-                  END DO 
-                  igrd = 3
-                  DO ib = 1, ilen1(igrd)
+                     dta_obc(ib_obc)%v3d(ib,ik) =  ( vn(ii,ij,ik) - pv2d(ii,ij) ) * vmask(ii,ij,ik)         
+                     END DO
+               END DO 
+            ENDIF
+
+            IF( nn_tra(ib_obc) .gt. 0 .and. nn_tra_dta(ib_obc) .eq. 0 ) THEN 
+               IF( nn_tra(ib_obc) .eq. jp_frs ) THEN
+                  ilen1(:) = nblen(:)
+               ELSE
+                  ilen1(:) = nblenrim(:)
+               ENDIF
+               igrd = 1                       ! Everything is at T-points here
+               DO ib = 1, ilen1(igrd)
+                  DO ik = 1, jpkm1
                      ii = idx_obc(ib_obc)%nbi(ib,igrd)
                      ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                     dta_obc(ib_obc)%v2d(ib) = pv2d(ii,ij) * vmask(ii,ij,1)         
-                  END DO 
-               ENDIF
-
-               IF( nn_dyn3d(ib_obc) .gt. 0 ) THEN 
-                  IF( nn_dyn3d(ib_obc) .eq. jp_frs ) THEN
-                     ilen1(:) = nblen(:)
-                  ELSE
-                     ilen1(:) = nblenrim(:)
-                  ENDIF
-                  igrd = 2 
-                  DO ib = 1, ilen1(igrd)
-                     DO ik = 1, jpkm1
-                        ii = idx_obc(ib_obc)%nbi(ib,igrd)
-                        ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                        dta_obc(ib_obc)%u3d(ib,ik) =  ( un(ii,ij,ik) - pu2d(ii,ij) ) * umask(ii,ij,ik)         
-                     END DO
-                  END DO 
-                  igrd = 3 
-                  DO ib = 1, ilen1(igrd)
-                     DO ik = 1, jpkm1
-                        ii = idx_obc(ib_obc)%nbi(ib,igrd)
-                        ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                        dta_obc(ib_obc)%v3d(ib,ik) =  ( vn(ii,ij,ik) - pv2d(ii,ij) ) * vmask(ii,ij,ik)         
-                     END DO
-                  END DO 
-               ENDIF
-
-               IF( nn_tra(ib_obc) .gt. 0 ) THEN 
-                  IF( nn_tra(ib_obc) .eq. jp_frs ) THEN
-                     ilen1(:) = nblen(:)
-                  ELSE
-                     ilen1(:) = nblenrim(:)
-                  ENDIF
-                  igrd = 1                       ! Everything is at T-points here
-                  DO ib = 1, ilen1(igrd)
-                     DO ik = 1, jpkm1
-                        ii = idx_obc(ib_obc)%nbi(ib,igrd)
-                        ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                        dta_obc(ib_obc)%tem(ib,ik) = tn(ii,ij,ik) * tmask(ii,ij,ik)         
-                        dta_obc(ib_obc)%sal(ib,ik) = sn(ii,ij,ik) * tmask(ii,ij,ik)         
-                     END DO
-                  END DO 
-               ENDIF
-
-#if defined key_lim2
-               IF( nn_ice_lim2(ib_obc) .gt. 0 ) THEN 
-                  IF( nn_ice_lim2(ib_obc) .eq. jp_frs ) THEN
-                     ilen1(:) = nblen(:)
-                  ELSE
-                     ilen1(:) = nblenrim(:)
-                  ENDIF
-                  igrd = 1                       ! Everything is at T-points here
-                  DO ib = 1, ilen1(igrd)
-                     ii = idx_obc(ib_obc)%nbi(ib,igrd)
-                     ij = idx_obc(ib_obc)%nbj(ib,igrd)
-                     dta_obc(ib_obc)%frld(ib) = frld(ii,ij) * tmask(ii,ij,1)         
-                     dta_obc(ib_obc)%hicif(ib) = hicif(ii,ij) * tmask(ii,ij,1)         
-                     dta_obc(ib_obc)%hsnif(ib) = hsnif(ii,ij) * tmask(ii,ij,1)         
-                  END DO 
-               ENDIF
-#endif
-
-            ENDIF
-         ENDDO
-
-      ENDIF
-
-      ! for nn_dtactl = 1, update external data from files
-      !---------------------------------------------------
+                     dta_obc(ib_obc)%tem(ib,ik) = tn(ii,ij,ik) * tmask(ii,ij,ik)         
+                     dta_obc(ib_obc)%sal(ib,ik) = sn(ii,ij,ik) * tmask(ii,ij,ik)         
+                  END DO
+               END DO 
+            ENDIF
+
+#if defined key_lim2
+            IF( nn_ice_lim2(ib_obc) .gt. 0 .and. nn_ice_lim2_dta(ib_obc) .eq. 0 ) THEN 
+               IF( nn_ice_lim2(ib_obc) .eq. jp_frs ) THEN
+                  ilen1(:) = nblen(:)
+               ELSE
+                  ilen1(:) = nblenrim(:)
+               ENDIF
+               igrd = 1                       ! Everything is at T-points here
+               DO ib = 1, ilen1(igrd)
+                  ii = idx_obc(ib_obc)%nbi(ib,igrd)
+                  ij = idx_obc(ib_obc)%nbj(ib,igrd)
+                  dta_obc(ib_obc)%frld(ib) = frld(ii,ij) * tmask(ii,ij,1)         
+                  dta_obc(ib_obc)%hicif(ib) = hicif(ii,ij) * tmask(ii,ij,1)         
+                  dta_obc(ib_obc)%hsnif(ib) = hsnif(ii,ij) * tmask(ii,ij,1)         
+               END DO 
+            ENDIF
+#endif
+
+         ENDDO ! ib_obc
+
+      ENDIF ! kt .eq. nit000
+
+      ! update external data from files
+      !--------------------------------
      
       jstart = 1
       DO ib_obc = 1, nb_obc   
-         IF( nn_dtactl(ib_obc) .eq. 1 ) THEN
+         IF( nn_dta(ib_obc) .eq. 1 ) THEN ! skip this bit if no external data required
       
             IF( PRESENT(jit) ) THEN
                ! Update barotropic boundary conditions only
                ! jit is optional argument for fld_read
-               IF( nn_dyn2d(ib_obc) .gt. 0 ) THEN
+               IF( nn_dyn2d(ib_obc) .gt. 0 .and. nn_dyn2d_dta(ib_obc) .eq. 1 ) THEN
                   IF( nn_tides(ib_obc) .eq. 1 ) THEN
                      dta_obc(ib_obc)%ssh(:) = 0.0
@@ -240,5 +237,6 @@
             ! time as the dynspg_ts option). 
 
-            IF( ln_full_vel_array(ib_obc) ) THEN 
+            IF( ln_full_vel_array(ib_obc) .and.                                             & 
+           &    ( nn_dyn2d_dta(ib_obc) .eq. 1 .or. nn_dyn3d_dta(ib_obc) .eq. 1 ) ) THEN 
 
                igrd = 2                      ! zonal velocity
@@ -274,5 +272,5 @@
             ENDIF
 
-         END IF ! nn_dtactl(ib_obc) = 1
+         END IF ! nn_dta(ib_obc) = 1
       END DO  ! ib_obc
 
@@ -319,4 +317,15 @@
       !!---------------------------------------------------------------------------
 
+      ! Set nn_dta
+      DO ib_obc = 1, nb_obc
+         nn_dta(ib_obc) = MAX(  nn_dyn2d_dta(ib_obc)       &
+                               ,nn_dyn3d_dta(ib_obc)       &
+                               ,nn_tra_dta(ib_obc)         &
+#if defined key_ice_lim2
+                               ,nn_ice_lim2_dta(ib_obc)    &
+#endif
+                              )
+      END DO
+
       ! Work out upper bound of how many fields there are to read in and allocate arrays
       ! ---------------------------------------------------------------------------
@@ -324,20 +333,18 @@
       nb_obc_fld(:) = 0
       DO ib_obc = 1, nb_obc         
-         IF( nn_dtactl(ib_obc) .eq. 1 ) THEN
-            IF( nn_dyn2d(ib_obc) .gt. 0 ) THEN
-               nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 3
-            ENDIF
-            IF( nn_dyn3d(ib_obc) .gt. 0 ) THEN
-               nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 2
-            ENDIF
-            IF( nn_tra(ib_obc) .gt. 0 ) THEN
-               nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 2
-            ENDIF
-#if defined key_lim2
-            IF( nn_ice_lim2(ib_obc) .gt. 0 ) THEN
-               nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 3
-            ENDIF
+         IF( nn_dyn2d(ib_obc) .gt. 0 .and. nn_dyn2d_dta(ib_obc) .eq. 1 ) THEN
+            nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 3
+         ENDIF
+         IF( nn_dyn3d(ib_obc) .gt. 0 .and. nn_dyn3d_dta(ib_obc) .eq. 1 ) THEN
+            nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 2
+         ENDIF
+         IF( nn_tra(ib_obc) .gt. 0 .and. nn_tra_dta(ib_obc) .eq. 1  ) THEN
+            nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 2
+         ENDIF
+#if defined key_lim2
+         IF( nn_ice_lim2(ib_obc) .gt. 0 .and. nn_ice_lim2_dta(ib_obc) .eq. 1  ) THEN
+            nb_obc_fld(ib_obc) = nb_obc_fld(ib_obc) + 3
+         ENDIF
 #endif               
-         ENDIF
       ENDDO            
 
@@ -365,5 +372,5 @@
       jfld = 0 
       DO ib_obc = 1, nb_obc         
-         IF( nn_dtactl(ib_obc) .eq. 1 ) THEN
+         IF( nn_dta(ib_obc) .eq. 1 ) THEN
             ! set file information
             cn_dir = './'        ! directory in which the model is executed
@@ -401,5 +408,5 @@
             ! Only read in necessary fields for this set.
             ! Important that barotropic variables come first.
-            IF( nn_dyn2d(ib_obc) .gt. 0 ) THEN 
+            IF( nn_dyn2d(ib_obc) .gt. 0 .and. nn_dyn2d_dta(ib_obc) .eq. 1 ) THEN 
 
                IF( nn_dyn2d(ib_obc) .ne. jp_frs .and. nn_tides(ib_obc) .ne. 1) THEN
@@ -441,6 +448,6 @@
 
             ! baroclinic velocities
-            IF( nn_dyn3d(ib_obc) .gt. 0 .or. &
-                  ( ln_full_vel_array(ib_obc) .and. nn_dyn2d(ib_obc) .gt. 0 ) ) THEN
+            IF( ( nn_dyn3d(ib_obc) .gt. 0 .and. nn_dyn3d_dta(ib_obc) .eq. 1 ) .or. &
+                  ( ln_full_vel_array(ib_obc) .and. nn_dyn2d(ib_obc) .gt. 0 .and. nn_dyn2d_dta(ib_obc) .eq. 1 ) ) THEN
 
                jfld = jfld + 1
@@ -469,5 +476,5 @@
 
             ! temperature and salinity
-            IF( nn_tra(ib_obc) .gt. 0 ) THEN
+            IF( nn_tra(ib_obc) .gt. 0 .and. nn_tra_dta(ib_obc) .eq. 1 ) THEN
 
                jfld = jfld + 1
@@ -497,5 +504,5 @@
 #if defined key_lim2
             ! sea ice
-            IF( nn_tra(ib_obc) .gt. 0 ) THEN
+            IF( nn_ice_lim2(ib_obc) .gt. 0 .and. nn_ice_lim2_dta(ib_obc) .eq. 1 ) THEN
 
                jfld = jfld + 1
@@ -545,5 +552,5 @@
             ENDIF
 
-         ENDIF ! nn_dtactl .eq. 1
+         ENDIF ! nn_dta .eq. 1
       ENDDO ! ib_obc
 
@@ -565,6 +572,6 @@
 
       ! Initialise local boundary data arrays
-      ! nn_dtactl=0 : allocate space - will be filled from initial conditions later
-      ! nn_dtactl=1 : point to "fnow" arrays
+      ! nn_xxx_dta=0 : allocate space - will be filled from initial conditions later
+      ! nn_xxx_dta=1 : point to "fnow" arrays
       !-------------------------------------
 
@@ -575,10 +582,6 @@
          nblenrim => idx_obc(ib_obc)%nblenrim
 
-         IF( nn_dtactl(ib_obc) .eq. 0 ) THEN
-               
-            ! nn_dtactl = 0 
-            ! Allocate space
-            !---------------
-            IF (nn_dyn2d(ib_obc) .gt. 0) THEN
+         IF (nn_dyn2d(ib_obc) .gt. 0) THEN
+            IF( nn_dyn2d_dta(ib_obc) .eq. 0 .or. ln_full_vel_array(ib_obc) .or. nn_tides(ib_obc) .eq. 1 ) THEN
                IF( nn_dyn2d(ib_obc) .eq. jp_frs ) THEN
                   ilen0(1:3) = nblen(1:3)
@@ -589,15 +592,35 @@
                ALLOCATE( dta_obc(ib_obc)%u2d(ilen0(2)) )
                ALLOCATE( dta_obc(ib_obc)%v2d(ilen0(3)) )
-            ENDIF
-            IF (nn_dyn3d(ib_obc) .gt. 0) THEN
-               IF( nn_dyn3d(ib_obc) .eq. jp_frs ) THEN
-                  ilen0(1:3) = nblen(1:3)
-               ELSE
-                  ilen0(1:3) = nblenrim(1:3)
-               ENDIF
-               ALLOCATE( dta_obc(ib_obc)%u3d(ilen0(2),jpk) )
-               ALLOCATE( dta_obc(ib_obc)%v3d(ilen0(3),jpk) )
-            ENDIF
-            IF (nn_tra(ib_obc) .gt. 0) THEN
+            ELSE
+               IF( nn_dyn2d(ib_obc) .ne. jp_frs ) THEN
+                  jfld = jfld + 1
+                  dta_obc(ib_obc)%ssh => bf(jfld)%fnow(:,1,1)
+               ENDIF
+               jfld = jfld + 1
+               dta_obc(ib_obc)%u2d => bf(jfld)%fnow(:,1,1)
+               jfld = jfld + 1
+               dta_obc(ib_obc)%v2d => bf(jfld)%fnow(:,1,1)
+            ENDIF
+         ENDIF
+
+         IF ( nn_dyn3d(ib_obc) .gt. 0 .and. nn_dyn3d_dta(ib_obc) .eq. 0 ) THEN
+            IF( nn_dyn3d(ib_obc) .eq. jp_frs ) THEN
+               ilen0(1:3) = nblen(1:3)
+            ELSE
+               ilen0(1:3) = nblenrim(1:3)
+            ENDIF
+            ALLOCATE( dta_obc(ib_obc)%u3d(ilen0(2),jpk) )
+            ALLOCATE( dta_obc(ib_obc)%v3d(ilen0(3),jpk) )
+         ENDIF
+         IF ( ( nn_dyn3d(ib_obc) .gt. 0 .and. nn_dyn3d_dta(ib_obc) .eq. 1 ).or. &
+           &  ( ln_full_vel_array(ib_obc) .and. nn_dyn2d(ib_obc) .gt. 0 ) ) THEN
+            jfld = jfld + 1
+            dta_obc(ib_obc)%u3d => bf(jfld)%fnow(:,1,:)
+            jfld = jfld + 1
+            dta_obc(ib_obc)%v3d => bf(jfld)%fnow(:,1,:)
+         ENDIF
+
+         IF (nn_tra(ib_obc) .gt. 0) THEN
+            IF( nn_tra_dta(ib_obc) .eq. 0 ) THEN
                IF( nn_tra(ib_obc) .eq. jp_frs ) THEN
                   ilen0(1:3) = nblen(1:3)
@@ -607,7 +630,15 @@
                ALLOCATE( dta_obc(ib_obc)%tem(ilen0(1),jpk) )
                ALLOCATE( dta_obc(ib_obc)%sal(ilen0(1),jpk) )
-            ENDIF
-#if defined key_lim2
-            IF (nn_ice_lim2(ib_obc) .gt. 0) THEN
+            ELSE
+               jfld = jfld + 1
+               dta_obc(ib_obc)%tem => bf(jfld)%fnow(:,1,:)
+               jfld = jfld + 1
+               dta_obc(ib_obc)%sal => bf(jfld)%fnow(:,1,:)
+            ENDIF
+         ENDIF
+
+#if defined key_lim2
+         IF (nn_ice_lim2(ib_obc) .gt. 0) THEN
+            IF( nn_ice_lim2_dta(ib_obc) .eq. 0 ) THEN
                IF( nn_ice_lim2(ib_obc) .eq. jp_frs ) THEN
                   ilen0(1:3) = nblen(1:3)
@@ -618,50 +649,5 @@
                ALLOCATE( dta_obc(ib_obc)%u2d(ilen0(1)) )
                ALLOCATE( dta_obc(ib_obc)%v2d(ilen0(1)) )
-            ENDIF
-#endif
-
-         ELSE
-
-            ! nn_dtactl = 1
-            ! Set boundary data arrays to point to "fnow" arrays
-            !---------------------------------------------------
-            IF (nn_dyn2d(ib_obc) .gt. 0) THEN
-               IF( nn_dyn2d(ib_obc) .ne. jp_frs .and. nn_tides(ib_obc) .ne. 1 ) THEN
-                  jfld = jfld + 1
-                  dta_obc(ib_obc)%ssh => bf(jfld)%fnow(:,1,1)
-               ENDIF
-               IF( ln_full_vel_array(ib_obc) .or. nn_tides(ib_obc) .eq. 1 ) THEN
-                  ! In this case we need space but we aren't reading it 
-                  ! directly from the external file. 
-                  IF( nn_dyn2d(ib_obc) .eq. jp_frs ) THEN
-                     ilen0(:) = nblen(:)
-                  ELSE
-                     ilen0(:) = nblenrim(:)
-                  ENDIF
-                  IF( nn_tides(ib_obc) .eq. 1 ) ALLOCATE( dta_obc(ib_obc)%ssh(ilen0(1)) )
-                  ALLOCATE( dta_obc(ib_obc)%u2d(ilen0(2)) )
-                  ALLOCATE( dta_obc(ib_obc)%v2d(ilen0(3)) )
-               ELSE
-                  jfld = jfld + 1
-                  dta_obc(ib_obc)%u2d => bf(jfld)%fnow(:,1,1)
-                  jfld = jfld + 1
-                  dta_obc(ib_obc)%v2d => bf(jfld)%fnow(:,1,1)
-               ENDIF
-            ENDIF
-            IF (nn_dyn3d(ib_obc) .gt. 0 .or. &
-              &  ( ln_full_vel_array(ib_obc) .and. nn_dyn2d(ib_obc) .gt. 0 ) ) THEN
-               jfld = jfld + 1
-               dta_obc(ib_obc)%u3d => bf(jfld)%fnow(:,1,:)
-               jfld = jfld + 1
-               dta_obc(ib_obc)%v3d => bf(jfld)%fnow(:,1,:)
-            ENDIF
-            IF (nn_tra(ib_obc) .gt. 0) THEN
-               jfld = jfld + 1
-               dta_obc(ib_obc)%tem => bf(jfld)%fnow(:,1,:)
-               jfld = jfld + 1
-               dta_obc(ib_obc)%sal => bf(jfld)%fnow(:,1,:)
-            ENDIF
-#if defined key_lim2
-            IF (nn_ice_lim2(ib_obc) .gt. 0) THEN
+            ELSE
                jfld = jfld + 1
                dta_obc(ib_obc)%frld  => bf(jfld)%fnow(:,1,1)
@@ -671,7 +657,6 @@
                dta_obc(ib_obc)%hsnif => bf(jfld)%fnow(:,1,1)
             ENDIF
-#endif
-
-         ENDIF ! nn_dtactl .eq. 0
+         ENDIF
+#endif
 
       ENDDO ! ib_obc 
Index: branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90
===================================================================
--- branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90	(revision 2830)
+++ branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90	(revision 2831)
@@ -67,10 +67,10 @@
       !!
       NAMELIST/namobc/ nb_obc, ln_coords_file, cn_coords_file,             &
-         &             ln_mask_file, cn_mask_file, nn_dyn2d, nn_dyn3d,     &
-         &             nn_tra,                                             &
+         &             ln_mask_file, cn_mask_file, nn_dyn2d, nn_dyn2d_dta, &
+         &             nn_dyn3d, nn_dyn3d_dta, nn_tra, nn_tra_dta,         &  
 #if defined key_lim2
-         &             nn_ice_lim2,                                        &
+         &             nn_ice_lim2, nn_ice_lim2_dta,                       &
 #endif
-         &             nn_tides, ln_vol, ln_clim, nn_dtactl, nn_volctl,    &
+         &             nn_tides, ln_vol, ln_clim, nn_volctl,               &
          &             nn_rimwidth, nn_dmp2d_in, nn_dmp2d_out,             &
          &             nn_dmp3d_in, nn_dmp3d_out
@@ -87,5 +87,5 @@
          &                               ' and general open boundary condition are not compatible' )
 
-      cgrid= (/'T','U','V'/)
+      cgrid= (/'t','u','v'/)
 
       ! -----------------------------------------
@@ -99,12 +99,15 @@
       cn_mask_file(:)   = ''
       nn_dyn2d(:)       = 0
+      nn_dyn2d_dta(:)   = -1  ! uninitialised flag
       nn_dyn3d(:)       = 0
+      nn_dyn3d_dta(:)   = -1  ! uninitialised flag
       nn_tra(:)         = 0
+      nn_tra_dta(:)     = -1  ! uninitialised flag
 #if defined key_lim2
       nn_ice_lim2(:)    = 0
+      nn_ice_lim2_dta(:)= -1  ! uninitialised flag
 #endif
       ln_vol            = .false.
       ln_clim(:)        = .false.
-      nn_dtactl(:)      = -1  ! uninitialised flag
       nn_tides(:)       =  0  ! default to no tidal forcing
       nn_volctl         = -1  ! uninitialised flag
@@ -135,12 +138,4 @@
         IF(lwp) WRITE(numout,*) '------ Open boundary data set ',ib_obc,'------' 
 
-        !                                         ! check type of data used (nn_dtactl value)
-        SELECT CASE( nn_dtactl(ib_obc) )                   ! 
-          CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for obc data'        
-          CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file'
-          CASE DEFAULT   ;   CALL ctl_stop( 'nn_dtactl must be 0 or 1' )
-        END SELECT
-        IF(lwp) WRITE(numout,*)
-
         IF(lwp) WRITE(numout,*) 'Boundary conditions for barotropic solution:  '
         SELECT CASE( nn_dyn2d(ib_obc) )                  
@@ -150,4 +145,11 @@
           CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_dyn2d' )
         END SELECT
+        IF( nn_dyn2d(ib_obc) .gt. 0 ) THEN
+           SELECT CASE( nn_dyn2d_dta(ib_obc) )                   ! 
+              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for obc data'        
+              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file'
+              CASE DEFAULT   ;   CALL ctl_stop( 'nn_dyn2d_dta must be 0 or 1' )
+           END SELECT
+        ENDIF
         IF(lwp) WRITE(numout,*)
 
@@ -158,4 +160,11 @@
           CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_dyn3d' )
         END SELECT
+        IF( nn_dyn3d(ib_obc) .gt. 0 ) THEN
+           SELECT CASE( nn_dyn3d_dta(ib_obc) )                   ! 
+              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for obc data'        
+              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file'
+              CASE DEFAULT   ;   CALL ctl_stop( 'nn_dyn3d_dta must be 0 or 1' )
+           END SELECT
+        ENDIF
         IF(lwp) WRITE(numout,*)
 
@@ -166,13 +175,27 @@
           CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_tra' )
         END SELECT
+        IF( nn_tra(ib_obc) .gt. 0 ) THEN
+           SELECT CASE( nn_tra_dta(ib_obc) )                   ! 
+              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for obc data'        
+              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file'
+              CASE DEFAULT   ;   CALL ctl_stop( 'nn_tra_dta must be 0 or 1' )
+           END SELECT
+        ENDIF
         IF(lwp) WRITE(numout,*)
 
 #if defined key_lim2
         IF(lwp) WRITE(numout,*) 'Boundary conditions for sea ice:  '
-        SELECT CASE( nn_tra(ib_obc) )                  
+        SELECT CASE( nn_ice_lim2(ib_obc) )                  
           CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      no open boundary condition'        
           CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      Flow Relaxation Scheme'
           CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_tra' )
         END SELECT
+        IF( nn_ice_lim2(ib_obc) .gt. 0 ) THEN 
+           SELECT CASE( nn_ice_lim2_dta(ib_obc) )                   ! 
+              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for obc data'        
+              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file'
+              CASE DEFAULT   ;   CALL ctl_stop( 'nn_ice_lim2_dta must be 0 or 1' )
+           END SELECT
+        ENDIF
         IF(lwp) WRITE(numout,*)
 #endif
@@ -255,5 +278,5 @@
          IF( .NOT. ln_coords_file(ib_obc) ) THEN ! Calculate global index arrays from namelist parameters
 
-           !! Calculate global index arrays from namelist parameters
+            !! Calculate global index arrays from namelist parameters
 
          ELSE            ! Read global index arrays from boundary coordinates file.
