# What's the maskdata's format?

**URL:** <https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919>\
**Category:** Run Time Errors and Issues\
**Tags:** cmaq\
**Created:** [December 19, 2021, 4:56am UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919 "2021-12-19T04:56:38Z")\
**Posts on this page:** 12\
**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 19, 2021, 4:56am UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/1 "2021-12-19T04:56:38Z")

</div>

Hi all.  
I tried to serach from the net, but the link failed( [Link to GRIDMASK files](https://drive.google.com/drive/folders/1x9mJUbKjJaMDFawgy2PUbETwEUopAQDl)

- [Link to README text file with information on how these files were created](https://drive.google.com/open?id=1bgbMyiFZMYP68zIm9iLFO36bwVY5fw_o))  
Once I find [cjcoats](https://forum.cmascenter.org/u/cjcoats) said, Just use your favorite text editor to create a text file with lines of the form  
`COL ROW`  
containing a list of the in-mask ( `MASK=1` ) grid-cells.  
So I want to make my maskdata file with COL for first column, ROW for second column, MASK(value=1) for thidr column? And the first line shoud be COL ROW MASK? What’s the correct format? Please give me an example.  
Hope to get a prompt reply，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 19, 2021, 4:15pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/2 "2021-12-19T16:15:44Z")

</div>

Dose maskdata(ASCⅡ) looks like the following? And only list the grid cells that mask=1?

| COL | ROW | MASK |
| --- | --- | --- |
| 91 | 57 | 1 |
| 91 | 58 | 1 |
| 92 | 57 | 1 |
| 92 | 58 | 1 |
| 93 | 43 | 1 |
| 93 | 44 | 1 |
| 93 | 57 | 1 |
| 93 | 58 | 1 |
| 93 | 59 | 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:** [December 23, 2021, 3:53pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/3 "2021-12-23T15:53:28Z")

</div>

It seems that your question in this new thread is related to [this other thread you started](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/10) in which @cjcoats provided feedback on using `m3merge` to create mask files for use by CMAQ ISAM.

The mask file(s) used by CMAQ ISAM are described in a section of [Appendix B of the User’s guide](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Appendix/CMAQ_UG_appendixB_emissions_control.md#b4-applying-masks-for-spatial-dependence). Specifically, they are I/O API-style netCDF files that “contain a separate variable for each spatial region of interest. Each variable is a gridded field of real numbers from 0.0 to 1.0, with 0.0 outside of the region of interest and 1.0 completely inside the region”.

Given that you may not be able to access the example GRIDMASK file with US states due to country-specific blocks on Google services, here is a ncdump of the relevant header portions of that example file:

dimensions:  
TSTEP = 1 ;  
DATE-TIME = 2 ;  
LAY = 1 ;  
VAR = 49 ;  
ROW = 299 ;  
COL = 459 ;  
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 AL(TSTEP, LAY, ROW, COL) ;  
AL:long\_name = "AL " ;  
AL:units = "fraction " ;  
AL:var\_desc = "AL fractional area per grid cell " ;  
float AZ(TSTEP, LAY, ROW, COL) ;  
AZ:long\_name = "AZ " ;  
AZ:units = "fraction " ;  
AZ:var\_desc = "AZ fractional area per grid cell " ;  
float AR(TSTEP, LAY, ROW, COL) ;  
AR:long\_name = "AR " ;  
AR:units = "fraction " ;  
AR:var\_desc = "AR fractional area per grid cell " ;  
… " ;  
float WV(TSTEP, LAY, ROW, COL) ;  
WV:long\_name = "WV " ;  
WV:units = "fraction " ;  
WV:var\_desc = "WV fractional area per grid cell " ;  
float WI(TSTEP, LAY, ROW, COL) ;  
WI:long\_name = "WI " ;  
WI:units = "fraction " ;  
WI:var\_desc = "WI fractional area per grid cell " ;  
float WY(TSTEP, LAY, ROW, COL) ;  
WY:long\_name = "WY " ;  
WY:units = "fraction " ;  
WY:var\_desc = "WY fractional area per grid cell " ;

// global attributes:  
:IOAPI\_VERSION = "ioapi-3.2: Id: init3.F90 1 2017-06-10 18:05:20Z coats " ;  
:EXEC\_ID = "??? " ;  
:FTYPE = 1 ;  
:CDATE = 2019303 ;  
:CTIME = 150353 ;  
:WDATE = 2019303 ;  
:WTIME = 150353 ;  
:SDATE = -635 ;  
:STIME = 0 ;  
:TSTEP = 0 ;  
:NTHIK = 1 ;  
:NCOLS = 459 ;  
:NROWS = 299 ;  
:NLAYS = 1 ;  
:NVARS = 49 ;  
:GDTYP = 2 ;  
:P\_ALP = 33. ;  
:P\_BET = 45. ;  
:P\_GAM = -97. ;  
:XCENT = -97. ;  
:YCENT = 40. ;  
:XORIG = -2556000. ;  
:YORIG = -1728000. ;  
:XCELL = 12000. ;  
:YCELL = 12000. ;  
:VGTYP = -9999 ;  
:VGTOP = -9.e+36f ;  
:VGLVLS = 0.f, 0.f ;  
:GDNAM = "US12\_459X299 " ;  
:UPNAM = "cdf2uamv " ;  
:VAR-LIST = "AL AZ AR CA CO CT DE DC FL GA ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY " ;  
:FILEDESC = “” ;  
:HISTORY = “” ;  
}

---

<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 23, 2021, 4:54pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/4 "2021-12-23T16:54:10Z")

</div>

Thank you for your reply.  
I have download the the example GRIDMASK file with US states, and knew the header portions of that example file. My problem is I don’t know how the MASK\_REGION have something to do with the and the emission grid. Because I make maskfile with m3mask and m3merge for 11 regions,with the suggestion from this forum, such as [ISAM SA\_ACONC output error - CMAQ-ISAM - CMAS CENTER FORUM](https://forum.cmascenter.org/t/isam-sa-aconc-output-error/1622). And thank you again for your explanation. But the tracking result for each region is zero. I think the MASK\_REGION must be not connected to the emission file’s grid. So I conclude that my MASK\_REGION is not correct, and the problem should be the fomat of my maskdata file. Can you tell me what variable should be in the maskdata? I have tried with only COL and ROW, and also don’t work. Look forward to your reply, thank you.

---

<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:** [December 23, 2021, 5:57pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/5 "2021-12-23T17:57:35Z")

</div>

Thanks for your response. If I’m understanding your problem correctly, there are at least two potential reasons for why your ISAM results for each region are zero - 1) the MASK\_REGION file you generated with m3mask and m3merge does not provide the expected information, or 2) your CMAQ run script, EmissCtrl namelist flile, and isam\_control.txt file have not been configured correctly to use the MASK\_REGION file you generated.

Before going back to possibility 1) (which would be best discussed in the [other thread you started](https://forum.cmascenter.org/t/how-to-make-isam-regions-file/2877/10)), I’d like to rule out possibility 2).

Assuming the MASK\_REGION file you generated is /home/pbwang/CMAQ5.3/data/maskdata1/files/cmaqmasks.nc and contains variables m01, m02, … m11 on the same grid as your emission files you’d have to make sure to do the following:

In your run script, setenv ISAM\_REGIONS /home/pbwang/CMAQ5.3/data/maskdata1/files/cmaqmasks.nc

In the RegionsRegistry of your EmissCtrl file, reference the environment variable for the mask file set in your run script:

&RegionsRegistry  
RGN\_NML =  
! | Region Label | File\_Label | Variable on File  
‘ALL’ ,‘ISAM\_REGIONS’,‘ALL’,  
/

[note that you can use any other name for the environment variable referencing your mask file, e.g. MASK\_REGION, as long as the name is consistent between the run script and the EmissCtrl namelist file]

In your isam\_control.txt file, define tags that reference one or more of the variables contained in your mask file (i.e. m01, m02, etc.), e.g.

!!! gridded emissions from region m01  
TAG NAME |G01  
REGION(S) |m01  
EMIS STREAM(S) |GR\_EMIS

where GR\_EMIS has to be the label of an emissions stream defined in your run script (e.g. setenv GR\_EMIS\_LAB\_001 GR\_EMIS).

One way to confirm that CMAQ correctly reads the variables from your grid mask file is to check the following portion of the CTM\_LOG files:

```
 |> Check Emissions Mapping:
 +============================

 =============================================================================
 |> SCALING EMISSIONS CONSISTENT WITH EMISSIONS CONTROL FILE SUPPLIED BY USER
 =============================================================================

 |> Regions Available for Scaling:
 =================================
    Number Region Label File Label Variable
    ------ ------------ ---------- --------
      1 EVERYWHERE N/A N/A
      2 m01 ISAM_REGIONS m01
      3 m02 ISAM_REGIONS m02

```

etc.

If your setup matches what’s described above, it indeed would seem to suggest a problem with the mask file you generated with m3mask and m3merge. In that case, it would be best to follow up in the other thread.

---

<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 24, 2021, 12:52pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/7 "2021-12-24T12:52:16Z")

</div>

I find my CMAQ can reads the variables from my grid mask file.（Here is another task’s CTM\_LOG files, and I change my variables from m01,m02……to M01, M02……)  
|\> SCALING EMISSIONS CONSISTENT WITH EMISSIONS CONTROL FILE SUPPLIED BY USER  
=============================================================================

