Index: branches/DEV_r1784_3DF/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- branches/DEV_r1784_3DF/NEMO/OPA_SRC/SBC/fldread.F90	(revision 2051)
+++ branches/DEV_r1784_3DF/NEMO/OPA_SRC/SBC/fldread.F90	(revision 2125)
@@ -78,6 +78,6 @@
       INTEGER, DIMENSION(:,:,:), POINTER      ::   data_jpj     ! array of source integers
       REAL(wp), DIMENSION(:,:,:), POINTER     ::   data_wgt     ! array of weights on model grid
-      REAL(wp), DIMENSION(:,:,:), POINTER     ::   fly_dta      ! array of values on input grid
-      REAL(wp), DIMENSION(:,:,:), POINTER     ::   col2         ! temporary array for reading in columns
+      REAL(wp), DIMENSION(:,:,:), POINTER       ::   fly_dta      ! array of values on input grid
+      REAL(wp), DIMENSION(:,:,:), POINTER       ::   col2         ! temporary array for reading in columns
    END TYPE WGT
 
@@ -146,5 +146,5 @@
 !CDIR COLLAPSE
                sd(jf)%fdta(:,:,:,1) = sd(jf)%fdta(:,:,:,2)
-               sd(jf)%rotn(1)       = sd(jf)%rotn(2)
+               sd(jf)%rotn(1)     = sd(jf)%rotn(2)
             ENDIF
 
@@ -209,12 +209,24 @@
             IF( LEN(TRIM(sd(jf)%wgtname)) > 0 ) THEN
                CALL wgt_list( sd(jf), kw )
-               ipk =  SIZE(sd(jf)%fdta,3)
-               CALL fld_interp( sd(jf)%num, sd(jf)%clvar , kw , ipk, sd(jf)%fdta(:,:,:,2) , sd(jf)%nrec_a(1) )
+               ipk = SIZE(sd(jf)%fnow,3)
+               IF( sd(jf)%ln_tint ) THEN
+                  CALL fld_interp( sd(jf)%num, sd(jf)%clvar , kw , ipk, sd(jf)%fdta(:,:,:,2) , sd(jf)%nrec_a(1) )
+               ELSE
+                  CALL fld_interp( sd(jf)%num, sd(jf)%clvar , kw , ipk, sd(jf)%fnow(:,:,:)   , sd(jf)%nrec_a(1) )
+               ENDIF
             ELSE
-               SELECT CASE( SIZE(sd(jf)%fdta,3) )
-               CASE(1)
-                  CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,1,2), sd(jf)%nrec_a(1) )
+               SELECT CASE( SIZE(sd(jf)%fnow,3) )
+               CASE(1)   
+                  IF( sd(jf)%ln_tint ) THEN
+                     CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,1,2), sd(jf)%nrec_a(1) )
+                  ELSE
+                     CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fnow(:,:,1)  , sd(jf)%nrec_a(1) )
+                  ENDIF 
                CASE(jpk)
-                  CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,:,2), sd(jf)%nrec_a(1) )
+                  IF( sd(jf)%ln_tint ) THEN
+                     CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,:,2), sd(jf)%nrec_a(1) )
+                  ELSE
+                     CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fnow(:,:,:)  , sd(jf)%nrec_a(1) )
+                  ENDIF 
                END SELECT
             ENDIF
@@ -251,5 +263,28 @@
                 IF( kf > 0 ) THEN
                    !! fields jf,kf are two components which need to be rotated together
