Agrif setup with eOrca 1 configuration

Good afternoon everyone,
I am trying to set up an AGRIF zoom in the eORCA1 configuration that I usually run, but I am facing several problems. I am following the Nemo AGRIF User-guide. In case you want to try to reproduce my steps with the input files that I am using, here is the archive: Filesender link (expiration date 1 April 2026). Full configuration description here.
I am running NEMO 5.0.1 and assuming this structure

.
└── $root_dir/
    ├── $nemo_dir
    └── input-eOrca1 (from extraction of 'input-eOrca1.tar.gz')

The way I setup the configuration is the following:

export Cfg_name=eOrca1_AGRIF;
cd $nemo_dir;
./makenemo -m $arch_file -r ORCA2_ICE_PISCES -n $Cfg_name --del_key "key_top" --add_key "key_isf key_agrif" -j 0;
./makenemo -m $arch_file -r ORCA2_ICE_PISCES -n $Cfg_name -j 8;
cd $nemo_dir/cfgs/$Cfg_name/EXP00;
cp $root_dir/input-eOrca1/make_links.sh .

where make_links.sh links all the input files in the EXP00 directory (a test without key_agrif should run out of the box from the dataset).

DOMAINcfg

I compile DOMAINcfg with the key_agrif key added in /tools/DOMAINcfg/cpp_DOMAINcfg.fcm

cd $nemo_dir/tools;
./maketools  -m $arch_file -n DOMAINcfg;
cd $nemo_dir/tools/DOMAINcfg/cfgs/AGRIF_DEMO;
ln -sf $root_dir/input-eOrca1/input_fields/domain_cfg.nc .

I have removed all *_namelist_ref and *_namelist_cfg superior to 1 (as I am working with only one zoom for now), then modified the AGRIF_FixedGrids.in file to read

1
108 208  65 165 1 1 1
0

and then I have modified the namelist_cfg file as follows

!-----------------------------------------------------------------------
&namdom        !   space and time domain (bathymetry, mesh, timestep)
!-----------------------------------------------------------------------
   ln_read_cfg = .true.
   nn_bathy    =    3      ! = 0 compute analyticaly
                           ! = 1 read the bathymetry file
                           ! = 2 compute from external bathymetry
                           ! = 3 compute from parent (if "key_agrif")
   nn_interp   =    1                          ! type of interpolation (nn_bathy =2)
   cn_domcfg   =  'domain_cfg.nc'                
   cn_topo     =  'GEBCO_2020.nc'   ! external topo file (nn_bathy =2)
   cn_bath     =  'elevation'       ! topo name in file  (nn_bathy =2)
   cn_lon      =  'lon'             ! lon  name in file  (nn_bathy =2)
   cn_lat      =  'lat'             ! lat  name in file  (nn_bathy =2)
   rn_scale    = 1
   rn_bathy    =    0.     !  value of the bathymetry. if (=0) bottom flat at jpkm1
   jphgr_msh   =       0               !  type of horizontal mesh
   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
   ppgphi0     =  999999.0             ! latitude  of first raw and column T-point (jphgr_msh = 1)
   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
   ppsur       =   -4762.96143546300   !  ORCA r4, r2 and r05 coefficients
   ppa0        =     255.58049070440   ! (default coefficients)
   ppa1        =     245.58132232490   !
   ppkth       =      21.43336197938   !
   ppacr       =       3.0             !
   ppdzmin     =  999999.              !  Minimum vertical spacing
   pphmax      =  999999.              !  Maximum depth
   ldbletanh   =  .FALSE.              !  Use/do not use double tanf function for vertical coordinates
   ppa2        =  999999.              !  Double tanh function parameters
   ppkth2      =  999999.              !
   ppacr2      =  999999.              !
/
!-----------------------------------------------------------------------
&namcfg        !   parameters of the configuration
!-----------------------------------------------------------------------
   !
   ln_e3_dep   = .true.    ! =T : e3=dk[depth] in discret sens.
   !                       !      ===>>> will become the only possibility in v4.0
   !                       ! =F : e3 analytical derivative of depth function
   !                       !      only there for backward compatibility test with v3.6
      !                      ! if ln_e3_dep = T
      ln_dept_mid = .true.   ! =T : set T points in the middle of cells
   !                       !
   cp_cfg      = "eORCA1"   !  name of the configuration
   jp_cfg      =       1   !  resolution of the configuration
   jpidta      =     360   !  1st lateral dimension ( >= jpi )
   jpjdta      =     331   !  2nd    "         "    ( >= jpj )
   jpkdta      =      75   !  number of levels      ( >= jpk )
   Ni0glo      =     360   !  1st dimension of global domain --> i =jpidta
   Nj0glo      =     331   !  2nd    -                  -    --> j  =jpjdta
   jpkglo      =      75
   jperio      =       6   !  lateral cond. type (between 0 and 6)
   ln_domclo = .false.     ! computation of closed sea masks (see namclo)
