Another way to generate the ISAM regions maks file is to use the Spatial Allocator using the script which was developed to generate the oceanfile (e.g. alloc_surf_zone_to_oceanfile.csh)
You just need your GRIDDESC, a shapefile with the area you want to map and the Spatial allocator.
Here is an example:
#! /bin/csh -f
#******************* Allocate Shapefiles Run Script **************************
# Allocates a polygon shapefile's data to an I/O API gridded file
# Oct. 2006, LR
# Dec. 2007, LR -- projection specification changes
#*****************************************************************************
setenv DEBUG_OUTPUT Y
# Set executable
setenv EXE "$SA_HOME/bin/32bits/allocator.exe"
# Set Input Directory
setenv DATADIR $SA_HOME/data
setenv OUTPUT $SA_HOME/output
# Select method of spatial analysis
setenv MIMS_PROCESSING ALLOCATE
setenv TIME time
#set "data" shapefile parameters
setenv GRIDDESC $DATADIR/GRIDDESC.txt
**These information you can get from in your shapefile projection**
#set parameters for file being allocated
setenv INPUT_FILE_NAME $DATADIR/surfzone/surfzone_NC_SC
setenv INPUT_FILE_TYPE ShapeFile
setenv INPUT_FILE_MAP_PRJN "+proj=lcc,+lat_1=33,+lat_2=45,+lat_0=40,+lon_0=-97"
setenv INPUT_FILE_ELLIPSOID "+a=6370000.0,+b=6370000.0"
setenv ALLOCATE_ATTRS TYPE
setenv ALLOC_MODE_FILE ALL_AREAPERCENT
#Set this to SURF_ZONE to create the variables needed for CMAQ OCEANfile
setenv ALLOC_ATTR_TYPE **NAME_OF_THE_ATTRIBUTE_IN_THE_SHAPEFILE**
**These information you can get from your GRIDDESC**
# Set name and path of resulting shapefile
setenv OUTPUT_FILE_TYPE IoapiFile
setenv OUTPUT_GRID_NAME NC4KM
setenv OUTPUT_FILE_MAP_PRJN "+proj=lcc,+lat_1=33,+lat_2=45,+lat_0=40,+lon_0=-97"
setenv OUTPUT_FILE_ELLIPSOID "+a=6370000.0,+b=6370000.0"
setenv OUTPUT_FILE_NAME /OUTPUT/MAKS_ISAM_${OUTPUT_GRID_NAME}.ncf
#echo "Allocating MAKS data to CMAQ ISAM"
$TIME $EXE
This script can generates one are at a time, so if you have nine areas, you need to run it 9 times (remember to change the attribute name for each area).
After it, you can merge them with m3merge, for example.
Additionally, check the number of variables in the global attributes of the NetCDF file just to make sure it has the correct number of variables.
Regards