# MEGAN 3.1 Error While Running run.mgn2mech.v31.csh

**URL:** <https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018>\
**Category:** MEGAN\
**Tags:** emissions\
**Created:** [March 27, 2023, 7:27am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018 "2023-03-27T07:27:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Hu](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@Jason\_Hu](https://forum.cmascenter.org/u/Jason_Hu)\
**Post date:** [March 27, 2023, 7:27am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/1 "2023-03-27T07:27:40Z")

</div>

Dear all,

I failed running the mgn2mech in MEGAN v3.1. It didn’t show any error message when running mgn2mech, only showing these as follows. More details could be seen in log.txt.  
[log.txt](https://forum.cmascenter.org/uploads/short-url/s9zFudvQLwSEKgRoC7zl4lGOwYK.txt) (57.4 KB)

forrtl: severe (174): SIGSEGV, segmentation fault occurred  
Image PC Routine Line Source  
mgn2mech 0000000000565804 Unknown Unknown Unknown  
libpthread-2.17.s 00002B925D5F55E0 Unknown Unknown Unknown  
mgn2mech 0000000000405BBA Unknown Unknown Unknown  
mgn2mech 000000000040309E Unknown Unknown Unknown  
libc-2.17.so 00002B925D823C05 \_\_libc\_start\_main Unknown Unknown  
mgn2mech 0000000000402FA9 Unknown Unknown Unknown

---

<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:** [March 27, 2023, 11:28am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/2 "2023-03-27T11:28:52Z")

</div>

All of those "Unknown"s aren’ very informative – just that something is happening in `mgn2mech`, but not where.

To get more information, re-compile everything for traceback – use flags borrowed from the appropriate I/O API \*Makeinclude._dbg_ to see how to do this.

---

<div class="post-metadata">

**Author:** ![xuan](https://avatars.discourse-cdn.com/v4/letter/x/a87d85/32.png) [@xuan](https://forum.cmascenter.org/u/xuan)\
**Post date:** [September 27, 2023, 6:37am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/3 "2023-09-27T06:37:25Z")

</div>

Hi,  
I had the same problem as you, could you please help me if you solved it now?

---

<div class="post-metadata">

**Author:** ![Jason\_Hu](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@Jason\_Hu](https://forum.cmascenter.org/u/Jason_Hu)\
**Post date:** [September 27, 2023, 6:59am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/4 "2023-09-27T06:59:32Z")

</div>

no, can’t solve it yet. I’m trying to use mega2.1

---

<div class="post-metadata">

**Author:** ![xuan](https://avatars.discourse-cdn.com/v4/letter/x/a87d85/32.png) [@xuan](https://forum.cmascenter.org/u/xuan)\
**Post date:** [September 27, 2023, 7:40am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/5 "2023-09-27T07:40:22Z")

</div>

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![FengLiu](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@FengLiu](https://forum.cmascenter.org/u/FengLiu)\
**Post date:** [September 27, 2023, 8:49pm UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/6 "2023-09-27T20:49:45Z")

</div>

Jason,

I’m curious if the issue has indeed been resolved. If not, please make the following modifications to the program in the file mgn2mech.F:

1. In line 161, replace “nmpsp” with “s”.

2. In line 168, also replace “nmpsp” with “s”.

After making these changes, recompile the package and then try running the program again. This should address the bug. BTW, you may move on to MEGANv3.2.

```
       tmper(nmpsp,:,:) = inper(nmpmg,:,:) * EF(nmpmg,:,:)
 & * effs_all(nmpsp)

     ELSEIF ( nmpmg .EQ. INO ) then

```

!!-----------------NO Stuff-----------------------  
IF ( .NOT. BDSNP\_YN ) THEN  
! GAMNO is emission activity factor  
tmper(nmpsp,:,🙂 = GAMNO(:,🙂 \* EF(INO,:,🙂  
& \* effs\_all(nmpsp)

---

<div class="post-metadata">

**Author:** ![Starry](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Starry](https://forum.cmascenter.org/u/Starry)\
**Post date:** [November 16, 2023, 8:37am UTC](https://forum.cmascenter.org/t/megan-3-1-error-while-running-run-mgn2mech-v31-csh/4018/8 "2023-11-16T08:37:19Z")

</div>

Hi Jason\_Hu  
Do you have input files for MEGAN3.1 preprocessor? It says I don’t have access to the file in google driver and I need these files to run MEGAN3.1 preprocessor. Thank you.
