# DOMAINcfg tool produces crashed domain and mask files

**URL:** <https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408>\
**Category:** v4.2.x\
**Tags:** tools, DOM\
**Created:** [7 December 2022 13:31 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408 "2022-12-07T13:31:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![m-n-o](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/m-n-o/32/101_2.png) [@m-n-o](https://nemo-ocean.discourse.group/u/m-n-o)\
**Post date:** [7 December 2022 13:31 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/1 "2022-12-07T13:31:01Z")

</div>

Hello!  
I’m trying to create a domain and mask files via DOMAINcfg tool. Coordinate mesh\_mask is cut from the ORCA\_R025 (min lat ~ 53 N) and I use GEBCO\_2022 (min lat ~45 N) as a bathymetry data.

> **Input coordinates and bathymetry**
>
> ![Screenshot from 2022-12-07 16-36-35](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/7a02ca7b566da0dd228d16cc7a0579eea9fbea1b.png)

> **namelist\_cfg**
>
> ```auto
> !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> !! 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
> !-----------------------------------------------------------------------
> cn_exp = "Arct_ORCA025" ! experience name
> 
> /
> !-----------------------------------------------------------------------
> &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_fcoord = 'arct_orca025_coord_v2.nc' ! external coordinates file (jphgr_msh = 0)
> cn_topo = 'GEBCO_arct_2022.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 ! multiplicative factor to account for possibly negative input bathymetry (agrif only) 
> rn_bathy = 0. ! value of the bathymetry. if (=0) bottom flat at jpkm1
> nn_msh = 1 ! create (=1) a mesh file or not (=0)
> 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 = .false. ! =T : set T points in the middle of cells
> ! !
> cp_cfg = "orca" ! name of the configuration
> jp_cfg = 025 ! resolution of the configuration
> jpidta = 488 ! 1st lateral dimension ( >= jpi )
> jpjdta = 422 ! 2nd " " ( >= jpj )
> jpkdta = 31 ! number of levels ( >= jpk )
> Ni0glo = 488 ! 1st dimension of global domain --> i =jpidta
> Nj0glo = 422 ! 2nd - - --> j =jpjdta
> jpkglo = 31
> jperio = 4 ! 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")
> !-----------------------------------------------------------------------
> /
> 
> ```

But output files look crashed and `ocean.output` file has 1 error:

> ===\>\>\> : E R R O R
> 
> ```
> ===========
> 
> ```
> 
> iom\_nf90\_check : NetCDF: Index exceeds dimension bound  
> iom\_nf90\_g123d , file: GEBCO\_arct\_2022.nc, var: elevation

> **bathy\_metry in final domain file**
>
> ![Bathymetry](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/486c2ab8527f02f87f4923aebacb830b214d091a.png)

> **umask in final mesh\_mask file**
>
> ![Screenshot from 2022-12-07 16-08-03](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/58d951fddbe77b8f0d42a98ba9bcc9f9ae8ee392.png)

Do you have any idea what this error comes from?

---

<div class="post-metadata">

**Author:** ![m-n-o](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/m-n-o/32/101_2.png) [@m-n-o](https://nemo-ocean.discourse.group/u/m-n-o)\
**Post date:** [20 December 2022 11:13 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/2 "2022-12-20T11:13:49Z")

</div>

## Update

We solved error in ocean.output with usage of global GEBCO bathymetry.  
But I still have the bad data at the last row of the domain. It looks like that the DOMAINcgf writes wrong coordinates in appropriate variables:

> **"Last (-1) and second to last gphit rows"**
>
> ![Screenshot from 2022-12-20 13-44-02](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/4ccff35ac523b946517d3f85047d0ab91ea4d1cd.png)

> **"Last (-1) and second to last glamt rows"**
>
> ![Screenshot from 2022-12-20 13-49-26](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/6702066ee879a5edaad27c723399c63eaa217586.png)

DOMAINcfg run ends with next MPICH message:

```auto
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 39159 RUNNING AT hm-vm-nemo
= EXIT CODE: 9
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Killed (signal 9)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

```

Original coordinate mesh is ok:

> **"Original last (-1) and second to last gphit rows"**
>
> ![Screenshot from 2022-12-20 14-04-56](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/a48bbace62606393723a8bd28c95f7a2965acd64.png)

> **"Original last (-1) and second to last glamt rows"**
>
> ![Screenshot from 2022-12-20 14-02-10](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/abb9d1e87543bf19a7e3bf81bd897bacef88b895.png)

> **Relevant DOMAINcfg namelist**
>
> ```auto
> !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> !! 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
> !-----------------------------------------------------------------------
> cn_exp = "Arct_ORCA025" ! experience name
> 
> /
> !-----------------------------------------------------------------------
> &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_fcoord = 'arct_orca025_coord_v2.nc' ! external coordinates file (jphgr_msh = 0)
> cn_topo = 'GEBCO_2022.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 ! multiplicative factor to account for possibly negative input bathymetry (agrif only) 
> rn_bathy = 0. ! value of the bathymetry. if (=0) bottom flat at jpkm1
> nn_msh = 1 ! create (=1) a mesh file or not (=0)
> rn_hmin = 5. ! min depth of the ocean (>0) or min number of ocean level (<0)
> rn_e3zps_min= 2. ! 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 = 2. ! Minimum vertical spacing
> pphmax = 5000. ! 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 = "orca" ! name of the configuration
> jp_cfg = 025 ! resolution of the configuration
> jpidta = 488 ! 1st lateral dimension ( >= jpi )
> jpjdta = 418 ! 2nd " " ( >= jpj )
> jpkdta = 31 ! number of levels ( >= jpk )
> Ni0glo = 488 ! 1st dimension of global domain --> i =jpidta
> Nj0glo = 418 ! 2nd - - --> j =jpjdta
> jpkglo = 31
> jperio = 4 ! 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")
> !-----------------------------------------------------------------------
> /
> !-----------------------------------------------------------------------
> &nammpp ! Massively Parallel Processing ("key_mpp_mpi")
> !-----------------------------------------------------------------------
> ! ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
> ! ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
> /
> !-----------------------------------------------------------------------
> &namctl ! Control prints (default: OFF)
> !-----------------------------------------------------------------------
> sn_cfctl%l_runstat = .TRUE.
> ln_timing = .true. ! timing by routine write out in timing.output file
> /
> !-----------------------------------------------------------------------
> &namnc4 ! netcdf4 chunking and compression settings ("key_netcdf4")
> !-----------------------------------------------------------------------
> /
> 
> ```

---

<div class="post-metadata">

**Author:** ![jchanut](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/jchanut/32/9_2.png) [@jchanut](https://nemo-ocean.discourse.group/u/jchanut)\
**Post date:** [12 January 2023 11:07 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/3 "2023-01-12T11:07:29Z")

</div>

gphit, glamt are indeed more or less duplicated in extreme (masked) ghosts points (interpolation from parent is not possible there). This should not matter ?

---

<div class="post-metadata">

**Author:** ![m-n-o](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/m-n-o/32/101_2.png) [@m-n-o](https://nemo-ocean.discourse.group/u/m-n-o)\
**Post date:** [17 January 2023 08:52 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/4 "2023-01-17T08:52:16Z")

</div>

Thanks for attention)  
I guess this shouldn’t be a problem because all previous i-rows are calculated correctly at masked points. Is it possible to run the DOMAINcfg tool in debug mode?

---

<div class="post-metadata">

**Author:** ![m-n-o](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/m-n-o/32/101_2.png) [@m-n-o](https://nemo-ocean.discourse.group/u/m-n-o)\
**Post date:** [25 January 2023 07:21 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/5 "2023-01-25T07:21:50Z")

</div>

I’ve run the tool with debug flags (attached below) and got the following backtrace:

> Assertion failed in file src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c at line 599: hdr.pkt\_type \> == MPIDI\_NEM\_TCP\_SOCKSM\_PKT\_ID\_INFO || hdr.pkt\_type == MPIDI\_NEM\_TCP\_SOCKSM\_PKT\_TMPVC\_INFO  
> 0x7fe65fe26707 ???  
> ???:0  
> 0x7fe65fe89f74 ???  
> ???:0  
> 0x7fe65fe8c19e ???  
> ???:0  
> 0x7fe65fe7aff1 ???  
> ???:0  
> 0x7fe65fd72e72 ???  
> ???:0  
> 0x7fe65fd664f4 ???  
> ???:0  
> 0x7fe6608447d6 ???  
> ???:0  
> 0x55df9868e4de \_\_lib\_mpp\_MOD\_mpprecv\_dp  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/lib\_mpp.f90:364  
> 0x55df9845a24f \_\_lbclnk\_MOD\_mpp\_lnk\_3d\_dp  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/lbclnk.f90:3221  
> 0x55df983118b0 zgr\_zps  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/domzgr.f90:1231  
> 0x55df983432c5 \_\_domzgr\_MOD\_dom\_zgr  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/domzgr.f90:201  
> 0x55df9826c8fd \_\_domain\_MOD\_dom\_init  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/domain.f90:93  
> 0x55df98255c67 \_\_nemogcm\_MOD\_nemo\_init  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/nemogcm.f90:296  
> 0x55df98255cb5 \_\_nemogcm\_MOD\_nemo\_gcm  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/nemogcm.f90:108  
> 0x55df98251c80 make\_domain\_cfg  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/make\_domain\_cfg.f90:28  
> 0x55df98251cc2 main  
> /home/hydmet/Build\_NEMO/nemo\_4.2.0/tools/DOMAINcfg/BLD/ppsrc/nemo/make\_domain\_cfg.f90:21  
> 0x7fe660223082 \_\_libc\_start\_main  
> …/csu/libc-start.c:308  
> 0x55df98251b8d ???  
> ???:0  
> 0xffffffffffffffff ???  
> ???:0  
> internal ABORT - process 49

Debug flags:

> %FCFLAGS -fdefault-real-8 -O0 -g -fbacktrace -funroll-all-loops -fcray-pointer -ffree-line-length-none -fcheck=all -finit-real=nan

Can you tell me where to look for the error?

---

<div class="post-metadata">

**Author:** ![m-n-o](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/m-n-o/32/101_2.png) [@m-n-o](https://nemo-ocean.discourse.group/u/m-n-o)\
**Post date:** [7 March 2023 07:06 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/6 "2023-03-07T07:06:58Z")

</div>

I avoided this problem by using a DOMAINcfg tool from [DCM](https://github.com/meom-group/DCM/tree/4.2) from branch “4.2”.

---

<div class="post-metadata">

**Author:** ![elsy](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/elsy/32/163_2.png) [@elsy](https://nemo-ocean.discourse.group/u/elsy)\
**Post date:** [15 February 2024 13:42 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/7 "2024-02-15T13:42:44Z")

</div>

Hi, sorry, I’m trying to create my masks-T, U, and V in a 3D grid. I have my domain\_cfg.nc file with all the correct variables, including the 3D settings(e3\*) and bathy. However, when I use nn\_msh to generate my mesh mask file in the DOMAIN\_cfg tool, it doesn’t seem to do anything. I noticed that you have your mesh mask files. Could you please tell me how you obtained them?(P.D. I use 4.0.4 NEMO version)

---

<div class="post-metadata">

**Author:** ![m-n-o](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/m-n-o/32/101_2.png) [@m-n-o](https://nemo-ocean.discourse.group/u/m-n-o)\
**Post date:** [19 February 2024 09:11 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/8 "2024-02-19T09:11:17Z")

</div>

Hello, Elsy.  
Now we use the DOMAIN\_cfg tool within NEMO v.4.2.2 (whithout DCM) and have not encountered any problems using “create mask” option (_nn\_msh_).  
You can check if the _nn\_msh_ parameter reaches the program in the _ocean.output_ file.  
If the program reads the parameter correctly, but does not create files, then the problem is somewhere in the program and the behavior of the program itself should be studied. In particular, with which messages it ends. We usually do something like this when such problems arise.

---

<div class="post-metadata">

**Author:** ![elsy](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/elsy/32/163_2.png) [@elsy](https://nemo-ocean.discourse.group/u/elsy)\
**Post date:** [19 February 2024 09:48 UTC](https://nemo-ocean.discourse.group/t/domaincfg-tool-produces-crashed-domain-and-mask-files/408/9 "2024-02-19T09:48:28Z")

</div>

Thank you very much for your answer, yes, in version 4.0.4 there is a missing line of code which is corrected by adding the following line of code at the end of the “dom\_init” subroutine in the “domain.F90” file and now it works:

**IF(nmsh/=0) CALL dom\_wri!Create mesh\_mask file**

In the new version 4.2 the line is already included.

P.S. you have to recompile the tool after adding the line
