Index: trunk/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/fldread.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/fldread.F90	(revision 1730)
@@ -24,12 +24,12 @@
 
    TYPE, PUBLIC ::   FLD_N      !: Namelist field informations
-      CHARACTER(len = 34) ::   clname      ! generic name of the NetCDF flux file
-      REAL(wp)            ::   freqh       ! frequency of each flux file
-      CHARACTER(len = 34) ::   clvar       ! generic name of the variable in the NetCDF flux file
-      LOGICAL             ::   ln_tint     ! time interpolation or not (T/F)
-      LOGICAL             ::   ln_clim     ! climatology or not (T/F)
-      CHARACTER(len = 7)  ::   cltype      ! type of data file 'daily', 'monthly' or yearly'
-      CHARACTER(len = 34) ::   wname       ! generic name of a NetCDF weights file to be used, blank if not
-      CHARACTER(len = 34) ::   vcomp       ! symbolic component name if a vector that needs rotation
+      CHARACTER(len = 256) ::   clname      ! generic name of the NetCDF flux file
+      INTEGER              ::   nfreqh      ! frequency of each flux file
+      CHARACTER(len = 34)  ::   clvar       ! generic name of the variable in the NetCDF flux file
+      LOGICAL              ::   ln_tint     ! time interpolation or not (T/F)
+      LOGICAL              ::   ln_clim     ! climatology or not (T/F)
+      CHARACTER(len = 7)   ::   cltype      ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 34)  ::   wname       ! generic name of a NetCDF weights file to be used, blank if not
+      CHARACTER(len = 34)  ::   vcomp       ! symbolic component name if a vector that needs rotation
                                            ! a string starting with "U" or "V" for each component   
                                            ! chars 2 onwards identify which components go together  
@@ -39,5 +39,5 @@
       CHARACTER(len = 256)            ::   clrootname   ! generic name of the NetCDF file
       CHARACTER(len = 256)            ::   clname       ! current name of the NetCDF file
-      REAL(wp)                        ::   freqh        ! frequency of each flux file
+      INTEGER                         ::   nfreqh       ! frequency of each flux file
       CHARACTER(len = 34)             ::   clvar        ! generic name of the variable in the NetCDF flux file
       LOGICAL                         ::   ln_tint      ! time interpolation or not (T/F)
@@ -45,7 +45,7 @@
       CHARACTER(len = 7)              ::   cltype       ! type of data file 'daily', 'monthly' or yearly'
       INTEGER                         ::   num          ! iom id of the jpfld files to be read
