Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/fldread.F90
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/fldread.F90	(revision 14219)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/fldread.F90	(revision 14644)
@@ -211,5 +211,5 @@
             !
             IF( sd(jf)%ln_tint ) THEN              ! temporal interpolation
-               IF(lwp .AND. kt - nit000 <= 100 ) THEN 
+               IF(lwp .AND. ( kt - nit000 <= 20 .OR. nitend - kt <= 20 ) ) THEN 
                   clfmt = "('   fld_read: var ', a, ' kt = ', i8, ' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
                      &    "', records b/a: ', i6.4, '/', i6.4, ' (days ', f9.4,'/', f9.4, ')')"
@@ -223,5 +223,5 @@
                sd(jf)%fnow(:,:,:) = ztintb * sd(jf)%fdta(:,:,:,ibb) + ztinta * sd(jf)%fdta(:,:,:,iaa)
             ELSE   ! nothing to do...
-               IF(lwp .AND. kt - nit000 <= 100 ) THEN
+               IF(lwp .AND. ( kt - nit000 <= 20 .OR. nitend - kt <= 20 ) ) THEN
                   clfmt = "('   fld_read: var ', a, ' kt = ', i8,' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
                      &    "', record: ', i6.4, ' (days ', f9.4, ' <-> ', f9.4, ')')"
@@ -251,5 +251,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nflag == 0 )   nflag = -( HUGE(0) - 10 )
+      IF( nflag == 0 )   nflag = -HUGE(0)
       !
       CALL fld_def( sdjf )
@@ -908,10 +908,10 @@
       TYPE(FLD)        , INTENT(inout) ::   sdjf       ! input field related variables
       !
-      INTEGER, DIMENSION(2)  :: isave
+      INTEGER  :: isave
       LOGICAL  :: llprev, llnext, llstop
       !!----------------------------------------------------------------------
       !
       llprev = sdjf%nrecsec(sdjf%nreclast) < nsec000_1jan000   ! file ends before the beginning of the job -> file may not exist
-      llnext = sdjf%nrecsec(       0     ) > nsecend_1jan000   ! file begins after the end of the job -> file may not exist 
+      llnext = sdjf%nrecsec(      1      ) > nsecend_1jan000   ! file begins after the end of the job -> file may not exist 
 
       llstop = sdjf%ln_clim .OR. .NOT. ( llprev .OR. llnext )
@@ -926,18 +926,17 @@
          IF( llprev ) THEN   ! previous file does not exist : go back to current and accept to read only the first record
             CALL ctl_warn('previous file: '//TRIM(sdjf%clname)//' not found -> go back to current year/month/week/day file')
-            isave(1:2) = sdjf%nrecsec(sdjf%nreclast-1:sdjf%nreclast)   ! save previous file info
-            CALL fld_def( sdjf )   ! go back to current file
-            sdjf%nreclast = 1   ! force to use only the first record (do as if other were not existing...)
-            sdjf%nrecsec(0:1) = isave(1:2)
+            isave = sdjf%nrecsec(sdjf%nreclast)   ! save previous file info
+            CALL fld_def( sdjf )                  ! go back to current file
+            sdjf%nreclast = 1                     ! force to use only the first record (do as if other were not existing...)
          ENDIF
          !
          IF( llnext ) THEN   ! next     file does not exist : go back to current and accept to read only the last  record 
             CALL ctl_warn('next file: '//TRIM(sdjf%clname)//' not found -> go back to current year/month/week/day file')
-            isave(1:2) = sdjf%nrecsec(0:1)    ! save next file info
-            CALL fld_def( sdjf )   ! go back to current file
-            ! -> read last record but keep record info from the first record of next file
-            sdjf%nrecsec(sdjf%nreclast-1:sdjf%nreclast) = isave(1:2)
-            sdjf%nrecsec(0:sdjf%nreclast-2) = nflag
-         ENDIF
+            isave = sdjf%nrecsec(1)               ! save next file info
+            CALL fld_def( sdjf )                  ! go back to current file
+         ENDIF
+         ! -> read "last" record but keep record info from the first record of next file
+         sdjf%nrecsec(  sdjf%nreclast  ) = isave
+         sdjf%nrecsec(0:sdjf%nreclast-1) = nflag
          !
          CALL iom_open( sdjf%clname, sdjf%num, ldiof = LEN_TRIM(sdjf%wgtname) > 0 )   
