New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5089 – NEMO

Changeset 5089


Ignore:
Timestamp:
2015-02-17T13:57:51+01:00 (9 years ago)
Author:
acc
Message:

#1472. Branch dev_r5087_NOC2_JATTR. Submit first working version tested with ORCA1 extended grids. See wiki:ticket/1472_NOC2_JATTR for usage example

Location:
branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5029 r5089  
    7676                                       !  = 5 North fold F-point pivot 
    7777                                       !  = 6 cyclic East-West AND North fold F-point pivot 
     78   ln_use_jattr = .false.              !  use (T) the file attribute: open_ocean_jstart, if present  
     79                                       !  in netcdf input files, as the start j-row for reading 
    7880/ 
    7981!----------------------------------------------------------------------- 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r5039 r5089  
    149149         &             nn_bench, nn_timing 
    150150      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    151          &             jpizoom, jpjzoom, jperio 
     151         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    152152      !!---------------------------------------------------------------------- 
    153153      cltxt = '' 
     
    359359         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    360360         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     361         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    361362      ENDIF 
    362363      !                             ! Parameter control 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90

    r4990 r5089  
    129129         &             nn_bench, nn_timing 
    130130      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    131          &             jpizoom, jpjzoom, jperio 
     131         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    132132      !!---------------------------------------------------------------------- 
    133133      ! 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90

    r4990 r5089  
    616616      CALL iom_open( 'coordinates', inum ) 
    617617       
    618       CALL iom_get( inum, jpdom_data, 'glamt', glamt ) 
    619       CALL iom_get( inum, jpdom_data, 'glamu', glamu ) 
    620       CALL iom_get( inum, jpdom_data, 'glamv', glamv ) 
    621       CALL iom_get( inum, jpdom_data, 'glamf', glamf ) 
    622        
    623       CALL iom_get( inum, jpdom_data, 'gphit', gphit ) 
    624       CALL iom_get( inum, jpdom_data, 'gphiu', gphiu ) 
    625       CALL iom_get( inum, jpdom_data, 'gphiv', gphiv ) 
    626       CALL iom_get( inum, jpdom_data, 'gphif', gphif ) 
    627        
    628       CALL iom_get( inum, jpdom_data, 'e1t', e1t ) 
    629       CALL iom_get( inum, jpdom_data, 'e1u', e1u ) 
    630       CALL iom_get( inum, jpdom_data, 'e1v', e1v ) 
    631       CALL iom_get( inum, jpdom_data, 'e1f', e1f ) 
    632        
    633       CALL iom_get( inum, jpdom_data, 'e2t', e2t ) 
    634       CALL iom_get( inum, jpdom_data, 'e2u', e2u ) 
    635       CALL iom_get( inum, jpdom_data, 'e2v', e2v ) 
    636       CALL iom_get( inum, jpdom_data, 'e2f', e2f ) 
     618      CALL iom_get( inum, jpdom_data, 'glamt', glamt, lrowattr=ln_use_jattr ) 
     619      CALL iom_get( inum, jpdom_data, 'glamu', glamu, lrowattr=ln_use_jattr ) 
     620      CALL iom_get( inum, jpdom_data, 'glamv', glamv, lrowattr=ln_use_jattr ) 
     621      CALL iom_get( inum, jpdom_data, 'glamf', glamf, lrowattr=ln_use_jattr ) 
     622       
     623      CALL iom_get( inum, jpdom_data, 'gphit', gphit, lrowattr=ln_use_jattr ) 
     624      CALL iom_get( inum, jpdom_data, 'gphiu', gphiu, lrowattr=ln_use_jattr ) 
     625      CALL iom_get( inum, jpdom_data, 'gphiv', gphiv, lrowattr=ln_use_jattr ) 
     626      CALL iom_get( inum, jpdom_data, 'gphif', gphif, lrowattr=ln_use_jattr ) 
     627       
     628      CALL iom_get( inum, jpdom_data, 'e1t', e1t, lrowattr=ln_use_jattr ) 
     629      CALL iom_get( inum, jpdom_data, 'e1u', e1u, lrowattr=ln_use_jattr ) 
     630      CALL iom_get( inum, jpdom_data, 'e1v', e1v, lrowattr=ln_use_jattr ) 
     631      CALL iom_get( inum, jpdom_data, 'e1f', e1f, lrowattr=ln_use_jattr ) 
     632       
     633      CALL iom_get( inum, jpdom_data, 'e2t', e2t, lrowattr=ln_use_jattr ) 
     634      CALL iom_get( inum, jpdom_data, 'e2u', e2u, lrowattr=ln_use_jattr ) 
     635      CALL iom_get( inum, jpdom_data, 'e2v', e2v, lrowattr=ln_use_jattr ) 
     636      CALL iom_get( inum, jpdom_data, 'e2f', e2f, lrowattr=ln_use_jattr ) 
    637637       
    638638      CALL iom_close( inum ) 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r5040 r5089  
    534534         IF( ln_zps .OR. ln_sco )   THEN              ! zps or sco : read meter bathymetry 
    535535            CALL iom_open ( 'bathy_meter.nc', inum )  
    536             CALL iom_get  ( inum, jpdom_data, 'Bathymetry', bathy ) 
     536            IF ( ln_isfcav ) THEN 
     537               CALL iom_get  ( inum, jpdom_data, 'Bathymetry_isf', bathy, lrowattr=.false. ) 
     538            ELSE 
     539               CALL iom_get  ( inum, jpdom_data, 'Bathymetry'    , bathy, lrowattr=ln_use_jattr  ) 
     540            END IF 
    537541            CALL iom_close( inum ) 
    538542            !   
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r5043 r5089  
    543543   END SUBROUTINE iom_g1d 
    544544 
    545    SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount ) 
     545   SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, lrowattr ) 
    546546      INTEGER         , INTENT(in   )                           ::   kiomid    ! Identifier of the file 
    547547      INTEGER         , INTENT(in   )                           ::   kdom      ! Type of domain to be read 
     
    551551      INTEGER         , INTENT(in   ), DIMENSION(2)  , OPTIONAL ::   kstart    ! start axis position of the reading  
    552552      INTEGER         , INTENT(in   ), DIMENSION(2)  , OPTIONAL ::   kcount    ! number of points in each axis 
     553      LOGICAL         , INTENT(in   )                , OPTIONAL ::   lrowattr  ! logical flag telling iom_get to 
     554                                                                               ! look for and use a file attribute 
     555                                                                               ! called open_ocean_jstart to set the start 
     556                                                                               ! value for the 2nd dimension (netcdf only) 
    553557      ! 
    554558      IF( kiomid > 0 ) THEN 
    555559         IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom       , cdvar        , pv_r2d=pvar,   & 
    556               &                                                     ktime=ktime, kstart=kstart, kcount=kcount ) 
     560              &                                                     ktime=ktime, kstart=kstart, kcount=kcount, & 
     561              &                                                     lrowattr=lrowattr ) 
    557562      ENDIF 
    558563   END SUBROUTINE iom_g2d 
    559564 
    560    SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount ) 
     565   SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, lrowattr ) 
    561566      INTEGER         , INTENT(in   )                             ::   kiomid    ! Identifier of the file 
    562567      INTEGER         , INTENT(in   )                             ::   kdom      ! Type of domain to be read 
     
    566571      INTEGER         , INTENT(in   ), DIMENSION(3)    , OPTIONAL ::   kstart    ! start axis position of the reading  
    567572      INTEGER         , INTENT(in   ), DIMENSION(3)    , OPTIONAL ::   kcount    ! number of points in each axis 
     573      LOGICAL         , INTENT(in   )                  , OPTIONAL ::   lrowattr  ! logical flag telling iom_get to 
     574                                                                                 ! look for and use a file attribute 
     575                                                                                 ! called open_ocean_jstart to set the start 
     576                                                                                 ! value for the 2nd dimension (netcdf only) 
    568577      ! 
    569578      IF( kiomid > 0 ) THEN 
    570579         IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom       , cdvar        , pv_r3d=pvar,   & 
    571               &                                                     ktime=ktime, kstart=kstart, kcount=kcount ) 
     580              &                                                     ktime=ktime, kstart=kstart, kcount=kcount, & 
     581              &                                                     lrowattr=lrowattr ) 
    572582      ENDIF 
    573583   END SUBROUTINE iom_g3d 
     
    576586   SUBROUTINE iom_get_123d( kiomid, kdom  , cdvar ,   & 
    577587         &                  pv_r1d, pv_r2d, pv_r3d,   & 
    578          &                  ktime , kstart, kcount  ) 
     588         &                  ktime , kstart, kcount,   & 
     589         &                  lrowattr                ) 
    579590      !!----------------------------------------------------------------------- 
    580591      !!                  ***  ROUTINE  iom_get_123d  *** 
     
    593604      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart     ! start position of the reading in each axis  
    594605      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount     ! number of points to be read in each axis 
     606      LOGICAL                    , INTENT(in   ), OPTIONAL ::   lrowattr   ! logical flag telling iom_get to 
     607                                                                           ! look for and use a file attribute 
     608                                                                           ! called open_ocean_jstart to set the start 
     609                                                                           ! value for the 2nd dimension (netcdf only) 
    595610      ! 
    596611      LOGICAL                        ::   llnoov      ! local definition to read overlap 
     612      LOGICAL                        ::   luse_jattr  ! local definition to read open_ocean_jstart file attribute 
     613      INTEGER                        ::   jstartrow   ! start point for 2nd dimension optionally set by file attribute 
    597614      INTEGER                        ::   jl          ! loop on number of dimension  
    598615      INTEGER                        ::   idom        ! type of domain 
     
    604621      INTEGER                        ::   ix1, ix2, iy1, iy2   ! subdomain indexes 
    605622      INTEGER                        ::   ji, jj      ! loop counters 
    606       INTEGER                        ::   irankpv       !  
     623      INTEGER                        ::   irankpv     !  
    607624      INTEGER                        ::   ind1, ind2  ! substring index 
    608625      INTEGER, DIMENSION(jpmax_dims) ::   istart      ! starting point to read for each axis 
     
    628645      IF( PRESENT(kstart) .AND. (.NOT. PRESENT(kcount)) ) CALL ctl_stop(trim(clinfo), 'kstart present needs kcount present') 
    629646      IF( PRESENT(kstart) .AND. idom /= jpdom_unknown   ) CALL ctl_stop(trim(clinfo), 'kstart present needs kdom = jpdom_unknown') 
     647 
     648      luse_jattr = .false. 
     649      IF( PRESENT(lrowattr) ) THEN 
     650         IF( lrowattr .AND. idom /= jpdom_data   ) CALL ctl_stop(trim(clinfo), 'lrowattr present and true needs kdom = jpdom_data') 
     651         IF( lrowattr .AND. idom == jpdom_data   ) luse_jattr = .true. 
     652      ENDIF 
     653      IF( luse_jattr ) THEN 
     654         SELECT CASE (iom_file(kiomid)%iolib) 
     655         CASE (jpioipsl, jprstdimg ) 
     656             CALL ctl_warn(trim(clinfo), 'lrowattr present and true but this only works with netcdf (jpnf90)') 
     657             luse_jattr = .false. 
     658         CASE (jpnf90   )    
     659             ! Ok 
     660         CASE DEFAULT     
     661            CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 
     662         END SELECT 
     663      ENDIF 
    630664 
    631665      ! Search for the variable in the data base (eventually actualize data) 
     
    701735            ELSE  
    702736               IF( .NOT. PRESENT(pv_r1d) ) THEN   !   not a 1D array 
    703                   IF(     idom == jpdom_data    ) THEN ; istart(1:2) = (/ mig(1), mjg(1) /)  ! icnt(1:2) done bellow 
    704                   ELSEIF( idom == jpdom_global  ) THEN ; istart(1:2) = (/ nimpp , njmpp  /)  ! icnt(1:2) done bellow 
     737                  IF(     idom == jpdom_data    ) THEN 
     738                     jstartrow = 1 
     739                     IF( luse_jattr ) THEN 
     740                        CALL iom_getatt(kiomid, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 
     741                        jstartrow = MAX(1,jstartrow) 
     742                     ENDIF 
     743                     istart(1:2) = (/ mig(1), mjg(1) + jstartrow - 1 /)  ! icnt(1:2) done below 
     744                  ELSEIF( idom == jpdom_global  ) THEN ; istart(1:2) = (/ nimpp , njmpp  /)  ! icnt(1:2) done below 
    705745                  ENDIF 
    706746                  ! we do not read the overlap                     -> we start to read at nldi, nldj 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90

    r4990 r5089  
    4545      INTEGER ::  inum                        ! temporary logical unit 
    4646      INTEGER ::  idir                        ! temporary integers 
     47      INTEGER ::  jstartrow                   ! temporary integers 
    4748      INTEGER ::   ios                        ! Local integer output status for namelist read 
    4849      INTEGER ::   & 
     
    100101      ! open the file 
    101102      ! Remember that at this level in the code, mpp is not yet initialized, so 
    102       ! the file must be open with jpdom_unknown, and kstart amd kcount forced  
     103      ! the file must be open with jpdom_unknown, and kstart and kcount forced  
     104      jstartrow = 1 
    103105      IF ( ln_zco ) THEN  
    104106         CALL iom_open ( 'bathy_level.nc', inum )   ! Level bathymetry 
    105          CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 
     107          ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 
     108          ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 
     109         CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 
     110         jstartrow = MAX(1,jstartrow) 
     111         CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 
    106112      ELSE 
    107113         CALL iom_open ( 'bathy_meter.nc', inum )   ! Meter bathy in case of partial steps 
    108          CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 
     114         IF ( ln_isfcav ) THEN 
     115             CALL iom_get ( inum, jpdom_unknown, 'Bathymetry_isf' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 
     116         ELSE 
     117             ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 
     118             ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 
     119             CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 
     120             jstartrow = MAX(1,jstartrow) 
     121             CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 
     122         ENDIF 
    109123      ENDIF 
    110124      CALL iom_close (inum) 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r4990 r5089  
    222222         &             nn_bench, nn_timing 
    223223      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    224          &             jpizoom, jpjzoom, jperio 
     224         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    225225      !!---------------------------------------------------------------------- 
    226226      ! 
     
    261261      nperio  = 0 
    262262      jperio  = 0 
     263      ln_use_jattr = .false. 
    263264   ENDIF 
    264265#endif 
     
    506507         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    507508         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     509         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    508510      ENDIF 
    509511      !                             ! Parameter control 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/OPA_SRC/par_oce.F90

    r4990 r5089  
    5353   !                                       !  = 6 cyclic East-West AND North fold F-point pivot 
    5454 
     55   ! Input file read offset 
     56   LOGICAL       ::   ln_use_jattr     !: Use file global attribute: open_ocean_jstart to determine start j-row  
     57                                           ! when reading input from those netcdf files that have the  
     58                                           ! attribute defined. This is designed to enable input files associated  
     59                                           ! with the extended grids used in the under ice shelf configurations to  
     60                                           ! be used without redundant rows when the ice shelves are not in use. 
     61 
    5562   !!  Values set to pp_not_used indicates that this parameter is not used in THIS config. 
    5663   !!  Values set to pp_to_be_computed  indicates that variables will be computed in domzgr 
  • branches/2015/dev_r5087_NOC2_JATTR/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r4624 r5089  
    161161         &             nn_bench, nn_timing 
    162162      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    163          &             jpizoom, jpjzoom, jperio 
     163         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    164164      !!---------------------------------------------------------------------- 
    165165      cltxt = '' 
     
    348348         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    349349         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     350         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    350351      ENDIF 
    351352      !                             ! Parameter control 
Note: See TracChangeset for help on using the changeset viewer.