-      REAL(wp)                        ::   swap_sec     ! swapping time in second since Jan. 1st 00h of nit000 year
-      REAL(wp) , DIMENSION(2)         ::   rec_b        ! before record (1: index, 2: second since Jan. 1st 00h of nit000 year
-      REAL(wp) , DIMENSION(2)         ::   rec_a        ! after  record (1: index, 2: second since Jan. 1st 00h of nit000 year
+      INTEGER                         ::   nswap_sec    ! swapping time in second since Jan. 1st 00h of nit000 year
+      INTEGER , DIMENSION(2)          ::   nrec_b       ! before record (1: index, 2: second since Jan. 1st 00h of nit000 year)
+      INTEGER , DIMENSION(2)          ::   nrec_a       ! after  record (1: index, 2: second since Jan. 1st 00h of nit000 year)
       REAL(wp) , ALLOCATABLE, DIMENSION(:,:)   ::   fnow         ! input fields interpolated to now time step
       REAL(wp) , ALLOCATABLE, DIMENSION(:,:,:) ::   fdta         ! 2 consecutive record of input fields
@@ -121,6 +121,6 @@
       INTEGER  ::   jf         ! dummy indices
       INTEGER  ::   kw         ! index into wgts array
-      REAL(wp) ::   zreclast   ! last record to be read in the current year file
-      REAL(wp) ::   zsecend    ! number of second since Jan. 1st 00h of nit000 year at nitend
+      INTEGER  ::   ireclast   ! last record to be read in the current year file
+      INTEGER  ::   isecend    ! number of second since Jan. 1st 00h of nit000 year at nitend
       LOGICAL  ::   llnxtyr    ! open next year  file?
       LOGICAL  ::   llnxtmth   ! open next month file?
@@ -139,5 +139,5 @@
          !
          ! read/update the after data?
-         IF( rsec_year + sec1jan000 > sd(jf)%swap_sec ) THEN 
+         IF( nsec_year + nsec1jan000 > sd(jf)%nswap_sec ) THEN 
 
             IF( sd(jf)%ln_tint ) THEN         ! time interpolation: swap before record field
@@ -153,20 +153,20 @@
             IF( sd(jf)%ln_tint ) THEN
                ! if we do time interpolation we will need to open next year/month/day file before the end of the current one
-               ! if so, we are still before the end of the year/month/day when calling fld_rec so sd(jf)%rec_a(1) will be
+               ! if so, we are still before the end of the year/month/day when calling fld_rec so sd(jf)%nrec_a(1) will be
                ! larger than the record number that should be read for current year/month/day (for ex. 13 for monthly mean file)
 
                ! last record to be read in the current file
-               IF( sd(jf)%freqh == -1. ) THEN             ;   zreclast = 12.
+               IF( sd(jf)%nfreqh == -1 ) THEN                  ;   ireclast = 12
                ELSE                             
-                  IF(     sd(jf)%cltype == 'monthly'   ) THEN  ;   zreclast = 24. / sd(jf)%freqh * REAL( nmonth_len(nmonth), wp )
-                  ELSEIF( sd(jf)%cltype == 'daily'     ) THEN  ;   zreclast = 24. / sd(jf)%freqh
-                  ELSE                                         ;   zreclast = 24. / sd(jf)%freqh * REAL( nyear_len(     1 ), wp )
+                  IF(     sd(jf)%cltype == 'monthly'   ) THEN  ;   ireclast = 24 * nmonth_len(nmonth) / sd(jf)%nfreqh 
+                  ELSEIF( sd(jf)%cltype == 'daily'     ) THEN  ;   ireclast = 24                      / sd(jf)%nfreqh
+                  ELSE                                         ;   ireclast = 24 * nyear_len(     1 ) / sd(jf)%nfreqh 
                   ENDIF
                ENDIF
               
                ! do we need next file data?
-               IF( sd(jf)%rec_a(1) > zreclast ) THEN
-
-                  sd(jf)%rec_a(1) = 1.              ! force to read the first record of the next file
+               IF( sd(jf)%nrec_a(1) > ireclast ) THEN
+
+                  sd(jf)%nrec_a(1) = 1              ! force to read the first record of the next file
 
                   IF( .NOT. sd(jf)%ln_clim ) THEN   ! close the current file and open a new one.
@@ -177,6 +177,6 @@
                      ! if the run finishes at the end of the current year/month/day, we will allow next year/month/day file to be
                      ! not present. If the run continue further than the current year/month/day, next year/month/day file must exist
-                     zsecend = rsec_year + sec1jan000 + REAL(nitend - kt, wp) * rdttra(1)   ! second at the end of the run 
-                     llstop = zsecend > sd(jf)%swap_sec                                 ! read more than 1 record of next year
+                     isecend = nsec_year + nsec1jan000 + (nitend - kt) * NINT(rdttra(1))   ! second at the end of the run 
+                     llstop = isecend > sd(jf)%nswap_sec                                   ! read more than 1 record of next year
 
                      CALL fld_clopn( sd(jf), nyear  + COUNT((/llnxtyr /))                                           ,         &
@@ -188,5 +188,5 @@
                                 &     ' not present -> back to current year/month/day')
                         CALL fld_clopn( sd(jf), nyear, nmonth, nday )       ! back to the current year/month/day
-                        sd(jf)%rec_a(1) = zreclast     ! force to read the last record to be read in the current year file
+                        sd(jf)%nrec_a(1) = ireclast     ! force to read the last record to be read in the current year file
                      ENDIF
 
@@ -197,6 +197,6 @@
                ! if we are not doing time interpolation, we must change the year/month/day of the file just after switching
                ! to the NEW year/month/day. If it is the case, we are at the beginning of the year/month/day when calling 
-               ! fld_rec so sd(jf)%rec_a(1) = 1
-               IF( sd(jf)%rec_a(1) == 1 .AND. .NOT. sd(jf)%ln_clim )   CALL fld_clopn( sd(jf), nyear, nmonth, nday )
+               ! fld_rec so sd(jf)%nrec_a(1) = 1
+               IF( sd(jf)%nrec_a(1) == 1 .AND. .NOT. sd(jf)%ln_clim )   CALL fld_clopn( sd(jf), nyear, nmonth, nday )
             ENDIF
 
@@ -204,7 +204,7 @@
             IF( LEN(TRIM(sd(jf)%wgtname)) > 0 ) THEN
                CALL wgt_list( sd(jf), kw )
-               CALL fld_interp( sd(jf)%num, sd(jf)%clvar, kw, sd(jf)%fdta(:,:,2), NINT( sd(jf)%rec_a(1) ) )
+               CALL fld_interp( sd(jf)%num, sd(jf)%clvar, kw, sd(jf)%fdta(:,:,2), sd(jf)%nrec_a(1) )
             ELSE
-               CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,2), NINT( sd(jf)%rec_a(1) ) )
+               CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,2), sd(jf)%nrec_a(1) )
             ENDIF
             sd(jf)%rotn(2) = .FALSE.
