Index: NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/fldread.F90
===================================================================
--- NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/fldread.F90	(revision 12866)
+++ NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/SBC/fldread.F90	(revision 12960)
@@ -53,5 +53,5 @@
       LOGICAL              ::   ln_tint     ! time interpolation or not (T/F)
       LOGICAL              ::   ln_clim     ! climatology or not (T/F)
-      CHARACTER(len = 8)   ::   cltype      ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 8)   ::   clftyp      ! type of data file 'daily', 'monthly' or yearly'
       CHARACTER(len = 256) ::   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
@@ -69,12 +69,14 @@
       LOGICAL                         ::   ln_tint      ! time interpolation or not (T/F)
       LOGICAL                         ::   ln_clim      ! climatology or not (T/F)
-      CHARACTER(len = 8)              ::   cltype       ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 8)              ::   clftyp       ! type of data file 'daily', 'monthly' or yearly'
+      CHARACTER(len = 1)              ::   cltype       ! nature of grid-points: T, U, V...
+      REAL(wp)                        ::   zsgn         ! -1. the sign change across the north fold, =  1. otherwise
       INTEGER                         ::   num          ! iom id of the jpfld files to be read
       INTEGER , DIMENSION(2,2)        ::   nrec         ! before/after record (1: index, 2: second since Jan. 1st 00h of yr nit000)
       INTEGER                         ::   nbb          ! index of before values
       INTEGER                         ::   naa          ! index of after  values
-      INTEGER , ALLOCATABLE, DIMENSION(:      ) ::   nrecsec   ! 
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:  ) ::   fnow   ! input fields interpolated to now time step
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   fdta   ! 2 consecutive record of input fields
+      INTEGER , ALLOCATABLE, DIMENSION(:) ::   nrecsec   ! 
+      REAL(wp), POINTER, DIMENSION(:,:,:  ) ::   fnow   ! input fields interpolated to now time step
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   fdta   ! 2 consecutive record of input fields
       CHARACTER(len = 256)            ::   wgtname      ! current name of the NetCDF weight file acting as a key
       !                                                 ! into the WGTLIST structure
@@ -351,73 +353,38 @@
       INTEGER ::   iaa      ! shorter name for sdjf%naa
       INTEGER ::   iw       ! index into wgts array
-      INTEGER ::   ipdom    ! index of the domain
       INTEGER ::   idvar    ! variable ID
       INTEGER ::   idmspc   ! number of spatial dimensions
       LOGICAL ::   lmoor    ! C1D case: point data
-      !!---------------------------------------------------------------------
-      !
-      ipk = SIZE( sdjf%fnow, 3 )
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   dta_alias   ! short cut
+      !!---------------------------------------------------------------------
       iaa = sdjf%naa
       !
-      IF( ASSOCIATED(sdjf%imap) ) THEN
-         IF( sdjf%ln_tint ) THEN   ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,iaa), sdjf%nrec(1,iaa),   &
-            &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm )
-         ELSE                      ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fnow(:,:,:    ), sdjf%nrec(1,iaa),   &
-            &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm )
-         ENDIF
-      ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN
+      IF( sdjf%ln_tint ) THEN   ;   dta_alias => sdjf%fdta(:,:,:,iaa)
+      ELSE                      ;   dta_alias => sdjf%fnow(:,:,:    )
+      ENDIF
+      ipk = SIZE( dta_alias, 3 )
+      !
+      IF( ASSOCIATED(sdjf%imap) ) THEN              ! BDY case 
+         CALL fld_map( sdjf%num, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   &
+            &          sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm )
+      ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN   ! On-the-fly interpolation
          CALL wgt_list( sdjf, iw )
-         IF( sdjf%ln_tint ) THEN   ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, sdjf%fdta(:,:,:,iaa),   & 
-            &                                                                          sdjf%nrec(1,iaa), sdjf%lsmname )
-            CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,:,iaa), 'T', 1._wp, kfillmode = jpfillcopy )
-         ELSE                      ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, sdjf%fnow(:,:,:    ),   &
-            &                                                                          sdjf%nrec(1,iaa), sdjf%lsmname )
-            CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,:    ), 'T', 1._wp, kfillmode = jpfillcopy )
-         ENDIF
-      ELSE
-         IF( SIZE(sdjf%fnow, 1) == jpi ) THEN   ;   ipdom = jpdom_global
-         ELSE                                   ;   ipdom = jpdom_unknown
-         ENDIF
+         CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, dta_alias(:,:,:), sdjf%nrec(1,iaa), sdjf%lsmname )
+         CALL lbc_lnk( 'fldread', dta_alias(:,:,:), sdjf%cltype, sdjf%zsgn, kfillmode = jpfillcopy )
+      ELSE                                          ! default case
          ! C1D case: If product of spatial dimensions == ipk, then x,y are of
          ! size 1 (point/mooring data): this must be read onto the central grid point
          idvar  = iom_varid( sdjf%num, sdjf%clvar )
          idmspc = iom_file ( sdjf%num )%ndims( idvar )
