# Running DESID Module on CMAQ-HDDMv5.4

**URL:** <https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531>\
**Category:** DESID\
**Created:** [November 9, 2023, 1:59am UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531 "2023-11-09T01:59:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![munshimdrasel](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@munshimdrasel](https://forum.cmascenter.org/u/munshimdrasel)\
**Post date:** [November 9, 2023, 1:59am UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/1 "2023-11-09T01:59:07Z")

</div>

Hy,  
I’m very new to using DESID module. I am trying to scale PT\_EGU’s SO2 emissions by 10 times. Based on the tutorial mentioned in CMAQ github, I have updated CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml [inside of BLD\_CCTM\_v54\_DDM3D\_gcc] folder (also attached below) file like this:

‘EVERYWHERE’, ‘ALL’ ,‘SO2’ ,‘SO2’ ,‘GAS’ ,10 ,‘UNIT’,‘o’,  
‘EVERYWHERE’, ‘PT\_EGU’ ,‘SO2’ ,‘SO2’ ,‘GAS’ ,10 ,‘UNIT’,‘o’,

I have also updated CMAQ\_Control\_DESID.nml [inside of BLD\_CCTM\_v54\_DDM3D\_gcc] file like this (also attached below):

&Desid\_StreamFamVars  
Desid\_N\_Stream\_Fams = 1 ! Exact number of stream family definitions  
Desid\_Max\_Stream\_Fam\_Members = 20 ! Larger than the number of streams on all  
! family definitions  
/

&Desid\_StreamFam  
! For emission streams available in several run scripts under CCTM/scripts  
! Set Desid\_N\_Stream\_Fams to 1 !!!  
StreamFamilyName(1) = ‘PT\_SOURCES’  
StreamFamilyMembers(1,1:3)= ‘PT\_NONEGU’,‘PT\_EGU’,‘PT\_OTHER’

I’m not sure if I’m doing this right or wrong. After I updated the files, I ran my script (attached below), however, I did not find any CCTM\_DESID output. All other outputs were there like CCTM\_ACONC, CCTM\_AELMO etc except CCTM\_DESID output. Please have a look at the attached files and let me know what steps I need to follow correctly.

Thanks  
Rasel  
[CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml.txt](https://forum.cmascenter.org/uploads/short-url/iwcMS5S2Rzth8MwOv4XI9mkGSxF.txt) (13.0 KB)  
[CMAQ\_Control\_DESID.nml.txt](https://forum.cmascenter.org/uploads/short-url/tlX2CVQEetLCOupXslT36u1zYB7.txt) (13.8 KB)  
[run\_cctm\_desid.csh\_sbatch.txt](https://forum.cmascenter.org/uploads/short-url/nQt9Ue32PdzDgNibz5SNlolzqId.txt) (41.4 KB)

---

<div class="post-metadata">

**Author:** ![manishsoni](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@manishsoni](https://forum.cmascenter.org/u/manishsoni)\
**Post date:** [November 9, 2023, 10:08pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/2 "2023-11-09T22:08:42Z")

</div>

Hi Rasel,  
Do you want to just run desid to do the emission reduction, or you wants to run desid for emission reduction and run DDM3D as well. when we look at your files the desid diagonstics are set to 0. So you need to change that also. Detailed description is mentioned below.

Set of operations defined in desid.

- ‘Operation’ - Specifies the kind of rule to be carried out. Options are:
  - ‘a’ - add the rule to existing instructions. This operation should be used for new entries, too.
  - ‘m’ - find existing scaling instructions matching this rule’s features (ie. species, streams, etc) and multiply them by the factor in this particular rule.
  - ‘o’ - find existing scaling instructions matching this rule and overwrite them.

For example : The following rule in the Chemical Maping Control Namelist will scale all emissions from one example stream (“MOBILE”) by a factor of 2. The operator ‘m’ will multiply the cumulative value of all scale factors that have been applied for the “MOBILE” stream to that point.

```auto
! Region | Stream Label |Emission | CMAQ- |Phase/|Scale |Basis |Op ! Label | |Surrogate| Species |Mode |Factor| |'EVERYWHERE' , 'MOBILE' ,'All' ,'All' ,'All' ,2.0 ,'UNIT','m',

```

First in your CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml. this should be your change.

```auto
!‘EVERYWHERE’, ‘ALL’ ,‘SO2’ ,‘SO2’ ,‘GAS’ ,10 ,‘UNIT’,‘o’ # this need to be commented
‘EVERYWHERE’, ‘PT_EGU’ ,‘SO2’ ,‘SO2’ ,‘GAS’ ,10 ,‘UNIT’,‘m’,

```

Secondly in your CMAQ\_Control\_DESID.nml file activate the desid diagnostics. This should be your change. In your file Desid\_N\_Diag\_Rules is set to 0

```auto

&Desid_DiagVars
  Desid_N_Diag_Rules = 1 ! Exact Number of Diagnostic Rules Below
  Desid_Max_Diag_Streams=20 ! Maximum number of species variables on all rules 
                            ! below (do not count expansions)
  Desid_Max_Diag_Spec = 80 ! Maximum number of species variables on all rules 
                            ! below (do not count expansions)
/
&Desid_StreamFamVars
 Desid_N_Stream_Fams = 2 ! Exact number of stream family definitions
 Desid_Max_Stream_Fam_Members = 20 ! Larger than the number of streams on all
                                   ! family definitions
/

```

```auto
&Desid_StreamFam
! For emission streams available in several run scripts under CCTM/scripts

  StreamFamilyName(1) = 'PT_SOURCES'
  StreamFamilyMembers(1,1:3)= 'PT_NONEGU','PT_EGU','PT_OTHER'

  StreamFamilyName(2) = 'PT_EGUS'
  StreamFamilyMembers(2,1:1)= 'PT_EGU'

```

and also this change in &Desid\_Diag this changes you need to do.

```auto
&Desid_Diag
    Desid_Diag_Streams_Nml(1,:)= 'PT_EGUS'
    Desid_Diag_Fmt_Nml(1) = 'COLSUM'
    Desid_Diag_Spec_Nml(1,:) = 'ALL'

/

```

---

<div class="post-metadata">

**Author:** ![munshimdrasel](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@munshimdrasel](https://forum.cmascenter.org/u/munshimdrasel)\
**Post date:** [November 9, 2023, 11:02pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/3 "2023-11-09T23:02:51Z")

</div>

@manishsoni

Hy,  
Thank you for clarifying the steps. I want to run DESID to see change in emissions and also would like to run DDM3D as well. In addition to see PT\_EGU impact, I would like to see impact of NOx emissions change from all sources as well. What do I need to adjust for that?

Thanks  
Rasel

---

<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:** [November 10, 2023, 2:16pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/4 "2023-11-10T14:16:28Z")

</div>

This [DESID User Guide](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_emissions.md) gives example use cases.

First step would be to define a family of chemical species for NOX.

Chemical families are defined by prescribing, via the [CMAQ Miscellaneous Control File](https://github.com/USEPA/CMAQ/blob/main/CCTM/src/util/util/CMAQ_Control_Misc.nml), the total number of chemical families to be used, the name of each, the number of members of each family, and the name of each family member.

In the default CMAQ\_Control\_Misc.nml file, the NOX family is given as an example, but is commented out.

To add the NOX family definition, change the default setting:

```auto
!------------------------------------------------------------------------------!
! Emissions Scaling Family Definitions !
! This component includes definitions for families of CMAQ chemical species, !
! emission streams and region combinations. !
!------------------------------------------------------------------------------!
&Chemical_FamVars
 N_Chem_Fams = 0
 Max_Chem_Fam_Members = 20
/

&ChemicalFamilies
! ChemFamilyName(1) = 'NOX'
! ChemFamilyMembers(1,:)= 'NO','NO2'
/

```

To the following, note I have removed the ! or comment from lines 132 and 133 in the default file, and I have modified N\_Chem\_Fams = 0 to N\_Chem\_Fams = 1.

```auto
!------------------------------------------------------------------------------!
! Emissions Scaling Family Definitions !
! This component includes definitions for families of CMAQ chemical species, !
! emission streams and region combinations. !
!------------------------------------------------------------------------------!
&Chemical_FamVars
 N_Chem_Fams = 1
 Max_Chem_Fam_Members = 20
/

&ChemicalFamilies
 ChemFamilyName(1) = 'NOX'
 ChemFamilyMembers(1,:)= 'NO','NO2'
/

```

Once NOX is defined, then you can use it to set the scaling factor as you did for SO2.

---

<div class="post-metadata">

**Author:** ![munshimdrasel](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@munshimdrasel](https://forum.cmascenter.org/u/munshimdrasel)\
**Post date:** [November 10, 2023, 2:59pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/5 "2023-11-10T14:59:41Z")

</div>

@lizadams

Hy Liz,  
Can you please have a look at my CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml.txt, CMAQ\_Control\_Misc.nml.txt, and CMAQ\_Control\_DESID.nml.txt file to see if I’ve changed those file correctly? I’m trying to run CMAQ-DDMv5.4 and trying to use DESID to scale PT\_EGU emissions, and NOX [from all sources] emissions by 10 times. Please let me know if I need to correct anything.

Thanks  
Rasel  
[CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml.txt](https://forum.cmascenter.org/uploads/short-url/9lUR9hJWc5Q8y83c5l26AeRukg0.txt) (13.1 KB)  
[CMAQ\_Control\_Misc.nml.txt](https://forum.cmascenter.org/uploads/short-url/cwvB7yxCiC6qBzLaexJ00tVUCxo.txt) (8.0 KB)  
[CMAQ\_Control\_DESID.nml.txt](https://forum.cmascenter.org/uploads/short-url/jdaAJHvxYvUoxB1ye9YxNmwsWT4.txt) (14.0 KB)  
[run\_cctm\_desid.csh\_sbatch.txt](https://forum.cmascenter.org/uploads/short-url/ctX58ZCF46wlcd5jS2hpRv6vJZG.txt) (41.4 KB)

---

<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:** [November 10, 2023, 3:56pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/6 "2023-11-10T15:56:00Z")

</div>

In your run script you have one of the emissions streams labeled as PT\_EGU

setenv STK\_EMIS\_LAB\_002 PT\_EGU

In your CMAQ\_Control\_DESID.nml.txt file, you define the StreamFamilyName to be identical as the StreamFamilyMembers.  
I don’t know what the impact of having the same name for the stream family as the stream family member.

StreamFamilyName(2) = ‘PT\_EGU’  
StreamFamilyMembers(2,1:1)= ‘PT\_EGU’

I would recommend using a unique name for the StreamFamilyName(2). To distinuguish between the two. You could use PT\_EGU\_FAM for the StreamFamilyName. I think we had suggested PT\_EGUS in the responses above, which was not clear.

StreamFamilyName(2) = ‘PT\_EGU\_FAM’  
StreamFamilyMembers(2,1:1)= ‘PT\_EGU’

However, you may not need a new StreamFamilyName, as the PT\_EGU is the only member in the StreamFamilyName(2). So, you could use the PT\_EGU emission stream label, without defining a new family.

It doesn’t appear that you need any new stream families to be defined, as you only want to multiply the PT\_EGU stream by 10 for SO2, and all emission streams by 10 for NOX.

I am going to assume that the clearest method is to not define any Stream Families. Note, I have commented out the StreamFamilyName(1) and StreamFamilyName(2) by using the ! at the front of those lines.

```auto
&Desid_StreamFamVars
 Desid_N_Stream_Fams = 0 ! Exact number of stream family definitions
 Desid_Max_Stream_Fam_Members = 20 ! Larger than the number of streams on all 
                                   ! family definitions
/

&Desid_StreamFam
! For emission streams available in several run scripts under CCTM/scripts     
 ! Set Desid_N_Stream_Fams to 1 !!!!!!!
  !StreamFamilyName(1) = 'PT_SOURCES'
  !StreamFamilyMembers(1,1:3)= 'PT_NONEGU','PT_EGU','PT_OTHER'

  !StreamFamilyName(2) = 'PT_EGU_FAM'
  !StreamFamilyMembers(2,1:1)= 'PT_EGU'

```

In the diagnostic rules section, you need to activate the DESID reporting of SO2 from PT\_EGU and NOX from all sources

In this example, I’ve changed the number of Diagnosic Rules to 2, and listed two rules below. The first rule will print out the column sum for the SO2 variable for the PT\_EGU emissions stream, and the second rule will print out the column sum for NOX from all emission streams.

```auto

&Desid_DiagVars
  Desid_N_Diag_Rules = 2 ! Exact Number of Diagnostic Rules Below

&Desid_Diag
    Desid_Diag_Streams_Nml(1,:)= 'PT_EGU'
    Desid_Diag_Fmt_Nml(1) = 'COLSUM'
    Desid_Diag_Spec_Nml(1,:) = 'SO2'

    Desid_Diag_Streams_Nml(2,:)= 'ALL'
    Desid_Diag_Fmt_Nml(2) = 'COLSUM'
    Desid_Diag_Spec_Nml(2,:) = 'NOX'

```

In the CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml file, I think you have the scaling set correctly to increase the SO2 by 10x for the PT\_EGU Stream Label, and to increase NOX by 10x for all emission streams.

```auto
&Desid_Scaling
 Desid_Rules_nml =

 ! Region | Stream Label |Emission | CMAQ- |Phase/|Scale |Basis |Op
 ! Label | |Species | Species |Mode |Factor| |

   ! Gases
   'EVERYWHERE', 'ALL' ,'NO2' ,'NO2' ,'GAS' ,1 ,'UNIT','a',
   'EVERYWHERE', 'ALL' ,'NO' ,'NO' ,'GAS' ,1 ,'UNIT','a',

   'EVERYWHERE', 'ALL' ,'NOX' ,'NOX' ,'GAS' ,10 ,'UNIT','m',

   'EVERYWHERE', 'ALL' ,'HONO' ,'HONO' ,'GAS' ,1. ,'UNIT','a',
   'EVERYWHERE', 'ALL' ,'SO2' ,'SO2' ,'GAS' ,1 ,'UNIT','a',

   'EVERYWHERE', 'PT_EGU' ,'SO2' ,'SO2' ,'GAS' ,10 ,'UNIT','m',

```

What I am unclear about, is whether multiplying by a factor of 10 for NOX only applies to emission streams that are defined in the run script. For your case, this would be the Point Source Emissions. Or, is DESID also able to multiply by a factor of 10 the NOX from the Gridded Emissions File that is defined here:

```auto
  #> Gridded Emissions files
  setenv N_EMIS_GR 1 #2
  set EMISfile = all/emis_mole_all_${YYYYMMDD}_${APPL}_nobeis_2016fh_16j.ncf

```

I found the answer, the Gridded Emissions are labeled in your run script as GRIDDED\_EMIS, so they will be included in the definition of ALL.

```auto
  #> Gridded Emissions files
  setenv N_EMIS_GR 1 #2
  set EMISfile = all/emis_mole_all_${YYYYMMDD}_${APPL}_nobeis_2016fh_16j.ncf
  setenv GR_EMIS_001 ${EMISpath}/${EMISfile}
  setenv GR_EMIS_LAB_001 GRIDDED_EMIS
  setenv GR_EM_SYM_DATE_001 F # To change default behaviour please see Users Guide for EMIS_SYM_DATE

```

---

<div class="post-metadata">

**Author:** ![manishsoni](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@manishsoni](https://forum.cmascenter.org/u/manishsoni)\
**Post date:** [November 10, 2023, 6:58pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/7 "2023-11-10T18:58:35Z")

</div>

Also, it will be better to show us your sensinput file of DDM for sensitivity for NOx emissions.  
Here is an example file: [https://github.com/USEPA/CMAQ/blob/main/CCTM/scripts/sensinput.2016\_12SE1.dat](https://github.com/USEPA/CMAQ/blob/main/CCTM/scripts/sensinput.2016_12SE1.dat)

---

<div class="post-metadata">

**Author:** ![munshimdrasel](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@munshimdrasel](https://forum.cmascenter.org/u/munshimdrasel)\
**Post date:** [November 12, 2023, 5:07pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/8 "2023-11-12T17:07:46Z")

</div>

@lizadams  
Hy Liz,  
I’ve modified the files like you suggested and it worked fine. However, when I’m running the CCTM script for 1 month (July, 2020), I’m currently seeing following error:

```
 Could not determine Courant-condition safe sync step for model step: 010000 HHMMSS
 (Max vel)/(dX) = Infinity
 *** ERROR ABORT in subroutine ADVSTEP on PE 000  

```

Please see the attached log file, script, and DESID files. Can you please let me know why am I seeing this error?

@manishsoni

Please see the attached sensinput file.

Regards,  
Rasel  
[run\_cctm\_desid.csh\_sbatch.txt](https://forum.cmascenter.org/uploads/short-url/hvODUDXdte2DPihqwZINn8NN4pu.txt) (41.4 KB)  
[CMAQ\_Control\_Misc.nml.txt](https://forum.cmascenter.org/uploads/short-url/cwvB7yxCiC6qBzLaexJ00tVUCxo.txt) (8.0 KB)  
[CMAQ\_Control\_DESID\_cb6r5\_ae7\_aq.nml.txt](https://forum.cmascenter.org/uploads/short-url/eulL2YNAkaam5XLlCN9MugzUIGP.txt) (13.1 KB)  
[CMAQ\_Control\_DESID.nml.txt](https://forum.cmascenter.org/uploads/short-url/sc2GRut4j9dRrL2BoDfbl8CvZcm.txt) (14.1 KB)  
[sensinput.ptegu.dat.txt](https://forum.cmascenter.org/uploads/short-url/AgN6c5YMpSdvMEwo4HwU7ZXPVk1.txt) (2.4 KB)  
[CTM\_LOG\_000.v54\_DDM3D\_gcc\_AQF5X\_20200701.txt](https://forum.cmascenter.org/uploads/short-url/7fSGzDMrhPQOTpDIgARCtX1uqVh.txt) (1.0 MB)

---

<div class="post-metadata">

**Author:** ![munshimdrasel](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@munshimdrasel](https://forum.cmascenter.org/u/munshimdrasel)\
**Post date:** [November 15, 2023, 12:47am UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/9 "2023-11-15T00:47:45Z")

</div>

@lizadams  
Hy Liz,

Any suggestion how to solve this error?

Could not determine Courant-condition safe sync step for model step: 010000 HHMMSS  
(Max vel)/(dX) = Infinity  
\*\*\* ERROR ABORT in subroutine ADVSTEP on PE 000

Thanks  
Rasel

---

<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:** [November 15, 2023, 2:50pm UTC](https://forum.cmascenter.org/t/running-desid-module-on-cmaq-hddmv5-4/4531/10 "2023-11-15T14:50:16Z")

</div>

Hi,

I found this nice explanation of the error message that you are getting.

> **[Understanding the Importance of the CFL Condition in CFD Simulations](https://www.neuralconcept.com/post/understanding-the-importance-of-the-cfl-condition-in-cfd-simulations)**
>
> In the world of CFD simulations, accuracy is of utmost importance. A fundamental concept that ensures stability in high-fidelity CFD is the Courant-Friedrichs-Lewy (CFL) condition. CFL governs crucial parameters such as time step size, grid spacing,...

I would try running your scenario without DDM-3D and see if you encounter the same error.

This post may also help you try adjusting settings for the base case (without DDM-3D) in the run script.

> [@Questions on CMAQ CTM\_MAXSYNC and CTM\_ADV\_CFL settings](https://forum.cmascenter.org/t/questions-on-cmaq-ctm-maxsync-and-ctm-adv-cfl-settings/3454/2):
>
> Actually, as a mathematician I am much happier about runs with Courant number less than 1/SQRT(2) ~ 0.7 — after all, horizontal advection is a two-dimensional process relating to winds with magnitude SQRT(U^2+V^2) And then there’s the coupling with other physical processes (also affected by the coupling time-step)…

Once you solve the issue with your base case, then you can try the DDM-3D instrumented version.

Liz
