# \[v4.0.x\] Output \`msftbarot\` and \`uocetr\_vsum\_cumul\` at a given frequency

**URL:** https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232
**Category:** v4.0.x
**Tags:** orca, DIA, IOM
**Created:** [9 March 2022 15:55 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232 "2022-03-09T15:55:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yruprich](https://avatars.discourse-cdn.com/v4/letter/y/a88e4f/32.png) [@yruprich](https://nemo-ocean.discourse.group/u/yruprich)
#### Post date: [9 March 2022 15:55 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232/1 "2022-03-09T15:55:38Z")

</div>

Hello,

I am using NEMO4.0.4 on ORCA1 and I struggle in outputting the variables `msftbarot` and `uocetr_vsum_cumul`. When I include these variables in the _file\_def\_nemo-oce.xml_ my simulation crashes with this error message:

```nohighlight
`> Error [CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) const] : 
In file '/gpfs/scratch/bsc32/bsc32019/a4cr/auto-nemo/sources/xios-2.5/src/filter/store_filter.cpp', line 54 
-> Impossible to get the packet with timestamp = 1831766400`

```

Tracking back the problem it seems that it is coming from the variable `uocetr_vsum_op` that NEMO is retrieving from xios in the routine `diaptr.F90` (cf. line 310: `CALL iom_get_var( 'uocetr_vsum_op', z2d )`).

Here is this `iom_get_var` function from the file `iom.F90`:

```fortran
   SUBROUTINE iom_get_var( cdname, z2d)
      CHARACTER(LEN=*), INTENT(in ) :: cdname
      REAL(wp), DIMENSION(jpi,jpj) :: z2d 
#if defined key_iomput
      IF( xios_field_is_active( cdname, at_current_timestep_arg = .TRUE. ) ) THEN
         z2d(:,:) = 0._wp
         CALL xios_recv_field( cdname, z2d)
      ENDIF
#else
      IF( .FALSE. ) WRITE(numout,*) cdname, z2d ! useless test to avoid compilation warnings                                                                                                                     
#endif
   END SUBROUTINE iom_get_var

```

Here I can see this line:

```fortran
IF( xios_field_is_active( cdname, at_current_timestep_arg = .TRUE. ) ) THEN

```

, which I understood as a check to verify whether the variable `uocetr_vsum_op` exists at the current timestep and is possibly available for NEMO.

Here is the parts related to those variables in my:

- _field\_def\_nemo-oce.xml_:

- _file\_def\_nemo-oce.xml_

Can someone help me with this problem? Am I doing something wrong with the XML files?

Thank you,  
Yohan

---

<div class="post-metadata">

### Author: ![acc](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@acc](https://nemo-ocean.discourse.group/u/acc)
#### Post date: [14 March 2022 12:45 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232/2 "2022-03-14T12:45:38Z")

</div>

Hi Yohan, I’m not sure I understand how this is meant to work either. This seems to have been put in to support the CMIP6 diagnostics 2 years ago (around revision 11993). My only guess is that it will only work with certain time periods (either monthly or annual averages) and that you are asking for output at a different frequency?

---

<div class="post-metadata">

### Author: ![yruprich](https://avatars.discourse-cdn.com/v4/letter/y/a88e4f/32.png) [@yruprich](https://nemo-ocean.discourse.group/u/yruprich)
#### Post date: [14 March 2022 21:14 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232/3 "2022-03-14T21:14:01Z")

</div>

Thank you for your answer Andrew.

> [@acc](#):
>
> My only guess is that it will only work with certain time periods (either monthly or annual averages)

This is also how I understood it. And since the `freq_op` option of the variable `uocetr_vsum_cumul` is set to `freq_op="1mo"` in the _field\_def\_nemo-oce.xml_, my guess was that asking it at monthly frequency would be fine. But it does not work. I also tried to output it at the model time step then, but I had the same error.

---

<div class="post-metadata">

### Author: ![smasson](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@smasson](https://nemo-ocean.discourse.group/u/smasson)
#### Post date: [18 March 2022 14:15 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232/4 "2022-03-18T14:15:20Z")

</div>

Did you try with simply the reference to `msftbarot` in your _file\_def\_nemo-oce.xml_:

```auto
        <file id="file42" name_suffix="_grid_U_2D" description="ocean U grid variables" enabled=".TRUE.">
          <field field_ref="msftbarot" />
        </file>

```

The other variables are intermediate variables that will be used internally to compute `msftbarot`.

---

<div class="post-metadata">

### Author: ![smasson](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@smasson](https://nemo-ocean.discourse.group/u/smasson)
#### Post date: [18 March 2022 14:50 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232/5 "2022-03-18T14:50:37Z")

</div>

Two other points :

- `msftbarot` will be wrong if you suppress some land domains
- it is so much simpler to simply output `u_masstr_vint` and, in a post-processing phase, do the cumulative sum along the `j` direction to get `msftbarot`

---

<div class="post-metadata">

### Author: ![yruprich](https://avatars.discourse-cdn.com/v4/letter/y/a88e4f/32.png) [@yruprich](https://nemo-ocean.discourse.group/u/yruprich)
#### Post date: [25 March 2022 15:10 UTC](https://nemo-ocean.discourse.group/t/v4-0-x-output-msftbarot-and-uocetr-vsum-cumul-at-a-given-frequency/232/6 "2022-03-25T15:10:07Z")

</div>

Hi Sebastien,

thank you for your replies.

I have the same problem in case I only try to output `msftbarot` in my `file_def_nemo-oce.xml`. The issue seems to be coming from the `diaptr.F90` routine that is called to compute `uocetr_vsum_cumul`, from which the variable `msftbarot` is built on.

> [@smasson](#):
>
> msftbarot will be wrong if you suppress some land domains

Good to know… Could you explain why?

> [@smasson](#):
>
> it is so much simpler to simply output “u\_masstr\_vint” and, in a post-processing phase, do the cumulative sum along the j direction to get msftbarot

We are actually currently outputing `uocetr_vsum` and computing offline its cumulative sum along j. But it seems that I should get the same thing if I compute offline msftbarot from `u_masstr_vint` (taking into account the mutliplication by rau0). What do you think? I will try in any case.
