CMAQ 5.4 - CCTM_BUDGET_v54 Error

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

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.

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”

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?

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 (47.4 KB)
run_cctm_c2_54_ddm.csh (40.7 KB)

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}

Thank you, this resolved the issue