function lndmake(fem_grid_struct,belfilename) %LNDMAKE create land masking information for FD CONTOURING % LNDMAKE creates a polygon list from existing .bel and the node % lists from a fem_grid_struct. This polygon list can be used with % the FD-based contouring and vector plotting functions (FDCONT) % to mask out the land. % % The .bel file must have been generated by the OPNML boundary % code generator GENBEL, since this code orders the boundary % elements in order, with islands connected and last in the file. % Other codes (CONVCODES, fortran, Dartmouth) also output .bel % information in the needed order. Work is ongoing to remove % this requirement. If a .bel file needs ordering, load the % .bel file into GENBEL and directly output it to a different % filename. % % LNDMAKE outputs new files for the land nodes and segments. % The new files are .lnd and .lbe, and are % output to the current working directory. Thus, LNDMAKE need % only be run once per domain. % % Input: fem_grid_struct - FEM domain structure % belfilename - FEM domain .bel file % % Output: NONE (See above) % % Call as: >> lndmake(fem_grid_struct,belfilename) % % Written by: Chris E. Naimie % Modified by: Brian O. Blanton to more general usage. (Jan 99) %----------------------------------------------------------------------- if nargin ~=2 error(' Incorrect number of input arguments to LNDMAKE'); end if ~is_valid_struct(fem_grid_struct) error(' Argument to LNDMAKE must be a valid fem_grid_struct.') end x=fem_grid_struct.x; y=fem_grid_struct.y; % Read boundary elements % [bel,gridname]=read_bel(belfilename); % % Outer boundary % % find last non-island boundary segment notsea=find(bel(:,5)~=2); lastnotsea=max(notsea); sea=find(bel(:,5)==2); firstsea=min(sea); if(firstsea