# Horizontal zooms in NEMO 4.0.x

**URL:** <https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893>\
**Category:** v4.0.x\
**Tags:** orca, XIOS\
**Created:** [1 May 2025 08:34 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893 "2025-05-01T08:34:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmwilder](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/tmwilder/32/120_2.png) [@tmwilder](https://nemo-ocean.discourse.group/u/tmwilder)\
**Post date:** [1 May 2025 08:34 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/1 "2025-05-01T08:34:42Z")

</div>

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

I have modified `domain_def.xml` and `grid_def.xml`:

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

```

```auto
<grid id="grid_so_zoomT" >
  <domain domain_ref="so_zoomT" />
</grid>

```

Then the `file_def` looks like

```auto
<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

```auto
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

---

<div class="post-metadata">

**Author:** ![robinson](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@robinson](https://nemo-ocean.discourse.group/u/robinson)\
**Post date:** [1 May 2025 16:24 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/2 "2025-05-01T16:24:05Z")

</div>

Hei,

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

Cheers,

Robinson

---

<div class="post-metadata">

**Author:** ![atb299](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@atb299](https://nemo-ocean.discourse.group/u/atb299)\
**Post date:** [6 May 2025 08:48 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/3 "2025-05-06T08:48:12Z")

</div>

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](https://github.com/NOC-MSM/RAPID-Evolution/tree/main/cfgs/AGRIF_QCO/eORCA025-RAPID12-RAPID36)

---

<div class="post-metadata">

**Author:** ![tmwilder](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/tmwilder/32/120_2.png) [@tmwilder](https://nemo-ocean.discourse.group/u/tmwilder)\
**Post date:** [7 May 2025 09:12 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/4 "2025-05-07T09:12:27Z")

</div>

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](https://github.com/NOC-MSM/RAPID-Evolution/blob/main/cfgs/SHARED/grid_def_zoom2.xml)

```auto
<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`

```auto
<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](https://github.com/NOC-MSM/RAPID-Evolution/blob/main/cfgs/SHARED/grid_def_zoom2.xml)…?

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](https://nemo-ocean.discourse.group/t/zoom-example-in-nemo-4-2-2/697/13) thread?

Cheers for your help so far

---

<div class="post-metadata">

**Author:** ![robinson](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@robinson](https://nemo-ocean.discourse.group/u/robinson)\
**Post date:** [7 May 2025 09:25 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/5 "2025-05-07T09:25:24Z")

</div>

Hei, Does output a single point work ?

---

<div class="post-metadata">

**Author:** ![tmwilder](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/tmwilder/32/120_2.png) [@tmwilder](https://nemo-ocean.discourse.group/u/tmwilder)\
**Post date:** [7 May 2025 12:49 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/6 "2025-05-07T12:49:17Z")

</div>

Trying with one point

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

```

gives

```auto
> 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

```auto
> 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)

```

---

<div class="post-metadata">

**Author:** ![tmwilder](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/tmwilder/32/120_2.png) [@tmwilder](https://nemo-ocean.discourse.group/u/tmwilder)\
**Post date:** [7 May 2025 14:35 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/7 "2025-05-07T14:35:18Z")

</div>

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

```auto
> 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?

---

<div class="post-metadata">

**Author:** ![tmwilder](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/tmwilder/32/120_2.png) [@tmwilder](https://nemo-ocean.discourse.group/u/tmwilder)\
**Post date:** [16 May 2025 09:49 UTC](https://nemo-ocean.discourse.group/t/horizontal-zooms-in-nemo-4-0-x/893/8 "2025-05-16T09:49:50Z")

</div>

The fix for this was

in `grid_def_file.xml`

```auto
<!-- -->

       <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`

```auto
 <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.
