DOMAINcfg: NetCDF: Index exceeds dimension bound

Hi All,

I am having a hard time with generating a domain file with the tool DOMAINcfg

This is my namelist_cgf

!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! NEMO/OCE  Configuration namelist : overwrite reference namelist
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!!                      GYRE PISCES configuration                     !!
!!======================================================================
!!              ***  Domain & Run management namelists  ***           !!
!!                                                                    !!
!!   namrun       parameters of the run
!!   namdom       space and time domain
!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
!!   namwad       Wetting and drying                                    (default: OFF)
!!   namtsd       data: temperature & salinity                          (default: OFF)
!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
!!   namc1d       1D configuration options                              (ln_c1d =T)
!!   namc1d_dyndmp 1D newtonian damping applied on currents             (ln_c1d =T)
!!   namc1d_uvd   1D data (currents)                                    (ln_c1d =T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namrun        !   parameters of the run
!-----------------------------------------------------------------------
   cn_exp      =  "PAGBILAO"   !  experience name
   nn_it000    =       1   !  first time step
   nn_itend    =    4320   !  last  time step
   nn_leapy    =      30   !  Leap year calendar (1) or not (0)
   nn_stock    =    4320   !  frequency of creation of a restart file (modulo referenced to 1)
   nn_write    =      60   !  frequency of write in the output file   (modulo referenced to nn_it000)
   nn_istate   =       0   !  output the initial state (1) or not (0)
/
!-----------------------------------------------------------------------
&namcfg        !   parameters of the configuration                      (default: user defined GYRE)
!-----------------------------------------------------------------------
   ln_read_cfg = .true.   !  (=T) user defined configuration           (F => create/check namusr_def)
      !
      cn_domcfg = 'input/mesh_mask'            ! domain configuration filename
      !
      ln_closea = .false.                 ! (=T => fill namclo)
      !                                   ! (=F) no control of net precip/evap over closed sea
      !
      ln_write_cfg = .false.              ! (=T) create the domain configuration file
         cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
         !
      ln_use_jattr = .false.              ! use (T) the file attribute: open_ocean_jstart, if present
      !                                   ! in netcdf input files, as the start j-row for reading
/
!-----------------------------------------------------------------------
&namtile        !   parameters of the tiling
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namusr_def    !   GYRE user defined namelist  
!-----------------------------------------------------------------------
   nn_GYRE     =   1     !  GYRE resolution [1/degrees]
   ln_bench    = .false.   !  ! =T benchmark with gyre: the gridsize is kept constant
   jpkglo      =   31     !  number of model levels
/
!-----------------------------------------------------------------------
&namdom        !   time and space domain
!-----------------------------------------------------------------------
   ln_linssh   = .false.    !  =T  linear free surface  ==>>  model level are fixed in time
   !
   rn_Dt      = 1200.     !  time step for the dynamics
/
!!======================================================================
!!            ***  Surface Boundary Condition namelists  ***          !!
!!                                                                    !!
!!   namsbc          surface boundary condition manager                 (default: NO selection)
!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
!!   namsbc_isf      ice shelf melting/freezing                         (ln_isfcav  =T : read (ln_read_cfg=T) or set or usr_def_zgr )
!!   namsbc_iscpl    coupling option between land ice model and ocean   (ln_isfcav  =T)
!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
!!   namberg         iceberg floats                                     (ln_icebergs=T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namsbc        !   Surface Boundary Condition (surface module)          (default: NO selection)
!-----------------------------------------------------------------------
   nn_fsbc     = 1         !  frequency of SBC module call
   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc)
   ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
/
!-----------------------------------------------------------------------
&namtra_qsr    !   penetrative solar radiation                          (ln_traqsr =T)
!-----------------------------------------------------------------------
   ln_qsr_2bd  = .true.    !  2 bands              light penetration
   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
/
!!======================================================================
!!               ***  Lateral boundary condition  ***                 !!
!!                                                                    !!
!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
!!   namagrif      agrif nested grid ( read by child model only )       ("key_agrif")
!!   nam_tide      Tidal forcing                                        (default: OFF)
!!   nambdy        Unstructured open boundaries                         (default: OFF)
!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
!-----------------------------------------------------------------------
   rn_shlat    =    0.     !  free slip
/
!!======================================================================
!!                ***  Top/Bottom boundary condition  ***             !!
!!                                                                    !!
!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T)
!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F)
!!   nambbc        bottom temperature boundary condition                (default: OFF)
!!   nambbl        bottom boundary layer scheme                         (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&namdrg        !   top/bottom drag coefficient                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_non_lin = .true.     !  non-linear  drag: Cd = Cd0 |U|
/
!!======================================================================
!!                        Tracer (T & S) namelists                    !!
!!                                                                    !!
!!   nameos        equation of state                                    (default: NO selection)
!!   namtra_adv    advection scheme                                     (default: NO selection)
!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
!-----------------------------------------------------------------------
   ln_eos80    = .true.      !  = Use EOS80 equation of state
/
!-----------------------------------------------------------------------
&namtra_adv    !   advection scheme for tracer                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_traadv_fct =  .true.   !  FCT scheme
      nn_fct_h   =  2               !  =2/4, horizontal 2nd / 4th order 
      nn_fct_v   =  2               !  =2/4, vertical   2nd / COMPACT 4th order 
/
!-----------------------------------------------------------------------
&namtra_ldf    !   lateral diffusion scheme for tracers                 (default: NO selection)
!-----------------------------------------------------------------------
   ln_traldf_lap   =  .true.   !    laplacian operator
   ln_traldf_iso   =  .true.   !  iso-neutral (standard operator)
   nn_aht_ijk_t    = 0         !  = 0   constant = 1/2  Ud*Ld   (lap case) 
      rn_Ud        = 0.02           !  lateral diffusive velocity [m/s]
      rn_Ld        = 100.e+3        !  lateral diffusive length   [m]
/
!!======================================================================
!!                      ***  Dynamics namelists  ***                  !!
!!                                                                    !!
!!   nam_vvl       vertical coordinate options                          (default: z-star)
!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
!!   namdyn_vor    advection scheme                                     (default: NO selection)
!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
!!======================================================================
!
!-----------------------------------------------------------------------
&namdyn_adv    !   formulation of the momentum advection                (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynadv_vec = .true.  !  vector form - 2nd centered scheme
     nn_dynkeg     = 0        ! grad(KE) scheme: =0   C2  ;  =1   Hollingsworth correction
/
!-----------------------------------------------------------------------
&namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynvor_ene = .true.  !  energy conserving scheme
/
!-----------------------------------------------------------------------
&namdyn_hpg    !   Hydrostatic pressure gradient option                 (default: NO selection)
!-----------------------------------------------------------------------
   ln_hpg_zco  = .true.    !  z-coordinate - full steps
/
!-----------------------------------------------------------------------
&namdyn_spg    !   surface pressure gradient                            (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynspg_ts  = .true.  !  split-explicit free surface
/
!-----------------------------------------------------------------------
&namdyn_ldf    !   lateral diffusion on momentum                        (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynldf_lap =  .true.     !    laplacian operator
   ln_dynldf_lev =  .true.     !  iso-level
   nn_ahm_ijk_t  = 0           !  = 0  constant = 1/2  Uv*Lv   (lap case) 
      rn_Uv      = 2.0              !  lateral viscous velocity [m/s] 
      rn_Lv      = 100.e+3          !  lateral viscous length   [m]
/
!!======================================================================
!!                     vertical physics namelists                     !!
!!                                                                    !!
!!    namzdf        vertical physics manager                            (default: NO selection)
!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namzdf        !   vertical physics                                     (default: NO selection)
!-----------------------------------------------------------------------
   ln_zdftke   = .true.       !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
   ln_zdfevd   = .true.       !  enhanced vertical diffusion
      nn_evdm     =    1         ! apply on tracer (=0) or on tracer and momentum (=1)
      rn_evd      =  100.        ! mixing coefficient [m2/s]
   !                       ! coefficients
   rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
   rn_avt0     =   1.2e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
/
!-----------------------------------------------------------------------
&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
!-----------------------------------------------------------------------
   nn_etau     =   0       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves
/
!!======================================================================
!!                  ***  Diagnostics namelists  ***                   !!
!!                                                                    !!
!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
!!   namhsb       Heat and salt budgets                                 (default: OFF)
!!   namdiu       Cool skin and warm layer models                       (default: OFF)
!!   namdiu       Cool skin and warm layer models                       (default: OFF)
!!   namflo       float parameters                                      (default: OFF)
!!   nam_diadct   transports through some sections                      (default: OFF)
!!   nam_dia25h   25h Mean Output                                       (default: OFF)
!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
!!======================================================================
!
!!======================================================================
!!                  ***  Miscellaneous namelists  ***                 !!
!!                                                                    !!
!!   nammpp            Massively Parallel Processing
!!   namctl            Control prints                                   (default: OFF)
!!   namsto            Stochastic parametrization of EOS                (default: OFF)
!!======================================================================
!
!
!-----------------------------------------------------------------------
&nammpp        !   Massively Parallel Processing
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namctl        !   Control prints                                       (default: OFF)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namsto        ! Stochastic parametrization of EOS                      (default: OFF)
!-----------------------------------------------------------------------
/

and here’s the recurring error, I can’t seem to find a solution for this one

  ===>>> : E R R O R

          ===========

 iom_nf90_check : NetCDF: Index exceeds dimension bound
 iom_nf90_g123d , file: gebco_2025_tayabas.nc, var: elevation

                     iom_close ~~~ close file: gebco_2025_tayabas.nc ok
 Interpolation of high resolution bathymetry on child grid
 Median average ...
 Minimum ocean depth:    30.003215807562810       minimum number of ocean levels :            3

Hei,

But where is the grid provided for ?

Apologies, I mistakenly provided the wrong namelist_cfg, herest he DOMAINcfg namelist_cfg

!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! NEMO/OCE :   Configuration namelist_cfg used to overwrite defaults value defined in namelist_ref
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! NEMO/OCE  :  1 - Domain & run manager (namrun, namcfg, namdom, namzgr, namzgr_sco )
!!              2 - diagnostics      (namnc4)
!!              3 - miscellaneous    (nammpp, namctl)
!!
!! namelist skeleton : egrep -E '(^/ *$|^! *$|^ *$|&nam.*|!---.*|!! .*|!!==.*|!!>>>.*)' namelist_ref > namelist_skl
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!-----------------------------------------------------------------------
&namrun        !   parameters of the run
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namdom        !   space and time domain (bathymetry, mesh, timestep)
!-----------------------------------------------------------------------
   ln_read_cfg = .false.
   nn_bathy    =    2      ! = 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_ph_parent.nc'                
   cn_topo     =  'gebco_2025_tayabas.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
   nn_msh      =    1
   rn_e3zps_min=    0.5     !  partial step thickness is set larger than the minimum of
   rn_e3zps_rat=    0.1    !  rn_e3zps_min and rn_e3zps_rat*e3t, with 0<rn_e3zps_rat<1
   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      =  500.                 !  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 = .false.  ! =T : set T points in the middle of cells
   !                       !
   cp_cfg      =  "pagbilao"   !  name of the configuration
   jp_cfg      =     025   !  resolution of the configuration
   jpidta      =     120   !  1st lateral dimension ( >= jpi )
   jpjdta      =      90   !  2nd    "         "    ( >= jpj )
   jpkdta      =      31   !  number of levels      ( >= jpk )
   Ni0glo      =     120   !  1st dimension of global domain --> i =jpidta
   Nj0glo      =      90   !  2nd    -                  -    --> j  =jpjdta
   jpkglo      =      31
   jperio      =       0   !  lateral cond. type (between 0 and 6)
   ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present
                           !  in netcdf input files, as the start j-row for reading
   ln_domclo = .false.     ! computation of closed sea masks (see namclo)
/
!-----------------------------------------------------------------------
&namzgr        !   vertical coordinate                                  (default: NO selection)
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
   ln_zco      = .false.   !  z-coordinate - full    steps
   ln_zps      = .true.   !  z-coordinate - partial steps
   ln_sco      = .false.   !  s- or hybrid z-s-coordinate
   ln_isfcav   = .false.   !  ice shelf cavity             (T: see namzgr_isf)
/
!-----------------------------------------------------------------------
&namzgr_isf    !   isf cavity geometry definition
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate                (default F)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namclo ! (closed sea : need ln_domclo = .true. in namcfg)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namagrif      !  AGRIF zoom                                            ("key_agrif")
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
!-----------------------------------------------------------------------
/

Hi!

What kind of configuration are you trying to build? Is this a configuration with a zoom? I assume so from cn_domcfg = 'domain_ph_parent.nc' .

If so, did you compile the DOMAINcfg with key_agrif and follow the instructions provided here?

Furthermore, are you trying to build the domain_cfg from an external topography (gebco in your case) for the parent grid as well? We’ve seen issues with this before, depending on the geographical location of the grid, e.g. crossing 180° in combination with other factors might be an issue.

Questions to the developers: Is DOMAINcfg made for creating domain_cfg.nc from external bathymetries for non-nested configurations (or here, parent grids) at all?