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 15279 for utils/tools/DOMAINcfg/make_namelist.py – NEMO

Ignore:
Timestamp:
2021-09-23T12:00:23+02:00 (3 years ago)
Author:
jchanut
Message:

#2222 and #2638: Enable creating agrif meshes with different vertical grids (geopotential only as a start)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/DOMAINcfg/make_namelist.py

    r14962 r15279  
    6262    print(int(Ni0glo_parent), int(Nj0glo_parent)) 
    6363 
    64     nbghostcells_x = nbghostcells 
    65     nbghostcells_y = nbghostcells 
    66     nbghostcells_y_n = nbghostcells_y 
    67     nbghostcells_y_s = nbghostcells_y 
     64    nbghostcells_x_e = nbghostcells 
     65    nbghostcells_x_w = nbghostcells 
     66    nbghostcells_y_n = nbghostcells 
     67    nbghostcells_y_s = nbghostcells 
    6868    if (int(grid[cnt-1][2]) == 1 ): 
    6969        nbghostcells_y_s = 1  
    7070    if int(grid[cnt-1][3]) == int(Nj0glo_parent)-1 : 
    7171        nbghostcells_y_n = 1  
     72    if (int(grid[cnt-1][0]) == 1 ): 
     73        nbghostcells_x_w = 1  
     74    if int(grid[cnt-1][1]) == int(Ni0glo_parent)-1 : 
     75        nbghostcells_x_e = 1  
     76    if int(grid[cnt-1][3]) == int(Nj0glo_parent) : 
     77        nbghostcells_y_n = 0  
    7278    if int(grid[cnt-1][1]) - int(grid[cnt-1][0]) == int(Ni0glo_parent) : 
    73         nbghostcells_x = 0 
     79        nbghostcells_x_w = 0 
     80        nbghostcells_x_e = 0 
    7481 
    75     Ni0glo = (int(grid[cnt-1][1])-int(grid[cnt-1][0]))*int(grid[cnt-1][4]) + 2*nbghostcells_x 
     82    Ni0glo = (int(grid[cnt-1][1])-int(grid[cnt-1][0]))*int(grid[cnt-1][4]) + nbghostcells_x_w  + nbghostcells_x_e 
    7683    Nj0glo = (int(grid[cnt-1][3])-int(grid[cnt-1][2]))*int(grid[cnt-1][5]) + nbghostcells_y_n  + nbghostcells_y_s 
    7784    #print( "Grid "+str(cnt)+" : jpiglo = "+cnt(jpiglo)+ "  jpjglo = "+str(jpjglo) )  
    7885    print(int(grid[cnt-1][0]), int(grid[cnt-1][1]), int(grid[cnt-1][2]),int(grid[cnt-1][3])) 
    79     print(nbghostcells_x, nbghostcells_y_s, nbghostcells_y_n) 
     86    print(nbghostcells_x_w, nbghostcells_x_e, nbghostcells_y_s, nbghostcells_y_n) 
    8087    print('Grid {:1d} : Ni0glo = {:3d} , Nj0glo = {:3d}'.format(cnt, Ni0glo, Nj0glo)) 
    8188 
     
    9198               else: 
    9299                   line = "   jperio = 0\n" 
     100               if nbghostcells_y_n == 0: 
     101                   line = "   jperio = 4\n" 
    93102           if line.strip().startswith('nn_bathy'): 
    94103                  line = "   nn_bathy = 2\n" 
Note: See TracChangeset for help on using the changeset viewer.