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 12807 for NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM – NEMO

Ignore:
Timestamp:
2020-04-23T15:14:45+02:00 (4 years ago)
Author:
smasson
Message:

Extra_Halo: input file only over inner domain + new variables names, see #2366

Location:
NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/iom.F90

    r12745 r12807  
    2121   !!---------------------------------------------------------------------- 
    2222   USE dom_oce         ! ocean space and time domain 
     23   USE domutl          !  
    2324   USE c1d             ! 1D vertical configuration 
    2425   USE flo_oce         ! floats module declarations 
     
    3435   USE ice      , ONLY :   jpl 
    3536#endif 
    36    USE domngb          ! ocean space and time domain 
    3737   USE phycst          ! physical constants 
    3838   USE dianam          ! build name of file 
     
    117117      REAL(wp), DIMENSION(2,jpkam1)         :: za_bnds   ! ABL vertical boundaries 
    118118      LOGICAL ::   ll_tmppatch = .TRUE.    !: seb: patch before we remove periodicity 
    119       INTEGER ::   nldi_save, nlei_save    !:      and close boundaries in output files 
    120       INTEGER ::   nldj_save, nlej_save    !: 
     119      INTEGER ::   Nis0_save, Nie0_save    !:      and close boundaries in output files 
     120      INTEGER ::   Njs0_save, Nje0_save    !: 
    121121      LOGICAL ::   ll_closedef = .TRUE. 
    122122      !!---------------------------------------------------------------------- 
     
    127127      ENDIF 
    128128      IF ( ll_tmppatch ) THEN 
    129          nldi_save = nldi   ;   nlei_save = nlei 
    130          nldj_save = nldj   ;   nlej_save = nlej 
    131          IF( nimpp           ==      1 ) nldi = 1 
    132          IF( nimpp + jpi - 1 == jpiglo ) nlei = jpi 
    133          IF( njmpp           ==      1 ) nldj = 1 
    134          IF( njmpp + jpj - 1 == jpjglo ) nlej = jpj 
     129         Nis0_save = Nis0   ;   Nie0_save = Nie0 
     130         Njs0_save = Njs0   ;   Nje0_save = Nje0 
     131         IF( nimpp           ==      1 ) Nis0 = 1 
     132         IF( nimpp + jpi - 1 == jpiglo ) Nie0 = jpi 
     133         IF( njmpp           ==      1 ) Njs0 = 1 
     134         IF( njmpp + jpj - 1 == jpjglo ) Nje0 = jpj 
    135135      ENDIF 
    136136      IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef 
     
    169169         ! 
    170170         IF( ln_cfmeta ) THEN   ! Add additional grid metadata 
    171             CALL iom_set_domain_attr("grid_T", area = e1e2t(nldi:nlei, nldj:nlej)) 
    172             CALL iom_set_domain_attr("grid_U", area = e1e2u(nldi:nlei, nldj:nlej)) 
    173             CALL iom_set_domain_attr("grid_V", area = e1e2v(nldi:nlei, nldj:nlej)) 
    174             CALL iom_set_domain_attr("grid_W", area = e1e2t(nldi:nlei, nldj:nlej)) 
     171            CALL iom_set_domain_attr("grid_T", area = e1e2t(Nis0:Nie0, Njs0:Nje0)) 
     172            CALL iom_set_domain_attr("grid_U", area = e1e2u(Nis0:Nie0, Njs0:Nje0)) 
     173            CALL iom_set_domain_attr("grid_V", area = e1e2v(Nis0:Nie0, Njs0:Nje0)) 
     174            CALL iom_set_domain_attr("grid_W", area = e1e2t(Nis0:Nie0, Njs0:Nje0)) 
    175175            CALL set_grid_bounds( "T", glamf, gphif, glamt, gphit ) 
    176176            CALL set_grid_bounds( "U", glamv, gphiv, glamu, gphiu ) 
     
    192192         ! 
    193193         IF( ln_cfmeta .AND. .NOT. llrst_context) THEN   ! Add additional grid metadata 
    194             CALL iom_set_domain_attr("grid_T", area = e1e2t_crs(nldi:nlei, nldj:nlej)) 
    195             CALL iom_set_domain_attr("grid_U", area = e1u_crs(nldi:nlei, nldj:nlej) * e2u_crs(nldi:nlei, nldj:nlej)) 
    196             CALL iom_set_domain_attr("grid_V", area = e1v_crs(nldi:nlei, nldj:nlej) * e2v_crs(nldi:nlei, nldj:nlej)) 
    197             CALL iom_set_domain_attr("grid_W", area = e1e2t_crs(nldi:nlei, nldj:nlej)) 
     194            CALL iom_set_domain_attr("grid_T", area = e1e2t_crs(Nis0:Nie0, Njs0:Nje0)) 
     195            CALL iom_set_domain_attr("grid_U", area =   e1u_crs(Nis0:Nie0, Njs0:Nje0) * e2u_crs(Nis0:Nie0, Njs0:Nje0)) 
     196            CALL iom_set_domain_attr("grid_V", area =   e1v_crs(Nis0:Nie0, Njs0:Nje0) * e2v_crs(Nis0:Nie0, Njs0:Nje0)) 
     197            CALL iom_set_domain_attr("grid_W", area = e1e2t_crs(Nis0:Nie0, Njs0:Nje0)) 
    198198            CALL set_grid_bounds( "T", glamf_crs, gphif_crs, glamt_crs, gphit_crs ) 
    199199            CALL set_grid_bounds( "U", glamv_crs, gphiv_crs, glamu_crs, gphiu_crs ) 
     
    283283      ! 
    284284      IF ( ll_tmppatch ) THEN 
    285          nldi = nldi_save   ;   nlei = nlei_save 
    286          nldj = nldj_save   ;   nlej = nlej_save 
     285         Nis0 = Nis0_save   ;   Nie0 = Nie0_save 
     286         Njs0 = Njs0_save   ;   Nje0 = Nje0_save 
    287287      ENDIF 
    288288#endif 
     
    762762      ENDIF 
    763763      IF( llwrt ) THEN 
    764          idompar(:,1) = (/ nlei - nldi + 1, nlej - nldj + 1 /) 
    765          idompar(:,2) = (/ mig(nldi)      , mjg(nldj)      /) 
    766          idompar(:,3) = (/ mig(nlei)      , mjg(nlej)      /) 
    767          idompar(:,4) = (/ 0              , 0               /) 
    768          idompar(:,5) = (/ 0              , 0               /) 
     764         idompar(:,1) = (/ Ni_0     , Nj_0      /) 
     765         idompar(:,2) = (/ mig(Nis0), mjg(Njs0) /) 
     766         idompar(:,3) = (/ mig(Nie0), mjg(Nje0) /) 
     767         idompar(:,4) = (/ 0        , 0         /) 
     768         idompar(:,5) = (/ 0        , 0         /) 
    769769      ENDIF 
    770770      ! Open the NetCDF file 
     
    976976   END SUBROUTINE iom_g1d 
    977977 
    978    SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kstart, kcount, ldxios) 
     978   SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount, ldxios) 
    979979      INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file 
    980980      INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read 
     
    984984      CHARACTER(len=1), INTENT(in   )              , OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    985985      REAL(wp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
     986      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    986987      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading  
    987988      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis 
     
    989990      ! 
    990991      IF( kiomid > 0 ) THEN 
    991          IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom         , cdvar            , pv_r2d=pvar,   & 
    992             &                                                       ktime=ktime  , cd_type = cd_type, psgn = psgn,   & 
    993             &                                                       kstart=kstart, kcount=kcount    , ldxios=ldxios  ) 
     992         IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom, cdvar      , pv_r2d = pvar  , ktime = ktime,   & 
     993            &                                                       cd_type = cd_type, psgn   = psgn  , kfill = kfill,   & 
     994            &                                                       kstart  = kstart , kcount = kcount, ldxios=ldxios  ) 
    994995      ENDIF 
    995996   END SUBROUTINE iom_g2d 
    996997 
    997    SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kstart, kcount, ldxios ) 
     998   SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount, ldxios ) 
    998999      INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file 
    9991000      INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read 
     
    10031004      CHARACTER(len=1), INTENT(in   )              , OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    10041005      REAL(wp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
     1006      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    10051007      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading  
    10061008      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis 
     
    10081010      ! 
    10091011      IF( kiomid > 0 ) THEN 
    1010          IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom         , cdvar            , pv_r3d=pvar,   & 
    1011             &                                                       ktime=ktime  , cd_type = cd_type, psgn = psgn,   & 
    1012             &                                                       kstart=kstart, kcount=kcount    , ldxios=ldxios  ) 
     1012         IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom, cdvar      , pv_r3d = pvar  , ktime = ktime,   & 
     1013            &                                                       cd_type = cd_type, psgn   = psgn  , kfill = kfill,   & 
     1014            &                                                       kstart  = kstart , kcount = kcount, ldxios=ldxios  ) 
    10131015      ENDIF 
    10141016   END SUBROUTINE iom_g3d 
    10151017   !!---------------------------------------------------------------------- 
    10161018 
    1017    SUBROUTINE iom_get_123d( kiomid, kdom   , cdvar , pv_r1d, pv_r2d, pv_r3d,   & 
    1018          &                  ktime , cd_type, psgn  , kstart, kcount, ldxios ) 
     1019   SUBROUTINE iom_get_123d( kiomid , kdom, cdvar, pv_r1d, pv_r2d, pv_r3d, ktime ,   & 
     1020         &                  cd_type, psgn, kfill, kstart, kcount, ldxios ) 
    10191021      !!----------------------------------------------------------------------- 
    10201022      !!                  ***  ROUTINE  iom_get_123d  *** 
     
    10331035      CHARACTER(len=1)           , INTENT(in   ), OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    10341036      REAL(wp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
     1037      INTEGER                    , INTENT(in   ), OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    10351038      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis  
    10361039      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount    ! number of points to be read in each axis 
     
    11581161               ENDIF 
    11591162            ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown 
    1160                ! we do not read the overlap and the extra-halos -> from nldi to nlei and from nldj to nlej  
    1161                IF( idom == jpdom_global )   istart(1:2) = (/ mig(nldi), mjg(nldj) /) 
    1162                icnt(1:2) = (/ nlei - nldi + 1, nlej - nldj + 1 /) 
     1163               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0  
     1164               IF( idom == jpdom_global )   istart(1:2) = (/ mig(Nis0)-nn_hls, mjg(Njs0)-nn_hls /) 
     1165               icnt(1:2) = (/ Ni_0, Nj_0 /) 
    11631166               IF( PRESENT(pv_r3d) ) THEN 
    11641167                  IF( idom == jpdom_auto_xy ) THEN 
     
    11911194            ELSE 
    11921195               IF( irankpv == 2 ) THEN 
    1193                   ishape(1:2) = SHAPE(pv_r2d(nldi:nlei,nldj:nlej  ))   ;   ctmp1 = 'd(nldi:nlei,nldj:nlej)' 
     1196                  ishape(1:2) = SHAPE(pv_r2d(Nis0:Nie0,Njs0:Nje0  ))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0)' 
    11941197               ENDIF 
    11951198               IF( irankpv == 3 ) THEN  
    1196                   ishape(1:3) = SHAPE(pv_r3d(nldi:nlei,nldj:nlej,:))   ;   ctmp1 = 'd(nldi:nlei,nldj:nlej,:)' 
     1199                  ishape(1:3) = SHAPE(pv_r3d(Nis0:Nie0,Njs0:Nje0,:))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0,:)' 
    11971200               ENDIF 
    11981201            ENDIF          
     
    12091212            ! 
    12101213            ! find the right index of the array to be read 
    1211             IF( idom /= jpdom_unknown ) THEN   ;   ix1 = nldi   ;   ix2 = nlei      ;   iy1 = nldj   ;   iy2 = nlej 
     1214            IF( idom /= jpdom_unknown ) THEN   ;   ix1 = Nis0   ;   ix2 = Nie0      ;   iy1 = Njs0   ;   iy2 = Nje0 
    12121215            ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2) 
    12131216            ENDIF 
     
    12241227               !--- overlap areas and extra hallows (mpp) 
    12251228               IF(     PRESENT(pv_r2d) .AND. idom /= jpdom_unknown ) THEN 
    1226                   CALL lbc_lnk( 'iom', pv_r2d, cl_type, zsgn, kfillmode = jpfillnothing ) 
     1229                  CALL lbc_lnk( 'iom', pv_r2d, cl_type, zsgn, kfillmode = kfill ) 
    12271230               ELSEIF( PRESENT(pv_r3d) .AND. idom /= jpdom_unknown ) THEN 
    1228                   CALL lbc_lnk( 'iom', pv_r3d, cl_type, zsgn, kfillmode = jpfillnothing ) 
     1231                  CALL lbc_lnk( 'iom', pv_r3d, cl_type, zsgn, kfillmode = kfill ) 
    12291232               ENDIF 
    12301233               ! 
     
    18631866      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   plat 
    18641867      ! 
    1865       INTEGER  :: ni, nj 
    18661868      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmask 
    18671869      LOGICAL, INTENT(IN) :: ldxios, ldrxios 
    18681870      !!---------------------------------------------------------------------- 
    18691871      ! 
    1870       ni = nlei-nldi+1 
    1871       nj = nlej-nldj+1 
    1872       ! 
    1873       CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
    1874       CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     1872      CALL iom_set_domain_attr("grid_"//cdgrd,ni_glo=jpiglo,nj_glo=jpjglo,ibegin=nimpp+Nis0-2,jbegin=njmpp+Njs0-2,ni=Ni_0,nj=Nj_0) 
     1873      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-Nis0, data_ni = jpi, data_jbegin = 1-Njs0, data_nj = jpj) 
    18751874!don't define lon and lat for restart reading context.  
    18761875      IF ( .NOT.ldrxios ) & 
    1877          CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)),   & 
    1878          &                                     latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
     1876         CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),   & 
     1877         &                                        latvalue = RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)))   
    18791878      ! 
    18801879      IF ( ln_mskland .AND. (.NOT.ldxios) ) THEN 
     
    18871886         END SELECT 
    18881887         ! 
    1889          CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni*nj    /)) /= 0. ) 
    1890          CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. ) 
     1888         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,1),(/Ni_0*Nj_0    /)) /= 0. ) 
     1889         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,:),(/Ni_0*Nj_0,jpk/)) /= 0. ) 
    18911890      ENDIF 
    18921891      ! 
     
    19051904      REAL(wp), DIMENSION(jpi,jpj), OPTIONAL, INTENT(in) :: plon_pnt, plat_pnt  ! Lat/lon coord. of the point of cell (i,j) 
    19061905      ! 
    1907       INTEGER :: ji, jj, jn, ni, nj 
     1906      INTEGER :: ji, jj, jn 
    19081907      INTEGER :: icnr, jcnr                             ! Offset such that the vertex coordinate (i+icnr,j+jcnr) 
    19091908      !                                                 ! represents the bottom-left corner of cell (i,j) 
     
    19211920      CASE ('V')        ;   icnr = -1   ;   jcnr =  0 
    19221921      END SELECT 
    1923       ! 
    1924       ni = nlei-nldi+1   ! Dimensions of subdomain interior 
    1925       nj = nlej-nldj+1 
    19261922      ! 
    19271923      z_fld(:,:) = 1._wp 
     
    19581954         IF( (nbondi == 1 .OR. nbondi == 2) .AND. .NOT. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6) ) THEN 
    19591955            DO jn = 1, 4        ! (East or jpni = 1), closed E-W 
    1960                z_bnds(jn,nlci,:,1) = plat_pnt(nlci,:)  ;  z_bnds(jn,nlci,:,2) = plon_pnt(nlci,:) 
     1956               z_bnds(jn,jpi,:,1) = plat_pnt(jpi,:)  ;  z_bnds(jn,jpi,:,2) = plon_pnt(jpi,:) 
    19611957            END DO 
    19621958         ENDIF 
     
    19681964         IF( (nbondj == 1 .OR. nbondj == 2) .AND. jperio  < 3 ) THEN 
    19691965            DO jn = 1, 4        ! (North or jpnj = 1), no north fold 
    1970                z_bnds(jn,:,nlcj,1) = plat_pnt(:,nlcj)  ;  z_bnds(jn,:,nlcj,2) = plon_pnt(:,nlcj) 
     1966               z_bnds(jn,:,jpj,1) = plat_pnt(:,jpj)  ;  z_bnds(jn,:,jpj,2) = plon_pnt(:,jpj) 
    19711967            END DO 
    19721968         ENDIF 
     
    19911987      ENDIF 
    19921988      ! 
    1993       CALL iom_set_domain_attr("grid_"//cdgrd, bounds_lat = RESHAPE(z_bnds(:,nldi:nlei,nldj:nlej,1),(/ 4,ni*nj /)),           & 
    1994           &                                    bounds_lon = RESHAPE(z_bnds(:,nldi:nlei,nldj:nlej,2),(/ 4,ni*nj /)), nvertex=4 ) 
     1989      CALL iom_set_domain_attr("grid_"//cdgrd, bounds_lat = RESHAPE(z_bnds(:,Nis0:Nie0,Njs0:Nje0,1),(/ 4,Ni_0*Nj_0 /)),           & 
     1990          &                                    bounds_lon = RESHAPE(z_bnds(:,Nis0:Nie0,Njs0:Nje0,2),(/ 4,Ni_0*Nj_0 /)), nvertex=4 ) 
    19951991      ! 
    19961992      DEALLOCATE( z_bnds, z_fld, z_rot )  
     
    20082004      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   plat 
    20092005      ! 
    2010       INTEGER  :: ni, nj, ix, iy 
     2006      INTEGER  :: ix, iy 
    20112007      REAL(wp), DIMENSION(:), ALLOCATABLE  ::   zlon 
    20122008      !!---------------------------------------------------------------------- 
    20132009      ! 
    2014       ni=nlei-nldi+1       ! define zonal mean domain (jpj*jpk) 
    2015       nj=nlej-nldj+1 
    20162010      ALLOCATE( zlon(ni*nj) )       ;       zlon(:) = 0._wp 
    20172011      ! 
    20182012!      CALL dom_ngb( -168.53, 65.03, ix, iy, 'T' ) !  i-line that passes through Bering Strait: Reference latitude (used in plots) 
    20192013      CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
    2020       CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
    2021       CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     2014      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+Nis0-2, jbegin=njmpp+Njs0-2, ni=Ni_0, nj=Nj_0) 
     2015      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-Nis0, data_ni = jpi, data_jbegin = 1-Njs0, data_nj = jpj) 
    20222016      CALL iom_set_domain_attr("gznl", lonvalue = zlon,   & 
    2023          &                             latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
     2017         &                             latvalue = RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)))   
    20242018      CALL iom_set_zoom_domain_attr("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=jpjglo) 
    20252019      ! 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/iom_def.F90

    r12738 r12807  
    1414 
    1515   INTEGER, PARAMETER, PUBLIC ::   jpdom_global        = 1   !: ( 1  :jpiglo, 1  :jpjglo) 
    16    INTEGER, PARAMETER, PUBLIC ::   jpdom_local         = 2   !: (nldi:nlei  ,nldj:nlej ) 
     16   INTEGER, PARAMETER, PUBLIC ::   jpdom_local         = 2   !: (Nis0: Nie0 ,Njs0: Nje0 ) 
    1717   INTEGER, PARAMETER, PUBLIC ::   jpdom_unknown       = 3   !: No dimension checking 
    1818   INTEGER, PARAMETER, PUBLIC ::   jpdom_auto          = 4   !:  
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/iom_nf90.F90

    r12377 r12807  
    134134                 CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'nav_lev',            jpk, idmy ), clinfo) 
    135135                 CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'time_counter', NF90_UNLIMITED, idmy ), clinfo) 
    136                  CALL iom_nf90_check(NF90_DEF_DIM( if90id,  'numcat',          kdlev, idmy ), clinfo) 
     136                 IF( kdlev > 0 )   CALL iom_nf90_check(NF90_DEF_DIM( if90id,  'numcat',          kdlev, idmy ), clinfo) 
    137137              ENDIF 
    138138            ELSE 
     
    665665         IF( PRESENT(pv_r2d) .OR. PRESENT(pv_r3d) ) THEN 
    666666            idimsz(1:2) = iom_file(kiomid)%dimsz(1:2,idvar) 
    667             IF(     idimsz(1) == (nlei - nldi + 1) .AND. idimsz(2) == (nlej - nldj + 1) ) THEN 
    668                ix1 = nldi   ;   ix2 = nlei   ;   iy1 = nldj   ;   iy2 = nlej 
    669             ELSEIF( idimsz(1) == nlci              .AND. idimsz(2) == nlcj              ) THEN 
    670                ix1 = 1      ;   ix2 = nlci   ;   iy1 = 1      ;   iy2 = nlcj 
    671             ELSEIF( idimsz(1) == jpi               .AND. idimsz(2) == jpj               ) THEN 
     667            IF(     idimsz(1) == Ni_0 .AND. idimsz(2) == Nj_0 ) THEN 
     668               ix1 = Nis0   ;   ix2 = Nie0   ;   iy1 = Njs0   ;   iy2 = Nje0 
     669            ELSEIF( idimsz(1) == jpi  .AND. idimsz(2) == jpj  ) THEN 
     670               ix1 = 1      ;   ix2 = jpi    ;   iy1 = 1      ;   iy2 = jpj 
     671            ELSEIF( idimsz(1) == jpi  .AND. idimsz(2) == jpj  ) THEN 
    672672               ix1 = 1      ;   ix2 = jpi    ;   iy1 = 1      ;   iy2 = jpj 
    673673            ELSE  
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/IOM/prtctl.F90

    r12377 r12807  
    1818 
    1919   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   numid 
    20    INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nlditl , nldjtl    ! first, last indoor index for each i-domain 
    21    INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nleitl , nlejtl    ! first, last indoor index for each j-domain 
    22    INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nimpptl, njmpptl   ! i-, j-indexes for each processor 
    23    INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nlcitl , nlcjtl    ! dimensions of every subdomain 
    24    INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   ibonitl, ibonjtl   ! 
     20   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nis0allp, njs0allp   ! first, last indoor index for each i-domain 
     21   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nie0allp, nje0allp   ! first, last indoor index for each j-domain 
     22   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::    nimpptl, njmpptl   ! i-, j-indexes for each processor 
     23   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::    jpiallp,  jpjallp   ! dimensions of every subdomain 
     24   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::    ibonitl, ibonjtl   ! 
    2525 
    2626   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE ::   t_ctll , s_ctll    ! previous tracer trend values 
     
    134134         IF( .NOT. lsp_area ) THEN 
    135135            IF (lk_mpp .AND. jpnij > 1)   THEN 
    136                nictls = MAX(  1, nlditl(jn) ) 
    137                nictle = MIN(jpi, nleitl(jn) ) 
    138                njctls = MAX(  1, nldjtl(jn) ) 
    139                njctle = MIN(jpj, nlejtl(jn) ) 
     136               nictls = MAX(  1, nis0allp(jn) ) 
     137               nictle = MIN(jpi, nie0allp(jn) ) 
     138               njctls = MAX(  1, njs0allp(jn) ) 
     139               njctle = MIN(jpj, nje0allp(jn) ) 
    140140               ! Do not take into account the bound of the domain 
    141141               IF( ibonitl(jn) == -1 .OR. ibonitl(jn) == 2 ) nictls = MAX(2, nictls) 
    142142               IF( ibonjtl(jn) == -1 .OR. ibonjtl(jn) == 2 ) njctls = MAX(2, njctls) 
    143                IF( ibonitl(jn) ==  1 .OR. ibonitl(jn) == 2 ) nictle = MIN(nictle, nleitl(jn) - 1) 
    144                IF( ibonjtl(jn) ==  1 .OR. ibonjtl(jn) == 2 ) njctle = MIN(njctle, nlejtl(jn) - 1) 
     143               IF( ibonitl(jn) ==  1 .OR. ibonitl(jn) == 2 ) nictle = MIN(nictle, nie0allp(jn) - 1) 
     144               IF( ibonjtl(jn) ==  1 .OR. ibonjtl(jn) == 2 ) njctle = MIN(njctle, nje0allp(jn) - 1) 
    145145            ELSE 
    146                nictls = MAX(  1, nimpptl(jn) - 1 + nlditl(jn) ) 
    147                nictle = MIN(jpi, nimpptl(jn) - 1 + nleitl(jn) ) 
    148                njctls = MAX(  1, njmpptl(jn) - 1 + nldjtl(jn) ) 
    149                njctle = MIN(jpj, njmpptl(jn) - 1 + nlejtl(jn) ) 
     146               nictls = MAX(  1, nimpptl(jn) - 1 + nis0allp(jn) ) 
     147               nictle = MIN(jpi, nimpptl(jn) - 1 + nie0allp(jn) ) 
     148               njctls = MAX(  1, njmpptl(jn) - 1 + njs0allp(jn) ) 
     149               njctle = MIN(jpj, njmpptl(jn) - 1 + nje0allp(jn) ) 
    150150               ! Do not take into account the bound of the domain 
    151151               IF( ibonitl(jn) == -1 .OR. ibonitl(jn) == 2 ) nictls = MAX(2, nictls) 
    152152               IF( ibonjtl(jn) == -1 .OR. ibonjtl(jn) == 2 ) njctls = MAX(2, njctls) 
    153                IF( ibonitl(jn) ==  1 .OR. ibonitl(jn) == 2 ) nictle = MIN(nictle, nimpptl(jn) + nleitl(jn) - 2) 
    154                IF( ibonjtl(jn) ==  1 .OR. ibonjtl(jn) == 2 ) njctle = MIN(njctle, njmpptl(jn) + nlejtl(jn) - 2) 
     153               IF( ibonitl(jn) ==  1 .OR. ibonitl(jn) == 2 ) nictle = MIN(nictle, nimpptl(jn) + nie0allp(jn) - 2) 
     154               IF( ibonjtl(jn) ==  1 .OR. ibonjtl(jn) == 2 ) njctle = MIN(njctle, njmpptl(jn) + nje0allp(jn) - 2) 
    155155            ENDIF 
    156156         ENDIF 
     
    277277 
    278278      ! Allocate arrays 
    279       ALLOCATE( nlditl(ijsplt) , nleitl(ijsplt) , nimpptl(ijsplt) , ibonitl(ijsplt) ,   & 
    280          &      nldjtl(ijsplt) , nlejtl(ijsplt) , njmpptl(ijsplt) , ibonjtl(ijsplt) ,   & 
    281          &      nlcitl(ijsplt) , t_ctll(ijsplt) , u_ctll (ijsplt) ,                     & 
    282          &      nlcjtl(ijsplt) , s_ctll(ijsplt) , v_ctll (ijsplt)                       ) 
     279      ALLOCATE( nis0allp(ijsplt) , nie0allp(ijsplt) , nimpptl(ijsplt) , ibonitl(ijsplt) ,   & 
     280         &      njs0allp(ijsplt) , nje0allp(ijsplt) , njmpptl(ijsplt) , ibonjtl(ijsplt) ,   & 
     281         &       jpiallp(ijsplt) ,   t_ctll(ijsplt) ,  u_ctll(ijsplt) ,                     & 
     282         &       jpjallp(ijsplt) ,   s_ctll(ijsplt) ,  v_ctll(ijsplt)                       ) 
    283283 
    284284      ! Initialization  
     
    295295         cl_run = 'MULTI processor run' 
    296296         ! use indices for each area computed by mpp_init subroutine 
    297          nlditl(1:jpnij) = nldit(:)  
    298          nleitl(1:jpnij) = nleit(:)  
    299          nldjtl(1:jpnij) = nldjt(:)  
    300          nlejtl(1:jpnij) = nlejt(:)  
     297         nis0allp(1:jpnij) = nis0all(:)  
     298         nie0allp(1:jpnij) = nie0all(:)  
     299         njs0allp(1:jpnij) = njs0all(:)  
     300         nje0allp(1:jpnij) = nje0all(:)  
    301301         ! 
    302302         nimpptl(1:jpnij) = nimppt(:) 
    303303         njmpptl(1:jpnij) = njmppt(:) 
    304304         ! 
    305          nlcitl(1:jpnij) = nlcit(:) 
    306          nlcjtl(1:jpnij) = nlcjt(:) 
     305         jpiallp(1:jpnij) = jpiall(:) 
     306         jpjallp(1:jpnij) = jpjall(:) 
    307307         ! 
    308308         ibonitl(1:jpnij) = ibonit(:) 
     
    335335         ! Print the SUM control indices 
    336336         IF( .NOT. lsp_area )   THEN 
    337             nictls = nimpptl(jn) + nlditl(jn) - 1 
    338             nictle = nimpptl(jn) + nleitl(jn) - 1 
    339             njctls = njmpptl(jn) + nldjtl(jn) - 1 
    340             njctle = njmpptl(jn) + nlejtl(jn) - 1 
     337            nictls = nimpptl(jn) + nis0allp(jn) - 1 
     338            nictle = nimpptl(jn) + nie0allp(jn) - 1 
     339            njctls = njmpptl(jn) + njs0allp(jn) - 1 
     340            njctle = njmpptl(jn) + nje0allp(jn) - 1 
    341341         ENDIF 
    342342         WRITE(j_id,*)  
     
    344344         WRITE(j_id,*) '~~~~~~~' 
    345345         WRITE(j_id,*) 
    346          WRITE(j_id,9000)'                                nlej   = ', nlejtl(jn), '              ' 
     346         WRITE(j_id,9000)'                                Nje0   = ', nje0allp(jn), '              ' 
    347347         WRITE(j_id,9000)'                  ------------- njctle = ', njctle, ' -------------' 
    348348         WRITE(j_id,9001)'                  |                                       |' 
     
    350350         WRITE(j_id,9001)'                  |                                       |' 
    351351         WRITE(j_id,9002)'           nictls = ', nictls,  '                           nictle = ', nictle 
    352          WRITE(j_id,9002)'           nldi   = ', nlditl(jn),  '                           nlei   = ', nleitl(jn) 
     352         WRITE(j_id,9002)'           Nis0   = ', nis0allp(jn),  '                           Nie0   = ', nie0allp(jn) 
    353353         WRITE(j_id,9001)'                  |                                       |' 
    354354         WRITE(j_id,9001)'                  |                                       |' 
    355355         WRITE(j_id,9001)'                  |                                       |' 
    356356         WRITE(j_id,9004)'  njmpp  = ',njmpptl(jn),'   ------------- njctls = ', njctls, ' -------------' 
    357          WRITE(j_id,9003)'           nimpp  = ', nimpptl(jn), '        nldj   = ', nldjtl(jn), '              ' 
     357         WRITE(j_id,9003)'           nimpp  = ', nimpptl(jn), '        Njs0   = ', njs0allp(jn), '              ' 
    358358         WRITE(j_id,*) 
    359359         WRITE(j_id,*) 
     
    392392      !!                    njmpp     : latitudinal  index 
    393393      !!                    narea     : number for local area 
    394       !!                    nlcil      : first dimension 
    395       !!                    nlcjl      : second dimension 
     394      !!                    ipil      : first dimension 
     395      !!                    ipjl      : second dimension 
    396396      !!                    nbondil    : mark for "east-west local boundary" 
    397397      !!                    nbondjl    : mark for "north-south local boundary" 
     
    408408         ii, ij,                         &  ! temporary integers 
    409409         irestil, irestjl,               &  !    "          " 
    410          ijpi  , ijpj, nlcil,            &  ! temporary logical unit 
    411          nlcjl , nbondil, nbondjl,       & 
    412          nrecil, nrecjl, nldil, nleil, nldjl, nlejl 
    413  
    414       INTEGER, DIMENSION(jpi,jpj) ::   iimpptl, ijmpptl, ilcitl, ilcjtl   ! workspace 
     410         ijpi  , ijpj, ipil,             &  ! temporary logical unit 
     411         ipjl , nbondil, nbondjl,        & 
     412         nrecil, nrecjl, Nis0l, Nie0l, Njs0l, Nje0l 
     413 
     414      INTEGER, DIMENSION(jpi,jpj) ::   iimpptl, ijmpptl, ijpitl, ijpjtl   ! workspace 
    415415      REAL(wp) ::   zidom, zjdom            ! temporary scalars 
    416416      INTEGER ::   inum                     ! local logical unit 
     
    421421      !  1. Dimension arrays for subdomains 
    422422      ! ----------------------------------- 
    423       !  Computation of local domain sizes ilcitl() ilcjtl() 
     423      !  Computation of local domain sizes ijpitl() ijpjtl() 
    424424      !  These dimensions depend on global sizes isplt,jsplt and jpiglo,jpjglo 
    425425      !  The subdomains are squares leeser than or equal to the global 
     
    448448      DO jj = 1, jsplt  
    449449         DO ji=1, isplt-1  
    450             ilcitl(ji,jj) = ijpi  
     450            ijpitl(ji,jj) = ijpi  
    451451         END DO  
    452          ilcitl(isplt,jj) = jpiglo - (isplt - 1) * (ijpi - nrecil) 
     452         ijpitl(isplt,jj) = jpiglo - (isplt - 1) * (ijpi - nrecil) 
    453453      END DO  
    454454 
     
    457457      DO jj = 1, jsplt 
    458458         DO ji = 1, irestil 
    459             ilcitl(ji,jj) = ijpi 
     459            ijpitl(ji,jj) = ijpi 
    460460         END DO 
    461461         DO ji = irestil+1, isplt 
    462             ilcitl(ji,jj) = ijpi -1 
     462            ijpitl(ji,jj) = ijpi -1 
    463463         END DO 
    464464      END DO 
     
    472472      DO ji = 1, isplt  
    473473         DO jj=1, jsplt-1  
    474             ilcjtl(ji,jj) = ijpj  
     474            ijpjtl(ji,jj) = ijpj  
    475475         END DO  
    476          ilcjtl(ji,jsplt) = jpjglo - (jsplt - 1) * (ijpj - nrecjl) 
     476         ijpjtl(ji,jsplt) = jpjglo - (jsplt - 1) * (ijpj - nrecjl) 
    477477      END DO  
    478478 
     
    481481      DO ji = 1, isplt 
    482482         DO jj = 1, irestjl 
    483             ilcjtl(ji,jj) = ijpj 
     483            ijpjtl(ji,jj) = ijpj 
    484484         END DO 
    485485         DO jj = irestjl+1, jsplt 
    486             ilcjtl(ji,jj) = ijpj -1 
     486            ijpjtl(ji,jj) = ijpj -1 
    487487         END DO 
    488488      END DO 
     
    491491      zidom = nrecil 
    492492      DO ji = 1, isplt 
    493          zidom = zidom + ilcitl(ji,1) - nrecil 
     493         zidom = zidom + ijpitl(ji,1) - nrecil 
    494494      END DO 
    495495      IF(lwp) WRITE(numout,*) 
    496       IF(lwp) WRITE(numout,*)' sum ilcitl(i,1) = ', zidom, ' jpiglo = ', jpiglo 
     496      IF(lwp) WRITE(numout,*)' sum ijpitl(i,1) = ', zidom, ' jpiglo = ', jpiglo 
    497497       
    498498      zjdom = nrecjl 
    499499      DO jj = 1, jsplt 
    500          zjdom = zjdom + ilcjtl(1,jj) - nrecjl 
    501       END DO 
    502       IF(lwp) WRITE(numout,*)' sum ilcitl(1,j) = ', zjdom, ' jpjglo = ', jpjglo 
     500         zjdom = zjdom + ijpjtl(1,jj) - nrecjl 
     501      END DO 
     502      IF(lwp) WRITE(numout,*)' sum ijpitl(1,j) = ', zjdom, ' jpjglo = ', jpjglo 
    503503      IF(lwp) WRITE(numout,*) 
    504504       
     
    513513         DO jj = 1, jsplt 
    514514            DO ji = 2, isplt 
    515                iimpptl(ji,jj) = iimpptl(ji-1,jj) + ilcitl(ji-1,jj) - nrecil 
     515               iimpptl(ji,jj) = iimpptl(ji-1,jj) + ijpitl(ji-1,jj) - nrecil 
    516516            END DO 
    517517         END DO 
     
    521521         DO jj = 2, jsplt 
    522522            DO ji = 1, isplt 
    523                ijmpptl(ji,jj) = ijmpptl(ji,jj-1)+ilcjtl(ji,jj-1)-nrecjl 
     523               ijmpptl(ji,jj) = ijmpptl(ji,jj-1)+ijpjtl(ji,jj-1)-nrecjl 
    524524            END DO 
    525525         END DO 
     
    534534         nimpptl(jn) = iimpptl(ii,ij) 
    535535         njmpptl(jn) = ijmpptl(ii,ij) 
    536          nlcitl (jn) = ilcitl (ii,ij)      
    537          nlcil       = nlcitl (jn)      
    538          nlcjtl (jn) = ilcjtl (ii,ij)      
    539          nlcjl       = nlcjtl (jn) 
     536         jpiallp(jn) = ijpitl (ii,ij)      
     537         ipil        = jpiallp(jn)      
     538         jpjallp(jn) = ijpjtl (ii,ij)      
     539         ipjl        = jpjallp(jn) 
    540540         nbondjl = -1                                    ! general case 
    541541         IF( jn   >  isplt          )   nbondjl = 0      ! first row of processor 
     
    550550         ibonitl(jn) = nbondil 
    551551          
    552          nldil =  1   + nn_hls 
    553          nleil = nlcil - nn_hls 
    554          IF( nbondil == -1 .OR. nbondil == 2 )   nldil = 1 
    555          IF( nbondil ==  1 .OR. nbondil == 2 )   nleil = nlcil 
    556          nldjl =  1   + nn_hls 
    557          nlejl = nlcjl - nn_hls 
    558          IF( nbondjl == -1 .OR. nbondjl == 2 )   nldjl = 1 
    559          IF( nbondjl ==  1 .OR. nbondjl == 2 )   nlejl = nlcjl 
    560          nlditl(jn) = nldil 
    561          nleitl(jn) = nleil 
    562          nldjtl(jn) = nldjl 
    563          nlejtl(jn) = nlejl 
     552         Nis0l =  1   + nn_hls 
     553         Nie0l = ipil - nn_hls 
     554         IF( nbondil == -1 .OR. nbondil == 2 )   Nis0l = 1 
     555         IF( nbondil ==  1 .OR. nbondil == 2 )   Nie0l = ipil 
     556         Njs0l =  1   + nn_hls 
     557         Nje0l = ipjl - nn_hls 
     558         IF( nbondjl == -1 .OR. nbondjl == 2 )   Njs0l = 1 
     559         IF( nbondjl ==  1 .OR. nbondjl == 2 )   Nje0l = ipjl 
     560         nis0allp(jn) = Nis0l 
     561         nie0allp(jn) = Nie0l 
     562         njs0allp(jn) = Njs0l 
     563         nje0allp(jn) = Nje0l 
    564564      END DO 
    565565      ! 
     
    567567      IF(lwp) THEN 
    568568         CALL ctl_opn( inum, 'layout_prtctl.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea ) 
    569          WRITE(inum,'(a)') 'nproc nlcil nlcjl nldil nldjl nleil nlejl nimpptl njmpptl ibonitl ibonjtl' 
     569         WRITE(inum,'(a)') 'nproc ipil ipjl Nis0l Njs0l Nie0l Nje0l nimpptl njmpptl ibonitl ibonjtl' 
    570570         ! 
    571571         DO jn = 1, ijsplt 
    572             WRITE(inum,'(i5,6i6,4i8)') jn-1,nlcitl(jn),  nlcjtl(jn), & 
    573                &                            nlditl(jn),  nldjtl(jn), & 
    574                &                            nleitl(jn),  nlejtl(jn), & 
    575                &                           nimpptl(jn), njmpptl(jn), & 
    576                &                           ibonitl(jn), ibonjtl(jn) 
     572            WRITE(inum,'(i5,6i6,4i8)') jn-1, jpiallp(jn),  jpjallp(jn), & 
     573               &                            nis0allp(jn), njs0allp(jn), & 
     574               &                            nie0allp(jn), nje0allp(jn), & 
     575               &                             nimpptl(jn), njmpptl(jn), & 
     576               &                             ibonitl(jn), ibonjtl(jn) 
    577577         END DO 
    578578         CLOSE(inum)    
Note: See TracChangeset for help on using the changeset viewer.