Horizontal zooms in NEMO 4.0.x

I am trying to output a horizontal subdomain rather than the entire global output.

I have modified domain_def.xml and grid_def.xml:

<domain id="so_zoomT domain_ref="grid_T">
  <zoom_domain ibegin="1" jbegin="210" ni="1442" nj="350" />
</domain>
<grid id="grid_so_zoomT" >
  <domain domain_ref="so_zoomT" />
</grid>

Then the file_def looks like

<file id="file1" name_suffix="_grid_T" >
  <field field_ref="uoce"   name="uo"  domain_ref="so_zoomT" />
</file>

The model compiles and runs but then crashes, I assume when trying to write to netcdf.

The error I get is

ATP Stack walkback for Rank 348 starting:
  _start@start.S:113
  __libc_start_main@libc-start.c:242
  main@xios_server.f90:7
  xios::CXios::initServerSide()@cxios.cpp:157
  xios::CXios::initServer()@cxios.cpp:150
  xios::xml::CXMLParser::ParseFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@xml_parser.cpp:22
  xios::xml::CXMLParser::ParseStream(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@xml_parser.cpp:48
  xios::xml::CXMLNode::getElementName[abi:cxx11]() const@xml_node.cpp:22
  rapidxml::xml_base<char>::name() const@rapidxml.hpp:675
ATP Stack walkback for Rank 348 done
Process died with signal 11: 'Segmentation fault'
Forcing core dumps of ranks 348, 108, 344, 0
View application merged backtrace tree with: stat-view atpMergedBT.dot
You may need to: module load stat

_pmiu_daemon(SIGCHLD): [NID 00472] [c2-0c1s6n0] [Thu May  1 08:31:01 2025] PE RANK 345 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00499] [c2-0c1s12n3] [Thu May  1 08:31:01 2025] PE RANK 349 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00452] [c2-0c1s1n0] [Thu May  1 08:31:01 2025] PE RANK 72 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00454] [c2-0c1s1n2] [Thu May  1 08:31:01 2025] PE RANK 144 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00456] [c2-0c1s2n0] [Thu May  1 08:31:01 2025] PE RANK 216 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00465] [c2-0c1s4n1] [Thu May  1 08:31:01 2025] PE RANK 288 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00457] [c2-0c1s2n1] [Thu May  1 08:31:01 2025] PE RANK 252 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00455] [c2-0c1s1n3] [Thu May  1 08:31:01 2025] PE RANK 180 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00453] [c2-0c1s1n1] [Thu May  1 08:31:01 2025] PE RANK 109 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00450] [c2-0c1s0n2] [Thu May  1 08:31:01 2025] PE RANK 1 exit signal Killed
[NID 00453] 2025-05-01 08:31:01 Apid 229037526: initiated application termination
_pmiu_daemon(SIGCHLD): [NID 00468] [c2-0c1s5n0] [Thu May  1 08:31:01 2025] PE RANK 324 exit signal Killed
_pmiu_daemon(SIGCHLD): [NID 00451] [c2-0c1s0n3] [Thu May  1 08:31:01 2025] PE RANK 36 exit signal Killed
[FAIL] run_model # return-code=137
2025-05-01T08:31:03Z CRITICAL - failed/EXIT

The model is the GOSI9 configuration developed by the Met Office.

I could output the whole domain but I am outputting at daily frequency so would rather not.

Any thoughts on this?

Cheers in advance

Hei,

I think you lack the 3rd dimension, uoce is a 3D variable. Does it work if you output for example SSH ?

Cheers,

Robinson

Hi Tom,

I have this configuration which runs with a couple of output subdomains: RAPID-Evolution/cfgs/AGRIF_QCO/eORCA025-RAPID12-RAPID36 at main · NOC-MSM/RAPID-Evolution · GitHub

Hi Robinson, hi Adam,

Thanks for these. Unfortunately I am no further and still getting the same error.

Adding the <zoom_domain ... to the grid_def.xml file instead of specifying in the domain_def.xml file, following this

<grid id="gridU3D_so_zoom" >
  <domain domain_ref="grid_U" >
    <zoom_domain ibegin="1" jbegin="210" ni="1442" nj="350" />
  </domain>
  <axis axis_ref="depthu" />
</grid>

then in file_def.xml

<file id="file1" name_suffix="_grid_U_zoom" >
  <field field_ref="uoce" grid_ref="gridU3D_so_zoom" name="uo"   />
</file>

n.b. in first comment I accidentally wrote grid_T instead of grid_U.

I noticed that axis_ref=deptht is used for all grids in grid_def.xml here…?

Nevertheless, trying to output toce_con still results in the same error, just different core dump ranks.

This is not something to do with xios attached mode seen in this thread?

Cheers for your help so far

Hei, Does output a single point work ?

Trying with one point

<file id="file1" name_suffix="_grid_T_1point" >
  <field field_ref="toce_con" grid_ref="grid_1point" name="thetao_con"   />
</file>

gives

> Error [CGrid::completeGrid(CGrid* transformGridSrc)] : In file '/var/spool/jtmp/6413365.xcs00.XplTEw/xios/src/node/grid.cpp', line 2220 -> Two grids have different number of elements. 
Number of element of grid destination grid_1point is 1
Number of element of grid source grid_T_3D is 2

Trying with the zoom

> Error [CZoomDomain::checkValid(CDomain* domainSrc)] : In file '/var/spool/jtmp/6413365.xcs00.XplTEw/xios/src/node/zoom_domain.cpp', line 62 -> Zoom is wrongly defined, please check the values : 'ni' (1442), 'nj' (350), 'ibegin' (1), 'jbegin' (210)

Changing ni to 1441 removes the above error in the zoom, but is then replaced with

> Error [CNc4DataOutput::writeFieldData_ (CField*  field)] : In file '/var/spool/jtmp/6413365.xcs00.XplTEw/xios/src/io/nc4_data_output.cpp', line 2676 -> On writing field data: uo
In the context : nemo_server
Error when calling function ncPutVaraType(ncid, varId, start, count, data)
NetCDF: Numeric conversion not representable
Unable to write data given the location id: 65536 and the variable whose id: 11 and name: uo

Am I missing something basic?

The fix for this was

in grid_def_file.xml

<!--  -->

       <grid id="gridU3D_so_zoom" >

         <domain domain_ref="grid_U">

            <zoom_domain ni="1441" ibegin="1" nj="350" jbegin="210"/>

         </domain>

         <axis axis_ref="depthu" />

       </grid>

and in file_def.xml

 <file id="file301" name_suffix="_gridU_so_zoom" description="zoom variables gridU_so">

      <field field_ref="uoce"      grid_ref="gridU3D_so_zoom"      name="uo"      operation="average" freq_op="1d" detect_missing_value="true" > @uoce_e3u / @e3u </field>

    </file>

with detect_missing_value="true" being the key fixer.