Index: branches/2014/dev_r4650_UKMO14.4_OBS_GENERAL_VINTERP/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90
===================================================================
--- branches/2014/dev_r4650_UKMO14.4_OBS_GENERAL_VINTERP/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90	(revision 4737)
+++ branches/2014/dev_r4650_UKMO14.4_OBS_GENERAL_VINTERP/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90	(revision 5837)
@@ -105,4 +105,6 @@
       REAL(wp) ::   zlam1, zcos_alpha, zim1 , zjm1 , ze1, ze1deg
       REAL(wp) ::   zphi1, zsin_alpha, zim05, zjm05
+      INTEGER  ::   isrow                ! index for ORCA1 starting row
+
       !!----------------------------------------------------------------------
       !
@@ -159,49 +161,50 @@
          IF( cp_cfg == "orca" .AND. jp_cfg == 1 ) THEN    ! ORCA R1 configuration
             !                                             ! =====================
-
-            ii0 = 281   ;   ii1 = 282        ! Gibraltar Strait (e2u = 20 km)
-            ij0 = 200   ;   ij1 = 200   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  20.e3
+            ! This dirty section will be suppressed by simplification process: all this will come back in input files
+            ! Currently these hard-wired indices relate to configuration with
+            ! extend grid (jpjglo=332)
+            ! which had a grid-size of 362x292.
+            ! 
+            isrow = 332 - jpjglo
+            !
+            ii0 = 282           ;   ii1 = 283        ! Gibraltar Strait (e2u = 20 km)
+            ij0 = 201 + isrow   ;   ij1 = 241 - isrow   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  20.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: Gibraltar : e2u reduced to 20 km'
 
-            ii0 = 314   ;   ii1 = 315        ! Bhosporus Strait (e2u = 10 km)
-            ij0 = 208   ;   ij1 = 208   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  10.e3
+            ii0 = 314           ;   ii1 = 315        ! Bhosporus Strait (e2u = 10 km)
+            ij0 = 208 + isrow   ;   ij1 = 248 - isrow   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  10.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: Bhosporus : e2u reduced to 10 km'
 
-            ii0 =  44   ;   ii1 =  44        ! Lombok Strait (e1v = 13 km)
-            ij0 = 124   ;   ij1 = 125   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  13.e3
+            ii0 =  44           ;   ii1 =  44        ! Lombok Strait (e1v = 13 km)
+            ij0 = 124 + isrow   ;   ij1 = 165 - isrow   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  13.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: Lombok : e1v reduced to 10 km'
 
-            ii0 =  48   ;   ii1 =  48        ! Sumba Strait (e1v = 8 km) [closed from bathy_11 on]
-            ij0 = 124   ;   ij1 = 125   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  8.e3
+            ii0 =  48           ;   ii1 =  48        ! Sumba Strait (e1v = 8 km) [closed from bathy_11 on]
+            ij0 = 124 + isrow   ;   ij1 = 165 - isrow   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  8.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: Sumba : e1v reduced to 8 km'
 
-            ii0 =  53   ;   ii1 =  53        ! Ombai Strait (e1v = 13 km)
-            ij0 = 124   ;   ij1 = 125   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 13.e3
+            ii0 =  53           ;   ii1 =  53        ! Ombai Strait (e1v = 13 km)
+            ij0 = 124 + isrow   ;   ij1 = 165 - isrow   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 13.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: Ombai : e1v reduced to 13 km'
 
-            ii0 =  56   ;   ii1 =  56        ! Timor Passage (e1v = 20 km)
-            ij0 = 124   ;   ij1 = 125   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 20.e3
+            ii0 =  56           ;   ii1 =  56        ! Timor Passage (e1v = 20 km)
+            ij0 = 124 + isrow   ;   ij1 = 145 - isrow   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 20.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: Timor Passage : e1v reduced to 20 km'
 
-            ii0 =  55   ;   ii1 =  55        ! West Halmahera Strait (e1v = 30 km)
-            ij0 = 141   ;   ij1 = 142   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 30.e3
+            ii0 =  55           ;   ii1 =  55        ! West Halmahera Strait (e1v = 30 km)
+            ij0 = 141 + isrow   ;   ij1 = 182 - isrow   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 30.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: W Halmahera : e1v reduced to 30 km'
 
