# Gfortran Nemo + Drakkar + SI3 compilation

**URL:** <https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556>\
**Category:** v4.0.x\
**Created:** [22 August 2023 12:54 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556 "2023-08-22T12:54:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![avemelan](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@avemelan](https://nemo-ocean.discourse.group/u/avemelan)\
**Post date:** [22 August 2023 12:54 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556/1 "2023-08-22T12:54:14Z")

</div>

Hello. We have working configuration for the North Antlantic region with Drakkar + Nemo + SI3 compiled with Intel compilers on Intel CPU. We also run this configuration inside Docker container. We recently bought new machine with AMD processor and decided to go for GNU compilers… Problem number 1 was that namelists from intel compiled model were uncompatible. We had to put ‘’ around some strings in namelists in order to run compiled model. Next problem - numerous allocation and segmentation errors in runtime. For example -

double free or corruption (out)

Program received signal SIGABRT: Process abort signal.

Or like this:  
Backtrace for this error:

#0 0x14610e090960 in ???

#1 0x14610e08fac5 in ???

#2 0x14610dc8351f in ???

#3 0x14610dcd7a7c in ???

#4 0x14610dc83475 in ???

#5 0x14610dc697f2 in ???

#6 0x14610dcca6f5 in ???

#7 0x14610dce1d7b in ???

#8 0x14610dce3ac3 in ???

#9 0x14610dce64d2 in ???

#10 0x5650a81cad37 in \_\_zpshde\_MOD\_zps\_hde

at /base/nemo/WBARKA12-AMD1/cfgs/BARKA12-AMD1/BLD/ppsrc/nemo/zpshde.f90:117

I used gfortran base arch from your repo… What will you recommend to try in order to debug this?

---

<div class="post-metadata">

**Author:** ![avemelan](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@avemelan](https://nemo-ocean.discourse.group/u/avemelan)\
**Post date:** [22 August 2023 13:04 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556/2 "2023-08-22T13:04:53Z")

</div>

Will provide everything you need - just name it.  
Our NEMO version is 4.0.6

---

<div class="post-metadata">

**Author:** ![Saeed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Saeed](https://nemo-ocean.discourse.group/u/Saeed)\
**Post date:** [22 August 2023 17:54 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556/3 "2023-08-22T17:54:42Z")

</div>

Hello.  
Very interesting that you try gfortran. What is your optimization flag? Have you compiled with O0?

---

<div class="post-metadata">

**Author:** ![avemelan](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@avemelan](https://nemo-ocean.discourse.group/u/avemelan)\
**Post date:** [23 August 2023 07:52 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556/4 "2023-08-23T07:52:12Z")

</div>

FCFLAGS -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer -ffree-line-length-none

Used it as a baseline, tried whole bunch of other flags, mostly debug. Yes, we tried -O0.

gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

---

<div class="post-metadata">

**Author:** ![Saeed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Saeed](https://nemo-ocean.discourse.group/u/Saeed)\
**Post date:** [23 August 2023 17:52 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556/5 "2023-08-23T17:52:09Z")

</div>

Hello

Yes i see. As far as i remember there were some out of bounds error in nemo which can be ignored by ifort compiler and i guess not by gfortran by default. did you try these flags:

sanitize=address  
fcheck=bounds

Best

Saeed

---

<div class="post-metadata">

**Author:** ![avemelan](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@avemelan](https://nemo-ocean.discourse.group/u/avemelan)\
**Post date:** [24 August 2023 12:00 UTC](https://nemo-ocean.discourse.group/t/gfortran-nemo-drakkar-si3-compilation/556/6 "2023-08-24T12:00:54Z")

</div>

Added these two flags. Something definetly changed, now I have segfault without backtrace and error in ocean.output.\*.ABORT.
