I have masked a NetCDF file using basemap.gs
script in grads. Here is what I got using the mask:
So, I would like to obtain a NetCDF file which
Since you already have the non-continental values masked out, the process is actually fairly simple. There is a command called "sdfwrite" which can write and variable defined in grads to file. The code would go something like this:
define data =
set sdfwrite out.nc
sdfwrite data
*Make sure you remove the angle brackets; those were just for show
Entering these into grads will 1) allocate memory to save the displayed data in the variable "data" 2) set the name of the output file to "out.nc" (you can of course change this to whatever you like), and 3) writes the information in the variable "data" to the out.nc file.
Now as far as I know, there is no way to simply not have the masked out values not be written to file, but with this, they will all be written in as zero/undefined values.
sdfwrite documentation
Hope this Helps!!