@@ -274,8 +274,8 @@
                      &    "' records b/a: ', i4.4, '/', i4.4, ' (', f7.2,'/', f7.2, ' days)')"
                   WRITE(numout, clfmt)  TRIM( sd(jf)%clvar ), kt, nyear, nmonth, nday,   &
-                     & NINT(sd(jf)%rec_b(1)), NINT(sd(jf)%rec_a(1)), sd(jf)%rec_b(2)/rday, sd(jf)%rec_a(2)/rday
+                     & sd(jf)%nrec_b(1), sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday
                ENDIF
                !
-               ztinta =  ( rsec_year + sec1jan000 - sd(jf)%rec_b(2) ) / ( sd(jf)%rec_a(2) - sd(jf)%rec_b(2) )
+               ztinta =  REAL( nsec_year + nsec1jan000 - sd(jf)%nrec_b(2), wp ) / REAL( sd(jf)%nrec_a(2) - sd(jf)%nrec_b(2), wp )
                ztintb =  1. - ztinta
 !CDIR COLLAPSE
@@ -285,5 +285,5 @@
                   clfmt = "('fld_read: var ', a, ' kt = ', i8,' Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
                      &    "' record: ', i4.4, ' at ', f7.2, ' day')"
-                  WRITE(numout, clfmt)  TRIM(sd(jf)%clvar), kt, nyear, nmonth, nday, NINT(sd(jf)%rec_a(1)), sd(jf)%rec_a(2)/rday
+                  WRITE(numout, clfmt) TRIM(sd(jf)%clvar), kt, nyear, nmonth, nday, sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_a(2),wp)/rday
                ENDIF
 !CDIR COLLAPSE
@@ -335,26 +335,26 @@
       IF( sdjf%ln_tint ) THEN ! we need to read the previous record and we will put it in the current record structure
          
-         IF( sdjf%rec_b(1) == 0.e0 ) THEN   ! we redefine record sdjf%rec_b(1) with the last record of previous year file
-            IF( sdjf%freqh == -1. ) THEN    ! monthly mean
+         IF( sdjf%nrec_b(1) == 0  ) THEN   ! we redefine record sdjf%nrec_b(1) with the last record of previous year file
+            IF( sdjf%nfreqh == -1 ) THEN   ! monthly mean
                IF( sdjf%cltype == 'monthly' ) THEN   ! monthly file
-                  sdjf%rec_b(1) = 1.                                                       ! force to read the unique record
+                  sdjf%nrec_b(1) = 1                                                       ! force to read the unique record
                   llprevmth = .NOT. sdjf%ln_clim                                           ! use previous month file?
                   llprevyr  = llprevmth .AND. nmonth == 1                                  ! use previous year  file?
                ELSE                                  ! yearly file
-                  sdjf%rec_b(1) = 12.                                                      ! force to read december mean
+                  sdjf%nrec_b(1) = 12                                                      ! force to read december mean
                   llprevyr = .NOT. sdjf%ln_clim                                            ! use previous year  file?
                ENDIF
             ELSE   
                IF( sdjf%cltype == 'monthly' ) THEN   ! monthly file
