# How to make ISAM\_REGIONS file?

**URL:** <https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877>\
**Category:** CMAQ\
**Tags:** cmaq\
**Created:** [December 14, 2021, 8:32am UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877 "2021-12-14T08:32:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 14, 2021, 8:32am UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/1 "2021-12-14T08:32:44Z")

</div>

Dear all  
I’m using the CMAQ-ISAM to apportionment the local pollution contribution of the surrounding area.I use m3mask and m3merge creat a maskfile with 11 mask regions.I can run the CMAQ-ISAM without errors, but my reuslt of 11 mask regions’ contributions are all zero.I don’t know what’s wrong.When I use m3stat to test my maskfile, it shows that:  
Program version:  
Id:: m3stat.f 17 2017-09-02 16:47:59Z coats

```
 Value for IOAPI_CHECK_HEADERS not defined;returning default: FALSE
  
 "FOO" opened as OLD:READ-ONLY   
 File name "/home/pbwang/CMAQ5.3/data/maskdata1/files/cmaqmask_1"
 File type GRDDED3 
 Execution ID "????????????????"
 Grid name "CN5NC_156X117_CR"
 Dimensions: 117 rows, 156 cols, 1 lays, 11 vbles
 NetCDF ID: 65536 opened as READONLY            
 Time-independent data.
  
 The list of variables in file "FOO" is:
  
 m01 (fraction): Variable m01
 m02 (fraction): Variable m02
 m03 (fraction): Variable m03
 m04 (fraction): Variable m04
 m05 (fraction): Variable m05
 m06 (fraction): Variable m06
 m07 (fraction): Variable m07
 m08 (fraction): Variable m08
 m09 (fraction): Variable m09
 m10 (fraction): Variable m10
 m11 (fraction): Variable m11
  

 File: FOO             
 
 >>--->> WARNING in subroutine RDTFLAG
 Time step not available in file FOO for variable m01
 
 
 *** ERROR ABORT in subroutine M3STAT:STATGRID
 Read failure: file FOO variable m01

```

When I make maskfile with m3merge, the program needs to input the starting DATE, starting TIME, OUTPUT TIME STEP and RUN DURATION in the program. But I was confused that the format of starting DATE is HHMMSS,.I don’t know how to in put this variable.The following is my information of maskfile:  
netcdf cmaqmask\_2 {  
dimensions:  
TSTEP = 1 ;  
DATE-TIME = 2 ;  
LAY = 1 ;  
VAR = 11 ;  
ROW = 117 ;  
COL = 156 ;  
variables:  
int TFLAG(TSTEP, VAR, DATE-TIME) ;  
TFLAG:units = “\<YYYYDDD,HHMMSS\>” ;  
TFLAG:long\_name = "TFLAG " ;  
TFLAG:var\_desc = "Timestep-valid flags: (1) YYYYDDD or (2) HHMMSS " ;  
float m01(TSTEP, LAY, ROW, COL) ;  
m01:long\_name = "m01 " ;  
m01:units = "none " ;  
m01:var\_desc = "1==mask region, 0==outside-mask region " ;  
float m02(TSTEP, LAY, ROW, COL) ;  
m02:long\_name = "m02 " ;  
m02:units = "none " ;  
m02:var\_desc = "1==mask region, 0==outside-mask region " ;  
…………………………  
float m11(TSTEP, LAY, ROW, COL) ;  
m11:long\_name = "m11 " ;  
m11:units = "none " ;  
m11:var\_desc = "1==mask region, 0==outside-mask region " ;

// global attributes:  
:IOAPI\_VERSION = "ioapi-3.2: Id: init3.F90 98 2018-04-05 14:35:07Z coats " ;  
:EXEC\_ID = "??? " ;  
:FTYPE = 1 ;  
:CDATE = 2021348 ;  
:CTIME = 60132 ;  
:WDATE = 2021348 ;  
:WTIME = 60132 ;  
:SDATE = 0 ;  
:STIME = 0 ;  
:TSTEP = 0 ;  
:NTHIK = 1 ;  
:NCOLS = 156 ;  
:NROWS = 117 ;  
:NLAYS = 1 ;  
:NVARS = 11 ;  
:GDTYP = 2 ;  
:P\_ALP = 30. ;  
:P\_BET = 60. ;  
:P\_GAM = 105.661399841309 ;  
:XCENT = 105.661399841309 ;  
:YCENT = 34.6201438903809 ;  
:XORIG = -390000. ;  
:YORIG = -290000. ;  
:XCELL = 5000. ;  
:YCELL = 5000. ;  
:VGTYP = -9999 ;  
:VGTOP = 5000.f ;  
:VGLVLS = 1.f, 0.998f ;  
:GDNAM = “CN5NC\_156X117\_CR” ;  
:UPNAM = "M3MERGE " ;  
:VAR-LIST = "m01 m02 m03 m04 m05 m06 m07 m08 m09 m10 m11 " ;

I have input the time step when I make the maskfile with m3merge. But we can see there is no time step in my maskfile.  
Sincerely hope to get your help, thank you!

---

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 14, 2021, 8:38am UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/2 "2021-12-14T08:38:54Z")

</div>

What is the key of the problem ? time step?

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [December 14, 2021, 12:41pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/3 "2021-12-14T12:41:28Z")

</div>

Oops – there’s a prompt-bug in _m3merge_: instead of

> `Enter starting DATE for the run (HHMMSS)`

it should have been

> `Enter starting DATE for the run (YYYYDDD)`

As for the “But we can see there is no time step in my maskfile”: outputs from _m3mask_ are time independent and so are applicable to all time steps (something frequently not well-understood; see [https://cjcoats.github.io/ioapi/DATETIME.html](https://cjcoats.github.io/ioapi/DATETIME.html))

---

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 14, 2021, 1:33pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/4 "2021-12-14T13:33:12Z")

</div>

thank you cjcoats. I’ll correct my starting DATE in m3merge and try again.  
m3mask program is nothing to do with timestep. But m3merge need to input time step.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [December 14, 2021, 1:38pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/5 "2021-12-14T13:38:05Z")

</div>

Set the input time step to 0, as suggested by the date&time-conventions document…

---

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 14, 2021, 2:01pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/6 "2021-12-14T14:01:29Z")

</div>

> [@pbwang](#):
>
> RUN DURATION

Thank you for your prompt reply,cjcoats.  
How about RUN DURATION? And I followed hogrefe.christian’s advice, edit maskfile’s variable descriptions from integer to float. I’m not sure this change is correct.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [December 14, 2021, 2:07pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/7 "2021-12-14T14:07:23Z")

</div>

variable-type for mask-variables needs to be consistent across the programs that use it.

For a yes-or-no mask-decision, the use if `INTEGER` (which is not subject to round-off error) is appropriate; note that the _m3mask_ program (which correctly uses `INTEGER`) pre-dates all the CMAQ ocean-masking (which does not).

So there is a bit of a problem. (Fortunately, the bit-pattern for `INTEGER` zero is the same as the bit-pattern for `REAL` zero – all zeros, so up to a point you “get away with it”.)

---

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 14, 2021, 2:25pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/8 "2021-12-14T14:25:07Z")

</div>

@cjcoats  
So , the variable type looks like changed. But the value of variable is just only o or 1, not a fraction?

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [December 14, 2021, 2:34pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/9 "2021-12-14T14:34:48Z")

</div>

As far as computers are concerned, we don’t have “fractions” – only “bit patterns” that are interpreted according to variable-type. And fortunately the `REAL` and `INTEGER` bit-patterns are the same (all bit-zeros)…

---

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 16, 2021, 1:39pm UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/10 "2021-12-16T13:39:15Z")

