# Combine only output 1 layer

**URL:** <https://forum.cmascenter.org/t/combine-only-output-1-layer/2872>\
**Category:** CMAQ\
**Created:** [December 10, 2021, 4:08pm UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872 "2021-12-10T16:08:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmbmnb](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@bmbmnb](https://forum.cmascenter.org/u/bmbmnb)\
**Post date:** [December 10, 2021, 4:08pm UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/1 "2021-12-10T16:08:34Z")

</div>

Dear all,

I’m using CMAQ-combine to process CMAQ output files, but I only got 1 layer.  
How can combine output all layers?

Yunqing

---

<div class="post-metadata">

**Author:** ![wyat.appel](https://avatars.discourse-cdn.com/v4/letter/w/3d9bf3/32.png) [@wyat.appel](https://forum.cmascenter.org/u/wyat.appel)\
**Post date:** [December 10, 2021, 4:28pm UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/2 "2021-12-10T16:28:57Z")

</div>

Hi Yunqing,

The layer(s) combined is controlled in the species definition file provided with Combine. At the top of your species definition file you should see something like this:

!#start YYYYJJJ 010000  
!#end YYYYJJJ 000000  
#layer 1

I believe if you change  
#layer 1

to

!#layer 1

Combine will process all the layers. Please let me know if that works for you.

Wyat

---

<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:** [December 10, 2021, 6:21pm UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/3 "2021-12-10T18:21:05Z")

</div>

Yes, Wyat is correct. In addition, please note that if you want to output the species defined in the SpecDef file for all layers, all the input file(s) referenced in the species equations need to have the same number of layers for meaningful output to be computed.

---

<div class="post-metadata">

**Author:** ![bmbmnb](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@bmbmnb](https://forum.cmascenter.org/u/bmbmnb)\
**Post date:** [December 11, 2021, 12:15am UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/4 "2021-12-11T00:15:55Z")

</div>

Dear Wyat,

Yes, it works! Thank you for the reply!

Yunqing

---

<div class="post-metadata">

**Author:** ![bandaoshutiao](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bandaoshutiao](https://forum.cmascenter.org/u/bandaoshutiao)\
**Post date:** [March 21, 2022, 1:03am UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/5 "2022-03-21T01:03:40Z")

</div>

Dear Wyat,  
How do you know this? I didn’t find this explanation on CMAQ’s official website and GitHub. Where can I find the specific usage of the script? For example, enter “!” in this file，This means that this part of the code is enabled.

zhixu sun

---

<div class="post-metadata">

**Author:** ![bandaoshutiao](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bandaoshutiao](https://forum.cmascenter.org/u/bandaoshutiao)\
**Post date:** [March 21, 2022, 1:13am UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/6 "2022-03-21T01:13:50Z")

</div>

“！” It seems to mean that this part is not enabled, that is, the program will process all layers by default. I seem to understand. But I still don’t know where to learn about this knowledge. The official GitHub uses the word “Klay”, which I really don’t understand.

---

<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:** [March 21, 2022, 2:41am UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/7 "2022-03-21T02:41:05Z")

</div>

It seems you already found the [combine documentation](https://github.com/USEPA/CMAQ/tree/main/POST/combine), specifically this section:

```auto
 / records are comment lines
 ! records are comment lines
 # records can be used to define parameter
 #start YYYYDDD HHMMSS
 #end YYYYDDD HHMMSS
 #layer KLAY (default is all layers)

```

KLAY is shorthand for the layer number to be extracted if this record line is not commented out.

The default SpecDef files include this block:

!#start YYYYJJJ 010000  
!#end YYYYJJJ 000000  
#layer 1

Since the first two lines start with a “!”, they are treated as comments. The third line starts with a #, so the following number (1) instructs combine to extract layer 1, overriding the default behavior of extracting all layers.

---

<div class="post-metadata">

**Author:** ![bandaoshutiao](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bandaoshutiao](https://forum.cmascenter.org/u/bandaoshutiao)\
**Post date:** [March 23, 2022, 2:14am UTC](https://forum.cmascenter.org/t/combine-only-output-1-layer/2872/8 "2022-03-23T02:14:22Z")

</div>

Thank you very much  
I got it!!
