Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 5089)
@@ -76,4 +76,6 @@
                                        !  = 5 North fold F-point pivot
                                        !  = 6 cyclic East-West AND North fold F-point pivot
+   ln_use_jattr = .false.              !  use (T) the file attribute: open_ocean_jstart, if present 
+                                       !  in netcdf input files, as the start j-row for reading
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 5089)
@@ -149,5 +149,5 @@
          &             nn_bench, nn_timing
       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
-         &             jpizoom, jpjzoom, jperio
+         &             jpizoom, jpjzoom, jperio, ln_use_jattr
       !!----------------------------------------------------------------------
       cltxt = ''
@@ -359,4 +359,5 @@
          WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom
          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio   
+         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr
       ENDIF
       !                             ! Parameter control
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90	(revision 5089)
@@ -129,5 +129,5 @@
          &             nn_bench, nn_timing
       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
-         &             jpizoom, jpjzoom, jperio
+         &             jpizoom, jpjzoom, jperio, ln_use_jattr
       !!----------------------------------------------------------------------
       !
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90	(revision 5089)
@@ -616,23 +616,23 @@
       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 )
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 5089)
@@ -534,5 +534,9 @@
          IF( ln_zps .OR. ln_sco )   THEN              ! zps or sco : read meter bathymetry
             CALL iom_open ( 'bathy_meter.nc', inum ) 
-            CALL iom_get  ( inum, jpdom_data, 'Bathymetry', bathy )
+            IF ( ln_isfcav ) THEN
+               CALL iom_get  ( inum, jpdom_data, 'Bathymetry_isf', bathy, lrowattr=.false. )
+            ELSE
+               CALL iom_get  ( inum, jpdom_data, 'Bathymetry'    , bathy, lrowattr=ln_use_jattr  )
+            END IF
             CALL iom_close( inum )
             !  
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 5089)
@@ -543,5 +543,5 @@
    END SUBROUTINE iom_g1d
 
-   SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount )
+   SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, lrowattr )
       INTEGER         , INTENT(in   )                           ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                           ::   kdom      ! Type of domain to be read
@@ -551,12 +551,17 @@
       INTEGER         , INTENT(in   ), DIMENSION(2)  , OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(2)  , OPTIONAL ::   kcount    ! number of points in each axis
+      LOGICAL         , INTENT(in   )                , OPTIONAL ::   lrowattr  ! logical flag telling iom_get to
+                                                                               ! look for and use a file attribute
+                                                                               ! called open_ocean_jstart to set the start
+                                                                               ! value for the 2nd dimension (netcdf only)
       !
       IF( kiomid > 0 ) THEN
          IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom       , cdvar        , pv_r2d=pvar,   &
-              &                                                     ktime=ktime, kstart=kstart, kcount=kcount )
+              &                                                     ktime=ktime, kstart=kstart, kcount=kcount, &
+              &                                                     lrowattr=lrowattr )
       ENDIF
    END SUBROUTINE iom_g2d
 
-   SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount )
+   SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, lrowattr )
       INTEGER         , INTENT(in   )                             ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                             ::   kdom      ! Type of domain to be read
@@ -566,8 +571,13 @@
       INTEGER         , INTENT(in   ), DIMENSION(3)    , OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(3)    , OPTIONAL ::   kcount    ! number of points in each axis
+      LOGICAL         , INTENT(in   )                  , OPTIONAL ::   lrowattr  ! logical flag telling iom_get to
+                                                                                 ! look for and use a file attribute
+                                                                                 ! called open_ocean_jstart to set the start
+                                                                                 ! value for the 2nd dimension (netcdf only)
       !
       IF( kiomid > 0 ) THEN
          IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom       , cdvar        , pv_r3d=pvar,   &
-              &                                                     ktime=ktime, kstart=kstart, kcount=kcount )
+              &                                                     ktime=ktime, kstart=kstart, kcount=kcount, &
+              &                                                     lrowattr=lrowattr )
       ENDIF
    END SUBROUTINE iom_g3d
@@ -576,5 +586,6 @@
    SUBROUTINE iom_get_123d( kiomid, kdom  , cdvar ,   &
          &                  pv_r1d, pv_r2d, pv_r3d,   &
-         &                  ktime , kstart, kcount  )
+         &                  ktime , kstart, kcount,   &
+         &                  lrowattr                )
       !!-----------------------------------------------------------------------
       !!                  ***  ROUTINE  iom_get_123d  ***
@@ -593,6 +604,12 @@
       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart     ! start position of the reading in each axis 
       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount     ! number of points to be read in each axis
+      LOGICAL                    , INTENT(in   ), OPTIONAL ::   lrowattr   ! logical flag telling iom_get to
+                                                                           ! look for and use a file attribute
+                                                                           ! called open_ocean_jstart to set the start
+                                                                           ! value for the 2nd dimension (netcdf only)
       !
       LOGICAL                        ::   llnoov      ! local definition to read overlap
+      LOGICAL                        ::   luse_jattr  ! local definition to read open_ocean_jstart file attribute
+      INTEGER                        ::   jstartrow   ! start point for 2nd dimension optionally set by file attribute
       INTEGER                        ::   jl          ! loop on number of dimension 
       INTEGER                        ::   idom        ! type of domain
@@ -604,5 +621,5 @@
       INTEGER                        ::   ix1, ix2, iy1, iy2   ! subdomain indexes
       INTEGER                        ::   ji, jj      ! loop counters
-      INTEGER                        ::   irankpv       ! 
+      INTEGER                        ::   irankpv     ! 
       INTEGER                        ::   ind1, ind2  ! substring index
       INTEGER, DIMENSION(jpmax_dims) ::   istart      ! starting point to read for each axis
