# Controlling ELMO Output

**URL:** <https://forum.cmascenter.org/t/controlling-elmo-output/4972>\
**Category:** CMAQ\
**Created:** [May 31, 2024, 4:01pm UTC](https://forum.cmascenter.org/t/controlling-elmo-output/4972 "2024-05-31T16:01:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mneedham](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mneedham](https://forum.cmascenter.org/u/mneedham)\
**Post date:** [May 31, 2024, 4:01pm UTC](https://forum.cmascenter.org/t/controlling-elmo-output/4972/1 "2024-05-31T16:01:25Z")

</div>

Hello, I have a question about ELMO file output. I was not able to find information on this issue even after reading [Chapter 7 (Model Output Files)](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/CMAQ_UG_ch07_model_outputs.md) or [Appendix F (ELMO)](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Appendix/CMAQ_UG_appendixF_elmo_output.md) of the [CMAQ Users Guide](https://github.com/USEPA/CMAQ/tree/main/DOCS/Users_Guide). I am using **CMAQv5.4** compiled with the **`set DDM3D_CCTM`** flag enabled

## Context

I have recently compiled CMAQ and performed a successful 5-day simulation on the 36US3 grid. I can see the output data files (`ACONC`, `ASENS`, `DRYDEP`, etc.) in my output directory; one for each simulated day. However the ELMO files (ELMO and AELMO) are not there… instead I can see two files `CTM_AELMO_1` and `CTM_ELMO_1` located in the directory in which my job script runs the executable and writes the output logs. I just see a single file each for ELMO and AELMO, unlike the other outputs which have one file for each of the five simulated days. There is data in the `CTM_AELMO_1` and `CTM_ELMO_1` files, which I am able to read and make plots.

## Question: How do I control this ELMO output?

I am curious if there is some setting in which the ELMO files are written out less frequently (e.g., monthly) than the other output, which might explain why the files are sitting in my run directory and not yet moved to the output directory.

I would prefer to have those ELMO files be written to my output directory like those other output files on the same (daily) timescale. Is there an environment variable I need to set in my job script? Or perhaps is there some additional namelist setting I need to set?

Here is the current contents of the ELMO section of my `CMAQ_Control_Misc.nml` file:

```namelist
&elmo_activate
  instant = .TRUE.
  average = .TRUE.
/

&elmo_inst
  Inst_Layer_Top = 1
  Inst_Layer_Bot = 1
  Inst_Vars_Nml = 'DEFAULT'
  
! Example for limited output
! Inst_Vars_Nml = 'NO2', 'FORM', 'SO2', 'O3', 'PM25', 'PM10', 'DENS', 'NOX', 'AOD_550'
/

&elmo_avrg
  Avrg_Layer_Top = 1
  Avrg_Layer_Bot = 1
  Avrg_Vars_Nml ='DEFAULT'

! Example for limited output
! Avrg_Vars_Nml = 'NO2', 'FORM', 'SO2', 'O3', 'PM25', 'PM10', 'DENS', 'NOX', 'AOD_550'
/

```

---

<div class="post-metadata">

**Author:** ![mneedham](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mneedham](https://forum.cmascenter.org/u/mneedham)\
**Post date:** [May 31, 2024, 4:11pm UTC](https://forum.cmascenter.org/t/controlling-elmo-output/4972/2 "2024-05-31T16:11:25Z")

</div>

Linking to [this CMAS forum post](https://forum.cmascenter.org/t/about-the-file-ctm-aelmo-1/3810) which helped me find the answer. This was related to the new (v5.4) release, and the need to correctly define ELMO and AELMO output files in runscripts. My issue was from adapting a runscript originally for an older version of CMAQ.

## Solution

See the example runscripts shipped with CMAQv5.4 (e.g., [run\_cctm\_2010\_4CALIF1.csh](https://github.com/USEPA/CMAQ/blob/main/CCTM/scripts/run_cctm_2010_4CALIF1.csh)). User needs to ensure that the `CTM_ELMO_1` and `CTM_AELMO_1` environment variables are set properly.

```shell

  setenv CTM_ELMO_1 "$OUTDIR/CCTM_ELMO_${CTM_APPL}.nc -v" #> On-Hour Particle Diagnostics
  setenv CTM_AELMO_1 "$OUTDIR/CCTM_AELMO_${CTM_APPL}.nc -v" #> Hourly Avg. Particle Diagnostics

```

There are a few other things required to correctly run ELMO, as explained in that runscript:

```shell
  #> The following namelist configures aggregated output (via the Explicit and Lumped 
  #> Air Quality Model Output (ELMO) Module), domain-wide budget output, and chemical 
  #> family output.
  setenv MISC_CTRL_NML ${BLD}/CMAQ_Control_Misc.nml

```

and

```shell
set OUT_FILES = (${FLOOR_FILE} ${S_CGRID} ${CTM_CONC_1} ${A_CONC_1} ${MEDIA_CONC} \
             ${CTM_DRY_DEP_1} $CTM_DEPV_DIAG $B3GTS_S $MEGAN_SOILOUT $BEIS_SOILOUT $BDSNPOUT \
             $CTM_WET_DEP_1 $CTM_WET_DEP_2 $CTM_ELMO_1 $CTM_AELMO_1 \
             $CTM_RJ_1 $CTM_RJ_2 $CTM_RJ_3 $CTM_SSEMIS_1 $CTM_DUST_EMIS_1 $CTM_IPR_1 $CTM_IPR_2 \
             $CTM_IPR_3 $CTM_BUDGET $CTM_IRR_1 $CTM_IRR_2 $CTM_IRR_3 $CTM_DRY_DEP_MOS \
             $CTM_DEPV_MOS $CTM_VDIFF_DIAG $CTM_VSED_DIAG $CTM_LTNGDIAG_1 $CTM_LTNGDIAG_2 $CTM_VEXT_1 )

```

---

<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:** [May 31, 2024, 6:26pm UTC](https://forum.cmascenter.org/t/controlling-elmo-output/4972/3 "2024-05-31T18:26:18Z")

</div>

Thanks @mneedham for your clear and descriptive initial post and then following up by documenting the correct solution you found in another post. Yes, because model options and namelist files evolve as new CCTM versions are being released, we always advise starting with a run script released with the version of the CCTM you intend to use in your project. Good luck in your project!
