Hi @krober10nd and @WPringle,
I am following the typical workflow provided in the userguide to create input files (fort.15) for ADCIRC simulation. When I type the code m = Calc_tau0(m), an error occurs and prompts "No bathymetry data in the grid to calculate the tau0 coefficients". However, I have complete the interpolation by carrying out the previous step m = interp(m, DEMFILE, 'type', 'depth'). In the msh class, the attribute of b is not empty and the value of b is not always 0. I don't know why this happened. The following is my code,
% Example: Mesh the PRD
clearvars; clc;
addpath(genpath('utilities/'))
addpath(genpath('datasets/'))
addpath(genpath('m_map/'))
%% STEP 1: set mesh extents and set parameters for mesh.
bbox = [111.5 116.5; % lon_min lon_max
18 24]; % lat_min lat_max
min_el = 150; % minimum resolution in meters.
max_el = 5e4; % maximum resolution in meters.
max_el_ns = 200; % maximum resolution nearshore in meters.
grade = 0.3; % 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...
dem = 'topo15_compressed.nc'; coastline = 'GSHHS_f_L1';
gdat = geodata('shp',coastline,'dem',dem,'h0',min_el,...
'bbox',bbox);
% NOTE: You can plot the shapefile with bounding box by using the
% overloaded plot command:
% plot(gdat,'shp'); plot(gdat,'dem');
%% 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',1);
mshopts = mshopts.build;
m = mshopts.grd;
% plot(m,'tri');
DT = 2 ; % Stable timestep
TS = '01-Aug-2012 00:00' ; % start time of simulation
TE = '31-Nov-2012 00:00' ; % end time of simulation
DEMFILE = 'topo15_compressed.nc';
BUOYFILE = 'Gridded_N_values.mat';
TPXO9 = 'h_tpxo9.v1.nc';
CONST = 'major8';
m = interp(m, DEMFILE, 'type','depth');
plot(m,'b')
m = CheckTimestep(m,DT);
m = renum(m);
m = make_bc(m,'auto',gdat); % make the nodestring boundary conditions
% plot(m,'bd',0);
% makens(m,'outer',1)
m = Calc_tau0(m);
Looking forward to your reply.
Best wishes.
Jiangchao