-         IF( iom_file( sdjf%num )%luld( idvar ) )   idmspc = idmspc - 1
-         lmoor  = (  idmspc == 0 .OR. PRODUCT( iom_file( sdjf%num )%dimsz( 1:MAX(idmspc,1) ,idvar ) ) == ipk  )
-         !
-         SELECT CASE( ipk )
-         CASE(1)
-            IF( lk_c1d .AND. lmoor ) THEN
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, sdjf%clvar, sdjf%fdta(2,2,1,iaa), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,1,iaa),'T',1., kfillmode = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, sdjf%clvar, sdjf%fnow(2,2,1    ), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,1    ),'T',1., kfillmode = jpfillcopy )
-               ENDIF
-            ELSE
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,1,iaa), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,1    ), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ENDIF
-            ENDIF
-         CASE DEFAULT
-            IF(lk_c1d .AND. lmoor ) THEN
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fdta(2,2,:,iaa), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,:,iaa),'T',1., kfillmode = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fnow(2,2,:   ), sdjf%nrec(1,iaa) )
-                  CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,:   ),'T',1., kfillmode = jpfillcopy )
-               ENDIF
-            ELSE
-               IF( sdjf%ln_tint ) THEN
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,:,iaa), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ELSE
-                  CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,:    ), sdjf%nrec(1,iaa), kfill = jpfillcopy )
-               ENDIF
-            ENDIF
-         END SELECT
+         IF( iom_file( sdjf%num )%luld( idvar ) )   idmspc = idmspc - 1   ! id of the last spatial dimension
+         lmoor  = (  idmspc == 0 .OR. PRODUCT( iom_file( sdjf%num )%dimsz( 1:MAX(idmspc,1) ,idvar ) ) == ipk  )    
+         !
+         IF( lk_c1d .AND. lmoor ) THEN
+            CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, dta_alias(2,2,:), sdjf%nrec(1,iaa) )   ! jpdom_unknown -> no lbc_lnk
+            CALL lbc_lnk( 'fldread', dta_alias(:,:,:), 'T', 1., kfillmode = jpfillcopy )
+         ELSE
+            CALL iom_get( sdjf%num,  jpdom_global, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   &
+               &          sdjf%cltype, sdjf%zsgn, kfill = jpfillcopy )
+         ENDIF
       ENDIF
       !
@@ -458,10 +425,10 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zdta_read_z  ! work space local data requiring vertical interpolation
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zdta_read_dz ! work space local data requiring vertical interpolation
-      CHARACTER(LEN=1),DIMENSION(3)             ::   clgrid
+      CHARACTER(LEN=1),DIMENSION(3)             ::   cltype
       LOGICAL                                   ::   lluld        ! is the variable using the unlimited dimension
       LOGICAL                                   ::   llzint       ! local value of ldzint
       !!---------------------------------------------------------------------
       !
-      clgrid = (/'t','u','v'/)
+      cltype = (/'t','u','v'/)
       !
       ipi = SIZE( pdta, 1 )
@@ -498,12 +465,12 @@
          IF( ipkb /= ipk .OR. llzint ) THEN   ! boundary data not on model vertical grid : vertical interpolation
             !