```
 |> Regions Available for Scaling:
 =================================
    Number Region Label File Label Variable
    ------ ------------ ---------- --------
      1 EVERYWHERE N/A N/A
      2 R01 CMAQ_MASK M01
      3 R02 CMAQ_MASK M02
      4 R03 CMAQ_MASK M03
      5 R04 CMAQ_MASK M04
      6 R05 CMAQ_MASK M05
      7 R06 CMAQ_MASK M06
      8 R07 CMAQ_MASK M07
      9 R08 CMAQ_MASK M08
     10 R09 CMAQ_MASK M09
     11 R10 CMAQ_MASK M10
     12 R11 CMAQ_MASK M11

```

But, I find that there is a problem in ISAM\_REGIONS with Time step :  
Warning! Something went wrong while reading the  
RegionFamilies section of the Emissions Control  
Namelist. Default values for this section will be  
assumed.

```
 "CMAQ_MASK" opened as OLD:READ-ONLY   
 File name "/home/pbwang/CMAQ5.3/data/maskdata3/files/CMAQ_MASK"
 File type GRDDED3 
 Execution ID "????????????????"
 Grid name "CN5NC_156X117"
 Dimensions: 117 rows, 156 cols, 1 lays, 11 vbles
 NetCDF ID: 851968 opened as READONLY            
 Time-independent data.
 
 >>--->> WARNING in subroutine RDTFLAG
 Time step not available in file CMAQ_MASK for variable M01
 
 
 >>--->> WARNING in subroutine XTRACT3
 Time step not available for file: CMAQ_MASK
 
 
 >>--->> WARNING in subroutine INIT_REGIONS on PE 000
 Could not read M01 from file CMAQ_MASK
 
 
 >>--->> WARNING in subroutine RDTFLAG
 Time step not available in file CMAQ_MASK for variable M02
 
 
 >>--->> WARNING in subroutine XTRACT3
 Time step not available for file: CMAQ_MASK
 
 
 >>--->> WARNING in subroutine INIT_REGIONS on PE 000
 Could not read M02 from file CMAQ_MASK

```

