# AMET\_for specific region and specific emissions level

**URL:** <https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590>\
**Category:** AMET\
**Tags:** cmaq\
**Created:** [September 22, 2022, 4:53pm UTC](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590 "2022-09-22T16:53:25Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [September 28, 2022, 7:14pm UTC](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590/21 "2022-09-28T19:14:38Z")

</div>

Hello @hogrefe.christian

Thank you so much for the suggestions.

I tried to use m3tshift for the COMBINE file. And it seems the deviation from the date is not happening for the COMBINE file  
[diff\_combine\_o3.txt](https://forum.cmascenter.org/uploads/short-url/pW9thqrrrNHU9u4jUwmHUPzoBGn.txt) (405.7 KB)

 ![m3tshift combine](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/3/3bf9c6042ba0366be1c5c655a1c73f1ef6a24e8b.png)

Then, I used the new COMBINE file (output of m3tshift) to AMETv1.4 scripts.

```
                           ***My AMET setup is for version 1.4***

```

First, I set the “clim\_reg” variable to “South” in the all\_scripts.input of AMETv1.5 (as suggested by @wyat.appel in comment #4)

 ![amet3](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/6/6a6b7c819fdb20519eb77c448e7234f4ac771826.png)

Then, I made following changes in script\_analysis script

 ![amet2](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/a/a8d2d1132bcb2df2e6cfdcc17317070a27c508b3.png)

 ![amet1](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/5/53235673104a5b503da062334a9395e0483040ef.png)

The AMET run is successful. But the script didn’t extract data for the specific clim\_region “South”. I plotted a spatial plot to verify that using the above setup.

 ![MPE_2016v2_US_O3_8hrmax_1_spatialplot_mod](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/0/02b8fb6e04241bd0c5b069bb3b292ee096ebde8b.png)

Where you can see all the monitors of the U.S. are plotted, but my clim\_reg was set as “South” only.

So, I think all\_scripts.input and Network.input files from AMETv1.5 is not working in AMETv1.4

Is there any other way to extract data for specific regions in AMETv1.4 (original question, comment#1) ?

Thank you so much

---

<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:** [September 28, 2022, 7:41pm UTC](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590/22 "2022-09-28T19:41:26Z")

</div>

Glad to know that this temporary workaround of fixing the non-compliant time stamps in the COMBINE file (inherited from the non-compliant daily files) with m3shift worked as expected. And yes, comparing the metadata between the initial file created by COMBINE and the one fixed with m3shift should show differences for only a handful of attributes directly related to the creation and writing of the file as well as the program creating the file (aside from the time stamps fixed by m3tshift, of course). That’s because both programs are fortran tools that followed the proper approach of linking in the I/O API library and using its functions to read/create/write files, while whatever tool created the daily files didn’t follow that approach.

Your remaining question is one that’ll have to be answered by @wyat.appel since the AMET analysis scripts are outside my area of expertise.

---

<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:** [September 28, 2022, 7:46pm UTC](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590/23 "2022-09-28T19:46:51Z")

</div>

Thanks for providing the plot. I checked my code and I think I see what’s happening. Please make the following change in your all\_scripts.input file.

Move the following line (located near the top of the all\_scripts.input file):

query ← paste(" and s.stat\_id=d.stat\_id and d.ob\_dates BETWEEN",start\_date,“and”,end\_date,“and d.ob\_datee BETWEEN”,start\_date,“and”,end\_date,“and ob\_hour between”,start\_hour,“and”,end\_hour,add\_query,sep=" ")

to the bottom of the all\_scripts.input file (after the source command).

This should correctly apply the clim\_reg region to your analysis. Let me know if that change works for you.

Wyat

---

<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:** [September 28, 2022, 7:55pm UTC](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590/24 "2022-09-28T19:55:47Z")

</div>

Also note that you can only specify a single AMET\_ADD\_QUERY environment variable. It looks like you have possibly tried to set the AMET\_ADD\_QUERY environment variable twice. If you want to apply both of the those queries, you’ll need to do it in a single query string. For example:

setenv AMET\_ADD\_QUERY “and (d.month=05 or d.month=06 or d.month=07 or d.month=08 or d.month=09) and d.O3\_8hrmax\_ob \>= 60”

The string above will limit the analysis by May-Sept and limit the MDA8 O3 obs to just those values above 60. The way you had it written, the second setenv would simply overwrite the first setenv, so you’d only be limiting the obs, not applying the May-Sept criteria.

Let me know if you have questions about that.

Wyat

---

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [September 28, 2022, 8:29pm UTC](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590/25 "2022-09-28T20:29:39Z")

</div>

Hello, @wyat.appel  
Thank you so much. It’s working now.

I greatly appreciate your help @wyat.appel@hogrefe.christian

[Previous page](https://forum.cmascenter.org/t/amet-for-specific-region-and-specific-emissions-level/3590.md?page=1)
