# Turning off chemistry mechanism in CMAQ

**URL:** <https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535>\
**Category:** CMAQ\
**Created:** [June 1, 2020, 5:07pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535 "2020-06-01T17:07:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 1, 2020, 5:07pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/1 "2020-06-01T17:07:40Z")

</div>

Hi everyone. I’m using CMAQv5.3.1 to simulate Ozone concentration. As I’m using the local emission inventory, I have to generate emission files by myself instead of using SMOKE. I’ve successfully generate the emission files and they can be read by CMAQ. However I got very low O3 concentration and I doubted if my emissions are correct. In order to debug the issue, I want to turn off different features in CMAQ. Can I turn off chemistry mechanism and only allow transport and advection going on? Thanks!

---

<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:** [June 1, 2020, 6:51pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/2 "2020-06-01T18:51:10Z")

</div>

One way to do this is to comment out the call to CHEM in sciproc.F.

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 1, 2020, 6:55pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/3 "2020-06-01T18:55:12Z")

</div>

Thanks! Should I modify it in src directory then recompile the BLD, or just change it in my previous BLD directory and re-make the executable file?

---

<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:** [June 1, 2020, 8:53pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/4 "2020-06-01T20:53:44Z")

</div>

Either could work, but I would recommend:  
cp sciproc.F sciproc.F.orig  
Then edit sciproc.F.  
Then invoke make. You may need to source config\_cmaq.csh first

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 1, 2020, 10:11pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/5 "2020-06-01T22:11:59Z")

</div>

I commented out line 281 in sciproc.F and tried to run cmaq. The compilation reported no error. But when I ran the model, it gave me the following error:

```
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
CCTM_s07tic_noche 00000000009AF90D Unknown Unknown Unknown
libpthread-2.18.s 00002AF0F5B4B6D0 Unknown Unknown Unknown
CCTM_s07tic_noche 00000000006F3A8A Unknown Unknown Unknown
CCTM_s07tic_noche 0000000000605EF2 Unknown Unknown Unknown
CCTM_s07tic_noche 00000000005FEC8C Unknown Unknown Unknown
CCTM_s07tic_noche 00000000005FD619 Unknown Unknown Unknown
CCTM_s07tic_noche 0000000000406D9E Unknown Unknown Unknown
libc-2.18.so 00002AF0F6464D65 __libc_start_main Unknown Unknown
CCTM_s07tic_noche 0000000000406CA9 Unknown Unknown Unknown

```

Do you think it’s caused by commenting out the CHEM?

---

<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:** [June 2, 2020, 12:57pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/6 "2020-06-02T12:57:27Z")

</div>

Rebuild the model in debug mode, so that the stack trace gives you human-readable information about where the error occurs. Also relevant: does it crash immediately, or after running for some time?

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 2, 2020, 7:43pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/7 "2020-06-02T19:43:29Z")

</div>

It almost crashed immediately, after it called chemistry.

```
 ================================
 |>--- TIME INTEGRATION ---<|
 ================================

 Processing Day/Time [YYYYDDD:HHMMSS]: 2010264:000000
   Which is Equivalent to (UTC): 0:00:00 Tuesday, Sept. 21, 2010
   Time-Step Length (HHMMSS): 000500
             VDIFF completed... 20.5 seconds
            COUPLE completed... 1.1 seconds
              HADV completed... 24.9 seconds
              ZADV completed... 4.5 seconds
             HDIFF completed... 2.8 seconds
          DECOUPLE completed... 1.1 seconds
              PHOT completed... 13.0 seconds
           CLDPROC completed... 3.5 seconds
              CHEM completed... 0.4 seconds
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
CCTM_s07tic_noche 0000000001A61C1D Unknown Unknown Unknown
libpthread-2.18.s 00002B8D9E0FC6D0 Unknown Unknown Unknown
CCTM_s07tic_noche 0000000001551229 aero_ 503 aero_driver.F
CCTM_s07tic_noche 0000000000E617C1 sciproc_ 298 sciproc.F
CCTM_s07tic_noche 0000000000E48385 cmaq_driver_ 679 driver.F
CCTM_s07tic_noche 0000000000E40B84 MAIN__ 96 cmaq_main.F
CCTM_s07tic_noche 0000000000406D9E Unknown Unknown Unknown
libc-2.18.so 00002B8D9EA15D65 __libc_start_main Unknown Unknown
CCTM_s07tic_noche 0000000000406CA9 Unknown Unknown Unknown

```

Thanks

---

<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:** [June 2, 2020, 9:38pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/8 "2020-06-02T21:38:43Z")

</div>

Oops, when using the saprc07 mechanisms (or at least saprc07tic\_ae7i\_aq), commenting out the call to chem leads to a seg fault in aero\_driver. (This approach works when using cb6.)

Go back to the original version of sciproc.F. Instead modify hrdriver.F. At the end of the IF (LFIRST) block, insert an ELSE RETURN statement. Now chemistry will be called exactly once.

```
IF (LFIRST) THEN
...
ELSE
    RETURN
END IF

```

If you don’t want CHEM to be called even once, other than the initializations being done in the LFIRST block, then instead change to

```
IF (LFIRST) THEN
...
END IF
RETURN

```

This assumes you are using the EBI solver. If you’re using ros3 or smvgear, you may have to do something analogous in rbdriver.F or grdriver.F.

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 2, 2020, 10:09pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/9 "2020-06-02T22:09:59Z")

</div>

Thanks! I also saw in the script, LFIRST is set as .TRUE. Should I just keep it there and only add RETURN to IF (LFIRST)?

---

<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:** [June 2, 2020, 10:29pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/10 "2020-06-02T22:29:49Z")

