Improvements for the Masking codes

    current suggestions

  1. Try masking nested domains simultaneously to avoid troubles like this.

  2. Consider having both Grids and PE_mask preserve the coastline data file name into a global attribute. Then can grab this information for the Matlab version.

  3. The netCDF variables ncseg & lcseg have identical names to the similar maximal dimensions. These are often confused (standard packages, i.e. getnc) with "coordinate variables" (e.g. COARDS convention). This leads to errors. Change the names.

  4. Currently the Matlab & FORTRAN versions produce a different ordering for the islands. This is unacceptably unsystematic. To correct this:
    1. Load the boundary indices in the FORTRAN version to mimic the Matlab ordering. This will give the initial lists with consistent ordering.
    2. Reorder the islands based on size. This is done for sequential resetting of streamfunctions around islands. Use the exact same sorting code for both versions. Measure size based on either
      • Length of island coastlines
      • Area (number of grid points) contained within island.

  5. Create an option to initialize masks based on whether a point is inside GSHHS polygons.

  6. When GRIDS recognizes cyclic topography, PE_mask should produce masks with this feature.

  7. In the Matlab version,

  8. Update the FORTRAN version to:

  9. Protect PE_mask against failing if no land is masked.

  10. Possible useful annotations to Matlab version:

  11. Perhaps in clean_mask, should reflect near boundary to boundary. This would ensure 2 active points masked along boundary.

  12. Rename this stuff HOPS_Mask?