Grid Processing Scripts

From WikiROMS
Jump to navigationJump to search
c_contact.m
Creates a new contact coints NetCDF file for a ROMS nesting application. The contact point data is written elsewhere using write_contact.m. if the Ndatum argument is not provided, the datum dimension is unlimited.
c_contact  (ncname, spherical, Ngrids, Ndatum)
On Input:
ncname:   Ouptut contact points NetCDF file name (string)
spherical:   Spherical grid switch (logical)
Ngrids:   Number of nested grids
Ndatum:   Total number of contact points (optional)
contact.m
Sets ROMS nested grid contact points for each contact region. The order of the nested grid file names in the input cell array (Gnames) is important. Set the file names in the order of nesting layers and time-stepping in ROMS. The MaskInterp switch is only relevant when processing the contact region of a refinement grid. The setting of land/sea masking in the contact region is critical. Usually it is better to linearly interpolate the finer grid ψ- u-, and v-masks from coarser grid than recomputing via uvp_masks. The recomputed masks may be one point smaller or larger. Use the MaskInterp switch to either interpolate (true) or use uvp_masks (false). Recall that we are not modifying the original refined grid mask, but just computing the mask in the contact region adjacent to finer grid from the coarser grid mask. This is only relevant when there is a land/sea masking features in any of the refinement grid physical boundary. If so, the user just need to experiment with MaskInterp and edit such points during post-processing.
[S, G] = contact  (Gnames, Cname, Lmask, MaskInterp, Lplot)
On Input:
Gnames:   Input Grid NetCDF full path file names (cell array)
Cname:   Ouptut contact points NetCDF file name (string)
Lmask:   Switch to remove contact points over land (logical, optional, default false)
MaskInterp:   Switch to interpolate ψ-, u- and v-masks (true) or compute from interpolated ρ-mask (false). The default is false (logical, optional).
Cname:   Switch to plot various contact points figures (logical, optional, default true)
On Ouput:
S:   Nested grids contact points structure (struct array)
G:   Nested grids structure (1 x Ngrids struct array)
disp_contact.m
Prints the nested grids contact points unique values for each Contact Region. The contact points structure is rich and this simple function facilitates to summarize the contact points values.
disp_contact  (S)
On Input:
ncname:   Contact points structure(struct array)
grid_connections.m
Appends the nested grid connectivity fields between donor and receiver grids for each contact region to the nested grids structure, Sinp.
S = grid_connections  (G, Sinp)
On Input:
G:   Nested grids information structure (1 x Ngrids struct array)
Sinp:   Nested grids contact points structure (struct array)
On Output:
Sinp:   Outdated Nested grids contact points structure (struct array)
grid_perimeter.m
Creates a structure containing information about nested grids perimeters, boundary edges, and other information parameters.
S = grid_perimeter  (Gnames)
On Input:
Gnames:   Input Grid NetCDF full path file names (cell array)
On Output:
Sinp:   Beginning of contact points structure (struct array)
plot_contact.m
Plots various figures of contact points for each contact region.
plot_contact  (G, S)
On Input:
G:   Nested grids structure (1 x Ngrids struct array)
S:   Nested grids contact points structure (struct array)
read_contact.m
Reads in the nested grids contact points NetCDF file and loads data into a structure.
[S, G] = read_contact  (ncname)
On Input:
ncname:   Nested grids contact points NetCDF file name (string)
On Output:
S:   Nested grids contact points structure (struct array)
G:   Nested grids structure (1 x Ngrids struct array)
write_contact.m
Writes out the nested grids contact points data generated by contact.m or read_contact.m into a NetCDF.
write_contact   (ncname, S, Lcreate)
On Input:
ncname:   Nested grids contact points NetCDF file name (string)
S:   Nested grids contact points structure (struct array)
Lcreate:   Switch to create a new NetCDF file (logical, optional, default true)