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 5118 – NEMO

Changeset 5118


Ignore:
Timestamp:
2015-03-03T14:36:04+01:00 (9 years ago)
Author:
acc
Message:

Merge changes from dev_r5087_NOC2_JATTR (see #1472) into trunk following successful SETTE tests

Location:
trunk
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/DOC/TexFiles/Chapters/Chap_MISC.tex

    r4147 r5118  
    141141computational domain is laid out on local processor memories following a 2D  
    142142horizontal splitting. % (see {\S}IV.2-c) ref to the section to be updated 
     143 
     144\subsection{Simple subsetting of input files via netCDF attributes} 
     145 
     146The extended grids for use with the under-shelf ice cavities will result in redundant rows 
     147around Antarctica if the ice cavities are not active. A simple mechanism for subsetting 
     148input files associated with the extended domains has been implemented to avoid the need to 
     149maintain different sets of input fields for use with or without active ice cavities. The 
     150existing 'zoom' options are overly complex for this task and marked for deletion anyway. 
     151This alternative subsetting operates for the j-direction only and works by optionally 
     152looking for and using a global file attribute (named: \np{open\_ocean\_jstart}) to 
     153determine the starting j-row for input. The use of this option is best explained with an 
     154example: Consider an ORCA1 configuration using the extended grid bathymetry and coordinate 
     155files: 
     156\vspace{-10pt} 
     157\begin{alltt} 
     158\tiny 
     159\begin{verbatim} 
     160eORCA1_bathymetry_v2.nc 
     161eORCA1_coordinates.nc 
     162\end{verbatim} 
     163\end{alltt} 
     164\noindent These files define a horizontal domain of 362x332. Assuming the first row with 
     165open ocean wet points in the non-isf bathymetry for this set is row 42 (Fortran indexing) 
     166then the formally correct setting for \np{open\_ocean\_jstart} is 41. Using this value as the 
     167first row to be read will result in a 362x292 domain which is the same size as the original 
     168ORCA1 domain. Thus the extended coordinates and bathymetry files can be used with all the 
     169original input files for ORCA1 if the ice cavities are not active (\np{ln\_isfcav = 
     170.false.}). Full instructions for achieving this are: 
     171 
     172\noindent Add the new attribute to any input files requiring a j-row offset, i.e: 
     173\vspace{-10pt} 
     174\begin{alltt} 
     175\tiny 
     176\begin{verbatim} 
     177ncatted  -a open_ocean_jstart,global,a,d,41 eORCA1_coordinates.nc  
     178ncatted  -a open_ocean_jstart,global,a,d,41 eORCA1_bathymetry_v2.nc 
     179\end{verbatim} 
     180\end{alltt} 
     181  
     182\noindent Add the logical switch to \ngn{namcfg} in the configuration namelist and set true: 
     183%--------------------------------------------namcfg-------------------------------------------------------- 
     184\namdisplay{namcfg_orca1} 
     185%-------------------------------------------------------------------------------------------------------------- 
     186 
     187\noindent Note the j-size of the global domain is the (extended j-size minus 
     188\np{open\_ocean\_jstart} + 1 ) and this must match the size of all datasets other than 
     189bathymetry and coordinates currently. However the option can be extended to any global, 2D 
     190and 3D, netcdf, input field by adding the: 
     191\vspace{-10pt} 
     192\begin{alltt} 
     193\tiny 
     194\begin{verbatim} 
     195lrowattr=ln_use_jattr 
     196\end{verbatim} 
     197\end{alltt} 
     198optional argument to the appropriate \np{iom\_get} call and the \np{open\_ocean\_jstart} attribute to the corresponding input files. It remains the users responsibility to set \np{jpjdta} and \np{jpjglo} values in the \np{namelist\_cfg} file according to their needs. 
    143199 
    144200%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
  • trunk/NEMOGCM/ARCH/arch-X64_MOBILIS.fcm

    r4865 r5118  
    3636%NCDF_HOME           /home/acc/shared 
    3737%HDF5_HOME           /home/acc/shared 
    38 %XIOS_HOME           /home/acc/XIOS 
     38%XIOS_HOME           /home/acc/XIOS_1.0 
    3939%OASIS_HOME           
    4040 
  • trunk/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5109 r5118  
    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!----------------------------------------------------------------------- 
  • trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r5039 r5118  
    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 
  • trunk/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90

    r4990 r5118  
    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      ! 
  • trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90

    r4990 r5118  
    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 ) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r5040 r5118  
    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            !   
  • trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r5043 r5118  
    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 
  • trunk/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90

    r4990 r5118  
    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) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r4990 r5118  
    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 
  • trunk/NEMOGCM/NEMO/OPA_SRC/par_oce.F90

    r4990 r5118  
    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 
  • trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r4624 r5118  
    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.