# Error while running ./run.mgn2mech.v31.csh (MEGAN v3.1)

**URL:** <https://forum.cmascenter.org/t/error-while-running-run-mgn2mech-v31-csh-megan-v3-1/5088>\
**Category:** MEGAN\
**Created:** [July 20, 2024, 6:58am UTC](https://forum.cmascenter.org/t/error-while-running-run-mgn2mech-v31-csh-megan-v3-1/5088 "2024-07-20T06:58:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cynthia](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@Cynthia](https://forum.cmascenter.org/u/Cynthia)\
**Post date:** [July 20, 2024, 6:58am UTC](https://forum.cmascenter.org/t/error-while-running-run-mgn2mech-v31-csh-megan-v3-1/5088/1 "2024-07-20T06:58:55Z")

</div>

Dear all

I’ve successfully run and compiled other steps of MEGAN, but I’m encountering a segmentation fault when running `./run.mgn2mech.v31.csh` in the final step. My `wrfout_d03` file is 346.40MB, so it’s not excessively large in size.  
Why might this overflow be happening during execution?

Cynthia

 ![微信图片_20240720145823](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/7/76e5829adc66c572588dd1486089a0d2f556a255.png)

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 21, 2024, 4:34pm UTC](https://forum.cmascenter.org/t/error-while-running-run-mgn2mech-v31-csh-megan-v3-1/5088/2 "2024-07-21T16:34:48Z")

</div>

To get more detail about where this is happening (which is the start of tracing this down), you might try re-compiling using the flags from one of the I/OI API debug types – i.e., flags from the _ioapi/Makeinclude.\*dbg_ appropriate for your compiler-set.

---

<div class="post-metadata">

**Author:** ![Cynthia](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@Cynthia](https://forum.cmascenter.org/u/Cynthia)\
**Post date:** [July 22, 2024, 12:07pm UTC](https://forum.cmascenter.org/t/error-while-running-run-mgn2mech-v31-csh-megan-v3-1/5088/3 "2024-07-22T12:07:48Z")

</div>

I have tried changing different cases, recompiling IOAPI, and switching compilers, but none have resolved the issue (see error message in ‘log.txt’ below).

Additionally, when running ./make\_all\_programs.scr 64bit, I encounter many WARNINGs (see ‘make\_all\_programs.scr-WARNING.txt’ file below). Since there are many warnings and they do not affect the output, I have not made any modifications.

I’m unsure if this step could impact the segmentation fault I’m experiencing.

Thank you for your help

Cynthia

[log.txt](https://forum.cmascenter.org/uploads/short-url/mP4GwRydccOIA8QiIWgAWQYlXPP.txt) (56.7 KB)  
[make\_all\_programs.scr-WARNING.txt](https://forum.cmascenter.org/uploads/short-url/eTtGTLY3rXa1hTIqUVjbtt1WmoO.txt) (221.1 KB)

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 22, 2024, 1:12pm UTC](https://forum.cmascenter.org/t/error-while-running-run-mgn2mech-v31-csh-megan-v3-1/5088/4 "2024-07-22T13:12:13Z")

</div>

I repeat: Let’s find out where this is happening. Compile everything using the flags from _ioapi/Makeinclude.Linux2\_x86\_64gfortdbg_:

`-g -m64 -fbacktrace -Wsurprising -fbounds-check -finit-real=snan -ffpe-trap=invalid,zero,overflow`

That way, we’ll at least have some idea **where the segfault is coming from**
