CMAQV5.3 ISAM Region not found

Yukui,

A quick solution is to “borrow” the meta data. This solution assumes your new data is the same shape and consistent with the spatial domain in the borrowed meta data. For now, I assume you are using files with only one variable. This could be modified for multiple variables.

Each step includes code that can be used from the command line.

  1. Make your mask with ncl (hereafter /path/to/nclmask.nc)

  2. Copy an existing IOAPI compliant mask file

    cp /path/to/existing/ioapimask.nc /path/to/new/ioapimask.nc
    
  3. Use ncrename to change the variable name

    ncrename -v OLDNAME,NEWNAME /path/to/new/ioapimask.nc
    
  4. Use ncatted to edit the VAR-LIST global property to be consistent with the new name that must include 16 characters (spaces for unused characters).

    ncatted -a "VAR-LIST,global,o,c,NEWNAME         " /path/to/new/ioapimask.nc`
    
  5. Use python to overwrite the data (requires netCDF4 python library).

    python -ic "from netCDF4 import Dataset
    nclf = Dataset('/path/to/nclmask.nc')
    ioapif = Dataset('/path/to/ioapimask.nc', 'r+s')
    ioapif.variables['NEWNAME'][:] = nclf.variables['NEWNAME']
    ioapi.close()
    "