-                  sdjf%rec_b(1) = 24. / sdjf%freqh * REAL( nmonth_len(nmonth-1), wp )      ! last record of previous month
+                  sdjf%nrec_b(1) = 24 * nmonth_len(nmonth-1) / sdjf%nfreqh                 ! last record of previous month
                   llprevmth = .NOT. sdjf%ln_clim                                           ! use previous month file?
                   llprevyr  = llprevmth .AND. nmonth == 1                                  ! use previous year  file?
                ELSEIF( sdjf%cltype == 'daily' ) THEN ! daily file
-                  sdjf%rec_b(1) = 24. / sdjf%freqh                                         ! last record of previous day
+                  sdjf%nrec_b(1) = 24 / sdjf%nfreqh                                        ! last record of previous day
                   llprevday = .NOT. sdjf%ln_clim                                           ! use previous day   file?
                   llprevmth = llprevday .AND. nday   == 1                                  ! use previous month file?
                   llprevyr  = llprevmth .AND. nmonth == 1                                  ! use previous year  file?
                ELSE                                  ! yearly file
-                  sdjf%rec_b(1) = 24. / sdjf%freqh * REAL( nyear_len(0), wp )              ! last record of year month
+                  sdjf%nrec_b(1) = 24 * nyear_len(0) / sdjf%nfreqh                         ! last record of year month
                   llprevyr = .NOT. sdjf%ln_clim                                            ! use previous year  file?
                ENDIF
@@ -372,13 +372,13 @@
             ! we force to read the first record of the current year/month/day instead of last record of previous year/month/day
             llprev = .false.
-            sdjf%rec_b(1) = 1.
+            sdjf%nrec_b(1) = 1
             CALL fld_clopn( sdjf, nyear, nmonth, nday )
          ENDIF
          
-         IF( llprev ) THEN   ! check if the last record sdjf%rec_n(1) exists in the file
+         IF( llprev ) THEN   ! check if the last record sdjf%nrec_n(1) exists in the file
             idvar = iom_varid( sdjf%num, sdjf%clvar )                                        ! id of the variable sdjf%clvar
             IF( idvar <= 0 )   RETURN
             inrec = iom_file( sdjf%num )%dimsz( iom_file( sdjf%num )%ndims(idvar), idvar )   ! size of the last dim of idvar
-            sdjf%rec_b(1) = MIN( sdjf%rec_b(1), REAL( inrec, wp ) )   ! make sure we select an existing record
+            sdjf%nrec_b(1) = MIN( sdjf%nrec_b(1), inrec )   ! make sure we select an existing record
          ENDIF
 
@@ -386,12 +386,12 @@
          IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN
             CALL wgt_list( sdjf, kwgt )
-            CALL fld_interp( sdjf%num, sdjf%clvar, kwgt, sdjf%fdta(:,:,2), NINT( sdjf%rec_b(1) ) )
+            CALL fld_interp( sdjf%num, sdjf%clvar, kwgt, sdjf%fdta(:,:,2), sdjf%nrec_b(1) )
          ELSE
-            CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,2), NINT( sdjf%rec_b(1) ) )
+            CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,2), sdjf%nrec_b(1) )
          ENDIF
          sdjf%rotn(2) = .FALSE.
 
          clfmt = "('fld_init : time-interpolation for ', a, ' read previous record = ', i4, ' at time = ', f7.2, ' days')"
-         IF(lwp) WRITE(numout, clfmt) TRIM(sdjf%clvar), NINT(sdjf%rec_b(1)), sdjf%rec_b(2)/rday
+         IF(lwp) WRITE(numout, clfmt) TRIM(sdjf%clvar), sdjf%nrec_b(1), REAL(sdjf%nrec_b(2),wp)/rday
 
          IF( llprev )   CALL iom_close( sdjf%num )   ! close previous year file (-> redefine sdjf%num to 0)
@@ -401,5 +401,5 @@
       IF( sdjf%num == 0 )   CALL fld_clopn( sdjf, nyear, nmonth, nday )   ! make sure current year/month/day file is opened
 
-      sdjf%swap_sec = rsec_year + sec1jan000 - 1.   ! force read/update the after data in the following part of fld_read 
+      sdjf%nswap_sec = nsec_year + nsec1jan000 - 1   ! force read/update the after data in the following part of fld_read 
       
    END SUBROUTINE fld_init
