# Output NEMO sections / transects. DIADCT

**URL:** <https://nemo-ocean.discourse.group/t/output-nemo-sections-transects-diadct/1001>\
**Category:** v4.2.x\
**Tags:** tools, XIOS\
**Created:** [13 March 2026 13:34 UTC](https://nemo-ocean.discourse.group/t/output-nemo-sections-transects-diadct/1001 "2026-03-13T13:34:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joakim](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/joakim/32/139_2.png) [@joakim](https://nemo-ocean.discourse.group/u/joakim)\
**Post date:** [13 March 2026 13:34 UTC](https://nemo-ocean.discourse.group/t/output-nemo-sections-transects-diadct/1001/1 "2026-03-13T13:34:42Z")

</div>

Good afternoon

I’d like to output the transport through sections from NEMO 4.2. I’ve made the “sections” file using the SECTIONS tool and set ln\_diadct = .true. in the namelist.

But when I run, I get an error from XIOS saying the “mfo” does not exist. And it does not.  
NEMO has a line  
CALL iom\_put(“mfo”, vol\_transport)  
but there is no “mfo” defined in field\_def\_nemo-oce.xml. So XIOS crashes for good reason.

Instead, the field-def\_nemo-oce.xml file has some definitions to try and make XIOS calculate transports from uoce, but I don’t understand how it is supposed to work.  
If I comment out everything inside the “ifdef key\_xios” in diadct, then NEMO runs fine and writes transports to a text file.

Is there a way to write the transport sections output via XIOS? Is it not working in NEMO 4.2 or am I missing something in the settings?

Cheers  
/Joakim

---

<div class="post-metadata">

**Author:** ![Jsterlin](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Jsterlin](https://nemo-ocean.discourse.group/u/Jsterlin)\
**Post date:** [16 March 2026 23:43 UTC](https://nemo-ocean.discourse.group/t/output-nemo-sections-transects-diadct/1001/2 "2026-03-16T23:43:24Z")

</div>

Hi Joakim!

I managed to make DIADCT produces numbers via XIOS by adding these new entries in `field_def_nemo-oce.xml`:

```xml
<field_group id="DCT" grid_ref="grid_TRO">
    <field id="mfo" long_name="Volume transports through sections" standard_name="vol_transport" unit="Sv" />
    <field id="hfo" long_name="Heat transports through sections" standard_name="heat_transport" unit="PW" />
    <field id="sfo" long_name="Salt transports through sections" standard_name="salt_transport" unit="Gg/s" />
</field_group>

```

and then, in `file_def_nemo-oce.xml`:

```xml
<file id="file42" name_suffix="_strait_oce" description="transport variables through straits" >
     <field field_ref="mfo" name="mfo" level="0" / 
<!-- <field field_ref="masstr_strait" name="mfo" level="1" /> -->
</file>

```

It should work OK with your config, as you managed to write transports into files.

As you can see, I commented out the variable `masstr_strait` because I’m not sure how it works. It’s linked to `maskMFO_[uv]`. And it’s also used for sea ice mass transports across straits. I’m also curious to know why there are these definitions in the XML files.

On my side, I’d like to use DIADCT to output `Omon.mfo` and `SImon.simassacrossline` as per the CMIP7 data request. So far, I’ve been trying to stitch transects around the north fold in the orca grid. I’m interested in your work.

Cheers,

Jean S.

---

<div class="post-metadata">

**Author:** ![joakim](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/joakim/32/139_2.png) [@joakim](https://nemo-ocean.discourse.group/u/joakim)\
**Post date:** [17 March 2026 15:25 UTC](https://nemo-ocean.discourse.group/t/output-nemo-sections-transects-diadct/1001/3 "2026-03-17T15:25:50Z")

</div>

Hi Jean

Thanks for the tip. I gave this a try but I’m missing the definition of grid\_TRO. Did you define this yourself in grid\_def.xml? Could you share this?

If we have something that works, then perhaps it could be put into NEMO 4.2 as a bugfix.

Cheers  
/J

---

<div class="post-metadata">

**Author:** ![Jsterlin](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Jsterlin](https://nemo-ocean.discourse.group/u/Jsterlin)\
**Post date:** [17 March 2026 17:47 UTC](https://nemo-ocean.discourse.group/t/output-nemo-sections-transects-diadct/1001/4 "2026-03-17T17:47:08Z")

</div>

Sorry, I forgot the part with the grid definition. In [grid\_def\_nemo.xml around here](https://forge.nemo-ocean.eu/nemo/nemo/-/blob/branch_4.2/cfgs/SHARED/grid_def_nemo.xml?ref_type=heads#L313), I added the following:

```xml
<grid id="grid_TRO">
    <axis axis_ref="nstrait"/>
</grid>

```

Then, `nstrait` is already defined through `cfgs/SHARED/axis_def_nemo.xml`. And you can track that variable in NEMO in `src/OCE/IOM/iom.F90`.

I haven’t defined an equivalent grid for the ice transects, but I think it should similar to `grid_TRO`.

Cheers,

Jean
