CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
178 stars 64 forks source link

Problem making fort.15 file for ADCIRC model in OceanMesh2D #292

Closed jalal-90 closed 11 months ago

jalal-90 commented 11 months ago

Dear all,

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

Problem Error using msh/CheckTimestep (line 3051) This function has been deprecated. Use "bound_courant_number" instead

Array indices must be positive integers or logical values. Error in msh/make_bc (line 1446) eb_depth = gdat.Fb(eb_mid); Error in msh/makens (line 1259) obj = make_bc(obj,type,varargin);

Error using Calc_IT_Fric (line 30) Must put bathymetry and bathymetric slopes on the msh object (use GridData)

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

% Specify your simulation parameters DT = 5.0 ; % DT - TIME STEP (IN SECONDS) TS = '19-Jul-2021 00:00' ; % start time of simulation TE = '26-Jul-2021 00:00' ; % end time of simulation DEMFILE = 'topo15_compressed.nc'; BUOYFILE = 'Gridded_N_values_WOA2018_2005-2007.mat'; TPXO9 = 'tpxo9_netcdf/h_tpxo9.v2.nc'; CONST = 'major8' ;

% m = interp(m,DEMFILE,'type','lim_bathy_slope') ; m = CheckTimestep(m,DT) ; m = renum(m) ; m = makens(m,'auto',gdat) ; % geodata instance from the example

% plot(m,'bd',0); % check your boundary conditions here

m = Calc_tau0(m) ;

m = interp(m,DEMFILE,'type','lim_bathy_slope') ;

m = Calc_IT_Fric(m,BUOYFILE) ;

m = Make_f15( m, TS, TE, DT, 'tidal database', TPXO9, 'const', ... {CONST},'sta_database',{'CO-OPS','NDBC',[1]} ) ;

m.f15.dramp = 6; % ramp period m.f15.nramp = 1; % ramp type m.f15.outge = [1 0.0 6.0 120]; % global elevation m.f15.ntip = 0; % 0, tidal potential & self attraction/load tide forcings are not used m.f15.oute = [0 0.0 6.0 120]; % station output frequency m.f15.outhar = [10 40 360 0]; % THAS, THAF, NHAINC, FMV m.f15.outhar_flag = [0 0 1 1] ; % NHASE, NHASV, NHAGE, NHAGV

write( m ) ; % write all files to disk

krober10nd commented 11 months ago

Did you read the error you pasted?

jalal-90 commented 11 months ago

Did you read the error you pasted?

Thank you very much for your kind advice. I solved the issue for fort.15 file. Could I have an example script for Calc_f13_inpoly () function?