Index: NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC/fldread.F90
===================================================================
--- NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC/fldread.F90	(revision 12146)
+++ NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/OCE/SBC/fldread.F90	(revision 12154)
@@ -167,5 +167,5 @@
       IF( PRESENT(kit) )   ll_firstcall = ll_firstcall .and. kit == 1
 
-      IF ( nn_components == jp_iam_sas ) THEN   ;   it_offset = nn_fsbc
+      IF( nn_components == jp_iam_sas ) THEN   ;   it_offset = nn_fsbc
       ELSE                                      ;   it_offset = 0
       ENDIF
@@ -389,5 +389,5 @@
          ENDIF
          !
-         IF ( sdjf%cltype(1:4) == 'week' ) THEN
+         IF( sdjf%cltype(1:4) == 'week' ) THEN
             isec_week = isec_week + ksec_week( sdjf%cltype(6:8) )   ! second since the beginning of the week
             llprevmth = isec_week > nsec_month                      ! longer time since the beginning of the week than the month
@@ -464,5 +464,5 @@
       ENDIF
       !
-      IF ( nn_components == jp_iam_sas ) THEN   ;   it_offset = nn_fsbc
+      IF( nn_components == jp_iam_sas ) THEN   ;   it_offset = nn_fsbc
       ELSE                                      ;   it_offset = 0
       ENDIF
@@ -656,5 +656,5 @@
             ENDIF
          CASE DEFAULT
-            IF (lk_c1d .AND. lmoor ) THEN
+            IF(lk_c1d .AND. lmoor ) THEN
                IF( sdjf%ln_tint ) THEN
                   CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fdta(2,2,:,2), sdjf%nrec_a(1) )
@@ -1071,5 +1071,5 @@
          imonth = kmonth
          iday = kday
-         IF ( sdjf%cltype(1:4) == 'week' ) THEN             ! find the day of the beginning of the week
+         IF( sdjf%cltype(1:4) == 'week' ) THEN             ! find the day of the beginning of the week
             isec_week = ksec_week( sdjf%cltype(6:8) )- (86400 * 8 )  
             llprevmth  = isec_week > nsec_month             ! longer time since beginning of the week than the month
@@ -1080,5 +1080,5 @@
          ENDIF
       ELSE                                                  ! use current day values
-         IF ( sdjf%cltype(1:4) == 'week' ) THEN             ! find the day of the beginning of the week
+         IF( sdjf%cltype(1:4) == 'week' ) THEN             ! find the day of the beginning of the week
             isec_week  = ksec_week( sdjf%cltype(6:8) )      ! second since the beginning of the week
             llprevmth  = isec_week > nsec_month             ! longer time since beginning of the week than the month
@@ -1318,5 +1318,7 @@
 
       !! get dimensions
-      IF ( SIZE(sd%fnow, 3) > 1 ) THEN
+      !!GS: we consider 2D data as 3D data with vertical dim size = 1
+      !IF( SIZE(sd%fnow, 3) > 1 ) THEN
+      IF( SIZE(sd%fnow, 3) > 0 ) THEN
          ALLOCATE( ddims(4) )
       ELSE
@@ -1331,5 +1333,5 @@
 
       CALL iom_open ( sd%wgtname, inum )   ! interpolation weights
-      IF ( inum > 0 ) THEN
+      IF( inum > 0 ) THEN
 
          !! determine whether we have an east-west cyclic grid
@@ -1640,10 +1642,11 @@
          
          ref_wgts(kw)%fly_dta(:,:,:) = 0.0
-         SELECT CASE( SIZE(ref_wgts(kw)%fly_dta(jpi1:jpi2,jpj1:jpj2,:),3) )
-         CASE(1)
-              CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%fly_dta(jpi1:jpi2,jpj1:jpj2,1), nrec, rec1, recn)
-         CASE DEFAULT
+         !!GS: we consider 2D data as 3D data with vertical dim size = 1 
+         !SELECT CASE( SIZE(ref_wgts(kw)%fly_dta(jpi1:jpi2,jpj1:jpj2,:),3) )
+         !CASE(1)
+         !     CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%fly_dta(jpi1:jpi2,jpj1:jpj2,1), nrec, rec1, recn)
+         !CASE DEFAULT
               CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%fly_dta(jpi1:jpi2,jpj1:jpj2,:), nrec, rec1, recn)
-         END SELECT 
+         !END SELECT 
       ENDIF
       
@@ -1663,5 +1666,5 @@
       END DO
 
-      IF (ref_wgts(kw)%numwgt .EQ. 16) THEN
+      IF(ref_wgts(kw)%numwgt .EQ. 16) THEN
 
         !! fix up halo points that we couldnt read from file
@@ -1689,20 +1692,22 @@
            IF( jpi1 == 2 ) THEN
               rec1(1) = ref_wgts(kw)%ddims(1) - ref_wgts(kw)%overlap
-              SELECT CASE( SIZE( ref_wgts(kw)%col(:,jpj1:jpj2,:),3) )
-              CASE(1)
-                   CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%col(:,jpj1:jpj2,1), nrec, rec1, recn)
-              CASE DEFAULT
+              !!GS: we consider 2D data as 3D data with vertical dim size = 1
+              !SELECT CASE( SIZE( ref_wgts(kw)%col(:,jpj1:jpj2,:),3) )
+              !CASE(1)
+              !     CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%col(:,jpj1:jpj2,1), nrec, rec1, recn)
+              !CASE DEFAULT
                    CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%col(:,jpj1:jpj2,:), nrec, rec1, recn)
-              END SELECT      
+              !END SELECT      
               ref_wgts(kw)%fly_dta(jpi1-1,jpj1:jpj2,:) = ref_wgts(kw)%col(1,jpj1:jpj2,:)
            ENDIF
            IF( jpi2 + jpimin - 1 == ref_wgts(kw)%ddims(1)+1 ) THEN
               rec1(1) = 1 + ref_wgts(kw)%overlap
-              SELECT CASE( SIZE( ref_wgts(kw)%col(:,jpj1:jpj2,:),3) )
-              CASE(1)
-                   CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%col(:,jpj1:jpj2,1), nrec, rec1, recn)
-              CASE DEFAULT
+              !!GS: we consider 2D data as 3D data with vertical dim size = 1
+              !SELECT CASE( SIZE( ref_wgts(kw)%col(:,jpj1:jpj2,:),3) )
+              !CASE(1)
+              !     CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%col(:,jpj1:jpj2,1), nrec, rec1, recn)
+              !CASE DEFAULT
                    CALL iom_get( num, jpdom_unknown, clvar, ref_wgts(kw)%col(:,jpj1:jpj2,:), nrec, rec1, recn)
-              END SELECT
+              !END SELECT
               ref_wgts(kw)%fly_dta(jpi2+1,jpj1:jpj2,:) = ref_wgts(kw)%col(1,jpj1:jpj2,:)
            ENDIF
@@ -1746,5 +1751,5 @@
          END DO
          !
-      END IF
+      ENDIF
       !
    END SUBROUTINE fld_interp
