# Segmentation fault of running ptfire3d

**URL:** <https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514>\
**Category:** SMOKE\
**Created:** [July 16, 2021, 8:08pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514 "2021-07-16T20:08:44Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 3, 2021, 1:36pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/43 "2021-08-03T13:36:31Z")

</div>

Is there a reason why you didn’t use the precompiled executables that come with the NEI platform package but compiled your own? Incomparability? If you can still use them on your server, please use the precompiled laypoint program you downloaded with the platform package to see whether this addresses the issue or not.

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 3, 2021, 4:15pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/44 "2021-08-03T16:15:58Z")

</div>

I can’t use the precompiled model cause my system can only run large job with the program that compiled with gfortran while the pre-compile executables are compiled by the intel. I didn’t modify the source code but only switch to gfortran to compile the executable.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 3, 2021, 5:48pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/45 "2021-08-03T17:48:40Z")

</div>

So none of months are running with your own Laypoint? Can you give a run for other months and let know?

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 3, 2021, 5:59pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/46 "2021-08-03T17:59:57Z")

</div>

I run July and August but none of them is successed. I am now thinking you probably correct that the executable I generated may be the problem. I tried the pre-compiled executable and some premerged outputs are generated (I can’t run the whole program with the precompiled executable but I test it for a while). However I can find the source code in the 2016 platform so I am not able to compile the executable by myself now. Do you happen to know where can I find the source codes for the executables? I am now using SMOKE v 4.8. I assume some source codes might be modified in the pre-compiled version.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 3, 2021, 6:31pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/47 "2021-08-03T18:31:30Z")

</div>

I do not think we can confirm that it is a source code bug. Before we confirm, please go ahead run for other months to see any first day of month will run Laypoint successfully. If your domain covers the US, there should be at least one fire in first day of each month. If none of dates are running laypoint successfully, we can say that your executable has an issue.  
Also, pleaser send me your Laypoint and grdmat log files as well as the header line of your METCRO3D file from MCIP for me to check the model domain consistency.

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 3, 2021, 7:06pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/48 "2021-08-03T19:06:38Z")

</div>

Thanks for suggestion. I run both July and August with my own generated executable from SMOKE v4.8 and the log files are attached. I use same script but with the pre-compiled executables from 2016 platform and successfully got some emis\_mole\_ptagfire3d\* under premerged directory. Thus why I assume could be some bug in the origin source code from SMOKE v 4.8.

I used my own domain that covers whole US. The domain setting is like the following:  
// global attributes:  
:IOAPI\_VERSION = “ioapi” ;  
:EXEC\_ID = "mcip " ;  
:FTYPE = 1 ;  
:CDATE = 2021201 ;  
:CTIME = 201541 ;  
:WDATE = 2021201 ;  
:WTIME = 201541 ;  
:SDATE = 2016183 ;  
:STIME = 0 ;  
:TSTEP = 10000 ;  
:NTHIK = 1 ;  
:NCOLS = 486 ;  
:NROWS = 384 ;  
:NLAYS = 30 ;  
:NVARS = 16 ;  
:GDTYP = 2 ;  
:P\_ALP = 33. ;  
:P\_BET = 45. ;  
:P\_GAM = -97. ;  
:XCENT = -97. ;  
:YCENT = 40. ;  
:XORIG = -2916000. ;  
:YORIG = -2304000. ;  
:XCELL = 12000. ;  
:YCELL = 12000. ;  
:VGTYP = 7 ;  
:VGTOP = 5000.f ;  
:VGLVLS = 1.f, 0.996f, 0.99f, 0.983f, 0.97f, 0.954f, 0.934f, 0.909f, 0.88f, 0.845f, 0.807f, 0.765f, 0.719f, 0.672f, 0.622f, 0.571f, 0.507f, 0.444f, 0.38f, 0.324f, 0.273f, 0.228f, 0.188f, 0.152f, 0.121f, 0.093f, 0.069f, 0.048f, 0.029f, 0.014f, 0.f ;  
:GDNAM = "US\_12km\_CROSS " ;  
[grdmat\_ptagfire3D\_2016fh\_16j\_US\_12km.log.txt](https://forum.cmascenter.org/uploads/short-url/q5z89EmamBlLKu1Ht70aVGvCvoU.txt) (18.2 KB)  
[laypoint\_ptagfire3D\_aug\_2016fh\_16j\_20160801\_US\_12km.log.txt](https://forum.cmascenter.org/uploads/short-url/3zXMwRWf2EzugMEDHO0zY9W0GR1.txt) (21.8 KB)

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 5, 2021, 4:29pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/49 "2021-08-05T16:29:58Z")

</div>

I thought you were not able to run precompiled executables from 2016 platform on your server. If you were able run them successfully and generate the “emis\_mole\_ptagfire3d.\*.ncf” files, there could be some incompatibility issues in SMOKE code with gfortran.  
In this case, I would strongly suggest for you to keep using the precompiled executables from 2016 platform package. If that is still not an option, please recompile the 2016 platform original SMOKE source codes with the gfortran initialization flag “-finit-local-zero”. This flag option will initialize any un-initialized local variables to zero.

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 5, 2021, 5:01pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/50 "2021-08-05T17:01:15Z")

</div>

Thanks for your suggestion. I did add the flags in the make file when I compile smoke but still has the same error. Thus why I am thinking is it possible that I am not using same version of SMOKE as it provided in the 2016 platform. I am using v 4.8 and the precompiled version is v 4.7.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 5, 2021, 6:53pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/51 "2021-08-05T18:53:12Z")

</div>

I have attached the precompiled SMOKE v4.8.1 with gfortran for you. Let me know whether this resolves your issue or not.

[https://drive.google.com/drive/folders/1rHfjtmlB2iu5y7n3zC48Yno13IOyDr5t?usp=sharing](https://drive.google.com/drive/folders/1rHfjtmlB2iu5y7n3zC48Yno13IOyDr5t?usp=sharing)

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 5, 2021, 7:23pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/52 "2021-08-05T19:23:17Z")

</div>

Thanks for your help. The model runs well using your pre-compiled executables and the emis\_mole\* outputs are generated.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 5, 2021, 7:24pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/53 "2021-08-05T19:24:23Z")

</div>

That is a wonderful news! Glad to hear that this resolves the issue. Please let me know if you have any further issues.

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 5, 2021, 7:38pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/54 "2021-08-05T19:38:25Z")

</div>

I am still wandering why the executable I compiled is not working. Have you made any modification on the source code or the makefile (except the -finit-local-zero)?

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 5, 2021, 7:41pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/55 "2021-08-05T19:41:31Z")

</div>

Nope I did not make any update to the code. I think it may be related to your gfortran setup/version. This issue could happen when there is a bug in some versions of compiler and/or the way it got setup in your server. That is why I decided to compile the codes with my gfortran to see whether this is a bug in the code or not. This proves that it is not a bug.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 5, 2021, 7:43pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/56 "2021-08-05T19:43:33Z")

</div>

BTW, you should add " -finit-local-zero" flag to Makeinclude file not to Makefile. Like this:

EFLAG = -finit-local-zero -ffixed-line-length-132 -fno-backslash # GNU Fortran

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 5, 2021, 7:43pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/57 "2021-08-05T19:43:44Z")

</div>

Oh I see. Thanks a lot for your help. Really appreciate your time.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [August 5, 2021, 7:54pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/58 "2021-08-05T19:54:22Z")

</div>

Can you give another try with updating Makeinclude file with the following flag? Just curious whether “-finit-local-zero” flag was the fix for all this instead of compiler issue.

EFLAG = -finit-local-zero -ffixed-line-length-132 -fno-backslash # GNU Fortran

---

<div class="post-metadata">

**Author:** ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)\
**Post date:** [August 5, 2021, 8:07pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/59 "2021-08-05T20:07:20Z")

</div>

Actually, I use the same EFLAG as you shown in last reply.

---

<div class="post-metadata">

