# Error when running ICON run script

**URL:** https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272
**Category:** CMAQ
**Created:** [February 2, 2020, 10:24am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272 "2020-02-02T10:24:19Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 2, 2020, 10:24am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/1 "2020-02-02T10:24:19Z")

</div>

Dear Sir, I have a error when I am running run\_icon.csh,the main error are as follow:

```
 Value for IOAPI_CHECK_HEADERS not defined;returning default: FALSE
 Error opening file at path-name:
 netCDF error number -51 processing file "INIT_CONC_1"
 NetCDF: Unknown file format
 NetCDF: Unknown file format
 /home/Downloads
 
 *** ERROR ABORT in subroutine OPN_IC_FILE
 Could not open nor create INIT_CONC_1 file

```

I wish you could help me to solve the problem!  
Thanks a lot!

`

---

<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: [February 2, 2020, 8:38pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/2 "2020-02-02T20:38:24Z")

</div>

This says that the alleged input-file is NOT a netCDF file. Or at least, not a netCDF file recognized by the version/configuration of netCDF that your ICON program is built with…

Was every netCDF-program you’re using built with the recommended netCDF configuration flags (see the I/O API installation manual section [https://cjcoats.github.io/ioapi/AVAIL.html#ncf4](https://cjcoats.github.io/ioapi/AVAIL.html#ncf4)?

`--disable-netcdf-4 --disable-dap`

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 3, 2020, 1:27pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/3 "2020-02-03T13:27:25Z")

</div>

This routine is creating a new output file. Did you set the environment variable INIT\_CONC\_1 to point to a valid path? Is there an already-existing output file with that name?

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 3, 2020, 1:46pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/5 "2020-02-03T13:46:20Z")

</div>

I had set the environment variable INIT\_CONC\_1 to point to a valid path,there isn’t an already-existing output file with that name.

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 3, 2020, 2:12pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/6 "2020-02-03T14:12:33Z")

</div>

Have you been able to run any other programs using the Models-3 I/O API? You need to determine whether the problem is specific to ICON or whether you are having a more general problem with your netCDF and IOAPI.

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 4, 2020, 1:58am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/8 "2020-02-04T01:58:46Z")

</div>

Thanks, I can run CCTM using Benchmark data and run mcip program successfully. I don’t know whether it means I can use Models-3 I/O API. Do you have any suggestions to check the problem of my netCDF and IOAPI?

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 4, 2020, 2:45am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/9 "2020-02-04T02:45:41Z")

</div>

That suggests your IOAPI is ok.  
What is the value of your INIT\_CONC\_1? Is it /home/Downloads? This environment variable needs to be a fully qualified filename (including the path), not merely a directory.  
If you still cannot get it to work, please post your run script.

Also, please confirm that you are using CMAQv5.3.1. You might also try doing a clean build of ICON.

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 4, 2020, 3:03am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/10 "2020-02-04T03:03:00Z")

</div>

Thanks. I have change it to a fully qualified path but it doesn’t work.  
The run scripts and log file are as follows:  
[run\_icon.txt](https://forum.cmascenter.org/uploads/short-url/nnwxHabQrrXRotQrKD2U11pj3mF.txt) (5.0 KB)  
[icon\_log.txt](https://forum.cmascenter.org/uploads/short-url/d8l0H1oHZguIlgZGH17QrK5ZOeG.txt) (14.0 KB)  
The version of my CMAQ is 5.3.

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 4, 2020, 1:41pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/11 "2020-02-04T13:41:53Z")

</div>

`OUTDIR` is pointing to `/home/zhouminghui/Downloads/outputfile`, the same as `INIT_CONC_1`. Right before execution, your script says:

`if ( ! -d "$OUTDIR" ) mkdir -p $OUTDIR`  
and that will make that filename a _directory_. You can’t then write a netCDF file with the same name.

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 5, 2020, 7:43am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/12 "2020-02-05T07:43:01Z")

</div>

So,do you mean that I should change the path of `OUTDIR` to other valid path?

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 5, 2020, 8:01am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/13 "2020-02-05T08:01:35Z")

</div>

Could you please give me some specific suggestions to me? Thanks a lot!

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 5, 2020, 1:17pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/14 "2020-02-05T13:17:35Z")

</div>

Change line 65 of your script so that OUTDIR is pointing to the “Downloads” directory rather than to thefile “outputfile”:

```
set OUTDIR = /home/zhouminghui/Downloads #> output file directory
```

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 5, 2020, 1:56pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/16 "2020-02-05T13:56:01Z")

</div>

Unfortunately ,I follow your step,but it doesn’t work. 😂

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 5, 2020, 3:58pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/17 "2020-02-05T15:58:00Z")

</div>

I just tried your script, and it works for me after updating the paths correctly. What error are you getting?  
Check to see that /home/zhouminghui/Downloads/outputfile does not exist before you run the script.

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 6, 2020, 1:14am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/19 "2020-02-06T01:14:10Z")

</div>

Thanks,I have change my path and run script again,the last lines of the logs are:

```auto
    Value for IOAPI_CHECK_HEADERS not defined;returning default: FALSE
 Value for IOAPI_OFFSET_64: YES returning TRUE
 Value for IOAPI_CFMETA not defined;returning default: FALSE
 Value for IOAPI_CMAQMETA not defined; returning defaultval ': 'NONE'
 Value for IOAPI_CMAQMETA not defined; returning defaultval ': 'NONE'
 Value for IOAPI_SMOKEMETA not defined; returning defaultval ': 'NONE'
 Value for IOAPI_SMOKEMETA not defined; returning defaultval ': 'NONE'
 Value for IOAPI_TEXTMETA not defined; returning defaultval ': 'NONE'
 Value for IOAPI_TEXTMETA not defined; returning defaultval ': 'NONE'
  
 "INIT_CONC_1" opened as UNKNOWN(R-W)    
 File name "/home/zhouminghui/Downloads/outputfile/INIT_CONC_1"
 File type GRDDED3 
 Execution ID "ICON_v53.exe"
 Grid name "2020_01SE1"
 Dimensions: 10 rows, 10 cols, 79 lays, 104 vbles
 NetCDF ID: 131072 opened as READWRITE           
 Time-independent data.
 Value for IOAPI_LOG_WRITE: F returning FALSE

 >>----> Program ICON completed successfully <----<< 

```

Finnally,INIT\_CONC\_1 file is being generated in the path of /home/zhouminghui/Downloads/outputfile. Does it means that I run icon\_script correctly or I should set something else to change the script?Thanks a lot!

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 6, 2020, 1:50am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/20 "2020-02-06T01:50:33Z")

</div>

Yes, the message “Program ICON completed successfully” usually indicates that the program ran successfully.

It appears that you named the file “INIT\_CONC\_1” and put it in a subdirectory called “outputfile” – which is not what I would recommend. But it is a legal name for your initial conditions file.

---

<div class="post-metadata">

### Author: ![Rainzmh](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rainzmh](https://forum.cmascenter.org/u/Rainzmh)
#### Post date: [February 6, 2020, 2:09am UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/22 "2020-02-06T02:09:18Z")

</div>

Thanks, I have some other problems to ask you:  
1.Wether I got some other errors from the logs and I should set other things?  
2.What should I do in the next step?Is there a complete CMAQ simulation Userguide or Tutorial? The official userguide seems not a detailed one.

Best wishes!

---

<div class="post-metadata">

### Author: ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)
#### Post date: [February 6, 2020, 12:30pm UTC](https://forum.cmascenter.org/t/error-when-running-icon-run-script/1272/23 "2020-02-06T12:30:56Z")

</div>

There is a lot of information available in the [User’s Guide](https://github.com/USEPA/CMAQ/tree/master/DOCS/Users_Guide) and there are several [Tutorials](https://github.com/USEPA/CMAQ/tree/master/DOCS/Users_Guide/Tutorials) available, including running the CMAQ benchmark [test case](https://github.com/USEPA/CMAQ/blob/master/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_benchmark.md). We hope that is enough to get new users started. If it isn’t, please post a new question.
