# \[NEC\] Wrong time indexing while using \`ln\_apr\_dyn\` with monthly forcing

**URL:** <https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96>\
**Category:** Versions\
**Tags:** arch, SBC\
**Created:** [29 June 2021 13:18 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96 "2021-06-29T13:18:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![janna](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@janna](https://nemo-ocean.discourse.group/u/janna)\
**Post date:** [29 June 2021 13:18 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/1 "2021-06-29T13:18:05Z")

</div>

Dear all,

I’m using NEMO r4.0.2 as a stand alone model forced by monthly atmospheric files with time frequency of 1h. The input files have different length, for example with number of records = 672 in February and 744 in March.

When using monthly input file for atmospheric pressure (PRES) and `ln_apr_dyn = .true.`, the `namsbc_apr` section in the _namelist\_cfg_ looks like:

 ![namsbc_apr](https://global.discourse-cdn.com/free1/uploads/nemo_ocean/original/1X/fc8fef25f04176ad2e9d31910f47f7f339542696.png)

During the run time, following error encounters:

```auto
 ===>>> : E R R O R
         ===========

           iom_get_123d, file: NFORC/PRES_y2018m03.nc, var: PRES
 start and count too big regarding to the size of the data,
 (istart(3) + icnt(3) - 1) = 645
  is larger than idimsz(3) = 644

```

The time index of the previous month instead of the current month is used.

It seems that the file containing PRES variable for the previous month is opened for the initialization, but never closed after getting the first information.

Does someone of you use monthly atmopsheric forcing files and was having similar troubles with the time indexing and may have a hint how to solve this?

Kind regards,  
Janna

---

<div class="post-metadata">

**Author:** ![janna](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@janna](https://nemo-ocean.discourse.group/u/janna)\
**Post date:** [1 July 2021 14:09 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/2 "2021-07-01T14:09:03Z")

</div>

This behaviour seems to occur using the NEC (nfort) compiler.  
Using intel mpiifort the time stepping seems fine.

---

<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 July 2021 14:40 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/3 "2021-07-01T14:40:21Z")

</div>

Hei Janna,

So the very same thing does not happen on a different platform ?

/robinson

---

<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:** [1 July 2021 16:26 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/4 "2021-07-01T16:26:44Z")

</div>

Which value do you have for `nn_leapy`?

---

<div class="post-metadata">

**Author:** ![janna](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@janna](https://nemo-ocean.discourse.group/u/janna)\
**Post date:** [2 July 2021 08:02 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/5 "2021-07-02T08:02:01Z")

</div>

Hi Robinson,  
you got it right, it doesn’t happen on a different platform (x86 host for the NEC vector machine).

One question for all:  
is NEMO code tested on a vector machine like NEC?

Cheers,  
Janna

---

<div class="post-metadata">

**Author:** ![janna](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@janna](https://nemo-ocean.discourse.group/u/janna)\
**Post date:** [2 July 2021 08:06 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/6 "2021-07-02T08:06:20Z")

</div>

Hi,  
`nn_leapy` is 1, leap years are taken into account.  
To clarify the example, the time step is always wrong in the months after the shorter ones, like April/May, June/July, September/October, November/December.

---

<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:** [2 July 2021 08:10 UTC](https://nemo-ocean.discourse.group/t/nec-wrong-time-indexing-while-using-ln-apr-dyn-with-monthly-forcing/96/7 "2021-07-02T08:10:31Z")

</div>

I know there is some benchmark with nemo on NEC but I am not aware of any real usage…