@@ -410,5 +410,5 @@
       !!                    ***  ROUTINE fld_rec  ***
       !!
-      !! ** Purpose :   compute rec_a, rec_b and swap_sec
+      !! ** Purpose :   compute nrec_a, nrec_b and nswap_sec
       !!
       !! ** Method  :   
@@ -417,10 +417,10 @@
       !!
       INTEGER  ::   irec        ! record number
-      REAL(wp) ::   zrec        ! record number
+      INTEGER  ::   isecd       ! rday
       REAL(wp) ::   ztmp        ! temporary variable
-      REAL(wp) ::   zfreq_sec   ! frequency mean (in seconds)
+      INTEGER  ::   ifreq_sec   ! frequency mean (in seconds)
       !!----------------------------------------------------------------------
       !
-      IF( sdjf%freqh == -1. ) THEN      ! monthly mean
+      IF( sdjf%nfreqh == -1 ) THEN      ! monthly mean
          !
          IF( sdjf%ln_tint ) THEN                 ! time interpolation, shift by 1/2 record
@@ -442,19 +442,19 @@
          irec = nmonth + INT( ztmp )
 
-         IF( sdjf%ln_tint ) THEN   ;   sdjf%swap_sec = rmonth_half(irec) + sec1jan000   ! swap at the middle of the month
-         ELSE                      ;   sdjf%swap_sec = rmonth_end( irec) + sec1jan000   ! swap at the end    of the month
-         ENDIF
-
-         sdjf%rec_a(:) = (/ REAL( irec, wp ), rmonth_half(irec) + sec1jan000 /)   ! define after  record number and time
-         irec = irec - 1                                                          ! move back to previous record
-         sdjf%rec_b(:) = (/ REAL( irec, wp ), rmonth_half(irec) + sec1jan000 /)   ! define before record number and time
+         IF( sdjf%ln_tint ) THEN   ;   sdjf%nswap_sec = nmonth_half(irec) + nsec1jan000   ! swap at the middle of the month
+         ELSE                      ;   sdjf%nswap_sec = nmonth_end (irec) + nsec1jan000   ! swap at the end    of the month
+         ENDIF
+
+         sdjf%nrec_a(:) = (/ irec, nmonth_half(irec) + nsec1jan000 /)   ! define after  record number and time
+         irec = irec - 1                                                ! move back to previous record
+         sdjf%nrec_b(:) = (/ irec, nmonth_half(irec) + nsec1jan000 /)   ! define before record number and time
          !
-      ELSE                          ! higher frequency mean (in hours)
+      ELSE                              ! higher frequency mean (in hours)
          !
-         zfreq_sec = sdjf%freqh * 3600.   ! frequency mean (in seconds)
+         ifreq_sec = sdjf%nfreqh * 3600   ! frequency mean (in seconds)
          ! number of second since the beginning of the file
-         IF(     sdjf%cltype == 'monthly' ) THEN   ;   ztmp = rsec_month   ! since 00h on the first day of the current month
-         ELSEIF( sdjf%cltype == 'daily'   ) THEN   ;   ztmp = rsec_day     ! since 00h of the current day
-         ELSE                                      ;   ztmp = rsec_year    ! since 00h on Jan 1 of the current year
+         IF(     sdjf%cltype == 'monthly' ) THEN   ;   ztmp = REAL(nsec_month,wp)   ! since 00h on the 1st day of the current month
+         ELSEIF( sdjf%cltype == 'daily'   ) THEN   ;   ztmp = REAL(nsec_day  ,wp)   ! since 00h of the current day
+         ELSE                                      ;   ztmp = REAL(nsec_year ,wp)   ! since 00h on Jan 1 of the current year
          ENDIF
          IF( sdjf%ln_tint ) THEN                ! time interpolation, shift by 1/2 record
