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 14336 for NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE/DOM/domain.F90 – NEMO

Ignore:
Timestamp:
2021-01-23T11:09:54+01:00 (3 years ago)
Author:
smasson
Message:

dev_r14312_MPI_Interface: replace jperio by l_Iperio, l_Jperio, l_NFold, c_NFtype, #2598

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE/DOM/domain.F90

    r14255 r14336  
    113113         WRITE(numout,*)     '              jpnj    : ', jpnj, '   nn_hls  : ', nn_hls 
    114114         WRITE(numout,*)     '              jpnij   : ', jpnij 
    115          WRITE(numout,*)     '      lateral boundary of the Global domain : jperio  = ', jperio 
    116          SELECT CASE ( jperio ) 
    117          CASE( 0 )   ;   WRITE(numout,*) '         (i.e. closed)' 
    118          CASE( 1 )   ;   WRITE(numout,*) '         (i.e. cyclic east-west)' 
    119          CASE( 2 )   ;   WRITE(numout,*) '         (i.e. cyclic north-south)' 
    120          CASE( 3 )   ;   WRITE(numout,*) '         (i.e. north fold with T-point pivot)' 
    121          CASE( 4 )   ;   WRITE(numout,*) '         (i.e. cyclic east-west and north fold with T-point pivot)' 
    122          CASE( 5 )   ;   WRITE(numout,*) '         (i.e. north fold with F-point pivot)' 
    123          CASE( 6 )   ;   WRITE(numout,*) '         (i.e. cyclic east-west and north fold with F-point pivot)' 
    124          CASE( 7 )   ;   WRITE(numout,*) '         (i.e. cyclic east-west and north-south)' 
    125          CASE DEFAULT 
    126             CALL ctl_stop( 'dom_init:   jperio is out of range' ) 
    127          END SELECT 
     115         WRITE(numout,*)     '      lateral boundary of the Global domain:' 
     116         WRITE(numout,*)     '              cyclic east-west             :', l_Iperio 
     117         WRITE(numout,*)     '              cyclic north-south           :', l_Jperio 
     118         WRITE(numout,*)     '              North Pole folding           :', l_NFold 
     119         WRITE(numout,*)     '                 type of North pole Folding:', c_NFtype 
    128120         WRITE(numout,*)     '      Ocean model configuration used:' 
    129          WRITE(numout,*)     '         cn_cfg = ', TRIM( cn_cfg ), '   nn_cfg = ', nn_cfg 
     121         WRITE(numout,*)     '              cn_cfg = ', TRIM( cn_cfg ), '   nn_cfg = ', nn_cfg 
    130122      ENDIF 
    131123 
     
    622614 
    623615 
    624    SUBROUTINE domain_cfg( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     616   SUBROUTINE domain_cfg( cd_cfg, kk_cfg, kpi, kpj, kpk, ldIperio, ldJperio, ldNFold, cdNFtype ) 
    625617      !!---------------------------------------------------------------------- 
    626618      !!                     ***  ROUTINE domain_cfg  *** 
     
    630622      !! ** Method  :   read the cn_domcfg NetCDF file 
    631623      !!---------------------------------------------------------------------- 
    632       CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    633       INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
    634       INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes 
    635       INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c. 
    636       ! 
    637       INTEGER ::   inum   ! local integer 
     624      CHARACTER(len=*), INTENT(out) ::   cd_cfg               ! configuration name 
     625      INTEGER         , INTENT(out) ::   kk_cfg               ! configuration resolution 
     626      INTEGER         , INTENT(out) ::   kpi, kpj, kpk        ! global domain sizes 
     627      LOGICAL         , INTENT(out) ::   ldIperio, ldJperio   ! i- and j- periodicity 
     628      LOGICAL         , INTENT(out) ::   ldNFold              ! North pole folding 
     629      CHARACTER(len=1), INTENT(out) ::   cdNFtype             ! Folding type: T or F 
     630      ! 
     631      INTEGER ::   inum, iperio                   ! local integer 
    638632      REAL(wp) ::   zorca_res                     ! local scalars 
    639       REAL(wp) ::   zperio                        !   -      - 
     633      REAL(wp) ::   zperio, z01                   !   -      - 
    640634      INTEGER, DIMENSION(4) ::   idvar, idimsz    ! size   of dimensions 
    641635      !!---------------------------------------------------------------------- 
     
    678672      kpj = idimsz(2) 
    679673      kpk = idimsz(3) 
    680       CALL iom_get( inum, 'jperio', zperio )   ;   kperio = NINT( zperio ) 
     674      ! 
     675      IF( iom_varid( inum, 'jperio', ldstop = .FALSE. ) > 0 ) THEN                   ! keep compatibility with old version... 
     676         CALL iom_get( inum, 'jperio', zperio )   ;   iperio = NINT( zperio ) 
     677         ldIperio = iperio == 1 .OR. iperio == 4 .OR. iperio == 6 .OR. iperio == 7   ! i-periodicity 
     678         ldJperio = iperio == 2 .OR. iperio == 7                                     ! j-periodicity 
     679         ldNFold  = iperio >= 3 .OR. iperio <= 6                                     ! North pole folding 
     680         IF(     iperio == 3 .OR. iperio == 4 ) THEN   ;   cdNFtype = 'T'            !    folding at T point 
     681         ELSEIF( iperio == 5 .OR. iperio == 6 ) THEN   ;   cdNFtype = 'F'            !    folding at F point 
     682         ELSE                                          ;   cdNFtype = '-'   
     683         ENDIF 
     684      ELSE    
     685         z01 = 0._wp   ;   IF( iom_varid( inum, 'Iperio', ldstop = .FALSE. ) > 0 )   CALL iom_get( inum, 'Iperio', z01 ) 
     686         ldIperio = NINT(z01) == 1               ! i-periodicity 
     687         z01 = 0._wp   ;   IF( iom_varid( inum, 'Jperio', ldstop = .FALSE. ) > 0 )   CALL iom_get( inum, 'Jperio', z01 ) 
     688         ldJperio = NINT(z01) == 1               ! j-periodicity 
     689         cdNFtype = '-'                          ! default definition 
     690         z01 = 0._wp   ;   IF( iom_varid( inum, 'NFoldT', ldstop = .FALSE. ) > 0 )   CALL iom_get( inum, 'NFoldT', z01 ) 
     691         IF( NINT(z01) == 1 )   cdNFtype = 'T'   ! folding at T point 
     692         z01 = 0._wp   ;   IF( iom_varid( inum, 'NFoldF', ldstop = .FALSE. ) > 0 )   CALL iom_get( inum, 'NFoldF', z01 ) 
     693         IF( NINT(z01) == 1 )   cdNFtype = 'F'   ! folding at T point 
     694         ldNFold = cdNFtype /= '-'               ! North pole folding    
     695      ENDIF 
    681696      CALL iom_close( inum ) 
    682697      ! 
     
    686701         WRITE(numout,*) '      Nj0glo = ', kpj 
    687702         WRITE(numout,*) '      jpkglo = ', kpk 
    688          WRITE(numout,*) '      type of global domain lateral boundary   jperio = ', kperio 
    689703      ENDIF 
    690704      ! 
     
    733747      ! 
    734748      !                                   ! lateral boundary of the global domain 
    735       CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 ) 
     749      CALL iom_rstput( 0, 0, inum, 'Iperio', REAL( COUNT( (/l_Iperio/) ), wp), ktype = jp_i1 ) 
     750      CALL iom_rstput( 0, 0, inum, 'Jperio', REAL( COUNT( (/l_Jperio/) ), wp), ktype = jp_i1 ) 
     751      CALL iom_rstput( 0, 0, inum, 'NFoldT', REAL( COUNT( (/c_NFtype == 'T'/) ), wp), ktype = jp_i1 ) 
     752      CALL iom_rstput( 0, 0, inum, 'NFoldF', REAL( COUNT( (/c_NFtype == 'F'/) ), wp), ktype = jp_i1 ) 
    736753      ! 
    737754      !                                   ! type of vertical coordinate 
Note: See TracChangeset for help on using the changeset viewer.