Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem creating fort.13 file for ADCIRC model in OceanMesh2D #293

Closed
jalal-90 opened this issue Jul 19, 2023 · 3 comments
Closed

Problem creating fort.13 file for ADCIRC model in OceanMesh2D #293

jalal-90 opened this issue Jul 19, 2023 · 3 comments

Comments

@jalal-90
Copy link

Dear all,

I am facing problem to create a fort.13 file for ADCIRC model in OceanMesh2D. Here, I added my problems followed by main code.

Problem
Index exceeds array bounds.

Error in Calc_f13 (line 66)
if strcmpi(varargin{1},'inpoly')

Main code

clearvars; clc;clear;close all

addpath('..')
addpath(genpath('./utilities/'))
addpath(genpath('./datasets/'))
addpath(genpath('./OceanMesh2D_Datasets/'))
addpath(genpath('./m_map/'))

% STEP 1: set mesh extents and set parameters for mesh.
bbox = [110 134; % lon_min lon_max
20 32]; % lat_min lat_max
min_el = 1e3; % minimum resolution in meters.
max_el = 100e3; % maximum resolution in meters.
max_el_ns = 5e3; % maximum resolution nearshore in meters.
grade = 0.35; % mesh grade in decimal percent.
R = 3; % number of elements to resolve feature width.

%-------------------------------------------------------------------------
% STEP 2: specify geographical datasets and process the geographical data
% to be used later with other OceanMesh classes...

coastline = 'GSHHS_f_L1';
gdat = geodata('shp',coastline,'bbox',bbox,'h0',min_el);

% STEP 3: create an edge function class
fh = edgefx('geodata',gdat,...
'fs',R,'max_el_ns',max_el_ns,...
'max_el',max_el,'g',grade);

% STEP 4: Pass your edgefx class object along with some meshing options and
% build the mesh...

mshopts = meshgen('ef',fh,'bou',gdat,'plot_on',1,'nscreen',5,'proj','trans');
mshopts = mshopts.build;
m = mshopts.grd; % unpack the mesh object
m = make_bc(m,'auto',gdat,'distance'); % make the boundary conditions

m = Calc_f13(m,'Ev');

@krober10nd
Copy link
Collaborator

Did you read the docstring for calc_f13? You're calling the function incorrectly.

@jalal-90
Copy link
Author

Did you read the docstring for calc_f13? You're calling the function incorrectly.

I am sorry for the inconvenience caused.
Could I have an example script for Calc_f13_inpoly () function?

@krober10nd
Copy link
Collaborator

@jalal-90 The calling format is in the docstring for the function. Please read the help documentation we put together and try to figure it out from there. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants