# 'netCDF error number -40' when running onroad\_ca\_adj sectors

**URL:** <https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956>\
**Category:** SMOKE\
**Tags:** smoke\
**Created:** [August 8, 2025, 3:17pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956 "2025-08-08T15:17:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 8, 2025, 3:17pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/1 "2025-08-08T15:17:59Z")

</div>

Hi everyone,

I am attempting to compile NEI2020 using SMOKEv5.0 and am running into issue compiling the onroad\_ca\_adj sectors, specifically RPD/RPHO/RPP/RPV. Every other sector, including all the other onroad ones, compile successfully.

When running onroad\_ca\_adj/RPHO, for example. I get the error ‘netCDF error number -40’ in the m3stat step after opening the file and reading in the pollutant variables. I am attaching one of the m3stat logs below as an example.

[Untitled.txt](https://forum.cmascenter.org/uploads/short-url/1Iodee3oaROW8vzJQ6wTmpciZFX.txt) (6.7 KB)

Thank you in advance for the help.

---

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 8, 2025, 3:29pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/2 "2025-08-08T15:29:30Z")

</div>

From the output of the onroad/RPHO I think the error is somewhere here":

Value for PROMPTFLAG: N returning FALSE

Using default 2020001

Using default 0

\*\*\*Using default 0

netCDF error number -40

Where the \*\*\* should be “Using default 24000” according to onroad/RPHO. But I am unsure how to solve this.

---

<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:** [August 8, 2025, 4:07pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/3 "2025-08-08T16:07:23Z")

</div>

See the I/O API “troubleshooting” page on this topic: [https://cjcoats.github.io/ioapi/ERRORS.html#ncferr](https://cjcoats.github.io/ioapi/ERRORS.html#ncferr)

> I get “netCDF error -40”  
> Probably means you tried to read data past the last date-and-time on the file (the I/O API runs netCDF in “verbose mode”, so that netCDF will always print all error messages, including this one. Also can happen when the calling program is running in parallel, but a non-MP-enabled version of the I/O API library was linked in.

---

<div class="post-metadata">

**Author:** ![james.beidler](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@james.beidler](https://forum.cmascenter.org/u/james.beidler)\
**Post date:** [August 8, 2025, 5:03pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/4 "2025-08-08T17:03:15Z")

</div>

You do not appear to have any time steps in the RPHO file:

```auto
Maximum current record number 0

```

Can you verify that movesmrg and m3xtract ran correctly for that day?

---

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 11, 2025, 1:53pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/5 "2025-08-11T13:53:53Z")

</div>

@james.beidler Yes, I get the program to output the emis\_moles files, but there is no data within them. I see the movesmrg log files, but no log files from m3extract. So it seems like none of them ran correctly. I am attaching a log file from movesmrg for reference.

Mainly just confused because the CONUS onroad sectors were totally fine when running them. I would’ve imagined the onroad\_ca\_adj programs would be almost the same…

[movesmrg\_RPHO\_onroad\_ca\_adj\_jan\_2020ha2\_cb6\_20k\_20200101\_12US1\_cmaq\_cb6ae7.txt](https://forum.cmascenter.org/uploads/short-url/dxsfXa9yPTFk9pVn4SUw0q5rZsB.txt) (1.5 MB)

---

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 11, 2025, 2:01pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/6 "2025-08-11T14:01:31Z")

</div>

@cjcoats Thank you for this advice! I think it is an issue with the dates, but I am not sure how to resolve my issue with this advice, though. I am only trying to run a single month (January) and have the dates set correctly in Monthly\_onroad\_ca\_adj\_RPHO\_daily\_12US1\_2020ha2\_cb6\_20k.csh. The CONUS onroad sectors work completely fine. I am not trying to run an MP-enabled I/O API version either. Any further advice would be greatly appreciated! Thank you!

---

<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:** [August 11, 2025, 3:36pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/7 "2025-08-11T15:36:04Z")

</div>

You mentioned that the Movesmrg log stops abruptly without an error message, which we assume means it gave a segmentation fault.

- You mentioned issues with onroad\_ca\_adj RPD/RPHO/RPP/RPV; does that mean onroad\_ca\_adj RPH and RPS worked correctly and produced emissions?

- Could you provide the January 1 Movesmrg logs for all rates (RPD, RPP, etc) for both onroad and onroad\_ca\_adj?

---

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 11, 2025, 4:31pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/8 "2025-08-11T16:31:35Z")

</div>

@eyth.alison I get error messages and a “Error termination: Backtrace” message as well. The output to the terminal for is full of error messages. I attached that output for onroad\_ca\_adj/RPV below. They all have the same failure output so one should suffice. I get “cfpro” errors, which are not fatal, and then the fatal errors later on.

[ca\_adj\_RPV.out.txt](https://forum.cmascenter.org/uploads/short-url/u2SJSbmDvq9XjNIIyx1SNnSZ4Pm.txt) (227.0 KB)

You are correct, onroad\_ca\_adj/RPH and RPS work totally fine and produced emission files with non-zero values for all variables. The onroad\_ca\_adj /RPD script will produce a file for Jan. 1 but all the emission values are zero and stops running after that. The other onroad\_ca\_asj scripts will produce emissions files for each day, but there are no variables for emissions – just header information mainly. I am attaching all those files below. I changed the names to be easier to follow.

It is almost certainly something to do with the times. It looks like the month variable is getting lost somewhere, but I do not know why.

[ca\_adj\_RPV.out.txt](https://forum.cmascenter.org/uploads/short-url/u2SJSbmDvq9XjNIIyx1SNnSZ4Pm.txt) (227.0 KB)

[onroad\_ca\_adj\_RPH.txt](https://forum.cmascenter.org/uploads/short-url/hLNLeJ89Ms6txVpqSum7xgyPp2Z.txt) (868.7 KB)

[onroad\_ca\_adj\_RPS.txt](https://forum.cmascenter.org/uploads/short-url/dhzqdZdNdu1K6vPwlaYa9b7h4UH.txt) (2.8 MB)

[onroad\_ca\_adj\_RPV.txt](https://forum.cmascenter.org/uploads/short-url/NyLdGMlVUAgfgFIUH553N1JDFK.txt) (2.8 MB)

[onroad\_ca\_adj\_RPP.txt](https://forum.cmascenter.org/uploads/short-url/5953enm57oqcuJ1OZ2gKda3V61f.txt) (3.3 MB)

[onroad\_ca\_adj\_RPHO.txt](https://forum.cmascenter.org/uploads/short-url/mKGFfuwyvTqHuEshMi25ROxssxF.txt) (1.5 MB)

[onroad\_RPH.txt](https://forum.cmascenter.org/uploads/short-url/2We5Qk3YZAHaM5nJLHw1oIS4nV1.txt) (1.1 MB)

[onroad\_RPHO.txt](https://forum.cmascenter.org/uploads/short-url/zebIDPHOVlbCiQzUJQl6HaFHHSB.txt) (935.5 KB)

[onroad\_RPP.txt](https://forum.cmascenter.org/uploads/short-url/sgrzBzEeAlX9aTrvhmGye6m1myw.txt) (1.7 MB)

[onroad\_RPV.txt](https://forum.cmascenter.org/uploads/short-url/4QUUNWCOvKVitGEYKPuV5Qvlo2Y.txt) (1.1 MB)

[onroad\_RPS.txt](https://forum.cmascenter.org/uploads/short-url/q6Mf7wFNf6z3tsaZxf0fVzWlc3z.txt) (970.7 KB)

[onroad\_RPD.txt](https://forum.cmascenter.org/uploads/short-url/a7LGvsBp5WJwTZsFlfcYLk8o16S.txt) (2.3 MB)

---

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 11, 2025, 5:43pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/9 "2025-08-11T17:43:05Z")

</div>

@eyth.alison I took a look at the environment differences between the onroad\_RPHO and onroad\_ca\_adj\_RPHO, and I noticed a difference between the “USE\_CONTROL\_FACTORS”, where onroad has it set to “N” and onroad\_ca\_adj has it set to “Y”. I imagine this is the separation between the CFPRO on and off. I changed it to “N” for onroad\_ca\_adj\_RPHO, and that seems to produce the output I needed. If this is indeed turning off the adjustment factors, then it is related to that. If not, then that change worked and I will proceed on generating the other sectors with this same change.

---

<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:** [August 11, 2025, 8:15pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/10 "2025-08-11T20:15:44Z")

</div>

Yes, you are turning off the control factor application when you set that value to N, but good to know that it made output. We are wondering what version of SMOKE you are using? Can you try rerunning with the recently released v5.2? There was a bug fix included that may resolve this issue.

---

<div class="post-metadata">

**Author:** ![shejil17](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shejil17](https://forum.cmascenter.org/u/shejil17)\
**Post date:** [August 12, 2025, 2:48pm UTC](https://forum.cmascenter.org/t/netcdf-error-number-40-when-running-onroad-ca-adj-sectors/5956/11 "2025-08-12T14:48:43Z")

</div>

I am using v5.1. I will try to recompile with v5.2 and I will let you know how that goes.