I have two questions, first is RegionFamilies is not clear in the USER GUIDE, I don’t know if it is realation to the CMAQ\_MASK. Second is what’s the time step of CMAQ\_MASK, I have tried with the time step zero andan 010000. But the results of my 11 regions ISAM is all the same, all zero.  
Now I think my CMAQ\_MASK must be wrong. Please help me analyze the problem,thank you.

---

<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:** [December 24, 2021, 5:00pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/8 "2021-12-24T17:00:05Z")

</div>

Thanks for the detailed feedback and posting the relevant sections from your CTM\_LOG file. Yes, it seems there is a problem with your mask file, specifically with its time structure. Based on the error message, I suspect that there may be an inconsistency between SDATE, STIME, and TSTEP on the one hand and the values of the TFLAG variable on the other hand that prevent the code from reading the contents of your mask file properly. Given that the masks are initialized to zero, this read failure then leads to zero contributions for ISAM tags referencing these mask variables.

Could you please post the results of ncdump -v TFLAG /home/pbwang/CMAQ5.3/data/maskdata3/files/CMAQ\_MASK?

Regarding your question on the RegionFamilies section of the EmissCtrl, this is not really relevant to your current problem, so you can keep it commented out. In general, what it allows you to do is to define new combined regions from individual variables contained in your CMAQ\_MASK file to more efficiently apply emission scaling rules or define ISAM tags across multiple regions. For example, if you wanted to define a new region M123 as combination of M01, M02, and M03, you could do something like this:  
&RegionFamilies  
NRegionFamilies = 1  
RegionFamilyName(1) = ‘M123’  
RegionFamilyNum(1) = 3  
RegionFamilyMembers(1,:)= ‘M01’,‘M02’,‘M03’  
/  
and you could then refer to M123 in the EmissCtrl regional scaling instructions and/or the isam\_control.txt file. Of course, you can already list multiple regions in isam\_control.txt for a given tag, so the “Families” construct is simply a way to do so more efficiently if you end up using a given combination of regions repeatedly for emissions scaling and/or ISAM tag definitions.