@@ -628,4 +645,21 @@
       IF( PRESENT(kstart) .AND. (.NOT. PRESENT(kcount)) ) CALL ctl_stop(trim(clinfo), 'kstart present needs kcount present')
       IF( PRESENT(kstart) .AND. idom /= jpdom_unknown   ) CALL ctl_stop(trim(clinfo), 'kstart present needs kdom = jpdom_unknown')
+
+      luse_jattr = .false.
+      IF( PRESENT(lrowattr) ) THEN
+         IF( lrowattr .AND. idom /= jpdom_data   ) CALL ctl_stop(trim(clinfo), 'lrowattr present and true needs kdom = jpdom_data')
+         IF( lrowattr .AND. idom == jpdom_data   ) luse_jattr = .true.
+      ENDIF
+      IF( luse_jattr ) THEN
+         SELECT CASE (iom_file(kiomid)%iolib)
+         CASE (jpioipsl, jprstdimg )
+             CALL ctl_warn(trim(clinfo), 'lrowattr present and true but this only works with netcdf (jpnf90)')
+             luse_jattr = .false.
+         CASE (jpnf90   )   
+             ! Ok
+         CASE DEFAULT    
+            CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' )
+         END SELECT
+      ENDIF
 
       ! Search for the variable in the data base (eventually actualize data)
@@ -701,6 +735,12 @@
             ELSE 
                IF( .NOT. PRESENT(pv_r1d) ) THEN   !   not a 1D array
-                  IF(     idom == jpdom_data    ) THEN ; istart(1:2) = (/ mig(1), mjg(1) /)  ! icnt(1:2) done bellow
-                  ELSEIF( idom == jpdom_global  ) THEN ; istart(1:2) = (/ nimpp , njmpp  /)  ! icnt(1:2) done bellow
+                  IF(     idom == jpdom_data    ) THEN
+                     jstartrow = 1
+                     IF( luse_jattr ) THEN
+                        CALL iom_getatt(kiomid, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found
+                        jstartrow = MAX(1,jstartrow)
+                     ENDIF
+                     istart(1:2) = (/ mig(1), mjg(1) + jstartrow - 1 /)  ! icnt(1:2) done below
+                  ELSEIF( idom == jpdom_global  ) THEN ; istart(1:2) = (/ nimpp , njmpp  /)  ! icnt(1:2) done below
                   ENDIF
                   ! we do not read the overlap                     -> we start to read at nldi, nldj
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 5089)
@@ -45,4 +45,5 @@
       INTEGER ::  inum                        ! temporary logical unit
       INTEGER ::  idir                        ! temporary integers
+      INTEGER ::  jstartrow                   ! temporary integers
       INTEGER ::   ios                        ! Local integer output status for namelist read
       INTEGER ::   &
@@ -100,11 +101,24 @@
       ! open the file
       ! Remember that at this level in the code, mpp is not yet initialized, so
-      ! the file must be open with jpdom_unknown, and kstart amd kcount forced 
+      ! the file must be open with jpdom_unknown, and kstart and kcount forced 
+      jstartrow = 1
       IF ( ln_zco ) THEN 
          CALL iom_open ( 'bathy_level.nc', inum )   ! Level bathymetry
-         CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) )
+          ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file
+          ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry
+         CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found
+         jstartrow = MAX(1,jstartrow)
+         CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) )
       ELSE
          CALL iom_open ( 'bathy_meter.nc', inum )   ! Meter bathy in case of partial steps
-         CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) )
+         IF ( ln_isfcav ) THEN
+             CALL iom_get ( inum, jpdom_unknown, 'Bathymetry_isf' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) )
+         ELSE
+             ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file
+             ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry
+             CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found
+             jstartrow = MAX(1,jstartrow)
+             CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) )
+         ENDIF
       ENDIF
       CALL iom_close (inum)
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 5089)
@@ -222,5 +222,5 @@
          &             nn_bench, nn_timing
       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
-         &             jpizoom, jpjzoom, jperio
+         &             jpizoom, jpjzoom, jperio, ln_use_jattr
       !!----------------------------------------------------------------------
       !
@@ -261,4 +261,5 @@
       nperio  = 0
       jperio  = 0
+      ln_use_jattr = .false.
    ENDIF
 #endif
@@ -506,4 +507,5 @@
          WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom
          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio   
+         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr
       ENDIF
       !                             ! Parameter control
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/par_oce.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/par_oce.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/par_oce.F90	(revision 5089)
@@ -53,4 +53,11 @@
    !                                       !  = 6 cyclic East-West AND North fold F-point pivot
 
+   ! Input file read offset
+   LOGICAL       ::   ln_use_jattr     !: Use file global attribute: open_ocean_jstart to determine start j-row 
+                                           ! when reading input from those netcdf files that have the 
+                                           ! attribute defined. This is designed to enable input files associated 
+                                           ! with the extended grids used in the under ice shelf configurations to 
+                                           ! be used without redundant rows when the ice shelves are not in use.
+
    !!  Values set to pp_not_used indicates that this parameter is not used in THIS config.
    !!  Values set to pp_to_be_computed  indicates that variables will be computed in domzgr
Index: /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
===================================================================
--- /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 5088)
+++ /branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 5089)
@@ -161,5 +161,5 @@
          &             nn_bench, nn_timing
       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
-         &             jpizoom, jpjzoom, jperio
+         &             jpizoom, jpjzoom, jperio, ln_use_jattr
       !!----------------------------------------------------------------------
       cltxt = ''
@@ -348,4 +348,5 @@
          WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom
          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio   
+         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr
       ENDIF
       !                             ! Parameter control