/                      !      only there for backward compatibility test with v3.6

where the namcfg namelist has been adapted following the characteristics of domain_cfg.nc. Running ./make_namelist.py produces

Found 1 grids :
360 331
108 208 65 165
4 4 4 4
Grid 1 : Ni0glo = 108 , Nj0glo = 108

and the file 1_namelist_cfg should be coherent. For now I am trying to work out the workflow, so a 1:1 zoom is the easiest scenario. Running make_domain_cfg.exe runs with no problems.

WEIGHTS

I compile the tool WEIGHTS as follows

cd $nemo_dir/tools;
./maketools  -m $arch_file -n WEIGHTS;
cd $nemo_dir/tools/WEIGHTS/cfgs/AGRIF_DEMO;
ln -sf $root_dir/input-eOrca1/input_fields/domain_cfg.nc .

and then I modify the python script create_weights.py such that it reads

# Directory with domccfg target file
DOMCFG_DIR=os.environ["nemo_dir"]+"/tools/DOMAINcfg/cfgs/AGRIF_DEMO/"
# Suffix of domcfg files
RAD='domain_cfg.nc'
# Directory with original forcing on native grid
FORCING_DIR=os.environ["root_dir"]+'/input-eOrca1/'
# Forcing file names, interpolation method (default bilin), and weigth file name (optional), lon(optional), lat(optional)
FILES=[
['forcing_ORCA1/u_10.15JUNE2009_fill.nc'              , 'bicub', 'weights_coreII_2_eORCA1.4.2_bicubic.nc'  , '', ''],
['forcing_ORCA1/ncar_rad.15JUNE2009_fill.nc'          , 'bilin', 'weights_coreII_2_eORCA1.4.2_bilinear.nc' , '', ''],
['input_fields/eddy_viscosity_3D.nc'                  , 'bilin', 'weights_eddy_visc_bilinear.nc' ,'',''],
['input_fields/geothermal_heat_flux.nc'               , 'bilin', 'weights_ghflux_bilinear.nc'    ,'',''],
['input_fields/merged_ESACCI_BIOMER4V1R1_CHL_REG05.nc', 'bilin', 'weights_reg05_bilinear.nc'     ,'',''],
['input_fields/runoff-icb_DaiTrenberth_Depoorter.nc'  , 'bilin', 'weights_runoff-icb_bilinear.nc' ,'',''],
['input_fields/sss_climatology_for_restoring.nc'      , 'bilin', 'weights_sss_clima_bilinear.nc' ,'',''],
['input_fields/zdfiwm_forcing_TRA.nc'                 , 'bilin', 'weights_zdfiwm_bilinear.nc' ,'',''],
['initial_conditions/woce_salt_monthly_init_4p2.nc'   , 'bilin', 'weights_woce_salt_bilinear.nc' ,'',''],
['initial_conditions/woce_temp_monthly_init_4p2.nc'   , 'bilin', 'weights_woce_temp_bilinear.nc' ,'','']
]

this produces all the necessary weights that I need in the namelists.

Restart files

At the end of this procedure, The model only complains about the missing restart files. As the AGRIF zoom is actually a 1:1 zoom, I guess I can just do something like an ncks to crop the restart to the size of the zoom. However, in view of switching to an actual refinement, I tried to create this restart files with NESTING, but I cannot make it work.

  • Should I use NESTING or NESTING_AGRIF?
  • How can I set the parameters for the namelist of NESTING?
  • Apparently there’s a hot start option to let NEMO read parent grid restart files and interpolate them onto the child grids. I do not find any explaination on hot to use this option though. Any hint please?
  • If everything goes south, would a simple interpolation of the fields onto the new grid work or should I put some extra care somewhere to make it work?

Questions

  • Are the values from rn_bathy to ppacr2 coherent? The file README_configs_namcfg_namdom gives me different values for the ORCA_R1 75 vertical levels configuration and I don’t know exactly how to choose them. More in detail, I did not create the parent configuration myself so I don’t know exactly how the vertical coordinates were built, and I don’t know how to make the child grid vertical coordinate coherent ith the parent, starting from those values. For now, I don’t need to refine the vertical resolution for now, but guidelines on how to do this would be appreciated.
  • I am plannig to increase the resolution to 1/12 degree (so do two nested zooms, 1/4 and successive 1/3), so I guess a bunch of namelist parameters should be changed, starting with eddy_viscosity. Could you perhaps provide me with some guidelines to choose the values in the refined grids?

Thank you all for your help (this conversation will also be used to improve the AGRIF DEMO)