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 13065 for NEMO/branches/2020 – NEMO

Changeset 13065 for NEMO/branches/2020


Ignore:
Timestamp:
2020-06-08T18:11:57+02:00 (4 years ago)
Author:
smasson
Message:

Extra_Halo: toward AGRIF compatibility, see #2366

Location:
NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/cfgs/AGRIF_DEMO/EXPREF/AGRIF_FixedGrids.in

    r9770 r13065  
    112 
    2 42 82 49 91 1 1 1 
    3 122 153 110 143 4 4 4 
     241 81 49 91 1 1 1 
     3121 152 110 143 4 4 4 
    440 
    551 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/cfgs/AGRIF_DEMO/EXPREF/namelist_cfg

    r13015 r13065  
    3333/ 
    3434!----------------------------------------------------------------------- 
    35 &namcfg        !   parameters of the configuration                      (default: user defined GYRE) 
     35&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg) 
    3636!----------------------------------------------------------------------- 
    3737   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     
    4242/ 
    4343!----------------------------------------------------------------------- 
    44 &namtsd        !    Temperature & Salinity Data                         (default: OFF) 
     44&namtsd        !    Temperature & Salinity Data  (init/dmp)             (default: OFF) 
    4545!----------------------------------------------------------------------- 
    4646   !                       ! =T  read T-S fields for: 
     
    6363!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" ) 
    6464!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only) 
     65!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   ) 
    6566!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T) 
     67!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T) 
    6668!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T) 
     69!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T) 
    6770!!   namsbc_isf      ice shelf melting/freezing                         (ln_isfcav  =T : read (ln_read_cfg=T) or set or usr_def_zgr ) 
    6871!!   namsbc_iscpl    coupling option between land ice model and ocean   (ln_isfcav  =T) 
    69 !!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T) 
    70 !!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T) 
    7172!!   namsbc_wave     external fields from wave model                    (ln_wave    =T) 
    7273!!   namberg         iceberg floats                                     (ln_icebergs=T) 
     
    7475! 
    7576!----------------------------------------------------------------------- 
    76 &namsbc        !   Surface Boundary Condition (surface module) 
     77&namsbc        !   Surface Boundary Condition manager                   (default: NO selection) 
    7778!----------------------------------------------------------------------- 
    7879   nn_fsbc     = 1         !  frequency of SBC module call 
     
    8687                     ! Misc. options of sbc :  
    8788   ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
     89   ln_ssr      = .true.    !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr) 
    8890   ln_rnf      = .true.    !  runoffs                                   (T => fill namsbc_rnf) 
    89    ln_ssr      = .true.    !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr) 
    9091   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked 
    9192/ 
    9293!----------------------------------------------------------------------- 
    93 &namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk =T) 
     94&namsbc_blk    !   namsbc_blk  generic Bulk formula                     (ln_blk =T) 
    9495!----------------------------------------------------------------------- 
    9596   !                    !  bulk algorithm : 
    96    ln_NCAR      = .true.    ! "NCAR"      algorithm   (Large and Yeager 2008) 
    97    ln_COARE_3p0 = .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003) 
    98    ln_COARE_3p6 = .false.   ! "COARE 3.6" algorithm   (Edson et al. 2013) 
    99    ln_ECMWF     = .false.   ! "ECMWF"     algorithm   (IFS cycle 31) 
    100       ! 
    101       rn_zqt      = 10.       !  Air temperature & humidity reference height (m) 
    102       rn_zu       = 10.       !  Wind vector reference height (m) 
    103       ln_Cd_L12   = .false.   !  air-ice drags = F(ice concentration) (Lupkes et al. 2012) 
    104       ln_Cd_L15   = .false.   !  air-ice drags = F(ice concentration) (Lupkes et al. 2015) 
    105       rn_pfac     = 1.        !  multiplicative factor for precipitation (total & snow) 
    106       rn_efac     = 1.        !  multiplicative factor for evaporation (0. or 1.) 
    107       rn_vfac     = 0.        !  multiplicative factor for ocean & ice velocity used to 
    108       !                       !  calculate the wind stress (0.=absolute or 1.=relative winds) 
    109       ln_skin_cs = .false.  !  use the cool-skin parameterization (only available in ECMWF and COARE algorithms) !LB 
    110       ln_skin_wl = .false.  !  use the warm-layer        "               "                    " 
    111       ! 
    112       ln_humi_sph = .true.     !  humidity specified below in "sn_humi" is specific humidity     [kg/kg] if .true. 
    113       ln_humi_dpt = .false.    !  humidity specified below in "sn_humi" is dew-point temperature   [K]   if .true. 
    114       ln_humi_rlh = .false.    !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true. 
    115    ! 
     97   ln_NCAR    = .true.     ! "NCAR"      algorithm   (Large and Yeager 2008) 
     98 
    11699   cn_dir = './'  !  root directory for the bulk data location 
    117100   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________! 
    118101   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !          weights filename            ! rotation ! land/sea mask ! 
    119102   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   ! 
    120    sn_wndi     = 'u_10.15JUNE2009_fill'       ,    6.        , 'U_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'  , 'Uwnd'   , '' 
    121    sn_wndj     = 'v_10.15JUNE2009_fill'       ,    6.        , 'V_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'  , 'Vwnd'   , '' 
    122    sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'SWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    123    sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'LWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    124    sn_tair     = 't_10.15JUNE2009_fill'       ,    6.        , 'T_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    125    sn_humi     = 'q_10.15JUNE2009_fill'       ,    6.        , 'Q_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    126    sn_prec     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'PRC_MOD1',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    127    sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    128    sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
     103   sn_wndi     = 'u_10.15JUNE2009_fill'       ,    6.        , 'U_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bicub'  , 'Uwnd'   , '' 
     104   sn_wndj     = 'v_10.15JUNE2009_fill'       ,    6.        , 'V_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bicub'  , 'Vwnd'   , '' 
     105   sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'SWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     106   sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'LWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     107   sn_tair     = 't_10.15JUNE2009_fill'       ,    6.        , 'T_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     108   sn_humi     = 'q_10.15JUNE2009_fill'       ,    6.        , 'Q_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     109   sn_prec     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'PRC_MOD1',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     110   sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     111   sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
    129112/ 
    130113!----------------------------------------------------------------------- 
     
    143126/ 
    144127!----------------------------------------------------------------------- 
     128&namsbc_ssr    !   surface boundary condition : sea surface restoring   (ln_ssr =T) 
     129!----------------------------------------------------------------------- 
     130   nn_sssr     =     2     !  add a damping term to the surface freshwater flux 
     131      rn_deds     =  -166.67  !  magnitude of the damping on salinity   [mm/day] 
     132      ln_sssr_bnd =  .true.   !  flag to bound erp term (associated with nn_sssr=2) 
     133      rn_sssr_bnd =   4.e0    !  ABS(Max/Min) value of the damping erp term [mm/day] 
     134/ 
     135!----------------------------------------------------------------------- 
    145136&namsbc_rnf    !   runoffs                                              (ln_rnf =T) 
    146137!----------------------------------------------------------------------- 
     
    148139      rn_hrnf     =  15.e0    !  depth over which enhanced vertical mixing is used    (ln_rnf_mouth=T) 
    149140      rn_avt_rnf  =   1.e-3   !  value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T) 
     141   rn_rfact    =   1.e0    !  multiplicative factor for runoff 
    150142 
    151143   cn_dir = './'  !  root directory for the location of the runoff files 
     
    160152/ 
    161153!----------------------------------------------------------------------- 
    162 &namsbc_ssr    !   surface boundary condition : sea surface restoring   (ln_ssr =T) 
    163 !----------------------------------------------------------------------- 
    164    nn_sssr     =     2     !  add a damping term to the surface freshwater flux 
    165       rn_deds     =  -166.67  !  magnitude of the damping on salinity   [mm/day] 
    166       ln_sssr_bnd =  .true.   !  flag to bound erp term (associated with nn_sssr=2) 
    167       rn_sssr_bnd =   4.e0    !  ABS(Max/Min) value of the damping erp term [mm/day] 
    168 / 
    169 !----------------------------------------------------------------------- 
    170 &namberg       !   iceberg parameters                                   (default: No iceberg) 
     154&namsbc_wave   ! External fields from wave model                        (ln_wave=T) 
     155!----------------------------------------------------------------------- 
     156/ 
     157!----------------------------------------------------------------------- 
     158&namberg       !   iceberg parameters                                   (default: OFF) 
    171159!----------------------------------------------------------------------- 
    172160   !  iceberg floats are not currently available with AGRIF 
     
    177165!!                                                                    !! 
    178166!!   namlbc        lateral momentum boundary condition                  (default: NO selection) 
    179 !!   namagrif      agrif nested grid ( read by child model only )       ("key_agrif") 
     167!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif") 
    180168!!   nam_tide      Tidal forcing                                        (default: OFF) 
    181169!!   nambdy        Unstructured open boundaries                         (default: OFF) 
     
    230218/ 
    231219!!====================================================================== 
    232 !!                        Tracer (T & S) namelists                    !! 
     220!!                        Tracer (T-S) namelists                      !! 
    233221!!                                                                    !! 
    234222!!   nameos        equation of state                                    (default: NO selection) 
     
    251239      nn_fct_h   =  2               !  =2/4, horizontal 2nd / 4th order  
    252240      nn_fct_v   =  2               !  =2/4, vertical   2nd / COMPACT 4th order  
    253 / 
    254 !----------------------------------------------------------------------- 
    255 &namtra_mle    !   mixed layer eddy parametrisation (Fox-Kemper)        (default: OFF) 
    256 !----------------------------------------------------------------------- 
    257    ln_mle      = .true.   ! (T) use the Mixed Layer Eddy (MLE) parameterisation 
    258241/ 
    259242!----------------------------------------------------------------------- 
     
    273256/ 
    274257!----------------------------------------------------------------------- 
    275 &namtra_eiv !   eddy induced velocity param.                            (default: OFF) 
    276 !----------------------------------------------------------------------- 
    277    ln_ldfeiv     =.true.   ! use eddy induced velocity parameterization 
     258&namtra_mle    !   mixed layer eddy parametrisation (Fox-Kemper)        (default: OFF) 
     259!----------------------------------------------------------------------- 
     260   ln_mle      = .true.   ! (T) use the Mixed Layer Eddy (MLE) parameterisation 
     261/ 
     262!----------------------------------------------------------------------- 
     263&namtra_eiv    !   eddy induced velocity param.                         (default: OFF) 
     264!----------------------------------------------------------------------- 
     265   ln_ldfeiv   = .true.    ! use eddy induced velocity parameterization 
    278266      !                        !  Coefficients: 
    279267      nn_aei_ijk_t  = 21          ! space/time variation of the eiv coeficient 
     
    304292! 
    305293!----------------------------------------------------------------------- 
    306 &nam_vvl       !   vertical coordinate options                          (default: z-star) 
    307 !----------------------------------------------------------------------- 
    308 / 
    309 !----------------------------------------------------------------------- 
    310294&namdyn_adv    !   formulation of the momentum advection                (default: NO selection) 
    311295!----------------------------------------------------------------------- 
     
    352336! 
    353337!----------------------------------------------------------------------- 
    354 &namzdf        !   vertical physics                                     (default: NO selection) 
     338&namzdf        !   vertical physics manager                             (default: NO selection) 
    355339!----------------------------------------------------------------------- 
    356340   !                       ! type of vertical closure 
     
    402386!!====================================================================== 
    403387! 
    404 ! 
    405388!----------------------------------------------------------------------- 
    406389&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi") 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/cfgs/SHARED/namelist_ref

    r13015 r13065  
    13961396   jpni        =   0       !  number of processors following i (set automatically if < 1), see also ln_listonly = T 
    13971397   jpnj        =   0       !  number of processors following j (set automatically if < 1), see also ln_listonly = T 
     1398   nn_hls      =   1       !  halo width (applies to both rows and columns) 
    13981399/ 
    13991400!----------------------------------------------------------------------- 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_oce.F90

    r12377 r13065  
    6767   INTEGER, PUBLIC :: avt_id, avm_id, en_id                ! TKE related identificators 
    6868   INTEGER, PUBLIC :: mbkt_id, ht0_id 
     69   INTEGER, PUBLIC :: glamt_id, gphit_id 
    6970   INTEGER, PUBLIC :: kindic_agr 
    7071    
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_oce_interp.F90

    r12377 r13065  
    4343   PUBLIC   interptsn, interpsshn, interpavm 
    4444   PUBLIC   interpunb, interpvnb , interpub2b, interpvb2b 
    45    PUBLIC   interpe3t 
     45   PUBLIC   interpe3t, interpglamt, interpgphit 
    4646#if defined key_vertical 
    4747   PUBLIC   interpht0, interpmbkt 
     
    9595      ! 
    9696      ! --- West --- ! 
    97       ibdy1 = 2 
    98       ibdy2 = 1+nbghostcells  
    99       ! 
    100       IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
     97      ibdy1 = nn_hls + 2                  ! halo + land + 1 
     98      ibdy2 = nn_hls + 1 + nbghostcells   ! halo + land + nbghostcells 
     99      ! 
     100      IF( .NOT.ln_dynspg_ts ) THEN  ! Store tangential transport 
    101101         DO ji = mi0(ibdy1), mi1(ibdy2) 
    102102            uu_b(ji,:,Krhs_a) = 0._wp 
     
    115115      ! 
    116116      DO ji = mi0(ibdy1), mi1(ibdy2) 
    117          zub(ji,:) = 0._wp    ! Correct transport 
     117         zub(ji,:) = 0._wp    ! Correct tangential transport 
    118118         DO jk = 1, jpkm1 
    119119            DO jj = 1, jpj 
     
    153153 
    154154      ! --- East --- ! 
    155       ibdy1 = jpiglo-1-nbghostcells 
    156       ibdy2 = jpiglo-2  
     155      ibdy1 = jpiglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
     156      ibdy2 = jpiglo - ( nn_hls + 2 )                 ! halo + land + 1 
    157157      ! 
    158158      IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
     
    192192             
    193193      IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
    194          ibdy1 = jpiglo-nbghostcells 
    195          ibdy2 = jpiglo-1  
     194         ibdy1 = jpiglo - ( nn_hls + nbghostcells )   ! halo + land + nbghostcells - 1 
     195         ibdy2 = jpiglo - ( nn_hls + 1 )              ! halo + land + 1            - 1 
    196196         DO ji = mi0(ibdy1), mi1(ibdy2) 
    197197            zvb(ji,:) = 0._wp 
     
    215215 
    216216      ! --- South --- ! 
    217       jbdy1 = 2 
    218       jbdy2 = 1+nbghostcells  
     217      jbdy1 = nn_hls + 2                  ! halo + land + 1 
     218      jbdy2 = nn_hls + 1 + nbghostcells   ! halo + land + nbghostcells 
    219219      ! 
    220220      IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
     
    276276 
    277277      ! --- North --- ! 
    278       jbdy1 = jpjglo-1-nbghostcells 
    279       jbdy2 = jpjglo-2  
     278      jbdy1 = jpjglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
     279      jbdy2 = jpjglo - ( nn_hls + 2 )                 ! halo + land + 1 
    280280      ! 
    281281      IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
     
    315315             
    316316      IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
    317          jbdy1 = jpjglo-nbghostcells 
    318          jbdy2 = jpjglo-1 
     317         jbdy1 = jpjglo - ( nn_hls + nbghostcells )   ! halo + land + nbghostcells - 1 
     318         jbdy2 = jpjglo - ( nn_hls + 1 )              ! halo + land + 1            - 1 
    319319         DO jj = mj0(jbdy1), mj1(jbdy2) 
    320320            zub(:,jj) = 0._wp 
     
    354354      ! 
    355355      !--- West ---! 
    356       istart = 2 
    357       iend   = nbghostcells+1 
     356      istart = nn_hls + 2                              ! halo + land + 1 
     357      iend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    358358      DO ji = mi0(istart), mi1(iend) 
    359359         DO jj=1,jpj 
     
    364364      ! 
    365365      !--- East ---! 
    366       istart = jpiglo-nbghostcells 
    367       iend   = jpiglo-1 
     366      istart = jpiglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     367      iend   = jpiglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    368368      DO ji = mi0(istart), mi1(iend) 
    369369         DO jj=1,jpj 
     
    371371         END DO 
    372372      END DO 
    373       istart = jpiglo-nbghostcells-1 
    374       iend   = jpiglo-2 
     373      istart = jpiglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
     374      iend   = jpiglo - ( nn_hls + 2 )                 ! halo + land + 1 
    375375      DO ji = mi0(istart), mi1(iend) 
    376376         DO jj=1,jpj 
     
    380380      ! 
    381381      !--- South ---! 
    382       jstart = 2 
    383       jend   = nbghostcells+1 
     382      jstart = nn_hls + 2                              ! halo + land + 1 
     383      jend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    384384      DO jj = mj0(jstart), mj1(jend) 
    385385         DO ji=1,jpi 
     
    390390      ! 
    391391      !--- North ---! 
    392       jstart = jpjglo-nbghostcells 
    393       jend   = jpjglo-1 
     392      jstart = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     393      jend   = jpjglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    394394      DO jj = mj0(jstart), mj1(jend) 
    395395         DO ji=1,jpi 
     
    397397         END DO 
    398398      END DO 
    399       jstart = jpjglo-nbghostcells-1 
    400       jend   = jpjglo-2 
     399      jstart = jpjglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
     400      jend   = jpjglo - ( nn_hls + 2 )                 ! halo + land + 1 
    401401      DO jj = mj0(jstart), mj1(jend) 
    402402         DO ji=1,jpi 
     
    421421      ! 
    422422      !--- West ---! 
    423       istart = 2 
    424       iend   = nbghostcells+1 
     423      istart = nn_hls + 2                              ! halo + land + 1 
     424      iend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    425425      DO ji = mi0(istart), mi1(iend) 
    426426         DO jj=1,jpj 
     
    431431      ! 
    432432      !--- East ---! 
    433       istart = jpiglo-nbghostcells 
    434       iend   = jpiglo-1 
     433      istart = jpiglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     434      iend   = jpiglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    435435      DO ji = mi0(istart), mi1(iend) 
    436436         DO jj=1,jpj 
     
    438438         END DO 
    439439      END DO 
    440       istart = jpiglo-nbghostcells-1 
    441       iend   = jpiglo-2 
     440      istart = jpiglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
     441      iend   = jpiglo - ( nn_hls + 2 )                 ! halo + land + 1 
    442442      DO ji = mi0(istart), mi1(iend) 
    443443         DO jj=1,jpj 
     
    447447      ! 
    448448      !--- South ---! 
    449       jstart = 2 
    450       jend   = nbghostcells+1 
     449      jstart = nn_hls + 2                              ! halo + land + 1 
     450      jend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    451451      DO jj = mj0(jstart), mj1(jend) 
    452452         DO ji=1,jpi 
     
    457457      ! 
    458458      !--- North ---! 
    459       jstart = jpjglo-nbghostcells 
    460       jend   = jpjglo-1 
     459      jstart = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     460      jend   = jpjglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    461461      DO jj = mj0(jstart), mj1(jend) 
    462462         DO ji=1,jpi 
     
    464464         END DO 
    465465      END DO 
    466       jstart = jpjglo-nbghostcells-1 
    467       jend   = jpjglo-2 
     466      jstart = jpjglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
     467      jend   = jpjglo - ( nn_hls + 2 )                 ! halo + land + 1 
    468468      DO jj = mj0(jstart), mj1(jend) 
    469469         DO ji=1,jpi 
     
    542542      ! 
    543543      ! --- West --- ! 
    544       istart = 2 
    545       iend   = 1 + nbghostcells 
     544      istart = nn_hls + 2                              ! halo + land + 1 
     545      iend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    546546      DO ji = mi0(istart), mi1(iend) 
    547547         DO jj = 1, jpj 
     
    551551      ! 
    552552      ! --- East --- ! 
    553       istart = jpiglo - nbghostcells 
    554       iend   = jpiglo - 1 
     553      istart = jpiglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     554      iend   = jpiglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    555555      DO ji = mi0(istart), mi1(iend) 
    556556         DO jj = 1, jpj 
     
    560560      ! 
    561561      ! --- South --- ! 
    562       jstart = 2 
    563       jend   = 1 + nbghostcells 
     562      jstart = nn_hls + 2                              ! halo + land + 1 
     563      jend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    564564      DO jj = mj0(jstart), mj1(jend) 
    565565         DO ji = 1, jpi 
     
    569569      ! 
    570570      ! --- North --- ! 
    571       jstart = jpjglo - nbghostcells 
    572       jend   = jpjglo - 1 
     571      jstart = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     572      jend   = jpjglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    573573      DO jj = mj0(jstart), mj1(jend) 
    574574         DO ji = 1, jpi 
     
    593593      ! 
    594594      ! --- West --- ! 
    595       istart = 2 
    596       iend   = 1+nbghostcells 
     595      istart = nn_hls + 2                              ! halo + land + 1 
     596      iend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    597597      DO ji = mi0(istart), mi1(iend) 
    598598         DO jj = 1, jpj 
     
    602602      ! 
    603603      ! --- East --- ! 
    604       istart = jpiglo - nbghostcells 
    605       iend   = jpiglo - 1 
     604      istart = jpiglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     605      iend   = jpiglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    606606      DO ji = mi0(istart), mi1(iend) 
    607607         DO jj = 1, jpj 
     
    611611      ! 
    612612      ! --- South --- ! 
    613       jstart = 2 
    614       jend   = 1+nbghostcells 
     613      jstart = nn_hls + 2                              ! halo + land + 1 
     614      jend   = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    615615      DO jj = mj0(jstart), mj1(jend) 
    616616         DO ji = 1, jpi 
     
    620620      ! 
    621621      ! --- North --- ! 
    622       jstart = jpjglo - nbghostcells 
    623       jend   = jpjglo - 1 
     622      jstart = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
     623      jend   = jpjglo - ( nn_hls + 1 )                 ! halo + land + 1            - 1 
    624624      DO jj = mj0(jstart), mj1(jend) 
    625625         DO ji = 1, jpi 
     
    11521152                     WRITE(numout,*) ' Agrif error for e3t_0: parent , child, i, j, k ',  &  
    11531153                     &                 ptab(ji,jj,jk), tmask(ji,jj,jk) * e3t_0(ji,jj,jk), & 
    1154                      &                 ji+nimpp-1, jj+njmpp-1, jk 
    1155                      kindic_agr = kindic_agr + 1 
     1154                     &                 mig0(ji), mig0(jj), jk 
     1155                !     kindic_agr = kindic_agr + 1 
    11561156                  ENDIF 
    11571157               END DO 
     
    11621162      !  
    11631163   END SUBROUTINE interpe3t 
     1164 
     1165 
     1166   SUBROUTINE interpglamt( ptab, i1, i2, j1, j2, before ) 
     1167      !!---------------------------------------------------------------------- 
     1168      !!                  ***  ROUTINE interpglamt  *** 
     1169      !!----------------------------------------------------------------------   
     1170      INTEGER                        , INTENT(in   ) :: i1, i2, j1, j2 
     1171      REAL(wp),DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab 
     1172      LOGICAL                        , INTENT(in   ) :: before 
     1173      ! 
     1174      INTEGER :: ji, jj, jk 
     1175      REAL(wp):: ztst 
     1176      !!----------------------------------------------------------------------   
     1177      !     
     1178      IF( before ) THEN 
     1179         ptab(i1:i2,j1:j2) = glamt(i1:i2,j1:j2) 
     1180      ELSE 
     1181         ztst = MAXVAL(ABS(glamt(i1:i2,j1:j2)))*1.e-4 
     1182         DO jj = j1, j2 
     1183            DO ji = i1, i2 
     1184               IF( ABS( ptab(ji,jj) - glamt(ji,jj) ) > ztst ) THEN 
     1185                  WRITE(numout,*) ' Agrif error for glamt: parent, child, i, j ', ptab(ji,jj), glamt(ji,jj), mig0(ji), mig0(jj) 
     1186                  kindic_agr = kindic_agr + 1 
     1187               ENDIF 
     1188            END DO 
     1189         END DO 
     1190      ENDIF 
     1191      !  
     1192   END SUBROUTINE interpglamt 
     1193 
     1194 
     1195   SUBROUTINE interpgphit( ptab, i1, i2, j1, j2, before ) 
     1196      !!---------------------------------------------------------------------- 
     1197      !!                  ***  ROUTINE interpgphit  *** 
     1198      !!----------------------------------------------------------------------   
     1199      INTEGER                        , INTENT(in   ) :: i1, i2, j1, j2 
     1200      REAL(wp),DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab 
     1201      LOGICAL                        , INTENT(in   ) :: before 
     1202      ! 
     1203      INTEGER :: ji, jj, jk 
     1204      REAL(wp):: ztst 
     1205      !!----------------------------------------------------------------------   
     1206      !     
     1207      IF( before ) THEN 
     1208         ptab(i1:i2,j1:j2) = gphit(i1:i2,j1:j2) 
     1209      ELSE 
     1210         ztst = MAXVAL(ABS(gphit(i1:i2,j1:j2)))*1.e-4 
     1211         DO jj = j1, j2 
     1212            DO ji = i1, i2 
     1213               IF( ABS( ptab(ji,jj) - gphit(ji,jj) ) > ztst ) THEN 
     1214                  WRITE(numout,*) ' Agrif error for gphit: parent, child, i, j ', ptab(ji,jj), gphit(ji,jj), mig0(ji), mig0(jj) 
     1215                  kindic_agr = kindic_agr + 1 
     1216               ENDIF 
     1217            END DO 
     1218         END DO 
     1219      ENDIF 
     1220      !  
     1221   END SUBROUTINE interpgphit 
    11641222 
    11651223 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_oce_sponge.F90

    r12807 r13065  
    106106      REAL(wp) ::   z1_ispongearea, z1_jspongearea 
    107107      REAL(wp), DIMENSION(jpi,jpj) :: ztabramp 
     108#if defined key_vertical 
     109      REAL(wp), DIMENSION(jpi,jpj) :: ztabrampu 
     110      REAL(wp), DIMENSION(jpi,jpj) :: ztabrampv 
     111#endif 
    108112      REAL(wp), DIMENSION(jpjmax)  :: zmskwest,  zmskeast 
    109113      REAL(wp), DIMENSION(jpimax)  :: zmsknorth, zmsksouth 
     
    128132         ! --- West --- ! 
    129133         ztabramp(:,:) = 0._wp 
    130          ind1 = 1+nbghostcells 
     134         ind1 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    131135         DO ji = mi0(ind1), mi1(ind1)                 
    132136            ztabramp(ji,:) = ssumask(ji,:) 
    133137         END DO 
    134138         ! 
    135          zmskwest(:) = 0._wp 
    136139         zmskwest(1:jpj) = MAXVAL(ztabramp(:,:), dim=1) 
     140         zmskwest(jpj+1:jpjmax) = 0._wp 
    137141 
    138142         ! --- East --- ! 
    139143         ztabramp(:,:) = 0._wp 
    140          ind1 = jpiglo - nbghostcells - 1 
     144         ind1 = jpiglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
    141145         DO ji = mi0(ind1), mi1(ind1)                  
    142146            ztabramp(ji,:) = ssumask(ji,:) 
    143147         END DO 
    144148         ! 
    145          zmskeast(:) = 0._wp 
    146149         zmskeast(1:jpj) = MAXVAL(ztabramp(:,:), dim=1) 
     150         zmskeast(jpj+1:jpjmax) = 0._wp 
    147151 
    148152         ! --- South --- ! 
    149153         ztabramp(:,:) = 0._wp 
    150          ind1 = 1+nbghostcells 
     154         ind1 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    151155         DO jj = mj0(ind1), mj1(ind1)                  
    152156            ztabramp(:,jj) = ssvmask(:,jj) 
    153157         END DO 
    154158         ! 
    155          zmsksouth(:) = 0._wp 
    156159         zmsksouth(1:jpi) = MAXVAL(ztabramp(:,:), dim=2) 
     160         zmsksouth(jpi+1:jpimax) = 0._wp 
    157161 
    158162         ! --- North --- ! 
    159163         ztabramp(:,:) = 0._wp 
    160          ind1 = jpjglo - nbghostcells - 1 
     164         ind1 = jpjglo - ( nn_hls + nbghostcells + 1)   ! halo + land + nbghostcells 
    161165         DO jj = mj0(ind1), mj1(ind1)                  
    162166            ztabramp(:,jj) = ssvmask(:,jj) 
    163167         END DO 
    164168         ! 
    165          zmsknorth(:) = 0._wp 
    166169         zmsknorth(1:jpi) = MAXVAL(ztabramp(:,:), dim=2) 
     170         zmsknorth(jpi+1:jpimax) = 0._wp 
     171 
    167172         ! JC: SPONGE MASKING TO BE SORTED OUT: 
    168173         zmskwest(:)  = 1._wp 
    169174         zmskeast(:)  = 1._wp 
     175         zmsksouth(:) = 1._wp 
    170176         zmsknorth(:) = 1._wp 
    171          zmsksouth(:) = 1._wp 
    172177#if defined key_mpp_mpi 
    173178!         CALL mpp_max( 'AGRIF_sponge', zmskwest(:) , jpjmax ) 
     
    192197 
    193198         ! --- West --- ! 
    194          ind1 = 1+nbghostcells 
    195          ind2 = 1+nbghostcells + ispongearea  
     199         ind1 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
     200         ind2 = nn_hls + 1 + nbghostcells + ispongearea  
    196201         DO ji = mi0(ind1), mi1(ind2)    
    197202            DO jj = 1, jpj                
     
    202207         ! ghost cells: 
    203208         ind1 = 1 
    204          ind2 = nbghostcells + 1 
     209         ind2 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    205210         DO ji = mi0(ind1), mi1(ind2)    
    206211            DO jj = 1, jpj                
     
    210215 
    211216         ! --- East --- ! 
    212          ind1 = jpiglo - nbghostcells - ispongearea 
    213          ind2 = jpiglo - nbghostcells 
     217         ind1 = jpiglo - ( nn_hls + nbghostcells ) - ispongearea 
     218         ind2 = jpiglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
    214219         DO ji = mi0(ind1), mi1(ind2) 
    215220            DO jj = 1, jpj 
     
    219224 
    220225         ! ghost cells: 
    221          ind1 = jpiglo - nbghostcells 
     226         ind1 = jpiglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
    222227         ind2 = jpiglo 
    223228         DO ji = mi0(ind1), mi1(ind2) 
     
    228233 
    229234         ! --- South --- ! 
    230          ind1 = 1+nbghostcells 
    231          ind2 = 1+nbghostcells + jspongearea 
     235         ind1 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
     236         ind2 = nn_hls + 1 + nbghostcells + jspongearea  
    232237         DO jj = mj0(ind1), mj1(ind2)  
    233238            DO ji = 1, jpi 
     
    238243         ! ghost cells: 
    239244         ind1 = 1 
    240          ind2 = nbghostcells + 1 
     245         ind2 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells 
    241246         DO jj = mj0(ind1), mj1(ind2)  
    242247            DO ji = 1, jpi 
     
    246251 
    247252         ! --- North --- ! 
    248          ind1 = jpjglo - nbghostcells - jspongearea 
    249          ind2 = jpjglo - nbghostcells 
     253         ind1 = jpjglo - ( nn_hls + nbghostcells ) - jspongearea 
     254         ind2 = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
    250255         DO jj = mj0(ind1), mj1(ind2) 
    251256            DO ji = 1, jpi 
     
    255260 
    256261         ! ghost cells: 
    257          ind1 = jpjglo - nbghostcells 
     262         ind1 = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1 
    258263         ind2 = jpjglo 
    259264         DO jj = mj0(ind1), mj1(ind2) 
     
    273278            fspv(ji,jj) = 0.5_wp * ( ztabramp(ji,jj) + ztabramp(ji  ,jj+1) ) * ssvmask(ji,jj) 
    274279         END_2D 
    275          CALL lbc_lnk( 'agrif_Sponge', fspu, 'U', 1. )   ! Lateral boundary conditions 
    276          CALL lbc_lnk( 'agrif_Sponge', fspv, 'V', 1. ) 
    277  
    278          spongedoneT = .TRUE. 
    279280      ENDIF 
    280281 
     
    289290                                  &  * ssvmask(ji,jj) * ssvmask(ji,jj+1) 
    290291         END_2D 
    291          CALL lbc_lnk( 'agrif_Sponge', fspt, 'T', 1. )   ! Lateral boundary conditions 
    292          CALL lbc_lnk( 'agrif_Sponge', fspf, 'F', 1. ) 
    293           
     292      ENDIF 
     293       
     294      IF( .NOT. spongedoneT .AND. .NOT. spongedoneU ) THEN 
     295         CALL lbc_lnk_multi( 'agrif_Sponge', fspu, 'U', 1., fspv, 'V', 1., fspt, 'T', 1., fspf, 'F', 1. ) 
     296         spongedoneT = .TRUE. 
     297         spongedoneU = .TRUE. 
     298      ENDIF 
     299      IF( .NOT. spongedoneT ) THEN 
     300         CALL lbc_lnk_multi( 'agrif_Sponge', fspu, 'U', 1., fspv, 'V', 1. ) 
     301         spongedoneT = .TRUE. 
     302      ENDIF 
     303      IF( .NOT. spongedoneT .AND. .NOT. spongedoneU ) THEN 
     304         CALL lbc_lnk_multi( 'agrif_Sponge', fspt, 'T', 1., fspf, 'F', 1. ) 
    294305         spongedoneU = .TRUE. 
    295306      ENDIF 
     
    312323      END_2D 
    313324      ! 
    314       ztabramp(:,:) = REAL( mbkt_parent(:,:), wp )   ;   CALL lbc_lnk( 'Agrif_Sponge', ztabramp, 'T', 1. ) 
    315       mbkt_parent(:,:) = NINT( ztabramp(:,:) ) 
    316       ztabramp(:,:) = REAL( mbku_parent(:,:), wp )   ;   CALL lbc_lnk( 'Agrif_Sponge', ztabramp, 'U', 1. ) 
    317       mbku_parent(:,:) = NINT( ztabramp(:,:) ) 
    318       ztabramp(:,:) = REAL( mbkv_parent(:,:), wp )   ;   CALL lbc_lnk( 'Agrif_Sponge', ztabramp, 'V', 1. ) 
    319       mbkv_parent(:,:) = NINT( ztabramp(:,:) ) 
     325      ztabramp (:,:) = REAL( mbkt_parent (:,:), wp ) 
     326      ztabrampu(:,:) = REAL( mbku_parentu(:,:), wp ) 
     327      ztabrampv(:,:) = REAL( mbkv_parentv(:,:), wp ) 
     328      CALL lbc_lnk_multi( 'Agrif_Sponge', ztabramp, 'T', 1., ztabrampu, 'U', 1., ztabrampv, 'V', 1. ) 
     329      mbkt_parent(:,:) = NINT( ztabramp (:,:) ) 
     330      mbku_parent(:,:) = NINT( ztabrampu(:,:) ) 
     331      mbkv_parent(:,:) = NINT( ztabrampv(:,:) ) 
    320332#endif 
    321333      ! 
     
    505517 
    506518      INTEGER :: ji,jj,jk,jmax 
    507  
     519      INTEGER :: ind1 
    508520      ! sponge parameters  
    509521      REAL(wp) :: ze2u, ze1v, zua, zva, zbtr, zhtot, ztrelax 
     
    646658 
    647659         jmax = j2-1 
    648          IF ((nbondj == 1).OR.(nbondj == 2)) jmax = MIN(jmax,jpj-nbghostcells-2)   ! North 
     660         ind1 = jpjglo - ( nn_hls + nbghostcells + 2 )   ! North 
     661         DO jj = mj0(ind1), mj1(ind1)                  
     662            jmax = MIN(jmax,jj) 
     663         END DO 
    649664 
    650665         DO jj = j1+1, jmax 
     
    684699      ! 
    685700      INTEGER  ::   ji, jj, jk, imax 
     701      INTEGER  ::   ind1 
     702      ! sponge parameters  
    686703      REAL(wp) ::   ze2u, ze1v, zua, zva, zbtr, zhtot, ztrelax 
    687704      REAL(wp), DIMENSION(i1:i2,j1:j2,1:jpk) :: vbdiff 
     
    802819 
    803820         imax = i2 - 1 
    804          IF ((nbondi == 1).OR.(nbondi == 2))   imax = MIN(imax,jpi-nbghostcells-2)   ! East 
    805  
     821         ind1 = jpiglo - ( nn_hls + nbghostcells + 2 )   ! East 
     822         DO ji = mi0(ind1), mi1(ind1)                 
     823            imax = MIN(imax,ji) 
     824         END DO 
     825          
    806826         DO jj = j1+1, j2 
    807827            DO ji = i1+1, imax   ! vector opt. 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_user.F90

    r12807 r13065  
    6262      ! 1. Declaration of the type of variable which have to be interpolated 
    6363      !--------------------------------------------------------------------- 
    64       ind1 =     nbghostcells 
    65       ind2 = 1 + nbghostcells 
    66       ind3 = 2 + nbghostcells 
     64      ind1 =          nbghostcells       ! do the interpolation over nbghostcells points 
     65      ind2 = nn_hls + nbghostcells + 1   ! U/V points: array index of the first point in the reference grid  
     66      ind3 = nn_hls + nbghostcells + 2   ! T   points: array index of the first point in the reference grid  
    6767      CALL agrif_declare_variable((/1,2/),(/ind2,ind3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e1u_id) 
    6868      CALL agrif_declare_variable((/2,1/),(/ind3,ind2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e2v_id) 
     
    270270         ! 
    271271         ! In case of vertical interpolation, check only that total depths agree between child and parent: 
    272          DO ji = 1, jpi 
    273             DO jj = 1, jpj 
    274                IF ((mbkt_parent(ji,jj)/=0).AND.(ABS(ht0_parent(ji,jj)-ht_0(ji,jj))>1.e-3)) kindic_agr = kindic_agr + 1 
    275                IF ((mbku_parent(ji,jj)/=0).AND.(ABS(hu0_parent(ji,jj)-hu_0(ji,jj))>1.e-3)) kindic_agr = kindic_agr + 1 
    276                IF ((mbkv_parent(ji,jj)/=0).AND.(ABS(hv0_parent(ji,jj)-hv_0(ji,jj))>1.e-3)) kindic_agr = kindic_agr + 1 
    277             END DO 
    278          END DO 
     272         DO_2D_00_00 
     273            IF ((mbkt_parent(ji,jj)/=0).AND.(ABS(ht0_parent(ji,jj)-ht_0(ji,jj))>1.e-3)) kindic_agr = kindic_agr + 1 
     274            IF ((mbku_parent(ji,jj)/=0).AND.(ABS(hu0_parent(ji,jj)-hu_0(ji,jj))>1.e-3)) kindic_agr = kindic_agr + 1 
     275            IF ((mbkv_parent(ji,jj)/=0).AND.(ABS(hv0_parent(ji,jj)-hv_0(ji,jj))>1.e-3)) kindic_agr = kindic_agr + 1 
     276         END_2D 
    279277# endif 
    280278         CALL mpp_sum( 'agrif_user', kindic_agr ) 
     
    286284         END IF   
    287285         !     
     286         IF(lwp) WRITE(numout,*) ' ' 
     287         IF(lwp) WRITE(numout,*) 'AGRIF: Check longitude and latitude near bdys. Level: ', Agrif_Level() 
     288         ! 
     289         ! check glamt in sponge area: 
     290         kindic_agr = 0 
     291         CALL Agrif_Bc_variable(glamt_id,calledweight=1.,procname=interpglamt) 
     292         CALL mpp_sum( 'agrif_user', kindic_agr ) 
     293         IF( kindic_agr /= 0 ) THEN 
     294            CALL ctl_stop('==> Child glamt is NOT correct near boundaries.') 
     295         ELSE 
     296            IF(lwp) WRITE(numout,*) '==> Child glamt is ok near boundaries.' 
     297            IF(lwp) WRITE(numout,*) ' ' 
     298         END IF   
     299         ! 
     300         ! check gphit in sponge area: 
     301         kindic_agr = 0 
     302         CALL Agrif_Bc_variable(gphit_id,calledweight=1.,procname=interpgphit) 
     303         CALL mpp_sum( 'agrif_user', kindic_agr ) 
     304         IF( kindic_agr /= 0 ) THEN 
     305            CALL ctl_stop('==> Child gphit is NOT correct near boundaries.') 
     306         ELSE 
     307            IF(lwp) WRITE(numout,*) '==> Child gphit is ok near boundaries.' 
     308            IF(lwp) WRITE(numout,*) ' ' 
     309         END IF   
    288310      ENDIF 
    289311 
     
    314336      ! 1. Declaration of the type of variable which have to be interpolated 
    315337      !--------------------------------------------------------------------- 
    316       ind1 =     nbghostcells 
    317       ind2 = 1 + nbghostcells 
    318       ind3 = 2 + nbghostcells 
     338      ind1 =          nbghostcells       ! do the interpolation over nbghostcells points 
     339      ind2 = nn_hls + nbghostcells + 1   ! U/V points: array index of the first point in the reference grid  
     340      ind3 = nn_hls + nbghostcells + 2   ! T   points: array index of the first point in the reference grid  
    319341# if defined key_vertical 
    320342      CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts+1/),tsn_id) 
     
    340362 
    341363      CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),e3t_id) 
     364      CALL agrif_declare_variable((/2,2/),(/ind3,ind3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),glamt_id) 
     365      CALL agrif_declare_variable((/2,2/),(/ind3,ind3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),gphit_id) 
    342366 
    343367# if defined key_vertical 
     
    393417      CALL Agrif_Set_bcinterp(vn_sponge_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 
    394418 
    395       CALL Agrif_Set_bcinterp(e3t_id,interp=AGRIF_constant) 
     419      CALL Agrif_Set_bcinterp(  e3t_id,interp=AGRIF_constant) 
     420      CALL Agrif_Set_bcinterp(gphit_id,interp=AGRIF_constant) 
     421      CALL Agrif_Set_bcinterp(glamt_id,interp=AGRIF_constant) 
    396422 
    397423# if defined key_vertical 
     
    421447! JC: check near the boundary only until matching in sponge has been sorted out: 
    422448      CALL Agrif_Set_bc(  e3t_id, (/0,ind1-1/) )   
     449      CALL Agrif_Set_bc(glamt_id, (/0,ind1-1/) )   
     450      CALL Agrif_Set_bc(gphit_id, (/0,ind1-1/) )   
    423451 
    424452# if defined key_vertical  
     
    433461      !---------------  
    434462      CALL Agrif_Set_Updatetype(scales_t_id, update = AGRIF_Update_Average) 
     463!!$      CALL Agrif_Set_Updatetype(glamt_id, update = AGRIF_Update_Average) 
     464!!$      CALL Agrif_Set_Updatetype(gphit_id, update = AGRIF_Update_Average) 
    435465 
    436466# if defined UPD_HIGH 
     
    532562      !                            2,2 = two ghost lines 
    533563      !------------------------------------------------------------------------------------- 
    534       ind1 =     nbghostcells 
    535       ind2 = 1 + nbghostcells 
    536       ind3 = 2 + nbghostcells 
     564      ind1 =          nbghostcells       ! do the interpolation over nbghostcells points 
     565      ind2 = nn_hls + nbghostcells + 1   ! U/V points: array index of the first point in the reference grid  
     566      ind3 = nn_hls + nbghostcells + 2   ! T   points: array index of the first point in the reference grid  
    537567      CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpl*(8+nlay_s+nlay_i)/),tra_ice_id) 
    538568      CALL agrif_declare_variable((/1,2/)  ,(/ind2,ind3/)  ,(/'x','y'/)    ,(/1,1/)  ,(/jpi,jpj/)                      ,u_ice_id  ) 
     
    657687      ! 1. Declaration of the type of variable which have to be interpolated 
    658688      !--------------------------------------------------------------------- 
    659       ind1 =     nbghostcells 
    660       ind2 = 1 + nbghostcells 
    661       ind3 = 2 + nbghostcells 
     689      ind1 =          nbghostcells       ! do the interpolation over nbghostcells points 
     690      ind2 = nn_hls + nbghostcells + 1   ! U/V points: array index of the first point in the reference grid  
     691      ind3 = nn_hls + nbghostcells + 2   ! T   points: array index of the first point in the reference grid  
    662692# if defined key_vertical 
    663693      CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra+1/),trn_id) 
     
    756786      ! 
    757787      SELECT CASE( i ) 
    758       CASE(1)   ;   indglob = indloc + nimppt(nprocloc+1) - 1 
    759       CASE(2)   ;   indglob = indloc + njmppt(nprocloc+1) - 1 
    760       CASE DEFAULT 
    761          indglob = indloc 
     788      CASE(1)        ;   indglob = mig(indloc) 
     789      CASE(2)        ;   indglob = mjg(indloc) 
     790      CASE DEFAULT   ;   indglob = indloc 
    762791      END SELECT 
    763792      ! 
     
    776805      !!---------------------------------------------------------------------- 
    777806      ! 
    778       imin = nimppt(Agrif_Procrank+1)  ! ????? 
    779       jmin = njmppt(Agrif_Procrank+1)  ! ????? 
    780       imax = imin + jpi - 1 
    781       jmax = jmin + jpj - 1 
     807      imin = mig( 1 ) 
     808      jmin = mjg( 1 ) 
     809      imax = mig(jpi) 
     810      jmax = mjg(jpj) 
    782811      !  
    783812   END SUBROUTINE Agrif_get_proc_info 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domain.F90

    r12960 r13065  
    389389#endif 
    390390 
    391 #if defined key_agrif 
    392391      IF( Agrif_Root() ) THEN 
    393 #endif 
    394       IF(lwp) WRITE(numout,*) 
    395       SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    396       CASE (  1 )  
    397          CALL ioconf_calendar('gregorian') 
    398          IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "gregorian", i.e. leap year' 
    399       CASE (  0 ) 
    400          CALL ioconf_calendar('noleap') 
    401          IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "noleap", i.e. no leap year' 
    402       CASE ( 30 ) 
    403          CALL ioconf_calendar('360d') 
    404          IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "360d", i.e. 360 days in a year' 
    405       END SELECT 
    406 #if defined key_agrif 
    407       ENDIF 
    408 #endif 
     392         IF(lwp) WRITE(numout,*) 
     393         SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
     394         CASE (  1 )  
     395            CALL ioconf_calendar('gregorian') 
     396            IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "gregorian", i.e. leap year' 
     397         CASE (  0 ) 
     398            CALL ioconf_calendar('noleap') 
     399            IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "noleap", i.e. no leap year' 
     400         CASE ( 30 ) 
     401            CALL ioconf_calendar('360d') 
     402            IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "360d", i.e. 360 days in a year' 
     403         END SELECT 
     404      ENDIF 
    409405 
    410406      READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 
     
    473469      !! ** Method  :   compute and print extrema of masked scale factors 
    474470      !!---------------------------------------------------------------------- 
    475       INTEGER, DIMENSION(2) ::   imi1, imi2, ima1, ima2 
    476       INTEGER, DIMENSION(2) ::   iloc   !  
    477       REAL(wp) ::  ze1min, ze1max, ze2min, ze2max 
     471      LOGICAL, DIMENSION(jpi,jpj) ::   llmsk 
     472      INTEGER, DIMENSION(2)       ::   imil, imip, imi1, imi2, imal, imap, ima1, ima2 
     473      REAL(wp)                    ::   zglmin, zglmax, zgpmin, zgpmax, ze1min, ze1max, ze2min, ze2max 
    478474      !!---------------------------------------------------------------------- 
    479475      ! 
    480476      IF(lk_mpp) THEN 
    481          CALL mpp_minloc( 'domain', e1t(:,:), tmask_i(:,:), ze1min, imi1 ) 
    482          CALL mpp_minloc( 'domain', e2t(:,:), tmask_i(:,:), ze2min, imi2 ) 
    483          CALL mpp_maxloc( 'domain', e1t(:,:), tmask_i(:,:), ze1max, ima1 ) 
    484          CALL mpp_maxloc( 'domain', e2t(:,:), tmask_i(:,:), ze2max, ima2 ) 
     477         CALL mpp_minloc( 'domain', glamt(:,:), tmask_i(:,:), zglmin, imil ) 
     478         CALL mpp_minloc( 'domain', gphit(:,:), tmask_i(:,:), zgpmin, imip ) 
     479         CALL mpp_minloc( 'domain',   e1t(:,:), tmask_i(:,:), ze1min, imi1 ) 
     480         CALL mpp_minloc( 'domain',   e2t(:,:), tmask_i(:,:), ze2min, imi2 ) 
     481         CALL mpp_maxloc( 'domain', glamt(:,:), tmask_i(:,:), zglmax, imal ) 
     482         CALL mpp_maxloc( 'domain', gphit(:,:), tmask_i(:,:), zgpmax, imap ) 
     483         CALL mpp_maxloc( 'domain',   e1t(:,:), tmask_i(:,:), ze1max, ima1 ) 
     484         CALL mpp_maxloc( 'domain',   e2t(:,:), tmask_i(:,:), ze2max, ima2 ) 
    485485      ELSE 
    486          ze1min = MINVAL( e1t(:,:), mask = tmask_i(:,:) == 1._wp )     
    487          ze2min = MINVAL( e2t(:,:), mask = tmask_i(:,:) == 1._wp )     
    488          ze1max = MAXVAL( e1t(:,:), mask = tmask_i(:,:) == 1._wp )     
    489          ze2max = MAXVAL( e2t(:,:), mask = tmask_i(:,:) == 1._wp )     
    490          ! 
    491          iloc  = MINLOC( e1t(:,:), mask = tmask_i(:,:) == 1._wp ) 
    492          imi1(1) = iloc(1) + nimpp - 1 
    493          imi1(2) = iloc(2) + njmpp - 1 
    494          iloc  = MINLOC( e2t(:,:), mask = tmask_i(:,:) == 1._wp ) 
    495          imi2(1) = iloc(1) + nimpp - 1 
    496          imi2(2) = iloc(2) + njmpp - 1 
    497          iloc  = MAXLOC( e1t(:,:), mask = tmask_i(:,:) == 1._wp ) 
    498          ima1(1) = iloc(1) + nimpp - 1 
    499          ima1(2) = iloc(2) + njmpp - 1 
    500          iloc  = MAXLOC( e2t(:,:), mask = tmask_i(:,:) == 1._wp ) 
    501          ima2(1) = iloc(1) + nimpp - 1 
    502          ima2(2) = iloc(2) + njmpp - 1 
    503       ENDIF 
     486         llmsk = tmask_i(:,:) == 1._wp 
     487         zglmin = MINVAL( glamt(:,:), mask = llmsk )     
     488         zgpmin = MINVAL( gphit(:,:), mask = llmsk )     
     489         ze1min = MINVAL(   e1t(:,:), mask = llmsk )     
     490         ze2min = MINVAL(   e2t(:,:), mask = llmsk )     
     491         zglmin = MAXVAL( glamt(:,:), mask = llmsk )     
     492         zgpmin = MAXVAL( gphit(:,:), mask = llmsk )     
     493         ze1max = MAXVAL(   e1t(:,:), mask = llmsk )     
     494         ze2max = MAXVAL(   e2t(:,:), mask = llmsk )     
     495         ! 
     496         imil   = MINLOC( glamt(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     497         imip   = MINLOC( gphit(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     498         imi1   = MINLOC(   e1t(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     499         imi2   = MINLOC(   e2t(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     500         imal   = MAXLOC( glamt(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     501         imap   = MAXLOC( gphit(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     502         ima1   = MAXLOC(   e1t(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     503         ima2   = MAXLOC(   e2t(:,:), mask = llmsk ) + (/ nimpp - 1, njmpp - 1 /) 
     504      ENDIF 
     505      ! 
    504506      IF(lwp) THEN 
    505507         WRITE(numout,*) 
    506508         WRITE(numout,*) 'dom_ctl : extrema of the masked scale factors' 
    507509         WRITE(numout,*) '~~~~~~~' 
    508          WRITE(numout,"(14x,'e1t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1max, ima1(1), ima1(2) 
    509          WRITE(numout,"(14x,'e1t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1min, imi1(1), imi1(2) 
    510          WRITE(numout,"(14x,'e2t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze2max, ima2(1), ima2(2) 
    511          WRITE(numout,"(14x,'e2t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze2min, imi2(1), imi2(2) 
     510         WRITE(numout,"(14x,'glamt mini: ',1f10.2,' at i = ',i5,' j= ',i5)") zglmin, imil(1), imil(2) 
     511         WRITE(numout,"(14x,'glamt maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") zglmax, imal(1), imal(2) 
     512         WRITE(numout,"(14x,'gphit mini: ',1f10.2,' at i = ',i5,' j= ',i5)") zgpmin, imip(1), imip(2) 
     513         WRITE(numout,"(14x,'gphit maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") zgpmax, imap(1), imap(2) 
     514         WRITE(numout,"(14x,'  e1t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1min, imi1(1), imi1(2) 
     515         WRITE(numout,"(14x,'  e1t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1max, ima1(1), ima1(2) 
     516         WRITE(numout,"(14x,'  e2t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze2min, imi2(1), imi2(2) 
     517         WRITE(numout,"(14x,'  e2t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze2max, ima2(1), ima2(2) 
    512518      ENDIF 
    513519      ! 
     
    601607      !!---------------------------------------------------------------------- 
    602608      INTEGER           ::   ji, jj, jk   ! dummy loop indices 
    603       INTEGER           ::   izco, izps, isco, icav 
    604609      INTEGER           ::   inum     ! local units 
    605610      CHARACTER(len=21) ::   clnam    ! filename (mesh and mask informations) 
     
    616621      !          
    617622      clnam = cn_domcfg_out  ! filename (configuration information) 
    618       CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 
    619        
     623      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. )      
    620624      ! 
    621625      !                             !==  ORCA family specificities  ==! 
     
    625629      ENDIF 
    626630      ! 
    627       !                             !==  global domain size  ==! 
    628       ! 
    629       CALL iom_rstput( 0, 0, inum, 'jpiglo', REAL( jpiglo, wp), ktype = jp_i4 ) 
    630       CALL iom_rstput( 0, 0, inum, 'jpjglo', REAL( jpjglo, wp), ktype = jp_i4 ) 
    631       CALL iom_rstput( 0, 0, inum, 'jpkglo', REAL( jpk   , wp), ktype = jp_i4 ) 
    632       ! 
    633631      !                             !==  domain characteristics  ==! 
    634632      ! 
     
    637635      ! 
    638636      !                                   ! type of vertical coordinate 
    639       IF( ln_zco    ) THEN   ;   izco = 1   ;   ELSE   ;   izco = 0   ;   ENDIF 
    640       IF( ln_zps    ) THEN   ;   izps = 1   ;   ELSE   ;   izps = 0   ;   ENDIF 
    641       IF( ln_sco    ) THEN   ;   isco = 1   ;   ELSE   ;   isco = 0   ;   ENDIF 
    642       CALL iom_rstput( 0, 0, inum, 'ln_zco'   , REAL( izco, wp), ktype = jp_i4 ) 
    643       CALL iom_rstput( 0, 0, inum, 'ln_zps'   , REAL( izps, wp), ktype = jp_i4 ) 
    644       CALL iom_rstput( 0, 0, inum, 'ln_sco'   , REAL( isco, wp), ktype = jp_i4 ) 
     637      CALL iom_rstput( 0, 0, inum, 'ln_zco', REAL(COUNT((/ln_zco/)), wp), ktype = jp_i4 ) 
     638      CALL iom_rstput( 0, 0, inum, 'ln_zps', REAL(COUNT((/ln_zps/)), wp), ktype = jp_i4 ) 
     639      CALL iom_rstput( 0, 0, inum, 'ln_sco', REAL(COUNT((/ln_sco/)), wp), ktype = jp_i4 ) 
    645640      ! 
    646641      !                                   ! ocean cavities under iceshelves 
    647       IF( ln_isfcav ) THEN   ;   icav = 1   ;   ELSE   ;   icav = 0   ;   ENDIF 
    648       CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL( icav, wp), ktype = jp_i4 ) 
     642      CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL(COUNT((/ln_isfcav/)), wp), ktype = jp_i4 ) 
    649643      ! 
    650644      !                             !==  horizontal mesh  ! 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domhgr.F90

    r12807 r13065  
    8989      ENDIF 
    9090      ! 
    91       ! 
    9291      IF( ln_read_cfg ) THEN        !==  read in mesh_mask.nc file  ==! 
     92         ! 
    9393         IF(lwp) WRITE(numout,*) 
    9494         IF(lwp) WRITE(numout,*) '   ==>>>   read horizontal mesh in ', TRIM( cn_domcfg ), ' file' 
     
    113113         ! 
    114114      ENDIF 
    115       ! 
    116115      !                             !==  Coriolis parameter  ==!   (if necessary) 
    117116      ! 
     
    127126         ENDIF 
    128127      ENDIF 
    129  
    130128      ! 
    131129      !                             !==  associated horizontal metrics  ==! 
     
    151149      e2_e1u(:,:) = e2u(:,:) / e1u(:,:) 
    152150      e1_e2v(:,:) = e1v(:,:) / e2v(:,:) 
    153       ! 
    154151      ! 
    155152      IF( ln_timing )   CALL timing_stop('dom_hgr') 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/dommsk.F90

    r12980 r13065  
    130130      ! 
    131131      tmask(:,:,:) = 0._wp 
    132       DO_2D_00_00 
     132      DO_2D_11_11 
    133133         iktop = k_top(ji,jj) 
    134134         ikbot = k_bot(ji,jj) 
     
    140140      ! the following is mandatory 
    141141      ! it masks boundaries (bathy=0) where needed depending on the configuration (closed, periodic...)   
    142       IF( .NOT. (nbondj == 1 .OR. nbondj == 0 .OR. l_Jperio) ) THEN 
    143          tmask(mi0(  1 ):mi1(jpiglo),mj0(Njs0):mj1(Njs0  ),:) = 0._wp   ! line   number Njs0 at 0 
    144       ENDIF 
    145       IF( .NOT. (nbondi == 1 .OR. nbondi == 0 .OR. l_Iperio) ) THEN 
    146          tmask(mi0(Nis0):mi1(  Nis0),mj0(  1 ):mj1(jpjglo),:) = 0._wp   ! column number Nis0 at 0 
    147       ENDIF 
    148       CALL lbc_lnk( 'dommsk', tmask, 'T', 1._wp )      ! Lateral boundary conditions 
     142!!$      IF( .NOT. (nbondj == 1 .OR. nbondj == 0 .OR. l_Jperio) ) THEN 
     143!!$         tmask(mi0(  1 ):mi1(jpiglo),mj0(Njs0):mj1(Njs0  ),:) = 0._wp   ! line   number Njs0 at 0 
     144!!$      ENDIF 
     145!!$      IF( .NOT. (nbondi == 1 .OR. nbondi == 0 .OR. l_Iperio) ) THEN 
     146!!$         tmask(mi0(Nis0):mi1(  Nis0),mj0(  1 ):mj1(jpjglo),:) = 0._wp   ! column number Nis0 at 0 
     147!!$      ENDIF 
     148!!$      CALL lbc_lnk( 'dommsk', tmask, 'T', 1._wp )      ! Lateral boundary conditions 
    149149 
    150150     ! Mask corrections for bdy (read in mppini2) 
     
    166166      ! ---------------------------------------- 
    167167      ! NB: at this point, fmask is designed for free slip lateral boundary condition 
    168       DO jk = 1, jpk 
    169          DO jj = 1, jpjm1 
    170             DO ji = 1, jpim1   ! vector loop 
    171                umask(ji,jj,jk) = tmask(ji,jj  ,jk) * tmask(ji+1,jj  ,jk) 
    172                vmask(ji,jj,jk) = tmask(ji,jj  ,jk) * tmask(ji  ,jj+1,jk) 
    173             END DO 
    174             DO ji = 1, jpim1      ! NO vector opt. 
    175                fmask(ji,jj,jk) = tmask(ji,jj  ,jk) * tmask(ji+1,jj  ,jk)   & 
    176                   &            * tmask(ji,jj+1,jk) * tmask(ji+1,jj+1,jk) 
    177             END DO 
    178          END DO 
    179       END DO 
     168      DO_3D_00_00( 1, jpk ) 
     169         umask(ji,jj,jk) = tmask(ji,jj  ,jk) * tmask(ji+1,jj  ,jk) 
     170         vmask(ji,jj,jk) = tmask(ji,jj  ,jk) * tmask(ji  ,jj+1,jk) 
     171         fmask(ji,jj,jk) = tmask(ji,jj  ,jk) * tmask(ji+1,jj  ,jk)   & 
     172            &            * tmask(ji,jj+1,jk) * tmask(ji+1,jj+1,jk) 
     173      END_3D 
    180174      CALL lbc_lnk_multi( 'dommsk', umask, 'U', 1., vmask, 'V', 1., fmask, 'F', 1. )      ! Lateral boundary conditions 
    181175  
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DOM/domzgr.F90

    r12807 r13065  
    7575      INTEGER  ::   ioptio, ibat, ios   ! local integer 
    7676      REAL(wp) ::   zrefdep             ! depth of the reference level (~10m) 
     77      REAL(wp), DIMENSION(jpi,jpj) ::   zmsk 
    7778      !!---------------------------------------------------------------------- 
    7879      ! 
     
    109110         ! 
    110111      ENDIF 
     112      ! 
     113      ! make sure that closed boundaries are correctly defined in k_top that will be used to compute all mask arrays 
     114      ! 
     115      zmsk(:,:) = 1._wp                                       ! default: no closed boundaries 
     116      IF( jperio == 0 .OR. jperio == 2 .OR. jperio == 3 .OR. jperio == 5 ) THEN   ! E-W closed 
     117         zmsk(  mi0(     1+nn_hls):mi1(     1+nn_hls),:) = 0._wp   ! first column of inner global domain at 0 
     118         zmsk(  mi0(jpiglo-nn_hls):mi1(jpiglo-nn_hls),:) = 0._wp   ! last  column of inner global domain at 0  
     119      ENDIF 
     120      IF( .NOT. ( jperio == 2 .OR. jperio == 7 ) ) THEN                           ! S closed 
     121         zmsk(:,mj0(     1+nn_hls):mj1(     1+nn_hls)  ) = 0._wp   ! first   line of inner global domain at 0 
     122      ENDIF 
     123      IF( jperio == 0 .OR. jperio == 1 ) THEN                                     ! N closed 
     124         zmsk(:,mj0(jpjglo-nn_hls):mj1(jpjglo-nn_hls)  ) = 0._wp   ! last    line of inner global domain at 0 
     125      ENDIF 
     126      CALL lbc_lnk( 'usrdef_zgr', zmsk, 'T', 1. )             ! set halos 
     127      k_top(:,:) = k_top(:,:) * NINT( zmsk(:,:) ) 
    111128      ! 
    112129!!gm to be remove when removing the OLD definition of e3 scale factors so that gde3w disappears 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DYN/dynspg_ts.F90

    r12989 r13065  
    966966      ! Max courant number for ext. grav. waves 
    967967      ! 
    968       DO_2D_11_11 
     968      DO_2D_00_00 
    969969         zxr2 = r1_e1t(ji,jj) * r1_e1t(ji,jj) 
    970970         zyr2 = r1_e2t(ji,jj) * r1_e2t(ji,jj) 
     
    972972      END_2D 
    973973      ! 
    974       zcmax = MAXVAL( zcu(Nis1:Nie1,Njs1:Nje1) ) 
     974      zcmax = MAXVAL( zcu(Nis0:Nie0,Njs0:Nje0) ) 
    975975      CALL mpp_max( 'dynspg_ts', zcmax ) 
    976976 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/DYN/dynvor.F90

    r12939 r13065  
    8080   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   di_e2u_2        ! = di(e2u)/2          used in T-point metric term calculation 
    8181   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   dj_e1v_2        ! = dj(e1v)/2           -        -      -       -  
    82    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   di_e2v_2e1e2f   ! = di(e2u)/(2*e1e2f)  used in F-point metric term calculation 
    83    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   dj_e1u_2e1e2f   ! = dj(e1v)/(2*e1e2f)   -        -      -       -  
     82   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   di_e2v_2e1e2f   ! = di(e2v)/(2*e1e2f)  used in F-point metric term calculation 
     83   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   dj_e1u_2e1e2f   ! = dj(e1u)/(2*e1e2f)   -        -      -       -  
    8484    
    8585   REAL(wp) ::   r1_4  = 0.250_wp         ! =1/4 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mppini.F90

    r12993 r13065  
    163163           &             cn_ice, nn_ice_dta,                                     & 
    164164           &             ln_vol, nn_volctl, nn_rimwidth 
    165       NAMELIST/nammpp/ jpni, jpnj, ln_nnogather, ln_listonly 
     165      NAMELIST/nammpp/ jpni, jpnj, nn_hls, ln_nnogather, ln_listonly 
    166166      !!---------------------------------------------------------------------- 
    167167      ! 
     
    334334#if defined key_agrif 
    335335      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
    336          IF( jpiglo /= nbcellsx + 2 + 2*nbghostcells )   & 
    337             CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires jpiglo == nbcellsx + 2 + 2*nbghostcells' ) 
    338          IF( jpjglo /= nbcellsy + 2 + 2*nbghostcells )   & 
    339             CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires jpjglo == nbcellsy + 2 + 2*nbghostcells' ) 
     336         IF( jpiglo /= nbcellsx + 2 * ( nbghostcells + 1 + nn_hls ) )  & 
     337            CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires jpiglo == nbcellsx + 2*( nbghostcells + 1 + nn_hls )' ) 
     338         IF( jpjglo /= nbcellsy + 2 * ( nbghostcells + 1 + nn_hls ) )  & 
     339            CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires jpjglo == nbcellsy + 2*( nbghostcells + 1 + nn_hls )' ) 
    340340         IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'mpp_init:Agrif children requires ln_use_jattr = .false. ' ) 
    341341      ENDIF 
     
    12391239      !!---------------------------------------------------------------------- 
    12401240      INTEGER  ::   sxM, dxM, sxT, dxT, jn 
    1241       INTEGER  ::   njmppmax 
    1242       !!---------------------------------------------------------------------- 
    1243       ! 
    1244       njmppmax = MAXVAL( njmppt ) 
     1241      !!---------------------------------------------------------------------- 
    12451242      ! 
    12461243      !initializes the north-fold communication variables 
     
    12481245      nsndto     = 0 
    12491246      ! 
    1250       IF ( njmpp == njmppmax ) THEN      ! if I am a process in the north 
     1247      IF ( njmpp == MAXVAL( njmppt ) ) THEN      ! if I am a process in the north 
    12511248         ! 
    12521249         !sxM is the first point (in the global domain) needed to compute the north-fold for the current process 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_hgr.F90

    r12939 r13065  
    9090      zcos_alpha =   SQRT( 2._wp ) * 0.5_wp 
    9191      ze1deg = ze1 / (ra * rad) 
    92       zlam0 = zlam1 + zcos_alpha * ze1deg * REAL( Ni0glo - nn_hls , wp )   ! -nn_hls to keep same results -> to be removed... 
    93       zphi0 = zphi1 + zsin_alpha * ze1deg * REAL( Nj0glo - nn_hls , wp )   ! -nn_hls to keep same results -> to be removed... 
     92      zlam0 = zlam1 + zcos_alpha * ze1deg * REAL( Ni0glo - 2, wp ) 
     93      zphi0 = zphi1 + zsin_alpha * ze1deg * REAL( Nj0glo - 2, wp ) 
    9494 
    9595#if defined key_agrif 
    9696      ! ! Upper left longitude and latitude from parent: 
    9797      IF (.NOT.Agrif_root()) THEN 
    98          zlam0 = zlam1 + Agrif_irhox() * REAL(Agrif_Parent(jpjglo)-2 , wp) * ze1deg * zcos_alpha  & 
     98         zlam0 = zlam1 + Agrif_irhox() * REAL(Agrif_Parent(Ni0glo) -2, wp) * ze1deg * zcos_alpha  & 
    9999                   &   + ( Agrif_Ix()*Agrif_irhox()-(0.5_wp+nbghostcells)) * ze1deg * zcos_alpha  & 
    100100                   &   + ( Agrif_Iy()*Agrif_irhoy()-(0.5_wp+nbghostcells)) * ze1deg * zsin_alpha 
    101          zphi0 = zphi1 + Agrif_irhoy() * REAL(Agrif_Parent(jpjglo)-2 , wp) * ze1deg * zsin_alpha  & 
     101         zphi0 = zphi1 + Agrif_irhoy() * REAL(Agrif_Parent(Nj0glo) -2, wp) * ze1deg * zsin_alpha  & 
    102102                   &   - ( Agrif_Ix()*Agrif_irhox()-nbghostcells )         * ze1deg * zsin_alpha  & 
    103103                   &   + ( Agrif_Iy()*Agrif_irhoy()-nbghostcells )         * ze1deg * zcos_alpha 
     
    115115      !    
    116116      DO_2D_11_11 
    117          zim1 = REAL( mig(ji)-1, wp ) - 1.   ;   zim05 = REAL( mig(ji)-1, wp ) - 1.5   ! -1 to keep same results -> to be removed... 
    118          zjm1 = REAL( mjg(jj)-1, wp ) - 1.   ;   zjm05 = REAL( mjg(jj)-1, wp ) - 1.5   ! -1 to keep same results -> to be removed... 
     117         zim1 = REAL( mig0_oldcmp(ji), wp ) - 1.   ;   zim05 = REAL( mig0_oldcmp(ji), wp ) - 1.5 
     118         zjm1 = REAL( mjg0_oldcmp(jj), wp ) - 1.   ;   zjm05 = REAL( mjg0_oldcmp(jj), wp ) - 1.5 
    119119         !    
    120120         !glamt(i,j) longitude at T-point 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_nam.F90

    r12989 r13065  
    3636CONTAINS 
    3737 
    38    SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio, khls ) 
     38   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    3939      !!---------------------------------------------------------------------- 
    4040      !!                     ***  ROUTINE dom_nam  *** 
     
    5252      INTEGER         , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
    5353      INTEGER         , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    54       INTEGER,OPTIONAL, INTENT(out) ::   khls            ! halo dimension 
    5554      ! 
    5655      INTEGER ::   ios   ! Local integer 
     
    7069      kk_cfg = nn_GYRE 
    7170      ! 
    72       kpi = 30 * nn_GYRE + 1       ! Global Domain size 
    73       kpj = 20 * nn_GYRE + 1 
     71      kpi = 30 * nn_GYRE + 2       ! Global Domain size: add 1 land point on each side 
     72      kpj = 20 * nn_GYRE + 2 
    7473#if defined key_agrif 
    7574      IF( .NOT. Agrif_Root() ) THEN 
    76          kpi  = nbcellsx + 2*nbghostcells 
    77          kpj  = nbcellsy + 2*nbghostcells 
     75         kpi  = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     76         kpj  = nbcellsy + 2 * ( nbghostcells + 1 ) 
    7877      ENDIF 
    7978#endif 
     
    8180      !                             ! Set the lateral boundary condition of the global domain 
    8281      kperio = 0                    ! GYRE configuration : closed domain 
    83       IF (PRESENT(khls)) khls = 1 
    8482      ! 
    8583      !                             ! control print 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/nemogcm.F90

    r13015 r13065  
    386386         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    387387      ELSE                              ! user-defined namelist 
    388          CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio, nn_hls ) 
    389       ENDIF 
    390       IF (cn_cfg.NE."BENCH") nn_hls = 1  
     388         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
     389      ENDIF 
    391390      ! 
    392391      IF(lwm)   WRITE( numond, namcfg ) 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90

    r12807 r13065  
    4747   ! global domain size for AGRIF     !!! * total AGRIF computational domain * 
    4848   INTEGER, PUBLIC            ::   nbug_in_agrif_conv_do_not_remove_or_modify = 1 - 1 
    49    INTEGER, PUBLIC, PARAMETER ::   nbghostcells = 3                             !: number of ghost cells 
    50    INTEGER, PUBLIC            ::   nbcellsx   ! = jpiglo - 2 - 2*nbghostcells   !: number of cells in i-direction 
    51    INTEGER, PUBLIC            ::   nbcellsy   ! = jpjglo - 2 - 2*nbghostcells   !: number of cells in j-direction 
     49   INTEGER, PUBLIC, PARAMETER ::   nbghostcells = 3                                          !: number of ghost cells 
     50   INTEGER, PUBLIC            ::   nbcellsx   ! = jpiglo - 2 * (nbghostcells + 1 + nn_hls)   !: number of cells in i-direction 
     51   INTEGER, PUBLIC            ::   nbcellsy   ! = jpjglo - 2 * (nbghostcells + 1 + nn_hls)   !: number of cells in j-direction 
    5252 
    5353   ! local domain size                !!! * local computational domain * 
     
    5959   INTEGER, PUBLIC ::   jpkm1 ! = jpk-1                                            !:   -     -      - 
    6060   INTEGER, PUBLIC ::   jpij  ! = jpi*jpj                                          !:  jpi x jpj 
    61    INTEGER, PUBLIC ::   jpimax! = ( jpiglo-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls !: maximum jpi 
    62    INTEGER, PUBLIC ::   jpjmax! = ( jpjglo-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls !: maximum jpj 
     61   INTEGER, PUBLIC ::   jpimax! = ( Ni0glo + jpni-1 ) / jpni + 2*nn_hls            !: maximum jpi 
     62   INTEGER, PUBLIC ::   jpjmax! = ( Nj0glo + jpnj-1 ) / jpnj + 2*nn_hls            !: maximum jpj 
    6363 
    6464   !!--------------------------------------------------------------------- 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/BENCH/MY_SRC/usrdef_nam.F90

    r12989 r13065  
    2929CONTAINS 
    3030 
    31    SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio, khls ) 
     31   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    3232      !!---------------------------------------------------------------------- 
    3333      !!                     ***  ROUTINE dom_nam  *** 
     
    4545      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
    4646      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    47       INTEGER                       , INTENT(out) ::   khls            ! halo dimension  
    4847      ! 
    4948      ! 
     
    5857      LOGICAL          ::   ln_nnogather, ln_listonly 
    5958      !! 
    60       NAMELIST/namusr_def/ nn_isize, nn_jsize, nn_ksize, nn_perio, nn_hls 
    61       NAMELIST/nammpp/ jpni, jpnj, ln_nnogather, ln_listonly 
     59      NAMELIST/namusr_def/ nn_isize, nn_jsize, nn_ksize, nn_perio 
     60      NAMELIST/nammpp/ jpni, jpnj, nn_hls, ln_nnogather, ln_listonly 
    6261      !!----------------------------------------------------------------------      
    6362      ! 
     
    8786      kpk = nn_ksize 
    8887      kperio = nn_perio 
    89       khls = nn_hls  
    9088      !                             ! control print 
    9189      IF(lwp) THEN 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV1D/MY_SRC/usrdef_hgr.F90

    r12960 r13065  
    7575 
    7676      !                          ========== 
    77       zlam0 = -REAL(Ni0glo-1)/2, wp) * 1.e-3 * rn_dx 
    78       zphi0 = -REAL(Nj0glo-1)/2, wp) * 1.e-3 * rn_dy 
     77      zlam0 = -REAL( (Ni0glo-2)/2, wp) * 1.e-3 * rn_dx 
     78      zphi0 = -REAL( (Nj0glo-2)/2, wp) * 1.e-3 * rn_dy 
    7979 
    8080      DO_2D_11_11 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV1D/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    9090         WRITE(numout,*) '         LX [km]: ', zlx 
    9191         WRITE(numout,*) '         LY [km]: ', zly 
    92          WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
    93          WRITE(numout,*) '                                               jpjglo = ', kpj 
     92         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     93         WRITE(numout,*) '                                               Nj0glo = ', kpj 
    9494         WRITE(numout,*) '                                               jpkglo = ', kpk 
    9595         WRITE(numout,*) '         Coriolis:', ln_corio 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_hgr.F90

    r12960 r13065  
    7676 
    7777      !                          ========== 
    78       zlam0 = -REAL(Ni0glo-1)/2, wp) * 1.e-3 * rn_dx 
    79       zphi0 = -REAL(Nj0glo-1)/2, wp) * 1.e-3 * rn_dy  
     78      zlam0 = -REAL( (Ni0glo-2)/2, wp) * 1.e-3 * rn_dx 
     79      zphi0 = -REAL( (Nj0glo-2)/2, wp) * 1.e-3 * rn_dy  
    8080 
    8181#if defined key_agrif  
     
    8383!clem         zlam0  = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5 
    8484!clem         zphi0  = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5 
    85          zlam0 = ( 0.5_wp - ( Agrif_parent(jpiglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
     85         zlam0 = ( 0.5_wp - REAL( (Agrif_parent(Ni0glo) - 2 ) / 2, wp ) ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
    8686            &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
    87          zphi0 = ( 0.5_wp - ( Agrif_parent(jpjglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
     87         zphi0 = ( 0.5_wp - REAL( (Agrif_parent(Nj0glo) - 2 ) / 2, wp ) ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
    8888            &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    8989      ENDIF 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    8686         kpj = NINT( 300.e3 / rn_dy ) - 1 
    8787      ELSE 
    88          kpi = nbcellsx + 2 + 2*nbghostcells 
    89          kpj = nbcellsy + 2 + 2*nbghostcells 
     88         kpi = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     89         kpj = nbcellsy + 2 * ( nbghostcells + 1 ) 
    9090      ENDIF 
    9191      kpk = 1 
     
    110110         WRITE(numout,*) '         LX [km]: ', zlx 
    111111         WRITE(numout,*) '         LY [km]: ', zly 
    112          WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
    113          WRITE(numout,*) '                                               jpjglo = ', kpj 
     112         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     113         WRITE(numout,*) '                                               Nj0glo = ', kpj 
    114114         WRITE(numout,*) '                                               jpkglo = ', kpk 
    115115         WRITE(numout,*) '         Coriolis:', ln_corio 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/EXPREF/AGRIF_FixedGrids.in

    r9159 r13065  
    111 
    2 34 63 34 63 3 3 3 
     233 62 33 62 3 3 3 
    330 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90

    r12960 r13065  
    7676 
    7777      !                          ========== 
    78       zlam0 = -REAL(Ni0glo-1)/2, wp) * 1.e-3 * rn_dx 
    79       zphi0 = -REAL(Nj0glo-1)/2, wp) * 1.e-3 * rn_dy  
    80  
    8178#if defined key_agrif  
    82       IF( .NOT. Agrif_Root() ) THEN 
     79      IF( Agrif_Root() ) THEN 
     80#endif 
     81         ! Compatibility WITH old version:  
     82         ! jperio = 7 =>  Ni0glo = jpigo_old_version - 2 
     83         !            =>  jpiglo-1 replaced by Ni0glo+1 
     84         zlam0 = -REAL( (Ni0glo+1)/2, wp) * 1.e-3 * rn_dx 
     85         zphi0 = -REAL( (Nj0glo+1)/2, wp) * 1.e-3 * rn_dy   ! +1 for compatibility with old version --> to be replaced by -1 as before 
     86#if defined key_agrif  
     87      ELSE 
     88         ! ! let lower left longitude and latitude from parent 
    8389!clem         zlam0  = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5 
    8490!clem         zphi0  = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5 
    85          zlam0 = ( 0.5_wp - ( Agrif_parent(jpiglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
     91         ! Compatibility WITH old version:  
     92         ! jperio = 0 =>  Ni0glo = jpigo_old_version 
     93         !            =>  Agrif_parent(jpiglo)-1 replaced by  Agrif_parent(Ni0glo)-1 
     94         zlam0 = ( 0.5_wp - REAL( ( Agrif_parent(Ni0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
    8695            &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
    87          zphi0 = ( 0.5_wp - ( Agrif_parent(jpjglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
     96         zphi0 = ( 0.5_wp - REAL( ( Agrif_parent(Nj0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
    8897            &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    8998      ENDIF 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    8585         kpi = NINT( 300.e3 / rn_dx ) - 1 
    8686         kpj = NINT( 300.e3 / rn_dy ) - 1 
     87         kpi = kpi - 2   ! for compatibility with old version (because kerio=7) --> to be removed 
     88         kpj = kpj - 2   ! for compatibility with old version (because kerio=7) --> to be removed 
    8789      ELSE 
    88          kpi = nbcellsx + 2 + 2*nbghostcells 
    89          kpj = nbcellsy + 2 + 2*nbghostcells 
     90         kpi  = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     91         kpj  = nbcellsy + 2 * ( nbghostcells + 1 ) 
    9092      ENDIF 
    9193      kpk = 2 
     
    110112         WRITE(numout,*) '         LX [km]: ', zlx 
    111113         WRITE(numout,*) '         LY [km]: ', zly 
    112          WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
    113          WRITE(numout,*) '                                               jpjglo = ', kpj 
     114         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     115         WRITE(numout,*) '                                               Nj0glo = ', kpj 
    114116         WRITE(numout,*) '                                               jpkglo = ', kpk 
    115117         WRITE(numout,*) '         Coriolis:', ln_corio 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ISOMIP/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    9494         WRITE(numout,*) '         vertical   resolution                 rn_e3    = ', rn_e3   , ' meters' 
    9595         WRITE(numout,*) '      ISOMIP domain = 15° x 10° x 900 m' 
    96          WRITE(numout,*) '         resulting global domain size :        jpiglo   = ', kpi 
    97          WRITE(numout,*) '                                               jpjglo   = ', kpj 
     96         WRITE(numout,*) '         resulting global domain size :        Ni0glo   = ', kpi 
     97         WRITE(numout,*) '                                               Nj0glo   = ', kpj 
    9898         WRITE(numout,*) '                                               jpkglo   = ', kpk 
    9999         WRITE(numout,*) '   ' 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ISOMIP/MY_SRC/usrdef_zgr.F90

    r12939 r13065  
    6767      REAL(wp), DIMENSION(jpi,jpj) ::   zht  , zhu         ! bottom depth 
    6868      REAL(wp), DIMENSION(jpi,jpj) ::   zhisf, zhisfu      ! top depth 
    69       REAL(wp), DIMENSION(jpi,jpj) ::   zmsk  
    70       REAL(wp), DIMENSION(jpi,jpj) ::   z2d                ! 2d workspace 
    7169      !!---------------------------------------------------------------------- 
    7270      ! 
     
    8785      !                       !==  isfdraft  ==! 
    8886      ! 
    89       ! the ocean basin surrounded by land (1 grid-point) set through lbc_lnk call as jperio=0  
    90       z2d(:,:) = 1._wp                    ! surface ocean is the 1st level 
    91       CALL lbc_lnk( 'usrdef_zgr', z2d, 'T', 1. )        ! closed basin since jperio = 0 (see userdef_nam.F90) 
    92       zmsk(:,:) = NINT( z2d(:,:) ) 
    93       ! 
    94       ! 
    9587      zht  (:,:) = rbathy  
    9688      zhisf(:,:) = 200._wp 
    97       ij0 = 1 ; ij1 = 40 
     89      ij0 = 1+1 ; ij1 = 40+1    ! + 1 for compatibility with old version. ==> to be removed 
    9890      DO jj = mj0(ij0), mj1(ij1) 
    9991         zhisf(:,jj)=700.0_wp-(gphit(:,jj)+80.0_wp)*125.0_wp 
    10092      END DO 
    101       zhisf(:,:) = zhisf(:,:) * zmsk(:,:) 
    10293      ! 
    10394      CALL zgr_z1d( pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d )   ! Reference z-coordinate system 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    8484         WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters' 
    8585         WRITE(numout,*) '      LOCK_EXCHANGE domain = 64 km  x  3 grid-points  x  20 m' 
    86          WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
    87          WRITE(numout,*) '                                               jpjglo = ', kpj 
     86         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     87         WRITE(numout,*) '                                               Nj0glo = ', kpj 
    8888         WRITE(numout,*) '                                               jpkglo = ', kpk 
    8989         WRITE(numout,*) '   ' 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/OVERFLOW/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    8585      WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters' 
    8686      WRITE(numout,*) '      OVERFLOW domain = 200 km x 3 grid-points x 2000 m' 
    87       WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
    88       WRITE(numout,*) '                                               jpjglo = ', kpj 
     87      WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     88      WRITE(numout,*) '                                               Nj0glo = ', kpj 
    8989      WRITE(numout,*) '                                               jpkglo = ', kpk 
    9090      ! 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_hgr.F90

    r12960 r13065  
    7777      ! Position coordinates (in kilometers) 
    7878      !                          ========== 
    79       zlam0 = -REAL(Ni0glo-1)/2, wp) * 1.e-3 * rn_dx 
    80       zphi0 = -REAL(Nj0glo-1)/2, wp) * 1.e-3 * rn_dy  
    81  
     79#if defined key_agrif  
     80      IF( Agrif_Root() ) THEN 
     81#endif 
     82         ! Compatibility WITH old version:  
     83         ! jperio = 0 =>  Ni0glo = jpigo_old_version 
     84         !            =>  jpiglo-1 replaced by Ni0glo-1 
     85         zlam0 = -REAL( (Ni0glo-1)/2, wp) * 1.e-3 * rn_dx 
     86         zphi0 = -REAL( (Nj0glo-1)/2, wp) * 1.e-3 * rn_dy  
    8287#if defined key_agrif 
    83       ! ! let lower left longitude and latitude from parent 
    84       IF (.NOT.Agrif_root()) THEN 
    85           zlam0 = (0.5_wp-(Agrif_parent(jpiglo)-1)/2)*1.e-3*Agrif_irhox()*rn_dx & 
    86              &+(Agrif_Ix()+nbghostcells-1)*Agrif_irhox()*rn_dx*1.e-3-(0.5_wp+nbghostcells)*rn_dx*1.e-3 
    87           zphi0 = (0.5_wp-(Agrif_parent(jpjglo)-1)/2)*1.e-3*Agrif_irhoy()*rn_dy & 
    88              &+(Agrif_Iy()+nbghostcells-1)*Agrif_irhoy()*rn_dy*1.e-3-(0.5_wp+nbghostcells)*rn_dy*1.e-3 
     88      ELSE 
     89         ! ! let lower left longitude and latitude from parent 
     90         ! Compatibility WITH old version:  
     91         ! jperio = 0 =>  Ni0glo = jpigo_old_version 
     92         !            =>  Agrif_parent(jpiglo)-1 replaced by  Agrif_parent(Ni0glo)-1 
     93         zlam0 = ( 0.5_wp - REAL( ( Agrif_parent(Ni0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
     94            &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
     95         zphi0 = ( 0.5_wp - REAL( ( Agrif_parent(Nj0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
     96            &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    8997      ENDIF  
    9098#endif 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    8585         kpj = NINT( 1800.e3  / rn_dy ) + 3  
    8686      ELSE 
    87          kpi  = nbcellsx + 2 + 2*nbghostcells 
    88          kpj  = nbcellsy + 2 + 2*nbghostcells 
     87         kpi  = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     88         kpj  = nbcellsy + 2 * ( nbghostcells + 1 ) 
    8989      ENDIF 
    9090      kpk = NINT( 5000._wp / rn_dz ) + 1 
     
    104104         WRITE(numout,*) '      horizontal resolution             rn_dy  = ', rn_dy, ' m' 
    105105         WRITE(numout,*) '      vertical resolution               rn_dz  = ', rn_dz, ' m' 
     106         WRITE(numout,*) '      resulting global domain size :    Ni0glo = ', kpi 
     107         WRITE(numout,*) '                                        Nj0glo = ', kpj 
     108         WRITE(numout,*) '                                        jpkglo = ', kpk 
    106109         WRITE(numout,*) '      VORTEX domain: ' 
    107110         WRITE(numout,*) '         LX [km]: ', zlx 
  • NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/WAD/MY_SRC/usrdef_nam.F90

    r12939 r13065  
    7676      !                             ! Set the lateral boundary condition of the global domain 
    7777      kperio = 0                    ! WAD_TEST_CASES configuration : closed domain 
    78       IF( nn_wad_test == 8 ) kperio = 7 ! North-South cyclic test 
     78      IF( nn_wad_test == 8 ) THEN 
     79         kperio = 7         ! North-South cyclic test 
     80         kpi = kpi - 2      ! no closed boundary 
     81         kpj = kpj - 2      ! no closed boundary 
     82      ENDIF 
    7983      ! 
    8084      !                             ! control print 
Note: See TracChangeset for help on using the changeset viewer.