# Merge emission files

**URL:** <https://forum.cmascenter.org/t/merge-emission-files/5568>\
**Category:** SMOKE\
**Tags:** smoke\
**Created:** [February 4, 2025, 2:32pm UTC](https://forum.cmascenter.org/t/merge-emission-files/5568 "2025-02-04T14:32:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yan2024](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@yan2024](https://forum.cmascenter.org/u/yan2024)\
**Post date:** [February 4, 2025, 2:32pm UTC](https://forum.cmascenter.org/t/merge-emission-files/5568/1 "2025-02-04T14:32:08Z")

</div>

Hi teachers, I’ve already processed different sectors by SMOKE and got files like “energy.ncf”,“agriculture.ncf” and so on. I tried to merge these files with mrggrid program but encountered some problems.

[smk\_mrgall\_nctox.csh](https://forum.cmascenter.org/uploads/short-url/2oRj3E7hVgK2mr1UmcTscAZCUdy.csh) (2.5 KB)  
(AGTS\_L NGTS\_L BGTS\_L paths are consistent with /assigns/setmerge\_files.scr)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/0/03fbde4ce00bd258224ee061c76164ab51d7445f.png)

I checked the OUTFILE path and there is no file exist there. I am wondering is there any other methods could be used to merge emission files rather than this? I used cdo add to merge files but dimentions and variables changed and CCTM could not open merged file.

---

<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:** [February 4, 2025, 3:04pm UTC](https://forum.cmascenter.org/t/merge-emission-files/5568/2 "2025-02-04T15:04:12Z")

</div>

`OUTFILE` is meant to be the name of a file (possibly including a path), not only a path.

If `/public/home/jiabh/YZD/app/smoke_new/data/run_HEMI_108k/output` is an existing path, you would need to change `setenv OUTFILE /public/home/jiabh/YZD/app/smoke_new/data/run_HEMI_108k/output #$EGTS_L` to `setenv OUTFILE /public/home/jiabh/YZD/app/smoke_new/data/run_HEMI_108k/output/$EGTS_L` (if `EGTS_L` was properly set up through your ASSIGNS file), or just something like `setenv OUTFILE /public/home/jiabh/YZD/app/smoke_new/data/run_HEMI_108k/output/test_output.nc`

---

<div class="post-metadata">

**Author:** ![yan2024](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@yan2024](https://forum.cmascenter.org/u/yan2024)\
**Post date:** [February 5, 2025, 2:15am UTC](https://forum.cmascenter.org/t/merge-emission-files/5568/3 "2025-02-05T02:15:00Z")

</div>

Thank you so much! I resolved this problem.