-                   DO nf = 1,2
+                   IF( sd(jf)%ln_tint )THEN
+                      DO nf = 1,2
+                         !! check each time level of this pair
+                         IF( .NOT. sd(jf)%rotn(nf) .AND. .NOT. sd(kf)%rotn(nf) ) THEN
+                            utmp(:,:) = 0.0
+                            vtmp(:,:) = 0.0
+                            !
+                            ipk = SIZE( sd(kf)%fnow(:,:,:) ,3 )
+                            DO jk = 1,ipk
+                               CALL rot_rep( sd(jf)%fdta(:,:,jk,nf),sd(kf)%fdta(:,:,jk,nf),'T', 'en->i', utmp(:,:) )
+                               CALL rot_rep( sd(jf)%fdta(:,:,jk,nf),sd(kf)%fdta(:,:,jk,nf),'T', 'en->j', vtmp(:,:) )
+                               sd(jf)%fdta(:,:,jk,nf) = utmp(:,:)
+                               sd(kf)%fdta(:,:,jk,nf) = vtmp(:,:)
+                            ENDDO
+                            !
+                            sd(jf)%rotn(nf) = .TRUE.
+                            sd(kf)%rotn(nf) = .TRUE.
+                            IF( lwp .AND. kt == nit000 ) &
+                                      WRITE(numout,*) 'fld_read: vector pair (',  &
+                                                      TRIM(sd(jf)%clvar),',',TRIM(sd(kf)%clvar), &
+                                                      ') rotated on to model grid'
+                         ENDIF
+                      END DO
+                   ELSE 
                       !! check each time level of this pair
                       IF( .NOT. sd(jf)%rotn(nf) .AND. .NOT. sd(kf)%rotn(nf) ) THEN
@@ -257,11 +292,11 @@
                          vtmp(:,:) = 0.0
                          !
-                         ipk = SIZE( sd(kf)%fdta(:,:,:,nf) ,3 )
+                         ipk = SIZE( sd(kf)%fnow(:,:,:) ,3 )
                          DO jk = 1,ipk
-                            CALL rot_rep( sd(jf)%fdta(:,:,jk,nf),sd(kf)%fdta(:,:,jk,nf),'T', 'en->i', utmp(:,:) )
-                            CALL rot_rep( sd(jf)%fdta(:,:,jk,nf),sd(kf)%fdta(:,:,jk,nf),'T', 'en->j', vtmp(:,:) )
-                            sd(jf)%fdta(:,:,jk,nf) = utmp(:,:)
-                            sd(kf)%fdta(:,:,jk,nf) = vtmp(:,:)
-                         END DO
+                            CALL rot_rep( sd(jf)%fnow(:,:,jk),sd(kf)%fnow(:,:,jk),'T', 'en->i', utmp(:,:) )
+                            CALL rot_rep( sd(jf)%fnow(:,:,jk),sd(kf)%fnow(:,:,jk),'T', 'en->j', vtmp(:,:) )
+                            sd(jf)%fnow(:,:,jk) = utmp(:,:)
+                            sd(kf)%fnow(:,:,jk) = vtmp(:,:)
+                         ENDDO
                          !
                          sd(jf)%rotn(nf) = .TRUE.
@@ -272,5 +307,5 @@
                                                    ') rotated on to model grid'
                       ENDIF
-                   END DO
+                   ENDIF
                 ENDIF
              ENDIF
@@ -304,6 +339,4 @@
                ENDIF
 !CDIR COLLAPSE
-               sd(jf)%fnow(:,:,:) = sd(jf)%fdta(:,:,:,2)   ! piecewise constant field
- 
             ENDIF
             !
@@ -405,13 +438,28 @@
          IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN
             CALL wgt_list( sdjf, kwgt )
-            ipk = SIZE(sdjf%fdta,3)
-            CALL fld_interp( sdjf%num, sdjf%clvar, kwgt, ipk, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1) )
+            ipk = SIZE(sdjf%fnow,3)
+            IF( sdjf%ln_tint ) THEN
+               CALL fld_interp( sdjf%num, sdjf%clvar, kwgt, ipk, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1) )
+            ELSE
+               CALL fld_interp( sdjf%num, sdjf%clvar, kwgt, ipk, sdjf%fnow(:,:,:)  , sdjf%nrec_a(1) )
+            ENDIF
          ELSE
-            SELECT CASE ( SIZE(sdjf%fdta,3) )
+            write(narea+200,*)' sdjf%ln_tint SIZE(sdjf%fnow,3) ',sdjf%ln_tint,SIZE(sdjf%fnow,3) ; call flush(narea+200)
+            write(narea+200,*)' SIZE(sdjf%fdta,3)  SIZE(sdjf%fdta,4) ',SIZE(sdjf%fdta,3),SIZE(sdjf%fdta,4)  ; call flush(narea+200)
+            SELECT CASE( SIZE(sdjf%fnow,3) )
             CASE(1)