-            ii0 =  58   ;   ii1 =  58        ! East Halmahera Strait (e1v = 50 km)
-            ij0 = 141   ;   ij1 = 142   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 50.e3
+            ii0 =  58           ;   ii1 =  58        ! East Halmahera Strait (e1v = 50 km)
+            ij0 = 141 + isrow   ;   ij1 = 182 - isrow   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 50.e3
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) '             orca_r1: E Halmahera : e1v reduced to 50 km'
-
-            !
-
-            !
-            !
             !
             !
@@ -471,4 +474,12 @@
       re2u_e1u(:,:) = e2u(:,:) / e1u(:,:)
       re1v_e2v(:,:) = e1v(:,:) / e2v(:,:)
+      r1_e1t  (:,:) = 1._wp    / e1t(:,:)
+      r1_e1u  (:,:) = 1._wp    / e1u(:,:)
+      r1_e1v  (:,:) = 1._wp    / e1v(:,:)
+      r1_e1f  (:,:) = 1._wp    / e1f(:,:)
+      r1_e2t  (:,:) = 1._wp    / e2t(:,:)
+      r1_e2u  (:,:) = 1._wp    / e2u(:,:)
+      r1_e2v  (:,:) = 1._wp    / e2v(:,:)
+      r1_e2f  (:,:) = 1._wp    / e2f(:,:)
 
       ! Control printing : Grid informations (if not restart)
@@ -616,26 +627,53 @@
       CALL iom_open( 'coordinates', inum )
       
-      CALL iom_get( inum, jpdom_data, 'glamt', glamt )
-      CALL iom_get( inum, jpdom_data, 'glamu', glamu )
-      CALL iom_get( inum, jpdom_data, 'glamv', glamv )
-      CALL iom_get( inum, jpdom_data, 'glamf', glamf )
-      
-      CALL iom_get( inum, jpdom_data, 'gphit', gphit )
-      CALL iom_get( inum, jpdom_data, 'gphiu', gphiu )
-      CALL iom_get( inum, jpdom_data, 'gphiv', gphiv )
-      CALL iom_get( inum, jpdom_data, 'gphif', gphif )
-      
-      CALL iom_get( inum, jpdom_data, 'e1t', e1t )
-      CALL iom_get( inum, jpdom_data, 'e1u', e1u )
-      CALL iom_get( inum, jpdom_data, 'e1v', e1v )
-      CALL iom_get( inum, jpdom_data, 'e1f', e1f )
-      
-      CALL iom_get( inum, jpdom_data, 'e2t', e2t )
-      CALL iom_get( inum, jpdom_data, 'e2u', e2u )
-      CALL iom_get( inum, jpdom_data, 'e2v', e2v )
-      CALL iom_get( inum, jpdom_data, 'e2f', e2f )
+      CALL iom_get( inum, jpdom_data, 'glamt', glamt, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'glamu', glamu, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'glamv', glamv, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'glamf', glamf, lrowattr=ln_use_jattr )
+      
+      CALL iom_get( inum, jpdom_data, 'gphit', gphit, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'gphiu', gphiu, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'gphiv', gphiv, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'gphif', gphif, lrowattr=ln_use_jattr )
+      
+      CALL iom_get( inum, jpdom_data, 'e1t', e1t, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'e1u', e1u, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'e1v', e1v, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'e1f', e1f, lrowattr=ln_use_jattr )
+      
+      CALL iom_get( inum, jpdom_data, 'e2t', e2t, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'e2u', e2u, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'e2v', e2v, lrowattr=ln_use_jattr )
+      CALL iom_get( inum, jpdom_data, 'e2f', e2f, lrowattr=ln_use_jattr )
       
       CALL iom_close( inum )
       
+! need to be define for the extended grid south of -80S
+! some point are undefined but you need to have e1 and e2 .NE. 0
+      WHERE (e1t==0.0_wp)
+         e1t=1.0e2
+      END WHERE
+      WHERE (e1v==0.0_wp)
+         e1v=1.0e2
+      END WHERE
+      WHERE (e1u==0.0_wp)
+         e1u=1.0e2
+      END WHERE
+      WHERE (e1f==0.0_wp)
+         e1f=1.0e2
+      END WHERE
+      WHERE (e2t==0.0_wp)
+         e2t=1.0e2
+      END WHERE
+      WHERE (e2v==0.0_wp)
+         e2v=1.0e2
+      END WHERE
+      WHERE (e2u==0.0_wp)
+         e2u=1.0e2
+      END WHERE
+      WHERE (e2f==0.0_wp)
+         e2f=1.0e2
+      END WHERE
+       
     END SUBROUTINE hgr_read
     
