Spatial Allocator Ocean file -> land file

I want to create land mask file, meaning Ocean value should be 0 and land value should be 1.
Is there any description for ALLOC_ATTR_TYPE, such as SURF_ZONE.



If I understand correctly, you want the reverse of the ocean file that you are showing above.

To do this you need a shapefile with the attribute for the land polygons set to the value of 1. It is easy to get this from the included shapefile with GIS tools like ArcMap (you can also subset it for your domain to make the process with spatial allocator faster).

Then, in the script above, you will have to change ALLOCATE_ATTRS to the name of that attribute in your shapefile (TYPE is the original one). Also you can change ALLOC_ATTR_TYPE to something meaningful to you (i.e. AREA_FRACTION).

Note that the netcdf mask file that gets created may not work “as is” with m3tools that work with INTEGER type of masks for a yes-or-no decision (m3diff and option 20 for getting the product for your example) but will work just fine with other tools like R/Python for manipulating existing input/output.

I believe this is also the preferred method for creating masks for CMAQ-ISAM, CMAQ-DDM, and DESID.


I was able to make land mask file!
Thank you

Although it may be possible, we have not created a land mask file with the spatial allocator.

A couple of ideas:

  • If you are able to create an ocean file, use I/O API or netcdf tools to take 1-the fraction in each grid cell
  • If you have MCIP data, the MCIP variable LWMASK in the GRIDCRO2D file is used for this purpose (land=1, water=0).
1 Like