Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

How do I create a user-defined SCRIP grid file?

Hi all,

I want to create a new user-defined grid, but I need first to generate a SCRIP grid file for the atmosphere and ocean model components (point 1 in page 79 of the CESM1.2 user's guide).

I have successfully generated SCRIP grid files by using the following NCL function:
gridname = "output_filename.nc"
lat = 1d_vector
lon = 1d_vector
opt = True
opt@Mask2D = where(.not.ismissing(mask),1,0)
rectilinear_to_SCRIP(gridname,lat,lon,opt)
However, I need to specify the land/sea mask for the ocean. I assume that I have to interpolate it from a pre-existing out-of-the-box predefined grid file. Is it right? Where could I find this file? Is there any file with very large resolution so that the interpolation does not generate large errors? Should the land/sea mask be a 3D matrix depending on longitude, latitude and depth? (that is, taking into account the bathymetry?).

Many many thanks for your help.
joan
 

mlevy

Michael Levy
CSEG and Liaisons
Staff member
Hi Joan,
If you are using NCL version 6.1 or later, you can use the landsea_mask function. There is a 1x1 mask provided with NCL, so I took your code and inserted the following two lines:
Code:
fmask = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/landsea.nc","r")
opt@Mask2D = where(landsea_mask(fmask->LSMASK, lat, lon).eq.0,1,0)
Note that landsea_mask actually provides 5 different types of cells; the example I included will only mask ocean cells but you can include lakes, small islands, or ice shelfs in your mask as well.
 
Top