@@ -466,10 +466,10 @@
             !                    0 |--(              
             !                      |--+--|--+--|--+--|--> time
-            !                      0 /|\ 1 /|\ 2 /|\ 3 (rsec_year/zfreq_sec) or (rsec_month/zfreq_sec)
+            !                      0 /|\ 1 /|\ 2 /|\ 3 (nsec_year/ifreq_sec) or (nsec_month/ifreq_sec)
             !                         |     |     |
             !                         |     |     |
             !       forcing record :  1     2     3
             !                   
-            ztmp= ztmp / zfreq_sec + 0.5
+            ztmp= ztmp / ifreq_sec + 0.5
          ELSE                 
             !
@@ -480,31 +480,32 @@
             !                    0 |-----(              
             !                      |--+--|--+--|--+--|--> time
-            !                      0 /|\ 1 /|\ 2 /|\ 3 (rsec_year/zfreq_sec) or (rsec_month/zfreq_sec)
+            !                      0 /|\ 1 /|\ 2 /|\ 3 (nsec_year/ifreq_sec) or (nsec_month/ifreq_sec)
             !                         |     |     |
             !                         |     |     |
             !       forcing record :  1     2     3
             !                            
-            ztmp= ztmp / zfreq_sec
-         ENDIF
-         zrec = 1. + REAL( INT( ztmp ), wp )
-
+            ztmp= ztmp / ifreq_sec
+         ENDIF
+         irec = 1 + INT( ztmp )
+
+         isecd = NINT(rday)
          ! after record index and second since Jan. 1st 00h of nit000 year
-         sdjf%rec_a(:) = (/ zrec, zfreq_sec * ( zrec - 0.5 ) + sec1jan000 /)
+         sdjf%nrec_a(:) = (/ irec, ifreq_sec * irec - ifreq_sec / 2 + nsec1jan000 /)
          IF( sdjf%cltype == 'monthly' )   &   ! add the number of seconds between 00h Jan 1 and the end of previous month
-            sdjf%rec_a(2) = sdjf%rec_a(2) + rday * REAL(SUM(nmonth_len(1:nmonth -1)), wp)   ! ok if nmonth=1
+            sdjf%nrec_a(2) = sdjf%nrec_a(2) + isecd * SUM(nmonth_len(1:nmonth -1))   ! ok if nmonth=1
          IF( sdjf%cltype == 'daily'   )   &   ! add the number of seconds between 00h Jan 1 and the end of previous day
-            sdjf%rec_a(2) = sdjf%rec_a(2) + rday * ( nday_year - 1 )
+            sdjf%nrec_a(2) = sdjf%nrec_a(2) + isecd * ( nday_year - 1 )
 
          ! before record index and second since Jan. 1st 00h of nit000 year
-         zrec = zrec - 1.                           ! move back to previous record
-         sdjf%rec_b(:) = (/ zrec, zfreq_sec * ( zrec - 0.5 ) + sec1jan000 /)
+         irec = irec - 1.                           ! move back to previous record
+         sdjf%nrec_b(:) = (/ irec, ifreq_sec * irec - ifreq_sec / 2 + nsec1jan000 /)
          IF( sdjf%cltype == 'monthly' )   &   ! add the number of seconds between 00h Jan 1 and the end of previous month
-            sdjf%rec_b(2) = sdjf%rec_b(2) + rday * REAL(SUM(nmonth_len(1:nmonth -1)), wp)   ! ok if nmonth=1
+            sdjf%nrec_b(2) = sdjf%nrec_b(2) + isecd * SUM(nmonth_len(1:nmonth -1))   ! ok if nmonth=1
          IF( sdjf%cltype == 'daily'   )   &   ! add the number of seconds between 00h Jan 1 and the end of previous day
-            sdjf%rec_b(2) = sdjf%rec_b(2) + rday * ( nday_year - 1 )
+            sdjf%nrec_b(2) = sdjf%nrec_b(2) + isecd * ( nday_year - 1 )
 
          ! swapping time in second since Jan. 1st 00h of nit000 year
-         IF( sdjf%ln_tint ) THEN   ;   sdjf%swap_sec =  sdjf%rec_a(2)                     ! swap at the middle of the record
-         ELSE                      ;   sdjf%swap_sec =  sdjf%rec_a(2) + 0.5 * zfreq_sec   ! swap at the end    of the record
+         IF( sdjf%ln_tint ) THEN   ;   sdjf%nswap_sec =  sdjf%nrec_a(2)                     ! swap at the middle of the record
+         ELSE                      ;   sdjf%nswap_sec =  sdjf%nrec_a(2) + ifreq_sec / 2     ! swap at the end    of the record
          ENDIF       
          !
@@ -559,14 +560,13 @@
       DO jf = 1, SIZE(sdf)
          sdf(jf)%clrootname = TRIM( cdir )//TRIM( sdf_n(jf)%clname )
-         sdf(jf)%freqh      = sdf_n(jf)%freqh
+         sdf(jf)%nfreqh     = sdf_n(jf)%nfreqh
          sdf(jf)%clvar      = sdf_n(jf)%clvar
          sdf(jf)%ln_tint    = sdf_n(jf)%ln_tint
          sdf(jf)%ln_clim    = sdf_n(jf)%ln_clim
-         IF( sdf(jf)%freqh == -1. ) THEN   ;    sdf(jf)%cltype = 'yearly'
-         ELSE                              ;    sdf(jf)%cltype = sdf_n(jf)%cltype
+         IF( sdf(jf)%nfreqh == -1. ) THEN   ;   sdf(jf)%cltype = 'yearly'
+         ELSE                               ;   sdf(jf)%cltype = sdf_n(jf)%cltype
          ENDIF
          sdf(jf)%wgtname = " "
-         IF( LEN( TRIM(sdf_n(jf)%wname) ) > 0 )  &
-            sdf(jf)%wgtname = TRIM( cdir )//TRIM( sdf_n(jf)%wname )
+         IF( LEN( TRIM(sdf_n(jf)%wname) ) > 0 )   sdf(jf)%wgtname = TRIM( cdir )//TRIM( sdf_n(jf)%wname )
          sdf(jf)%vcomp   = sdf_n(jf)%vcomp
       END DO
@@ -581,5 +581,5 @@
             WRITE(numout,*) '               root filename: '  , TRIM( sdf(jf)%clrootname ),   &
                &                          ' variable name: '  , TRIM( sdf(jf)%clvar      )
-            WRITE(numout,*) '               frequency: '      ,       sdf(jf)%freqh       ,   &
+            WRITE(numout,*) '               frequency: '      ,       sdf(jf)%nfreqh      ,   &
                &                          ' time interp: '    ,       sdf(jf)%ln_tint     ,   &
                &                          ' climatology: '    ,       sdf(jf)%ln_clim     ,   &
Index: trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 1730)
@@ -140,11 +140,11 @@
          !            !    file     ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
          !            !    name     !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
-         sn_utau = FLD_N( 'utau'    ,    24.    ,  'utau'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
-         sn_vtau = FLD_N( 'vtau'    ,    24.    ,  'vtau'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
-         sn_wndm = FLD_N( 'mwnd10m' ,    24.    ,  'm_10'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
-         sn_tair = FLD_N( 'tair10m' ,    24.    ,  't_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
-         sn_humi = FLD_N( 'humi10m' ,    24.    ,  'q_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
-         sn_ccov = FLD_N( 'ccover'  ,    -1.    ,  'cloud'   ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
-         sn_prec = FLD_N( 'precip'  ,    -1.    ,  'precip'  ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_utau = FLD_N( 'utau'    ,    24     ,  'utau'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_vtau = FLD_N( 'vtau'    ,    24     ,  'vtau'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_wndm = FLD_N( 'mwnd10m' ,    24     ,  'm_10'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_tair = FLD_N( 'tair10m' ,    24     ,  't_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_humi = FLD_N( 'humi10m' ,    24     ,  'q_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_ccov = FLD_N( 'ccover'  ,    -1     ,  'cloud'   ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
+         sn_prec = FLD_N( 'precip'  ,    -1     ,  'precip'  ,  .true.    , .false. ,   'yearly'  , ''       , ''         ) 
 
          REWIND( numnam )                    ! ... read in namlist namsbc_clio
Index: trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 1730)
@@ -134,13 +134,13 @@
          !            !    file     ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
          !            !    name     !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
-         sn_wndi = FLD_N( 'uwnd10m' ,    24.    ,  'u_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_wndj = FLD_N( 'vwnd10m' ,    24.    ,  'v_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_qsr  = FLD_N( 'qsw'     ,    24.    ,  'qsw'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_qlw  = FLD_N( 'qlw'     ,    24.    ,  'qlw'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_tair = FLD_N( 'tair10m' ,    24.    ,  't_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_humi = FLD_N( 'humi10m' ,    24.    ,  'q_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_prec = FLD_N( 'precip'  ,    -1.    ,  'precip'  ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
-         sn_snow = FLD_N( 'snow'    ,    -1.    ,  'snow'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
-         sn_tdif = FLD_N( 'taudif'  ,    24.    ,  'taudif'  ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
+         sn_wndi = FLD_N( 'uwnd10m' ,    24     ,  'u_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_wndj = FLD_N( 'vwnd10m' ,    24     ,  'v_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_qsr  = FLD_N( 'qsw'     ,    24     ,  'qsw'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_qlw  = FLD_N( 'qlw'     ,    24     ,  'qlw'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_tair = FLD_N( 'tair10m' ,    24     ,  't_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_humi = FLD_N( 'humi10m' ,    24     ,  'q_10'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_prec = FLD_N( 'precip'  ,    -1     ,  'precip'  ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
+         sn_snow = FLD_N( 'snow'    ,    -1     ,  'snow'    ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
+         sn_tdif = FLD_N( 'taudif'  ,    24     ,  'taudif'  ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
          !
          REWIND( numnam )                    ! ... read in namlist namsbc_core
Index: trunk/NEMO/OPA_SRC/SBC/sbcflx.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 1730)
@@ -106,9 +106,9 @@
          !              !   file    ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
          !              !   name    !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
-         sn_utau = FLD_N(   'utau'  ,    24.    ,  'utau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_vtau = FLD_N(   'vtau'  ,    24.    ,  'vtau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_qtot = FLD_N(   'qtot'  ,    24.    ,  'qtot'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_qsr  = FLD_N(   'qsr'   ,    24.    ,  'qsr'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_emp  = FLD_N(   'emp'   ,    24.    ,  'emp'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_utau = FLD_N(   'utau'  ,    24     ,  'utau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_vtau = FLD_N(   'vtau'  ,    24     ,  'vtau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_qtot = FLD_N(   'qtot'  ,    24     ,  'qtot'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_qsr  = FLD_N(   'qsr'   ,    24     ,  'qsr'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_emp  = FLD_N(   'emp'   ,    24     ,  'emp'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
 
          REWIND ( numnam )               ! ... read in namlist namflx
Index: trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 1730)
@@ -72,5 +72,5 @@
          !             !   file    ! frequency !  variable  ! time intep !  clim  ! 'yearly' or ! weights  ! rotation   !
          !             !   name    !  (hours)  !   name     !   (T/F)    !  (T/F) !  'monthly'  ! filename ! pairs      ! 
-         sn_ice = FLD_N('ice_cover',    -1.    ,  'ice_cov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
+         sn_ice = FLD_N('ice_cover',    -1    ,  'ice_cov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
 
          REWIND ( numnam )               ! ... read in namlist namiif
Index: trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 1730)
@@ -133,6 +133,6 @@
       !            !   file    ! frequency !  variable  ! time intep !  clim  ! 'yearly' or ! weights  ! rotation   !
       !            !   name    !  (hours)  !   name     !   (T/F)    !  (T/F) !  'monthly'  ! filename ! pairs      !
-      sn_rnf = FLD_N( 'runoffs',    -1.    , 'sorunoff' ,  .TRUE.    , .true. ,   'yearly'  , ''       , ''         )
-      sn_cnf = FLD_N( 'runoffs',     0.    , 'sorunoff' ,  .FALSE.   , .true. ,   'yearly'  , ''       , ''         )
+      sn_rnf = FLD_N( 'runoffs',    -1     , 'sorunoff' ,  .TRUE.    , .true. ,   'yearly'  , ''       , ''         )
+      sn_cnf = FLD_N( 'runoffs',     0     , 'sorunoff' ,  .FALSE.   , .true. ,   'yearly'  , ''       , ''         )
 
       !
Index: trunk/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 1726)
+++ trunk/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 1730)
@@ -89,6 +89,6 @@
          !            !   file    ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
          !            !   name    !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
-         sn_sst = FLD_N( 'sst'    ,    24.    ,  'sst'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
-         sn_sss = FLD_N( 'sss'    ,    -1.    ,  'sss'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
+         sn_sst = FLD_N( 'sst'    ,    24     ,  'sst'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
+         sn_sss = FLD_N( 'sss'    ,    -1     ,  'sss'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
 
          REWIND ( numnam )            !* read in namlist namflx