</div>

@cjcoats  
I have changed the input time,data,and timestep,tried again,but the 11mask’s contribution are all zero. So I 'll change the value of grids to be rounded to be the integer., and try again.  
The following is my grids’svalue:  
1, 1, 1001,1.00000000  
1, 2, 1002,1.00000000  
1, 3, 1003,1.00000000  
1, 4, 1004,1.00000000  
1, 5, 1005,1.00000000  
1, 6, 1006,1.00000000  
1, 7, 1007,1.00000000  
1, 8, 1008,1.00000000  
1, 9, 1009,1.00000000  
1, 10, 1010,1.00000000  
1, 11, 1011,1.00000000  
1, 12, 1012,1.00000000  
1, 13, 1013,1.00000000  
1, 14, 1014,1.00000000  
1, 15, 1015,1.00000000  
1, 16, 1016,1.00000000  
1, 17, 1017,1.00000000  
1, 18, 1018,1.00000000  
1, 19, 1019,1.00000000  
1, 20, 1020,1.00000000  
1, 21, 1021,1.00000000  
1, 22, 1022,1.00000000  
1, 23, 1023,1.00000000  
1, 24, 1024,1.00000000  
1, 25, 1025,1.00000000  
1, 26, 1026,1.00000000  
1, 27, 1027,1.00000000  
1, 28, 1028,1.00000000  
1, 29, 1029,1.00000000  
1, 30, 1030,0.60140818  
1, 31, 1031,0.00000000  
1, 32, 1032,0.00000000

---

<div class="post-metadata">

**Author:** ![pbwang](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pbwang](https://forum.cmascenter.org/u/pbwang)\
**Post date:** [December 26, 2021, 7:56am UTC](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/11 "2021-12-26T07:56:47Z")

</div>

Thank you for your suggestion, I got it @cjcoast
