I use DOMAINcfg to create initial conditions for nested domains, e.g. domain_cfg.nc and 1_domain_cfg.nc files.
I found that 1_domain_cfg.nc is bigger than 1_coordinates.nc and 1_bathy_meter.nc by 4 points.
For example, 1_bathy_meter.nc and 1_coordinates.nc are 631 x 313 points but 1_domain_cfg.nc is 635 x 317 points.
Also, it seems that area in 1_domain_cfg.nc is shifted to the south-west by 5 points so that
(6,6)-point in 1_domain_cfg.nc coincides with (1,1)-point in 1_coordinates.nc.
npt_copy and npt_connect are numbers of coarse grid points.
npt_copy refers to the width of a zone right inside the child grid where the child bathymetry is exactly set to the parent one (so basically it is constant by blocks of nrafx X nrafy child grid points).
npt_connect refers to the width of a “connecting zone” right after the “copy zone” where the child bathymetry is linearly blended with the parent bathymetry.
These do not change neither the child grid size nor the grid positioning. You should not change these (the npt_copy parameter in particular that matches the “sponge zone” used in NEMO.)
The 1_domain_cfg.nc has the required number of points following what you have defined in your AGRIF_FixedGrids.in file. You apparently provide 1_bathy_meter.nc and 1_coordinates.nc files that do not comply with the expected size. The code should not allow this, even if it does.
My questions:
How did you get your 1_bathy_meter.nc and 1_coordinates.nc files ? From the previous NESTING_TOOLS ? If so, grid positioning over the parent grid has changed: It would be normal to have a shift.
I use NEMO for coupled modelling with WRF.
I prepare 1_ bathy_meter.nc and 1_coordinates.nc myself so that the nested domain in NEMO matches the nested domain in WRF.
My refinement factor is 3. 1_bathy_meter.nc and 1_coordinates.nc are both 631 x 313
I use AGRIF_FixedGrids.in
1
157 366 123 226 3 3 3
0
The resulted 1_domain_cfg.nc is 635 x 317
When I try to use another values in AGRIF_FixedGrids.in (for example, 158 366 124 226), DOMAINcfg fails with a message
AGRIF boundaries and ghost cells:
lk_west T
lk_east T
lk_south T
lk_north T
nbghostcells_y_s 4
nbghostcells_y_n 4
nbghostcells_x_w 4
nbghostcells_x_e 4
nbcellsx = 624
nbcellsy = 306
Ni0glo = 631
Ni0glo should be: 632
===>>> : E R R O R
===========
STOP
mpp_init: Agrif children requires Ni0glo == nbcellsx + nbghostcells_x_w + nbghostcells_x_e
It seems to me that the size of a nested domain in NEMO must be 3 nx + 8, 3 ny + 8
So it is impossible to create a nested domain, which is 631 x 313.
Am I correct?
You’re right. BTW, if changing values in AGRIF_FixedGrids.in, be careful: you must provide compliant child grid sizes in your 1_namelist_cfg. You may use the make_namelist.py python script that’s does that for you.