</div>

Just add a RETURN statement immediately after the END IF statement ending the LFIRST block.

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 2, 2020, 10:42pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/11 "2020-06-02T22:42:40Z")

</div>

Hi, I just tested it. It still reported the same error. I attached my bldit\_cctm.csh settings below for your reference.

```
set CompileBLDMAKE
set CopySrc
set ParOpt
set Debug_CCTM

set ModGrid = grid/cartesian #> grid configuration module
set DepMod = m3dry #> m3dry or stage
set ModAdv = wrf_cons #> 3-D Advection Scheme [Options: wrf_cons (default), local_cons]
set ModHdiff = hdiff/multiscale #> horizontal diffusion module
set ModVdiff = vdiff/acm2_${DepMod} #> vertical diffusion module (see $CMAQ_MODEL/CCTM/src/vdiff)
set ModDepv = depv/${DepMod} #> deposition velocity calculation module
                                           #> (see $CMAQ_MODEL/CCTM/src/depv)
set ModEmis = emis/emis #> in-line emissions module
set ModBiog = biog/beis3 #> BEIS3 in-line emissions module
set ModPlmrs = plrise/smoke #> in-line emissions plume rise
set ModCgrds = spcs/cgrid_spcs_nml #> chemistry species configuration module
                                           #> (see $CMAQ_MODEL/CCTM/src/spcs)
set ModPhot = phot/inline #> photolysis calculation module
                                           #> (see $CMAQ_MODEL/CCTM/src/phot)
set Mechanism = saprc07tic_ae7i_aq #> chemical mechanism (see $CMAQ_MODEL/CCTM/src/MECHS)
set ModGas = gas/ebi_${Mechanism} #> gas-phase chemistry solver (see $CMAQ_MODEL/CCTM/src/gas)
                                           #> use gas/ros3 or gas/smvgear for a solver independent
                                           # of the photochemical mechanism
set ModAero = aero/aero7 #> aerosol chemistry module (see $CMAQ_MODEL/CCTM/src/aero)
set ModCloud = cloud/acm_ae7 #> cloud chemistry module (see $CMAQ_MODEL/CCTM/src/cloud)
set ModUtil = util/util #> CCTM utility modules
set ModDiag = diag #> CCTM diagnostic modules
set Tracer = trac0 #> tracer configuration directory under
                                           #> $CMAQ_MODEL/CCTM/src/MECHS [default: no tracer species]
set ModPa = procan/pa #> CCTM process analysis
set ModPvO3 = pv_o3 #> potential vorticity from the free troposphere
set ModISAM = isam #> CCTM Integrated Source Apportionment Method

```

Thanks!

---

<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:** [June 3, 2020, 2:14am UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/12 "2020-06-03T02:14:45Z")

</div>

Sorry, my mistake.  
Starting from the release version of the code, modify hrdriver.F:

1. Change the end of the LFIRST block (around line 249) so that it reads:

2. Add a RETURN after the call to HETCHEM\_RATES.

I just tested this in CMAQv5.3.1 with the saprc07tic\_ae7i\_aq mechanism, and it worked for me.

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 3, 2020, 4:45pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/13 "2020-06-03T16:45:50Z")

</div>

Thanks! It works now!

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [June 14, 2020, 9:03am UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/14 "2020-06-14T09:03:11Z")

</div>

Hi, can I ask a further question? Would turning off chemistry also disable particle matter production? Thanks!

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [July 7, 2020, 10:43pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/15 "2020-07-07T22:43:54Z")

</div>

I believe that other processes contribute to PM2.5 including transport, so turning off chemistry would not necessarily eliminate PM2.5 production.

---

<div class="post-metadata">

**Author:** ![RockeyZ](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@RockeyZ](https://forum.cmascenter.org/u/RockeyZ)\
**Post date:** [July 21, 2020, 11:11pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/16 "2020-07-21T23:11:57Z")

</div>

I see. But aerosol chemistry is already turned off in this case, right?

---

<div class="post-metadata">

**Author:** ![SolL](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@SolL](https://forum.cmascenter.org/u/SolL)\
**Post date:** [September 30, 2024, 6:35pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/17 "2024-09-30T18:35:13Z")

</div>

Hello there.

Im also trying to run CMAQ without chemistry. Im using CMAQ v4. 5 and the cb6r3\_ae7\_aq mechanism.

Reading this topic I thought that commenting this line

```auto
diff sciproc.F sciproc_orig.F 
285c285
< #CALL CHEM ( CGRID, JDATE, JTIME, TSTEP )
---
> CALL CHEM ( CGRID, JDATE, JTIME, TSTEP )

```

in sciproc.F would be enough (I see that with saprc07 mechanism other things should be done).

But then I get the following error when trying to build the .exe

```auto
sciproc.F(285): error #5082: Syntax error, found POUND_BASE '' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ...
      #CALL CHEM ( CGRID, JDATE, JTIME, TSTEP )
------^
/tmp/iforttaJtHz.i: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem>
compilation aborted for sciproc.F (code 1)
make: *** [Makefile:457: sciproc.o] Error 1

```

What I am doing wrong here?

Thank you in advance  
Sol

---

<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:** [October 3, 2024, 3:42pm UTC](https://forum.cmascenter.org/t/turning-off-chemistry-mechanism-in-cmaq/1535/18 "2024-10-03T15:42:42Z")

</div>

Catastrophic compiler errors are just that – errors in the compiler itself, not something that can be fixed in the source code.  
The first thing I would try is `make clean; make`.  
If that does not work, then update your compiler.  
If you still have difficulties, please post your message in a new thread.
