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 14574 for NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM – NEMO

Ignore:
Timestamp:
2021-03-03T16:04:57+01:00 (3 years ago)
Author:
hadcv
Message:

#2600: Merge in trunk changes to r14509

Location:
NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/dom_oce.F90

    r14537 r14574  
    6565   !! space domain parameters 
    6666   !!---------------------------------------------------------------------- 
    67    INTEGER, PUBLIC ::   jperio   !: Global domain lateral boundary type (between 0 and 7) 
    68    !                                !  = 0 closed                 ;   = 1 cyclic East-West 
    69    !                                !  = 2 cyclic North-South     ;   = 3 North fold T-point pivot 
    70    !                                !  = 4 cyclic East-West AND North fold T-point pivot 
    71    !                                !  = 5 North fold F-point pivot 
    72    !                                !  = 6 cyclic East-West AND North fold F-point pivot 
    73    !                                !  = 7 bi-cyclic East-West AND North-South 
    74    LOGICAL, PUBLIC ::   l_Iperio, l_Jperio   !   should we explicitely take care I/J periodicity 
     67   LOGICAL         , PUBLIC ::   l_Iperio, l_Jperio   ! i- j-periodicity 
     68   LOGICAL         , PUBLIC ::   l_NFold              ! North Pole folding 
     69   CHARACTER(len=1), PUBLIC ::   c_NFtype             ! type of North pole Folding: T or F point 
    7570 
    7671   ! Tiling namelist 
     
    8681 
    8782   !                             !: domain MPP decomposition parameters 
    88    INTEGER             , PUBLIC ::   nimpp, njmpp     !: i- & j-indexes for mpp-subdomain left bottom 
    89    INTEGER             , PUBLIC ::   nproc            !: number for local processor 
    90    INTEGER             , PUBLIC ::   narea            !: number for local area 
    91    INTEGER             , PUBLIC ::   nbondi, nbondj   !: mark of i- and j-direction local boundaries 
    92    INTEGER, ALLOCATABLE, PUBLIC ::   nbondi_bdy(:)    !: mark i-direction local boundaries for BDY open boundaries 
    93    INTEGER, ALLOCATABLE, PUBLIC ::   nbondj_bdy(:)    !: mark j-direction local boundaries for BDY open boundaries 
    94    INTEGER, ALLOCATABLE, PUBLIC ::   nbondi_bdy_b(:)  !: mark i-direction of neighbours local boundaries for BDY open boundaries 
    95    INTEGER, ALLOCATABLE, PUBLIC ::   nbondj_bdy_b(:)  !: mark j-direction of neighbours local boundaries for BDY open boundaries 
    96  
    97    INTEGER, PUBLIC ::   npolj             !: north fold mark (0, 3 or 4) 
    98    INTEGER, PUBLIC ::   noea, nowe        !: index of the local neighboring processors in 
    99    INTEGER, PUBLIC ::   noso, nono        !: east, west, south and north directions 
    100    INTEGER, PUBLIC ::   nones, nonws        !: north-east, north-west directions for sending 
    101    INTEGER, PUBLIC ::   noses, nosws        !: south-east, south-west directions for sending 
    102    INTEGER, PUBLIC ::   noner, nonwr        !: north-east, north-west directions for receiving 
    103    INTEGER, PUBLIC ::   noser, noswr        !: south-east, south-west directions for receiving 
    104    INTEGER, PUBLIC ::   nidom             !: ??? 
     83   INTEGER              , PUBLIC ::   nimpp, njmpp     !: i- & j-indexes for mpp-subdomain left bottom 
     84   INTEGER              , PUBLIC ::   narea            !: number for local area (starting at 1) = MPI rank + 1 
     85   INTEGER,               PUBLIC ::   nidom      !: IOIPSL things... 
    10586 
    10687   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mig        !: local ==> global domain, including halos (jpiglo), i-index 
     
    11293   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mj0, mj1   !: global, including halos (jpjglo) ==> local domain j-index 
    11394   !                                                                !:    (mj0=1 and mj1=0 if global index not in local domain) 
    114    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nimppt,  njmppt   !: i-, j-indexes for each processor 
    115    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ibonit,  ibonjt   !: i-, j- processor neighbour existence 
    116    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   jpiall,  jpjall   !: dimensions of all subdomain 
    117    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nis0all, njs0all  !: first, last indoor index for all i-subdomain 
    118    INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nie0all, nje0all  !: first, last indoor index for all j-subdomain 
    11995   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nfimpp, nfproc, nfjpi 
    12096 
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domain.F90

    r14537 r14574  
    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      CHARACTER(len=7) ::   catt                  ! 'T', 'F', '-' or 'UNKNOWN' 
     632      INTEGER ::   inum, iperio, iatt             ! local integer 
    638633      REAL(wp) ::   zorca_res                     ! local scalars 
    639634      REAL(wp) ::   zperio                        !   -      - 
     
    649644      CALL iom_open( cn_domcfg, inum ) 
    650645      ! 
    651       !                                   !- ORCA family specificity 
    652       IF(  iom_varid( inum, 'ORCA'       , ldstop = .FALSE. ) > 0  .AND.  & 
    653          & iom_varid( inum, 'ORCA_index' , ldstop = .FALSE. ) > 0    ) THEN 
    654          ! 
    655          cd_cfg = 'ORCA' 
    656          CALL iom_get( inum, 'ORCA_index', zorca_res )   ;   kk_cfg = NINT( zorca_res ) 
    657          ! 
    658          IF(lwp) THEN 
    659             WRITE(numout,*) '   .' 
    660             WRITE(numout,*) '   ==>>>   ORCA configuration ' 
    661             WRITE(numout,*) '   .' 
     646      CALL iom_getatt( inum,  'CfgName', cd_cfg )   ! returns 'UNKNOWN' if not found 
     647      CALL iom_getatt( inum, 'CfgIndex', kk_cfg )   ! returns      -999 if not found 
     648      ! 
     649      ! ------- keep compatibility with OLD VERSION... start ------- 
     650      IF( cd_cfg == 'UNKNOWN' .AND. kk_cfg == -999 ) THEN 
     651         IF(  iom_varid( inum, 'ORCA'       , ldstop = .FALSE. ) > 0  .AND.  & 
     652            & iom_varid( inum, 'ORCA_index' , ldstop = .FALSE. ) > 0    ) THEN 
     653            ! 
     654            cd_cfg = 'ORCA' 
     655            CALL iom_get( inum, 'ORCA_index', zorca_res )   ;   kk_cfg = NINT( zorca_res ) 
     656            ! 
     657         ELSE 
     658            CALL iom_getatt( inum, 'cn_cfg', cd_cfg )  ! returns 'UNKNOWN' if not found 
     659            CALL iom_getatt( inum, 'nn_cfg', kk_cfg )  ! returns      -999 if not found 
    662660         ENDIF 
    663          ! 
    664       ELSE                                !- cd_cfg & k_cfg are not used 
    665          cd_cfg = 'UNKNOWN' 
    666          kk_cfg = -9999999 
    667                                           !- or they may be present as global attributes 
    668                                           !- (netcdf only) 
    669          CALL iom_getatt( inum, 'cn_cfg', cd_cfg )  ! returns   !  if not found 
    670          CALL iom_getatt( inum, 'nn_cfg', kk_cfg )  ! returns -999 if not found 
    671          IF( TRIM(cd_cfg) == '!') cd_cfg = 'UNKNOWN' 
    672          IF( kk_cfg == -999     ) kk_cfg = -9999999 
    673          ! 
    674       ENDIF 
    675        ! 
     661      ENDIF 
     662      ! ------- keep compatibility with OLD VERSION... end ------- 
     663      ! 
    676664      idvar = iom_varid( inum, 'e3t_0', kdimsz = idimsz )   ! use e3t_0, that must exist, to get jp(ijk)glo 
    677665      kpi = idimsz(1) 
    678666      kpj = idimsz(2) 
    679667      kpk = idimsz(3) 
    680       CALL iom_get( inum, 'jperio', zperio )   ;   kperio = NINT( zperio ) 
     668      ! 
     669      CALL iom_getatt( inum, 'Iperio', iatt )   ;   ldIperio = iatt == 1   ! returns      -999 if not found -> default = .false. 
     670      CALL iom_getatt( inum, 'Jperio', iatt )   ;   ldJperio = iatt == 1   ! returns      -999 if not found -> default = .false. 
     671      CALL iom_getatt( inum,  'NFold', iatt )   ;   ldNFold  = iatt == 1   ! returns      -999 if not found -> default = .false. 
     672      CALL iom_getatt( inum, 'NFtype', catt )                              ! returns 'UNKNOWN' if not found 
     673      IF( LEN_TRIM(catt) == 1 ) THEN   ;   cdNFtype = TRIM(catt) 
     674      ELSE                             ;   cdNFtype = '-' 
     675      ENDIF 
     676      ! 
     677      ! ------- keep compatibility with OLD VERSION... start ------- 
     678      IF( iatt == -999 .AND. catt == 'UNKNOWN' .AND. iom_varid( inum, 'jperio', ldstop = .FALSE. ) > 0 ) THEN                     
     679         CALL iom_get( inum, 'jperio', zperio )   ;   iperio = NINT( zperio ) 
     680         ldIperio = iperio == 1  .OR. iperio == 4 .OR. iperio == 6 .OR. iperio == 7   ! i-periodicity 
     681         ldJperio = iperio == 2  .OR. iperio == 7                                     ! j-periodicity 
     682         ldNFold  = iperio >= 3 .AND. iperio <= 6                                     ! North pole folding 
     683         IF(     iperio == 3 .OR. iperio == 4 ) THEN   ;   cdNFtype = 'T'             !    folding at T point 
     684         ELSEIF( iperio == 5 .OR. iperio == 6 ) THEN   ;   cdNFtype = 'F'             !    folding at F point 
     685         ELSE                                          ;   cdNFtype = '-'             !    default value 
     686         ENDIF 
     687      ENDIF 
     688      ! ------- keep compatibility with OLD VERSION... end ------- 
     689      ! 
    681690      CALL iom_close( inum ) 
    682691      ! 
    683692      IF(lwp) THEN 
    684          WRITE(numout,*) '      cn_cfg = ', TRIM(cd_cfg), '   nn_cfg = ', kk_cfg 
     693         WRITE(numout,*) '   .' 
     694         WRITE(numout,*) '   ==>>>   ', TRIM(cn_cfg), ' configuration ' 
     695         WRITE(numout,*) '   .' 
     696         WRITE(numout,*) '      nn_cfg = ', kk_cfg 
    685697         WRITE(numout,*) '      Ni0glo = ', kpi 
    686698         WRITE(numout,*) '      Nj0glo = ', kpj 
    687699         WRITE(numout,*) '      jpkglo = ', kpk 
    688          WRITE(numout,*) '      type of global domain lateral boundary   jperio = ', kperio 
    689700      ENDIF 
    690701      ! 
     
    724735      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 
    725736      ! 
    726       !                             !==  ORCA family specificities  ==! 
    727       IF( TRIM(cn_cfg) == "orca" .OR. TRIM(cn_cfg) == "ORCA" ) THEN 
    728          CALL iom_rstput( 0, 0, inum, 'ORCA'      , 1._wp            , ktype = jp_i4 ) 
    729          CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 ) 
    730       ENDIF 
     737      !                             !==  Configuration specificities  ==! 
     738      ! 
     739      CALL iom_putatt( inum,  'CfgName', TRIM(cn_cfg) ) 
     740      CALL iom_putatt( inum, 'CfgIndex',      nn_cfg  ) 
    731741      ! 
    732742      !                             !==  domain characteristics  ==! 
    733743      ! 
    734744      !                                   ! lateral boundary of the global domain 
    735       CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 ) 
    736       ! 
     745      CALL iom_putatt( inum, 'Iperio', COUNT( (/l_Iperio/) ) ) 
     746      CALL iom_putatt( inum, 'Jperio', COUNT( (/l_Jperio/) ) ) 
     747      CALL iom_putatt( inum,  'NFold', COUNT( (/l_NFold /) ) ) 
     748      CALL iom_putatt( inum, 'NFtype',          c_NFtype     ) 
     749 
    737750      !                                   ! type of vertical coordinate 
    738       CALL iom_rstput( 0, 0, inum, 'ln_zco', REAL(COUNT((/ln_zco/)), wp), ktype = jp_i4 ) 
    739       CALL iom_rstput( 0, 0, inum, 'ln_zps', REAL(COUNT((/ln_zps/)), wp), ktype = jp_i4 ) 
    740       CALL iom_rstput( 0, 0, inum, 'ln_sco', REAL(COUNT((/ln_sco/)), wp), ktype = jp_i4 ) 
    741       ! 
     751      IF(ln_zco)   CALL iom_putatt( inum, 'VertCoord', 'zco' ) 
     752      IF(ln_zps)   CALL iom_putatt( inum, 'VertCoord', 'zps' ) 
     753      IF(ln_sco)   CALL iom_putatt( inum, 'VertCoord', 'sco' ) 
     754       
    742755      !                                   ! ocean cavities under iceshelves 
    743       CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL(COUNT((/ln_isfcav/)), wp), ktype = jp_i4 ) 
     756      CALL iom_putatt( inum, 'IsfCav', COUNT( (/ln_isfcav/) ) ) 
    744757      ! 
    745758      !                             !==  horizontal mesh  ! 
     
    794807         CALL iom_rstput( 0, 0, inum, 'ht_0'   , ht_0   , ktype = jp_r8 ) 
    795808      ENDIF 
    796       ! 
    797       ! Add some global attributes ( netcdf only ) 
    798       CALL iom_putatt( inum, 'nn_cfg', nn_cfg ) 
    799       CALL iom_putatt( inum, 'cn_cfg', TRIM(cn_cfg) ) 
    800       ! 
    801       !                                ! ============================ 
    802       !                                !        close the files 
    803       !                                ! ============================ 
     809      !                       ! ============================ ! 
     810      !                       !        close the files 
     811      !                       ! ============================ ! 
    804812      CALL iom_close( inum ) 
    805813      ! 
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/dommsk.F90

    r14215 r14574  
    162162            &            * tmask(ji,jj+1,jk) * tmask(ji+1,jj+1,jk) 
    163163      END_3D 
    164       CALL lbc_lnk_multi( 'dommsk', umask, 'U', 1.0_wp, vmask, 'V', 1.0_wp, fmask, 'F', 1.0_wp )      ! Lateral boundary conditions 
     164      CALL lbc_lnk( 'dommsk', umask, 'U', 1.0_wp, vmask, 'V', 1.0_wp, fmask, 'F', 1.0_wp )      ! Lateral boundary conditions 
    165165  
    166166      ! Ocean/land mask at wu-, wv- and w points    (computed from tmask) 
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domqco.F90

    r14179 r14574  
    170170      ! 
    171171      IF( .NOT.PRESENT( pr3f ) ) THEN              !- lbc on ratio at u-, v-points only 
    172          CALL lbc_lnk_multi( 'dom_qco_r3c', pr3u, 'U', 1._wp, pr3v, 'V', 1._wp ) 
     172         CALL lbc_lnk( 'dom_qco_r3c', pr3u, 'U', 1._wp, pr3v, 'V', 1._wp ) 
    173173         ! 
    174174         ! 
     
    194194#endif 
    195195         !                                                 ! lbc on ratio at u-,v-,f-points 
    196          CALL lbc_lnk_multi( 'dom_qco_r3c', pr3u, 'U', 1._wp, pr3v, 'V', 1._wp, pr3f, 'F', 1._wp ) 
     196         CALL lbc_lnk( 'dom_qco_r3c', pr3u, 'U', 1._wp, pr3v, 'V', 1._wp, pr3f, 'F', 1._wp ) 
    197197         ! 
    198198      ENDIF 
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domvvl.F90

    r14140 r14574  
    423423         !                               ! d - thickness diffusion transport: boundary conditions 
    424424         !                             (stored for tracer advction and continuity equation) 
    425          CALL lbc_lnk_multi( 'domvvl', un_td , 'U' , -1._wp, vn_td , 'V' , -1._wp) 
     425         CALL lbc_lnk( 'domvvl', un_td , 'U' , -1._wp, vn_td , 'V' , -1._wp) 
    426426         ! 4 - Time stepping of baroclinic scale factors 
    427427         ! --------------------------------------------- 
     
    436436         END_3D 
    437437         ! 
    438          llmsk(   1:Nis1,:,:) = .FALSE.   ! exclude halos from the checked region 
    439          llmsk(Nie1: jpi,:,:) = .FALSE. 
    440          llmsk(:,   1:Njs1,:) = .FALSE. 
    441          llmsk(:,Nje1: jpj,:) = .FALSE. 
     438         llmsk(     1:nn_hls,:,:) = .FALSE.   ! exclude halos from the checked region 
     439         llmsk(Nie0+1:  jpi,:,:) = .FALSE. 
     440         llmsk(:,     1:nn_hls,:) = .FALSE. 
     441         llmsk(:,Nje0+1:  jpj,:) = .FALSE. 
    442442         ! 
    443443         llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp                  ! define only the inner domain 
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domwri.F90

    r13295 r14574  
    5858      CHARACTER(len=21) ::   clnam   ! filename (mesh and mask informations) 
    5959      INTEGER           ::   ji, jj, jk   ! dummy loop indices 
    60       INTEGER           ::   izco, izps, isco, icav 
    61       !                                
    6260      REAL(wp), DIMENSION(jpi,jpj)     ::   zprt, zprw     ! 2D workspace 
    6361      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdepu, zdepv   ! 3D workspace 
     
    7472      !                                  ! ============================ 
    7573      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 
    76       !                                                         ! domain characteristics 
    77       CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 ) 
     74      !                                                         ! Configuration specificities 
     75      CALL iom_putatt( inum,  'CfgName', TRIM(cn_cfg) ) 
     76      CALL iom_putatt( inum, 'CfgIndex',      nn_cfg  ) 
     77      !                                                         ! lateral boundary of the global domain 
     78      CALL iom_putatt( inum,   'Iperio', COUNT( (/l_Iperio/) ) ) 
     79      CALL iom_putatt( inum,   'Jperio', COUNT( (/l_Jperio/) ) ) 
     80      CALL iom_putatt( inum,    'NFold', COUNT( (/l_NFold /) ) ) 
     81      CALL iom_putatt( inum,   'NFtype',          c_NFtype     ) 
    7882      !                                                         ! type of vertical coordinate 
    79       IF( ln_zco    ) THEN   ;   izco = 1   ;   ELSE   ;   izco = 0   ;   ENDIF 
    80       IF( ln_zps    ) THEN   ;   izps = 1   ;   ELSE   ;   izps = 0   ;   ENDIF 
    81       IF( ln_sco    ) THEN   ;   isco = 1   ;   ELSE   ;   isco = 0   ;   ENDIF 
    82       CALL iom_rstput( 0, 0, inum, 'ln_zco'   , REAL( izco, wp), ktype = jp_i4 ) 
    83       CALL iom_rstput( 0, 0, inum, 'ln_zps'   , REAL( izps, wp), ktype = jp_i4 ) 
    84       CALL iom_rstput( 0, 0, inum, 'ln_sco'   , REAL( isco, wp), ktype = jp_i4 ) 
     83      IF(ln_zco)   CALL iom_putatt( inum, 'VertCoord', 'zco' ) 
     84      IF(ln_zps)   CALL iom_putatt( inum, 'VertCoord', 'zps' ) 
     85      IF(ln_sco)   CALL iom_putatt( inum, 'VertCoord', 'sco' ) 
    8586      !                                                         ! ocean cavities under iceshelves 
    86       IF( ln_isfcav ) THEN   ;   icav = 1   ;   ELSE   ;   icav = 0   ;   ENDIF 
    87       CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL( icav, wp), ktype = jp_i4 ) 
    88    
     87      CALL iom_putatt( inum,   'IsfCav', COUNT( (/ln_isfcav/) ) )   
    8988      !                                                         ! masks 
    9089      CALL iom_rstput( 0, 0, inum, 'tmask', tmask, ktype = jp_i1 )     !    ! land-sea mask 
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domzgr.F90

    r13295 r14574  
    115115      ! 
    116116      zmsk(:,:) = 1._wp                                       ! default: no closed boundaries 
    117       IF( jperio == 0 .OR. jperio == 2 .OR. jperio == 3 .OR. jperio == 5 ) THEN   ! E-W closed 
     117      IF( .NOT. l_Iperio ) THEN                                    ! E-W closed: 
    118118         zmsk(  mi0(     1+nn_hls):mi1(     1+nn_hls),:) = 0._wp   ! first column of inner global domain at 0 
    119119         zmsk(  mi0(jpiglo-nn_hls):mi1(jpiglo-nn_hls),:) = 0._wp   ! last  column of inner global domain at 0  
    120120      ENDIF 
    121       IF( .NOT. ( jperio == 2 .OR. jperio == 7 ) ) THEN                           ! S closed 
     121      IF( .NOT. l_Jperio ) THEN                                    ! S closed: 
    122122         zmsk(:,mj0(     1+nn_hls):mj1(     1+nn_hls)  ) = 0._wp   ! first   line of inner global domain at 0 
    123123      ENDIF 
    124       IF( jperio == 0 .OR. jperio == 1 ) THEN                                     ! N closed 
     124      IF( .NOT. ( l_Jperio .OR. l_NFold ) ) THEN                   ! N closed: 
    125125         zmsk(:,mj0(jpjglo-nn_hls):mj1(jpjglo-nn_hls)  ) = 0._wp   ! last    line of inner global domain at 0 
    126126      ENDIF 
     
    225225      ! 
    226226      INTEGER  ::   jk     ! dummy loop index 
    227       INTEGER  ::   inum   ! local logical unit 
     227      INTEGER  ::   inum, iatt 
    228228      REAL(WP) ::   z_zco, z_zps, z_sco, z_cav 
    229229      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! 2D workspace 
     230      CHARACTER(len=7) ::   catt   ! 'zco', 'zps, 'sco' or 'UNKNOWN' 
    230231      !!---------------------------------------------------------------------- 
    231232      ! 
     
    239240      ! 
    240241      !                          !* type of vertical coordinate 
    241       CALL iom_get( inum, 'ln_zco'   , z_zco ) 
    242       CALL iom_get( inum, 'ln_zps'   , z_zps ) 
    243       CALL iom_get( inum, 'ln_sco'   , z_sco ) 
    244       IF( z_zco == 0._wp ) THEN   ;   ld_zco = .false.   ;   ELSE   ;   ld_zco = .true.   ;   ENDIF 
    245       IF( z_zps == 0._wp ) THEN   ;   ld_zps = .false.   ;   ELSE   ;   ld_zps = .true.   ;   ENDIF 
    246       IF( z_sco == 0._wp ) THEN   ;   ld_sco = .false.   ;   ELSE   ;   ld_sco = .true.   ;   ENDIF 
    247       ! 
     242      CALL iom_getatt( inum, 'VertCoord', catt )   ! returns 'UNKNOWN' if not found 
     243      ld_zco = catt == 'zco'          ! default = .false. 
     244      ld_zps = catt == 'zps'          ! default = .false. 
     245      ld_sco = catt == 'sco'          ! default = .false. 
    248246      !                          !* ocean cavities under iceshelves 
    249       CALL iom_get( inum, 'ln_isfcav', z_cav ) 
    250       IF( z_cav == 0._wp ) THEN   ;   ld_isfcav = .false.   ;   ELSE   ;   ld_isfcav = .true.   ;   ENDIF 
     247      CALL iom_getatt( inum,    'IsfCav', iatt )   ! returns -999 if not found 
     248      ld_isfcav = iatt == 1           ! default = .false. 
     249      ! 
     250      ! ------- keep compatibility with OLD VERSION... start ------- 
     251      IF( catt == 'UNKNOWN' ) THEN 
     252         CALL iom_get( inum,    'ln_zco', z_zco )   ;   ld_zco = z_zco /= 0._wp 
     253         CALL iom_get( inum,    'ln_zps', z_zps )   ;   ld_zps = z_zps /= 0._wp 
     254         CALL iom_get( inum,    'ln_sco', z_sco )   ;   ld_sco = z_sco /= 0._wp 
     255      ENDIF 
     256      IF( iatt == -999 ) THEN 
     257         CALL iom_get( inum, 'ln_isfcav', z_cav )   ;   ld_isfcav = z_cav /= 0._wp 
     258      ENDIF 
     259      ! ------- keep compatibility with OLD VERSION... end ------- 
    251260      ! 
    252261      !                          !* vertical scale factors 
Note: See TracChangeset for help on using the changeset viewer.