---

<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 25, 2021, 1:58am UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/9 "2021-12-25T01:58:35Z")

</div>

Thank you for your reply, and I know RegionFamily works like a group. Here is my results of ncdump -v TFLAG  
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 M03(TSTEP, LAY, ROW, COL) ;  
M03:long\_name = "M03 " ;  
M03:units = "none " ;  
M03:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M04(TSTEP, LAY, ROW, COL) ;  
M04:long\_name = "M04 " ;  
M04:units = "none " ;  
M04:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M05(TSTEP, LAY, ROW, COL) ;  
M05:long\_name = "M05 " ;  
M05:units = "none " ;  
M05:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M06(TSTEP, LAY, ROW, COL) ;  
M06:long\_name = "M06 " ;  
M06:units = "none " ;  
M06:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M07(TSTEP, LAY, ROW, COL) ;  
M07:long\_name = "M07 " ;  
M07:units = "none " ;  
M07:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M08(TSTEP, LAY, ROW, COL) ;  
M08:long\_name = "M08 " ;  
M08:units = "none " ;  
M08:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M09(TSTEP, LAY, ROW, COL) ;  
M09:long\_name = "M09 " ;  
M09:units = "none " ;  
M09:var\_desc = "1==mask region, 0==outside-mask region " ;  
float M10(TSTEP, LAY, ROW, COL) ;  
M10:long\_name = "M10 " ;  
M10:units = "none " ;  
M10: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 = 2021354 ;  
:CTIME = 142105 ;  
:WDATE = 2021354 ;  
:WTIME = 142105 ;  
: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” ;  
:UPNAM = "M3MERGE " ;  
:VAR-LIST = "M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 " ;  
:FILEDESC = "US EPA COMMUNITY MULTISCALE AIR QUALITY MODEL METEOROLOGY-CHEMISTRY INTERFACE PROCESSOR MCIP V5.1 FROZEN 11/21/2019 INPUT METEOROLOGY DATA FROM WRF ARW V4.2 INPUT RUN INITIALIZED: 2018-12-25-00:00:00.0000 CUMULUS PARAMETERIZATION: Betts-Miller-Janjic SHALLOW CONVECTION: No shallow convection MICROPHYSICS: Purdue Lin et al. LONGWAVE RADIATION: RRTM SHORTWAVE RADIATION: Dudhia PBL SCHEME: Mellor-Yamada-Janjic (Eta) TKE SURFACE LAYER SCHEME: Monin-Obukhov (Janjic Eta) LAND-SURFACE SCHEME: NOAH Land-Surface Model URBAN MODEL: Multi-Layer Bldg Energy Model LAND USE CLASSIFICATION: MODIFIED\_IGBP\_MODIS 3D ANALYSIS NUDGING: OFF WIND COEFF: not applicable TEMP COEFF: not applicable MOIS COEFF: not applicable GEOP COEFF: not applicable SFC ANALYSIS NUDGING: OFF WIND COEFF: not applicable TEMP COEFF: not applicable MOIS COEFF: not applicable OBS NUDGING: OFF WIND COEFF: not applicable TEMP COEFF: not applicable MOIS COEFF: not applicable EARTH RADIUS ASSUMED IN MCIP: 6370000.000 m " ;  
:HISTORY = “” ;  
data:

