# preiceDt is giving me random values

**URL:** <https://precice.discourse.group/t/preicedt-is-giving-me-random-values/1974>\
**Category:** Using preCICE\
**Created:** [June 19, 2024, 5:40pm UTC](https://precice.discourse.group/t/preicedt-is-giving-me-random-values/1974 "2024-06-19T17:40:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abbas\_Ballout](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/abbas_ballout/32/2340_2.png) [@Abbas\_Ballout](https://precice.discourse.group/u/Abbas_Ballout)\
**Post date:** [June 19, 2024, 5:40pm UTC](https://precice.discourse.group/t/preicedt-is-giving-me-random-values/1974/1 "2024-06-19T17:40:22Z")

</div>

I am trying to replicate the perpendicular flap tutorial. I am using the dealii adapter srtiagh of the of box for the structural part.  
As for the fluid part, I am trying to interface with another solver which is written in fortran. I am not passing any forces or displacements between both solvers and my changes are minimal but  
A)  
whenver I querry for the max time step with:

```fortran
         CALL precicef_get_max_time_step_size(preciceDt)

```

I get random numbers which are either close to zero or very large.

B) I am ignoring this value and just progressing with my fluid solver with a small constant time step. At some point later precice aborts and I get this error:

- 

> "The time step size given to preCICE in “advance” 6e-06 exceeds the maximum allowed time step size 4.000000000000097e-06 in the remaining of this time window. Did you restrict your time step size, “dt = min(preciceDt, solverDt)”

- 

How is this value calculated? I can’t chose the minimum between the solver and precice’s time step because preciceDt as I explained above is just giving weird values.

[horses\_output.txt](https://precice.discourse.group/uploads/short-url/qrVA3aEttZcta7zA77loY0vmOUV.txt) (38.9 KB)  
[dealii\_output.txt](https://precice.discourse.group/uploads/short-url/kLJhO77BL5QvHqhgQqkfm7BJ3V1.txt) (1.0 KB)  
[precice-config.xml](https://precice.discourse.group/uploads/short-url/vQWa9t5HSXJYpMkG517DYTNSflX.xml) (1.8 KB)

---

<div class="post-metadata">

**Author:** ![Ray\_Scarr](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ray_scarr/32/980_2.png) [@Ray\_Scarr](https://precice.discourse.group/u/Ray_Scarr)\
**Post date:** [June 21, 2024, 4:51pm UTC](https://precice.discourse.group/t/preicedt-is-giving-me-random-values/1974/2 "2024-06-21T16:51:20Z")

</div>

Your Fortran compiler may be assuming a different endianness than the compiler you used to build preCICE. Also check that `preciceDt` is declared in your fluid solver as `REAL(KIND=C_DOUBLE)` where `C_DOUBLE` comes from the intrinsic `ISO_C_BINDING` module.

---

<div class="post-metadata">

**Author:** ![fsimonis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/fsimonis/32/6_2.png) [@fsimonis](https://precice.discourse.group/u/fsimonis)\
**Post date:** [June 24, 2024, 8:23am UTC](https://precice.discourse.group/t/preicedt-is-giving-me-random-values/1974/3 "2024-06-24T08:23:19Z")

</div>

Hi,

This looks very odd. If the comment from @Ray_Scarr doesn’t solve your issue, could you please let us know the following:

- OS Distribution ( `lsb_release -a`) and Architecture (`uname -m` )
- preCICE version
- method of installation (Debian package, spack, source-build)
- for source builds the configuration used
- compilers used and their versions
- can you reproduce this behaviour with the [Fortran solverdummy](https://github.com/precice/precice/tree/develop/examples/solverdummies/fortran)?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [July 1, 2024, 5:03pm UTC](https://precice.discourse.group/t/preicedt-is-giving-me-random-values/1974/4 "2024-07-01T17:03:27Z")

</div>

Closed on July 1, 2024, 5:03pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