**Author:** ![Jsward](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jsward](https://forum.cmascenter.org/u/Jsward)\
**Post date:** [March 4, 2022, 1:02am UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/60 "2022-03-04T01:02:08Z")

</div>

Hello @bbaek, I’ve run into a very similar string of errors trying to process the `ptertac` sector (replacement for ptegu sector) also for NEI 2016 v1. I’m using executables compiled on my machine mostly because we have GNU compilers (v9.3.1), but also because some folks at NYDEC let me know that `smkinven` reads in the ERTAC EGU data with a time shift, so they sent me a patch for that.

My errors followed a similar pattern through post #21, but adding

> [@bbaek](#):
>
> Add the following command in your run\_setting.txt input file:  
> all , $REGION\_ABBREV, smkreport, PART2, 0, 0, N

didn’t result in any change to the final error I’ve been facing, which remains related to the `COSTCY` file:

```auto
*******************************
* ERROR detected in logfile:
* /share/mzhang/jas983/emissions_data/nei_platform2016/v1/2016fh_16j/intermed/ptertac/logs/smkreport_ptertac_aug_2016fh_16j_temporal.log
*******************************
ERROR detected in Smkreport
ERROR: running QA & Smkreport for Temporal

```

Following this error to the `smkreport_ptertac_aug_2016fh_16j_temporal.log` I find:

```auto
File "COSTCY" opened for input on unit: 94
     /share/mzhang/jas983/emissions_data/nei_platform2016/v1/ge_dat/costcy_2016v1_platform_30jan2019_v0.txt

     Value for REPLABEL: 'ptertac_aug'
     Value for REPLABEL: 'ptertac_aug'
     Reading source data from inventory file...
     Generating unique lists from inventory data...
     Reading speciation matrices...
     Reading supplemental temporal file...
     
     *** ERROR ABORT in subroutine RDREPIN
     Number of variables in TSUP file is not supported.

```

This error occurred while using the Linux2\_x86\_64gfort\_mediumdbg version of both ioapi and smoke. However, I also downloaded the precompiled executables that you provided here:

> [@bbaek](#):
>
> I have attached the precompiled SMOKE v4.8.1 with gfortran for you. Let me know whether this resolves your issue or not.  
> [https://drive.google.com/drive/folders/1rHfjtmlB2iu5y7n3zC48Yno13IOyDr5t?usp=sharing](https://drive.google.com/drive/folders/1rHfjtmlB2iu5y7n3zC48Yno13IOyDr5t?usp=sharing)

but these resulted in a similar segmentation fault that I experienced with my own executables.

Thanks in advance for any advice you can provide!

[Annual\_ptertac\_daily\_summer\_12US2\_2016fh\_16j\_BM.csh](https://forum.cmascenter.org/uploads/short-url/heB0HX9psjmy8L1UU6jrO4uw4uZ.csh) (9.2 KB)  
[out\_ptertac\_summer.txt](https://forum.cmascenter.org/uploads/short-url/38jo14rPh1uQKy0BSSZawTUKPcS.txt) (10.5 KB)  
[rep\_logs\_ptertac\_2016fh\_16j\_12OTC2\_winter\_level1.csv](https://forum.cmascenter.org/uploads/short-url/8uyuQS6TLffHZGBDzmTC0f6kc0w.csv) (10.5 KB)  
[smkreport\_ptertac\_aug\_2016fh\_16j\_temporal.txt](https://forum.cmascenter.org/uploads/short-url/3NaAagIZJLLYPH6PkG6mEFMVBsw.txt) (15.9 KB)  
[temporal\_ptertac\_aug\_2016fh\_16j\_20160801.txt](https://forum.cmascenter.org/uploads/short-url/suw5rup39RCohIMDmbdf3PUsXtp.txt) (727.9 KB)

---

<div class="post-metadata">

**Author:** ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)\
**Post date:** [March 4, 2022, 1:52pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/61 "2022-03-04T13:52:02Z")

</div>

You’ll need to coordinate with someone familiar with running ERTAC emissions through SMOKE.

---

<div class="post-metadata">

**Author:** ![bbaek](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/bbaek/32/22_2.png) [@bbaek](https://forum.cmascenter.org/u/bbaek)\
**Post date:** [March 4, 2022, 3:03pm UTC](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514/62 "2022-03-04T15:03:55Z")

</div>

Based on the error message from Smkreport, there could be an inconsistency between the format of the temporal TSUP output file and the version of Smkreport program. TSUP format was updated a few years ago to enhance the quality of reports from Smkreport. To read this updated TSUP file properly, you also need an updated Smkreport program.  
You will find out the version of SMOKE if you check the log files from Temporal and Smkreport programs. Ensure whether they are identical or not. If not, let me know which versions are used in both programs.

[Previous page](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514.md?page=2)

[Next page](https://forum.cmascenter.org/t/segmentation-fault-of-running-ptfire3d/2514.md?page=4)