TFLAG =  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_,  
\_, \_ ;  
}  
I made this CMAQ\_MASK only by COL and ROW (the cell in the mask）. I input SDATE, STIME, and TSTEP ,Duration time with 2018360, 000000, 010000, 8890000 in this CMAQ\_MASK.  
I tried ncdump -v M01,the value of M01:  
data:

M01 =  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
\_, \_, \_, \_, \_, \_, \_, \_, \_, \_, \_,  
……………………  
So is there any problem with the TFLAG and M01? I found that the FLAG and M01 in CMAQ\_MASK which I input SDATE, STIME, and TSTEP ,Duration time all zero, are the same as I past above.

---

<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 25, 2021, 11:05am UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/10 "2021-12-25T11:05:15Z")

</div>

> So is there any problem with the TFLAG and M01?..

This says that the file-header has been created but no data has been written to the file.

---

<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 25, 2021, 1:48pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/11 "2021-12-25T13:48:06Z")

</div>

Thank you for your reply @cjcoats. So there is something wrong with my CMAQ\_MASK. I made the CMAQ\_MASK with the maskdata file which is a txtfile and only list the COL and ROW of the cell that mask=1. I made maskfile with m3mask. And I input ncdump -v MASK maskfile1:  
MASK =  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,  
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
…………  
But after I changed my CMAQ\_MASK’s variable form int to float with the program（I learned form [https://forum.cmascenter.org/t/isam-sa-aconc-output-error/1622/10）](https://forum.cmascenter.org/t/isam-sa-aconc-output-error/1622/10%EF%BC%89)  
ncdump -h CMAQ\_MASK \>CMAQ\_MASK.cdl  
vi CMAQ\_MASK.cdl (change “int” to “folat”)  
ncgen -o CMAQ\_MASK CMAQ\_MASK.cdl  
Then I tried ncdump -v M01,the value of M01 change to what I past above. So how to change the type of the variable？ Did ncgen need to install first?

---

<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:** [December 25, 2021, 5:35pm UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/12 "2021-12-25T17:35:14Z")

</div>

I haven’t tried the method of converting int to float using a combination of ncdump and ncgen myself, but it seems that you should not use “-h” in the command sequence above, otherwise your new netcdf file just contains the header data of the original file with no actual data, exactly the behavior you’re seeing. So, try this instead and verify afterwards with ncdump that that TFLAG and M01, M02, etc. all look reasonable:

> ncdump CMAQ\_MASK \>CMAQ\_MASK.cdl  
> vi CMAQ\_MASK.cdl (change “int” to “float”)  
> ncgen -o CMAQ\_MASK CMAQ\_MASK.cdl

---

<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, 2:01am UTC](https://forum.cmascenter.org/t/whats-the-maskdatas-format/2919/13 "2021-12-26T02:01:30Z")

</div>

Really appreciate you @hogrefe.christian @cjcoats  
The variables data has been written into my new CMAQ\_MASK. Now I’m trying to run the ISAM.
