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

Changeset 14655


Ignore:
Timestamp:
2021-03-30T16:41:30+02:00 (3 years ago)
Author:
jchanut
Message:

AGRIF: Set ghost cell number to 0 over root grid to properly define analytical grids in zooms, #2638

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14608_AGRIF_domcfg/src/NST/agrif_user.F90

    r14641 r14655  
    850850      ENDIF 
    851851 
    852       ! Set the number of ghost cells according to periodicity 
    853       nbghostcells_x   = nbghostcells 
    854       nbghostcells_y_s = nbghostcells 
    855       nbghostcells_y_n = nbghostcells 
    856  
    857       !IF ((jperio == 1).OR.(jperio == 4) ) THEN    
    858       IF ( l_Iperio ) nbghostcells_x = 0 
    859       lk_south = .NOT. ( Agrif_Iy() == 1 ) 
    860       IF( .NOT. lk_south )   nbghostcells_y_s = 0 
    861  
    862852! JC => side effects of lines below to be checked: 
    863853      IF (.not.agrif_root()) THEN 
    864         lk_west  = .NOT. ( Agrif_Ix() == 1 ) 
    865         lk_east  = .NOT. ( Agrif_Ix() + nbcellsx/AGRIF_Irhox() == Agrif_Parent(Ni0glo) -1 ) 
    866         lk_south = .NOT. ( Agrif_Iy() == 1 ) 
    867         lk_north = .NOT. ( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() == Agrif_Parent(Nj0glo) -1 ) 
    868       ! 
    869  
    870       ! 
    871         IF(    l_Iperio    )   nbghostcells_x   = 0 
    872         IF( .NOT. lk_south )   nbghostcells_y_s = 0 
    873         IF( .NOT. lk_north )   nbghostcells_y_n = 0 
    874       ! 
    875       ! Some checks 
    876         IF( (.NOT.ln_vert_remap).AND.(jpkglo>Agrif_Parent(jpkglo)) )                    CALL ctl_stop( 'STOP',    & 
     854         nbghostcells_x   = nbghostcells 
     855         nbghostcells_y_s = nbghostcells 
     856         nbghostcells_y_n = nbghostcells 
     857 
     858         lk_west  = .NOT. ( Agrif_Ix() == 1 ) 
     859         lk_east  = .NOT. ( Agrif_Ix() + nbcellsx/AGRIF_Irhox() == Agrif_Parent(Ni0glo) -1 ) 
     860         lk_south = .NOT. ( Agrif_Iy() == 1 ) 
     861         lk_north = .NOT. ( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() == Agrif_Parent(Nj0glo) -1 ) 
     862         ! 
     863         ! Correct number of ghost cells according to periodicity 
     864         ! 
     865         IF(    l_Iperio    )   nbghostcells_x   = 0 
     866         IF( .NOT. lk_south )   nbghostcells_y_s = 0 
     867         IF( .NOT. lk_north )   nbghostcells_y_n = 0 
     868         ! 
     869         ! Some checks 
     870         IF( (.NOT.ln_vert_remap).AND.(jpkglo>Agrif_Parent(jpkglo)) )                    CALL ctl_stop( 'STOP',    & 
    877871           &   'agrif_nemo_init: Agrif children must have less or equal number of vertical levels without ln_vert_remap defined' )  
    878         IF( jpiglo /= nbcellsx + 2 + 2*nn_hls + nbghostcells_x   + nbghostcells_x   )   CALL ctl_stop( 'STOP',    & 
     872         IF( jpiglo /= nbcellsx + 2 + 2*nn_hls + nbghostcells_x   + nbghostcells_x   )   CALL ctl_stop( 'STOP',    & 
    879873           &   'agrif_nemo_init: Agrif children requires jpiglo == nbcellsx + 2 + 2*nn_hls + 2*nbghostcells_x' ) 
    880         IF( jpjglo /= nbcellsy + 2 + 2*nn_hls + nbghostcells_y_s + nbghostcells_y_n )   CALL ctl_stop( 'STOP',    & 
     874         IF( jpjglo /= nbcellsy + 2 + 2*nn_hls + nbghostcells_y_s + nbghostcells_y_n )   CALL ctl_stop( 'STOP',    & 
    881875           &   'agrif_nemo_init: Agrif children requires jpjglo == nbcellsy + 2 + 2*nn_hls + nbghostcells_y_s + nbghostcells_y_n' ) 
    882         IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'agrif_nemo_init:Agrif children requires ln_use_jattr = .false. ' ) 
    883       ENDIF 
    884  
     876         IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'agrif_nemo_init:Agrif children requires ln_use_jattr = .false. ' ) 
     877      ELSE 
     878         ! Root grid 
     879         nbghostcells_x   = 0 
     880         nbghostcells_y_s = 0 
     881         nbghostcells_y_n = 0 
     882      ENDIF 
    885883      ! 
    886884      ! 
Note: See TracChangeset for help on using the changeset viewer.