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

Changeset 14674


Ignore:
Timestamp:
2021-04-06T14:36:08+02:00 (3 years ago)
Author:
ldebreu
Message:

AGFdomcfg: corrections for east-west cyclic grids, #2368

Location:
utils/tools/DOMAINcfg
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/DOMAINcfg/AGRIF_FixedGrids.in_cmems

    r14633 r14674  
    22-10 15 57 75 3 3 3 
    3330 70 126 170 3 3 3 
    4 1 179 1 35 3 3 3 
     41 181 1 35 3 3 3 
    550 
    660 
  • utils/tools/DOMAINcfg/make_namelist.py

    r14626 r14674  
    6464    if int(grid[cnt-1][2]) == 1: 
    6565        nbghostcells_y_s = 0 
    66     if int(grid[cnt-1][1]) + int(grid[cnt-1][0]) == int(Ni0glo_parent) : 
     66    if int(grid[cnt-1][1]) + int(grid[cnt-1][0]) == int(Ni0glo_parent) + 2 : 
    6767        nbghostcells_x = 0 
    68  
    69     Ni0glo = (int(grid[cnt-1][1])-int(grid[cnt-1][0]))*int(grid[cnt-1][4]) + 2 + 2*nbghostcells_x 
    70     Nj0glo = (int(grid[cnt-1][3])-int(grid[cnt-1][2]))*int(grid[cnt-1][5]) + 2 + nbghostcells_y_n  + nbghostcells_y_s 
     68    Ni0glo = (int(grid[cnt-1][1])-int(grid[cnt-1][0]))*int(grid[cnt-1][4]) + 2*nbghostcells_x 
     69    Nj0glo = (int(grid[cnt-1][3])-int(grid[cnt-1][2]))*int(grid[cnt-1][5]) + nbghostcells_y_n  + nbghostcells_y_s 
    7170    #print( "Grid "+str(cnt)+" : jpiglo = "+cnt(jpiglo)+ "  jpjglo = "+str(jpjglo) )  
    7271    print('Grid {:1d} : Ni0glo = {:3d} , Nj0glo = {:3d}'.format(cnt, Ni0glo, Nj0glo)) 
     
    7978           line = fp.readline() 
    8079           if line.strip().startswith('jperio'): 
    81                if int(grid[cnt-1][1]) + int(grid[cnt-1][0]) == int(Ni0glo_parent) : 
     80               if int(grid[cnt-1][1]) + int(grid[cnt-1][0]) == int(Ni0glo_parent) + 2: 
    8281                   line = "   jperio = 1\n" 
    8382               else: 
  • utils/tools/DOMAINcfg/src/agrif_user.F90

    r14640 r14674  
    215215      !--------------------------------------------------------------------- 
    216216 
    217       ind2 = nn_hls + 2 + nbghostcells_x 
    218       ind3 = nn_hls + 2 + nbghostcells_y_s 
     217      ind2 = nn_hls + 1 + nbghostcells_x 
     218      ind3 = nn_hls + 1 + nbghostcells_y_s 
    219219 
    220220      nbghostcellsfine_tot_x=nbghostcells_x+1 
     
    11151115      IF (.not.agrif_root()) THEN 
    11161116      lk_west  = .NOT. ( Agrif_Ix() == 1 ) 
    1117       lk_east  = .NOT. ( Agrif_Ix() + nbcellsx/AGRIF_Irhox() == Agrif_Parent(Ni0glo) -1 ) 
     1117      lk_east  = .NOT. ( Agrif_Ix() + nbcellsx/AGRIF_Irhox() == Agrif_Parent(Ni0glo) + 1 ) 
    11181118      lk_south = .NOT. ( Agrif_Iy() == 1 ) 
    1119       lk_north = .NOT. ( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() == Agrif_Parent(Nj0glo) -1 ) 
     1119      lk_north = .NOT. ( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() == Agrif_Parent(Nj0glo) + 1) 
    11201120         IF (.NOT.lk_south) THEN 
    11211121            nbghostcells_y_s = 0 
  • utils/tools/DOMAINcfg/src/mppini.F90

    r14623 r14674  
    109109         print *,'nbcellsx = ',nbcellsx,nbghostcells_x 
    110110         print *,'nbcellsy = ',nbcellsy,nbghostcells_y_s,nbghostcells_y_n 
    111          IF( Ni0glo /= nbcellsx + 2 + 2*nbghostcells_x ) THEN 
     111         IF( Ni0glo /= nbcellsx + 2*nbghostcells_x ) THEN 
    112112            IF(lwp) THEN 
    113113               WRITE(numout,*) 
    114                WRITE(numout,*) 'Ni0glo should be: ', nbcellsx + 2 + 2*nbghostcells_x 
     114               WRITE(numout,*) 'Ni0glo should be: ', nbcellsx + 2*nbghostcells_x 
    115115            ENDIF         
    116             CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires Ni0glo == nbcellsx + 2 + 2*nbghostcells_x' ) 
     116            CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires Ni0glo == nbcellsx + 2*nbghostcells_x' ) 
    117117         ENDIF    
    118          IF( Nj0glo /= nbcellsy + 2 + nbghostcells_y_s + nbghostcells_y_n ) THEN 
     118         IF( Nj0glo /= nbcellsy + nbghostcells_y_s + nbghostcells_y_n ) THEN 
    119119            IF(lwp) THEN 
    120120               WRITE(numout,*) 
    121                WRITE(numout,*) 'Nj0glo shoud be: ', nbcellsy + 2 + nbghostcells_y_s + nbghostcells_y_n 
     121               WRITE(numout,*) 'Nj0glo shoud be: ', nbcellsy + nbghostcells_y_s + nbghostcells_y_n 
    122122            ENDIF         
    123123            CALL ctl_stop( 'STOP', & 
    124                 'mpp_init: Agrif children requires Nj0glo == nbcellsy + 2 + nbghostcells_y_s + nbghostcells_y_n' ) 
     124                'mpp_init: Agrif children requires Nj0glo == nbcellsy + nbghostcells_y_s + nbghostcells_y_n' ) 
    125125         ENDIF    
    126126         IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'mpp_init:Agrif children requires ln_use_jattr = .false. ' ) 
     
    361361      CALL agrif_nemo_init() 
    362362      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
    363          IF( Ni0glo /= nbcellsx + 2 + 2*nbghostcells_x ) THEN 
     363         IF( Ni0glo /= nbcellsx + 2*nbghostcells_x ) THEN 
    364364            IF(lwp) THEN 
    365365               WRITE(numout,*) 
    366                WRITE(numout,*) 'Ni0glo should be: ', nbcellsx + 2 + 2*nbghostcells_x 
     366               WRITE(numout,*) 'Ni0glo should be: ', nbcellsx + 2*nbghostcells_x 
    367367            ENDIF         
    368             CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires Ni0glo == nbcellsx + 2 + 2*nbghostcells_x' ) 
     368            CALL ctl_stop( 'STOP', 'mpp_init: Agrif children requires Ni0glo == nbcellsx + 2*nbghostcells_x' ) 
    369369         ENDIF    
    370          IF( Nj0glo /= nbcellsy + 2 + nbghostcells_y_s + nbghostcells_y_n ) THEN 
     370         IF( Nj0glo /= nbcellsy + nbghostcells_y_s + nbghostcells_y_n ) THEN 
    371371            IF(lwp) THEN 
    372372               WRITE(numout,*) 
    373                WRITE(numout,*) 'Nj0glo shoud be: ', nbcellsy + 2 + nbghostcells_y_s + nbghostcells_y_n 
     373               WRITE(numout,*) 'Nj0glo shoud be: ', nbcellsy + nbghostcells_y_s + nbghostcells_y_n 
    374374            ENDIF         
    375375            CALL ctl_stop( 'STOP', & 
    376                'mpp_init: Agrif children requires Nj0glo == nbcellsy + 2 + nbghostcells_y_s + nbghostcells_y_n' ) 
     376               'mpp_init: Agrif children requires Nj0glo == nbcellsy + nbghostcells_y_s + nbghostcells_y_n' ) 
    377377         ENDIF    
    378378         IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'mpp_init:Agrif children requires ln_use_jattr = .false. ' ) 
Note: See TracChangeset for help on using the changeset viewer.