# CMAQ 5.4 - CCTM\_BUDGET\_v54 Error

**URL:** <https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661>\
**Category:** CMAQ\
**Created:** [October 25, 2022, 10:07pm UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661 "2022-10-25T22:07:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SharMM](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@SharMM](https://forum.cmascenter.org/u/SharMM)\
**Post date:** [October 25, 2022, 10:07pm UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/1 "2022-10-25T22:07:36Z")

</div>

I get the following error when running CMAQ 5.4, any clue what could be problem.

At line 152 of file budget\_defn.F (unit = 93)  
Fortran runtime error: Cannot open file ‘/CCTM\_BUDGET\_v54\_gcc\_20171221.txt’: Permission denied

---

<div class="post-metadata">

**Author:** ![hogrefe.christian](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hogrefe.christian](https://forum.cmascenter.org/u/hogrefe.christian)\
**Post date:** [October 26, 2022, 12:04am UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/2 "2022-10-26T00:04:56Z")

</div>

How are CTM\_BUDGET and OUTDIR defined in your run script? The default run script defines CTM\_BUDGET as “$OUTDIR/CCTM\_BUDGET\_${CTM\_APPL}.txt -v”. If that’s what you’re using, your error message suggests $OUTDIR may be undefined, so budget\_defn.F would then try to create the budget output file at the root level for which you likely don’t have write permission.

---

<div class="post-metadata">

**Author:** ![SharMM](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@SharMM](https://forum.cmascenter.org/u/SharMM)\
**Post date:** [October 26, 2022, 3:49pm UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/3 "2022-10-26T15:49:51Z")

</div>

Thanks for your quick response. I am using the default script setting. $OUTDIR is defined and the program creates other files (such as CCTM\_ACONC etc.) in this directory.  
Also, I tried commenting out CTM\_BUDGET , still it gives me the same error. Please advise  
#setenv CTM\_BUDGET “OUTDIR/CCTM\_BUDGET\_{CTM\_APPL}.txt -v”

---

<div class="post-metadata">

**Author:** ![hogrefe.christian](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hogrefe.christian](https://forum.cmascenter.org/u/hogrefe.christian)\
**Post date:** [October 26, 2022, 4:05pm UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/4 "2022-10-26T16:05:39Z")

</div>

Thanks for checking your run script for these settings. A few more follow-up questions:

Are you encountering this error when running the benchmark case or when running a case you have configured? If it’s the latter, were you able to successfully run the benchmark case before configuring your own simulation?

Could you please post the full run script and log file?

---

<div class="post-metadata">

**Author:** ![SharMM](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@SharMM](https://forum.cmascenter.org/u/SharMM)\
**Post date:** [October 26, 2022, 9:48pm UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/5 "2022-10-26T21:48:33Z")

</div>

This is for a case which i have configured. I have not yet tried running the benchmark case, I will do that.  
Here are the run and log files.  
[CTM\_LOG\_000.v54\_gcc\_c1\_c2\_4km\_20171221.txt](https://forum.cmascenter.org/uploads/short-url/qUUp3YltZleA2vJNiwh40PelK7W.txt) (47.4 KB)  
[run\_cctm\_c2\_54\_ddm.csh](https://forum.cmascenter.org/uploads/short-url/jtrYEjaEuE5jgtgSdYHsf1RpzW3.csh) (40.7 KB)

---

<div class="post-metadata">

**Author:** ![hogrefe.christian](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hogrefe.christian](https://forum.cmascenter.org/u/hogrefe.christian)\
**Post date:** [October 26, 2022, 11:19pm UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/6 "2022-10-26T23:19:06Z")

</div>

Thank you. Yes, please try running the benchmark case to see if you encounter this problem there, too, but I think I see the problem now.

Your modified run script uses `set OUTDIR = ${PROJ_DIR}/outputs` rather than `setenv OUTDIR ${PROJ_DIR}/outputs`. Looking at the code in RUNTIME\_VARS.F and budget\_defn.F, both OUTDIR and APPL\_NAME need to be defined as environment variables rather than just run script variables for budget\_defn.F to successfully open the ASCII output file (unless you have root write permission). This is the line in budget\_defn.F that constructs the file name `BDG_FILE = TRIM(OUTDIR) // "/CCTM_BUDGET_" // TRIM(APPL_NAME) // ".txt"`, and in your case `TRIM(OUTDIR)` would just be blank. The benchmark run script should work because it uses `setenv OUTDIR ${CMAQ_DATA}/output_CCTM_${RUNID}`

---

<div class="post-metadata">

**Author:** ![SharMM](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@SharMM](https://forum.cmascenter.org/u/SharMM)\
**Post date:** [October 27, 2022, 1:07am UTC](https://forum.cmascenter.org/t/cmaq-5-4-cctm-budget-v54-error/3661/7 "2022-10-27T01:07:38Z")

</div>

Thank you, this resolved the issue