-                CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_b(1) )
+               IF( sdjf%ln_tint ) THEN
+                  CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_b(1) )
+               ELSE
+                  CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fnow(:,:,1)  , sdjf%nrec_b(1) )
+               ENDIF
             CASE(jpk)
-                CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_b(1) )
+               IF( sdjf%ln_tint ) THEN
+                  CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_b(1) )
+               ELSE
+                  CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fnow(:,:,:)  , sdjf%nrec_b(1) )
+               ENDIF
             END SELECT
+            write(narea+200,*)' test1 ok ' ; call flush(narea+200)
          ENDIF
          sdjf%rotn(2) = .FALSE.
@@ -629,4 +677,5 @@
                &                          ' pairing    : '    , TRIM( sdf(jf)%vcomp      ),   &
                &                          ' data type: '      ,       sdf(jf)%cltype
+            call flush(numout)
          END DO
       ENDIF
@@ -891,5 +940,5 @@
          ! SA: +3 stencil is a patch to avoid out-of-bound computation in some configuration. 
          ! a more robust solution will be given in next release
-         ipk =  SIZE(sd%fdta,3)
+         ipk =  SIZE(sd%fnow,3)
          ALLOCATE( ref_wgts(nxt_wgt)%fly_dta(ref_wgts(nxt_wgt)%jpiwgt+3, ref_wgts(nxt_wgt)%jpjwgt+3 ,ipk) )
          IF( ref_wgts(nxt_wgt)%cyclic ) ALLOCATE( ref_wgts(nxt_wgt)%col2(2,ref_wgts(nxt_wgt)%jpjwgt+3,ipk) )
@@ -912,17 +961,17 @@
       !! ** Method  :   
       !!----------------------------------------------------------------------
-      INTEGER,          INTENT(in)                           ::   num                 ! stream number
-      CHARACTER(LEN=*), INTENT(in)                           ::   clvar               ! variable name
-      INTEGER,          INTENT(in)                           ::   kw                  ! weights number
-      INTEGER,          INTENT(in)                           ::   kk                  ! vertical dimension of kk
-      REAL(wp),         INTENT(inout), DIMENSION(jpi,jpj,kk) ::   dta                 ! output field on model grid
-      INTEGER,          INTENT(in)                           ::   nrec                ! record number to read (ie time slice)
+      INTEGER,          INTENT(in)                        ::   num                 ! stream number
+      CHARACTER(LEN=*), INTENT(in)                        ::   clvar               ! variable name
+      INTEGER,          INTENT(in)                        ::   kw                  ! weights number
+      INTEGER,          INTENT(in)                        ::   kk                  ! vertical dimension of kk
+      REAL(wp),         INTENT(inout), DIMENSION(jpi,jpj,kk) ::   dta              ! output field on model grid
+      INTEGER,          INTENT(in)                        ::   nrec                ! record number to read (ie time slice)
       !! 
-      INTEGER, DIMENSION(3)                                  ::   rec1,recn           ! temporary arrays for start and length
-      INTEGER                                                ::  jk, jn, jm           ! loop counters
-      INTEGER                                                ::  ni, nj               ! lengths
-      INTEGER                                                ::  jpimin,jpiwid        ! temporary indices
-      INTEGER                                                ::  jpjmin,jpjwid        ! temporary indices
-      INTEGER                                                ::  jpi1,jpi2,jpj1,jpj2  ! temporary indices
+      INTEGER, DIMENSION(3)                               ::   rec1,recn           ! temporary arrays for start and length
+      INTEGER                                             ::  jk, jn, jm           ! loop counters
+      INTEGER                                             ::  ni, nj               ! lengths
+      INTEGER                                             ::  jpimin,jpiwid        ! temporary indices
+      INTEGER                                             ::  jpjmin,jpjwid        ! temporary indices
+      INTEGER                                             ::  jpi1,jpi2,jpj1,jpj2  ! temporary indices
       !!----------------------------------------------------------------------
       !