-            IF( ipk == jpk .AND. iom_varid(knum,'gdep'//clgrid(kgrd)) /= -1 .AND. iom_varid(knum,'e3'//clgrid(kgrd)) /= -1 ) THEN
+            IF( ipk == jpk .AND. iom_varid(knum,'gdep'//cltype(kgrd)) /= -1 .AND. iom_varid(knum,'e3'//cltype(kgrd)) /= -1 ) THEN
                
                ALLOCATE( zdta_read(ipi,ipj,ipkb), zdta_read_z(ipi,ipj,ipkb), zdta_read_dz(ipi,ipj,ipkb) )
                 
                CALL fld_map_core( zz_read, kmap, zdta_read )
-               CALL iom_get ( knum, jpdom_unknown, 'gdep'//clgrid(kgrd), zz_read )   ! read only once? Potential temporal evolution?
+               CALL iom_get ( knum, jpdom_unknown, 'gdep'//cltype(kgrd), zz_read )   ! read only once? Potential temporal evolution?
                CALL fld_map_core( zz_read, kmap, zdta_read_z )
-               CALL iom_get ( knum, jpdom_unknown,   'e3'//clgrid(kgrd), zz_read )   ! read only once? Potential temporal evolution?
+               CALL iom_get ( knum, jpdom_unknown,   'e3'//cltype(kgrd), zz_read )   ! read only once? Potential temporal evolution?
                CALL fld_map_core( zz_read, kmap, zdta_read_dz )
                
@@ -515,6 +482,6 @@
                IF( ipk /= jpk ) CALL ctl_stop( 'fld_map : this should be an impossible case...' )
                WRITE(ctmp1,*) 'fld_map : vertical interpolation for bdy variable '//TRIM(cdvar)//' requires ' 
-               IF( iom_varid(knum, 'gdep'//clgrid(kgrd)) == -1 ) CALL ctl_stop( ctmp1//'gdep'//clgrid(kgrd)//' variable' )
-               IF( iom_varid(knum,   'e3'//clgrid(kgrd)) == -1 ) CALL ctl_stop( ctmp1//  'e3'//clgrid(kgrd)//' variable' )
+               IF( iom_varid(knum, 'gdep'//cltype(kgrd)) == -1 ) CALL ctl_stop( ctmp1//'gdep'//cltype(kgrd)//' variable' )
+               IF( iom_varid(knum,   'e3'//cltype(kgrd)) == -1 ) CALL ctl_stop( ctmp1//  'e3'//cltype(kgrd)//' variable' )
 
             ENDIF
@@ -739,4 +706,5 @@
       CHARACTER (LEN=100)          ::   clcomp       ! dummy weight name
       REAL(wp), DIMENSION(jpi,jpj) ::   utmp, vtmp   ! temporary arrays for vector rotation
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   dta_u, dta_v    ! short cut
       !!---------------------------------------------------------------------
       !
@@ -758,14 +726,11 @@
                   END DO
                   IF( iv > 0 ) THEN   ! fields ju and iv are two components which need to be rotated together
+                     IF( sd(ju)%ln_tint ) THEN   ;   dta_u => sd(ju)%fdta(:,:,:,jn)   ;   dta_v => sd(iv)%fdta(:,:,:,jn) 
+                     ELSE                        ;   dta_u => sd(ju)%fnow(:,:,:   )   ;   dta_v => sd(iv)%fnow(:,:,:   )
+                     ENDIF
                      DO jk = 1, SIZE( sd(ju)%fnow, 3 )
-                        IF( sd(ju)%ln_tint )THEN
-                           CALL rot_rep( sd(ju)%fdta(:,:,jk,jn), sd(iv)%fdta(:,:,jk,jn), 'T', 'en->i', utmp(:,:) )
-                           CALL rot_rep( sd(ju)%fdta(:,:,jk,jn), sd(iv)%fdta(:,:,jk,jn), 'T', 'en->j', vtmp(:,:) )
-                           sd(ju)%fdta(:,:,jk,jn) = utmp(:,:)   ;   sd(iv)%fdta(:,:,jk,jn) = vtmp(:,:)
-                        ELSE 
-                           CALL rot_rep( sd(ju)%fnow(:,:,jk   ), sd(iv)%fnow(:,:,jk   ), 'T', 'en->i', utmp(:,:) )
-                           CALL rot_rep( sd(ju)%fnow(:,:,jk   ), sd(iv)%fnow(:,:,jk   ), 'T', 'en->j', vtmp(:,:) )
-                           sd(ju)%fnow(:,:,jk   ) = utmp(:,:)   ;   sd(iv)%fnow(:,:,jk   ) = vtmp(:,:)
-                        ENDIF
+                        CALL rot_rep( dta_u(:,:,jk), dta_v(:,:,jk), 'T', 'en->i', utmp(:,:) )
+                        CALL rot_rep( dta_u(:,:,jk), dta_v(:,:,jk), 'T', 'en->j', vtmp(:,:) )
+                        dta_u(:,:,jk) = utmp(:,:)   ;   dta_v(:,:,jk) = vtmp(:,:)
                      END DO
                      sd(ju)%rotn(jn) = .TRUE.               ! vector was rotated 
@@ -813,12 +778,12 @@
 
       ! current file parameters
-      IF( sdjf%cltype(1:4) == 'week' ) THEN          ! find the day of the beginning of the current week
-         isecwk = ksec_week( sdjf%cltype(6:8) )     ! seconds between the beginning of the week and half of current time step
-         llprevmt = isecwk > nsec_month               ! longer time since beginning of the current week than the current month
+      IF( sdjf%clftyp(1:4) == 'week' ) THEN         ! find the day of the beginning of the current week
+         isecwk = ksec_week( sdjf%clftyp(6:8) )     ! seconds between the beginning of the week and half of current time step
+         llprevmt = isecwk > nsec_month             ! longer time since beginning of the current week than the current month
          llprevyr = llprevmt .AND. nmonth == 1
          iyr = nyear  - COUNT((/llprevyr/))
          imt = nmonth - COUNT((/llprevmt/)) + 12 * COUNT((/llprevyr/))
          idy = nday + nmonth_len(nmonth-1) * COUNT((/llprevmt/)) - isecwk / idaysec
-         isecwk = nsec_year - isecwk              ! seconds between 00h jan 1st of current year and current week beginning
+         isecwk = nsec_year - isecwk                ! seconds between 00h jan 1st of current year and current week beginning
       ELSE
          iyr = nyear
@@ -830,16 +795,16 @@
       ! previous file parameters
       IF( llprev ) THEN
-         IF( sdjf%cltype(1:4) == 'week'    ) THEN     ! find the day of the beginning of previous week
-            isecwk = isecwk + 7 * idaysec         ! seconds between the beginning of previous week and half of the time step
-            llprevmt = isecwk > nsec_month            ! longer time since beginning of the previous week than the current month
+         IF( sdjf%clftyp(1:4) == 'week'    ) THEN   ! find the day of the beginning of previous week
+            isecwk = isecwk + 7 * idaysec           ! seconds between the beginning of previous week and half of the time step
+            llprevmt = isecwk > nsec_month          ! longer time since beginning of the previous week than the current month
             llprevyr = llprevmt .AND. nmonth == 1
             iyr = nyear  - COUNT((/llprevyr/))
             imt = nmonth - COUNT((/llprevmt/)) + 12 * COUNT((/llprevyr/))
             idy = nday + nmonth_len(nmonth-1) * COUNT((/llprevmt/)) - isecwk / idaysec
-            isecwk = nsec_year - isecwk           ! seconds between 00h jan 1st of current year and previous week beginning
+            isecwk = nsec_year - isecwk             ! seconds between 00h jan 1st of current year and previous week beginning
          ELSE
-            idy = nday   - COUNT((/ sdjf%cltype == 'daily'                 /))
-            imt = nmonth - COUNT((/ sdjf%cltype == 'monthly' .OR. idy == 0 /))
-            iyr = nyear  - COUNT((/ sdjf%cltype == 'yearly'  .OR. imt == 0 /))
+            idy = nday   - COUNT((/ sdjf%clftyp == 'daily'                 /))
+            imt = nmonth - COUNT((/ sdjf%clftyp == 'monthly' .OR. idy == 0 /))
+            iyr = nyear  - COUNT((/ sdjf%clftyp == 'yearly'  .OR. imt == 0 /))
             IF( idy == 0 ) idy = nmonth_len(imt)
             IF( imt == 0 ) imt = 12
@@ -850,6 +815,6 @@
       ! next file parameters
       IF( llnext ) THEN
-         IF( sdjf%cltype(1:4) == 'week'    ) THEN     ! find the day of the beginning of next week
-            isecwk = 7 * idaysec - isecwk         ! seconds between half of the time step and the beginning of next week
+         IF( sdjf%clftyp(1:4) == 'week'    ) THEN   ! find the day of the beginning of next week
+            isecwk = 7 * idaysec - isecwk           ! seconds between half of the time step and the beginning of next week
             llnextmt = isecwk > ( nmonth_len(nmonth)*idaysec - nsec_month )   ! larger than the seconds to the end of the month
             llnextyr = llnextmt .AND. nmonth == 12
@@ -857,9 +822,9 @@
             imt = nmonth + COUNT((/llnextmt/)) - 12 * COUNT((/llnextyr/))
             idy = nday - nmonth_len(nmonth) * COUNT((/llnextmt/)) + isecwk / idaysec + 1
-            isecwk = nsec_year + isecwk           ! seconds between 00h jan 1st of current year and next week beginning
+            isecwk = nsec_year + isecwk             ! seconds between 00h jan 1st of current year and next week beginning
          ELSE
-            idy = nday   + COUNT((/ sdjf%cltype == 'daily'                                 /))
-            imt = nmonth + COUNT((/ sdjf%cltype == 'monthly' .OR. idy > nmonth_len(nmonth) /))
-            iyr = nyear  + COUNT((/ sdjf%cltype == 'yearly'  .OR. imt == 13                /))
+            idy = nday   + COUNT((/ sdjf%clftyp == 'daily'                                 /))
+            imt = nmonth + COUNT((/ sdjf%clftyp == 'monthly' .OR. idy > nmonth_len(nmonth) /))
+            iyr = nyear  + COUNT((/ sdjf%clftyp == 'yearly'  .OR. imt == 13                /))
             IF( idy > nmonth_len(nmonth) )   idy = 1
             IF( imt == 13                )   imt = 1
@@ -878,11 +843,11 @@
       IF    ( NINT(sdjf%freqh) == -12 ) THEN            ;   ireclast = 1    ! yearly mean: consider only 1 record
       ELSEIF( NINT(sdjf%freqh) ==  -1 ) THEN                                ! monthly mean:
-         IF(     sdjf%cltype      == 'monthly' ) THEN   ;   ireclast = 1    !  consider that the file has  1 record
+         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   ireclast = 1    !  consider that the file has  1 record
          ELSE                                           ;   ireclast = 12   !  consider that the file has 12 record
          ENDIF
       ELSE                                                                  ! higher frequency mean (in hours)
-         IF(     sdjf%cltype      == 'monthly' ) THEN   ;   ireclast = NINT( 24. * REAL(nmonth_len(indexmt), wp) / sdjf%freqh )
-         ELSEIF( sdjf%cltype(1:4) == 'week'    ) THEN   ;   ireclast = NINT( 24. * 7.                            / sdjf%freqh )
-         ELSEIF( sdjf%cltype      == 'daily'   ) THEN   ;   ireclast = NINT( 24.                                 / sdjf%freqh )
+         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   ireclast = NINT( 24. * REAL(nmonth_len(indexmt), wp) / sdjf%freqh )
+         ELSEIF( sdjf%clftyp(1:4) == 'week'    ) THEN   ;   ireclast = NINT( 24. * 7.                            / sdjf%freqh )
+         ELSEIF( sdjf%clftyp      == 'daily'   ) THEN   ;   ireclast = NINT( 24.                                 / sdjf%freqh )
          ELSE                                           ;   ireclast = NINT( 24. * REAL( nyear_len(indexyr), wp) / sdjf%freqh )
          ENDIF
@@ -902,5 +867,5 @@
          sdjf%nrecsec(1) = sdjf%nrecsec(0) + nyear_len( indexyr ) * idaysec
       ELSEIF( NINT(sdjf%freqh) ==  -1 ) THEN                                     ! monthly mean:
-         IF(     sdjf%cltype      == 'monthly' ) THEN                            !    monthly file
+         IF(     sdjf%clftyp      == 'monthly' ) THEN                            !    monthly file
             sdjf%nrecsec(0   ) = nsec1jan000 + nmonth_beg(indexmt  )
             sdjf%nrecsec(1   ) = nsec1jan000 + nmonth_beg(indexmt+1)
@@ -910,7 +875,7 @@
          ENDIF
       ELSE                                                                       ! higher frequency mean (in hours)
-         IF(     sdjf%cltype      == 'monthly' ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt)
-         ELSEIF( sdjf%cltype(1:4) == 'week'    ) THEN   ;   istart = nsec1jan000 + isecwk
-         ELSEIF( sdjf%cltype      == 'daily'   ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) + ( idy - 1 ) * idaysec
+         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt)
+         ELSEIF( sdjf%clftyp(1:4) == 'week'    ) THEN   ;   istart = nsec1jan000 + isecwk
+         ELSEIF( sdjf%clftyp      == 'daily'   ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) + ( idy - 1 ) * idaysec
          ELSEIF( indexyr          == 0         ) THEN   ;   istart = nsec1jan000 - nyear_len( 0 ) * idaysec
          ELSEIF( indexyr          == 2         ) THEN   ;   istart = nsec1jan000 + nyear_len( 1 ) * idaysec
@@ -1008,5 +973,7 @@
          sdf(jf)%ln_tint    = sdf_n(jf)%ln_tint
          sdf(jf)%ln_clim    = sdf_n(jf)%ln_clim
-         sdf(jf)%cltype     = sdf_n(jf)%cltype
+         sdf(jf)%clftyp     = sdf_n(jf)%clftyp
+         sdf(jf)%cltype     = 'T'   ! by default don't do any call to lbc_lnk in iom_get
+         sdf(jf)%zsgn       = 1.    ! by default don't do change signe across the north fold
          sdf(jf)%num        = -1
          sdf(jf)%nbb        = 1  ! start with before data in 1
@@ -1018,7 +985,7 @@
          sdf(jf)%vcomp      = sdf_n(jf)%vcomp
          sdf(jf)%rotn(:)    = .TRUE.   ! pretend to be rotated -> won't try to rotate data before the first call to fld_get
-         IF( sdf(jf)%cltype(1:4) == 'week' .AND. nn_leapy == 0  )   &
+         IF( sdf(jf)%clftyp(1:4) == 'week' .AND. nn_leapy == 0  )   &
             &   CALL ctl_stop('fld_clopn: weekly file ('//TRIM(sdf(jf)%clrootname)//') needs nn_leapy = 1')
-         IF( sdf(jf)%cltype(1:4) == 'week' .AND. sdf(jf)%ln_clim )   &
+         IF( sdf(jf)%clftyp(1:4) == 'week' .AND. sdf(jf)%ln_clim )   &
             &   CALL ctl_stop('fld_clopn: weekly file ('//TRIM(sdf(jf)%clrootname)//') needs ln_clim = .FALSE.')
          sdf(jf)%nreclast   = -1 ! Set to non zero default value to avoid errors, is updated to meaningful value during fld_clopn
@@ -1046,5 +1013,5 @@
             WRITE(numout,*) '         weights: '        , TRIM( sdf(jf)%wgtname    ),   &
                &                  '   pairing: '        , TRIM( sdf(jf)%vcomp      ),   &
-               &                  '   data type: '      ,       sdf(jf)%cltype      ,   &
+               &                  '   data type: '      ,       sdf(jf)%clftyp      ,   &
                &                  '   land/sea mask:'   , TRIM( sdf(jf)%lsmname    )
             call flush(numout)
@@ -1202,6 +1169,5 @@
             CALL iom_get ( inum, jpdom_global, clname, data_tmp(:,:), cd_type = 'Z' )   !  no call to lbc_lnk
             DO_2D_00_00
-!!$               isrc = NINT(data_tmp(ji,jj)) - 1
-               isrc = INT(data_tmp(ji,jj)) - 1
+               isrc = NINT(data_tmp(ji,jj)) - 1
                ref_wgts(nxt_wgt)%data_jpi(ji,jj,jn) = 1 + MOD(isrc,  ref_wgts(nxt_wgt)%ddims(1))
                ref_wgts(nxt_wgt)%data_jpj(ji,jj,jn) = 1 +     isrc / ref_wgts(nxt_wgt)%ddims(1)
@@ -1589,10 +1555,10 @@
       IF( .NOT. sdjf%ln_clim ) THEN   
                                          WRITE(clname, '(a,"_y",i4.4)' ) TRIM( sdjf%clrootname ), kyear    ! add year
-         IF( sdjf%cltype /= 'yearly' )   WRITE(clname, '(a, "m",i2.2)' ) TRIM( clname          ), kmonth   ! add month
+         IF( sdjf%clftyp /= 'yearly' )   WRITE(clname, '(a, "m",i2.2)' ) TRIM( clname          ), kmonth   ! add month
       ELSE
          ! build the new filename if climatological data
-         IF( sdjf%cltype /= 'yearly' )   WRITE(clname, '(a,"_m",i2.2)' ) TRIM( sdjf%clrootname ), kmonth   ! add month
-      ENDIF
-      IF(    sdjf%cltype == 'daily' .OR. sdjf%cltype(1:4) == 'week' ) &
+         IF( sdjf%clftyp /= 'yearly' )   WRITE(clname, '(a,"_m",i2.2)' ) TRIM( sdjf%clrootname ), kmonth   ! add month
+      ENDIF
+      IF(    sdjf%clftyp == 'daily' .OR. sdjf%clftyp(1:4) == 'week' ) &
          &                               WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname          ), kday     ! add day
 
@@ -1618,5 +1584,5 @@
          IF( cl_week(ijul) == TRIM(cdday) ) EXIT
       END DO
-      IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%cltype(6:8): '//TRIM(cdday) )
+      IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%clftyp(6:8): '//TRIM(cdday) )
       !
       ishift = ijul * NINT(rday)
