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

Enhancements/namelist #261

Merged
merged 5 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions @msh/private/writefort15.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

nm = 0 ;
for ib = 1: boudat.nbou
ibty = boudat.ibtype(ib)
ibty = boudat.ibtype(ib);

switch ibty
case {2,12,22,32,52}
Expand All @@ -197,7 +197,7 @@
% val = fscanf(fid, '%f ' ) ; % Must be revisit
icnt = 0 ;
for ib = 1: boudat.nbou
ibty = boudat.ibtype(ib)
ibty = boudat.ibtype(ib);

switch ibty
case {2,12,22,52}
Expand Down Expand Up @@ -316,8 +316,9 @@
fprintf( fid, '! -- Begin %s Control Namelist -- \n', f15dat.controllist(k).type ) ;
fprintf( fid, '&%sControl\n', f15dat.controllist(k).type ) ;
for m = 1:length(f15dat.controllist(k).var)
fprintf( fid, '%s = %s,\n',f15dat.controllist(k).var(m).name,...
f15dat.controllist(k).var(m).val) ;
val = f15dat.controllist(k).var(m).val;
if ~ischar(val); val = num2str(val); end
fprintf( fid, '%s = %s,\n',f15dat.controllist(k).var(m).name,val) ;
end
fprintf( fid, '/\n') ;
fprintf( fid, '! -- End %s Control Namelist -- \n', f15dat.controllist(k).type ) ;
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Default mesh improvement strategy is `ds` 2.
- Retrieve boundary indices in `msh.get_boundary_of_mesh` method. https://github.com/CHLNDDEV/OceanMesh2D/pull/259
- `msh.offset63` struct and associated write/make routines for dynamicwaterlevel offset functionality. https://github.com/CHLNDDEV/OceanMesh2D/pull/259
- dynamicWaterLevelCorrection to fort.15 namelist, and PRBCKGRND option to met fort.15 namelist. https://github.com/CHLNDDEV/OceanMesh2D/pull/261
## Fixed
- `msh.interp` method for `K` argument of length 1, and for the test to determine whether the bathymetry grid is irregular. https://github.com/CHLNDDEV/OceanMesh2D/pull/259
- Printing of namelist character strings or numbers. https://github.com/CHLNDDEV/OceanMesh2D/pull/261
- `Make_offset63.m` time interval computation. https://github.com/CHLNDDEV/OceanMesh2D/pull/261

### [5.0.0] - 2021-07-29
## Added
Expand Down
29 changes: 23 additions & 6 deletions utilities/Make_f15.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,33 @@
f15dat.extraline(10).msg = '';

% control lists
% met
f15dat.controllist(1).type = 'met';
f15dat.controllist(1).var(1).name = 'WindDragLimit';
f15dat.controllist(1).var(1).val = 0.0025;
f15dat.controllist(1).var(2).name = 'DragLawString';
f15dat.controllist(1).var(2).val = 'default';
f15dat.controllist(1).var(3).name = 'outputWindDrag';
f15dat.controllist(1).var(3).val = 'F';
f15dat.controllist(1).var(4).name = 'invertedBarometerOnElevationBoundary';
f15dat.controllist(1).var(2).name = 'PRBCKGRND';
f15dat.controllist(1).var(2).val = 1013;
f15dat.controllist(1).var(3).name = 'DragLawString';
f15dat.controllist(1).var(3).val = 'default';
f15dat.controllist(1).var(4).name = 'outputWindDrag';
f15dat.controllist(1).var(4).val = 'F';

f15dat.controllist(1).var(5).name = 'invertedBarometerOnElevationBoundary';
f15dat.controllist(1).var(5).val = 'F';
% dynamicwaterlevelcorrection control
f15dat.controllist(2).type = 'dynamicWaterLevelCorrection';
f15dat.controllist(2).var(1).name = [f15dat.controllist(2).type 'FileName'];
f15dat.controllist(2).var(1).val = 'offset.63';
f15dat.controllist(2).var(2).name = [f15dat.controllist(2).type 'Multiplier'];
f15dat.controllist(2).var(2).val = 1.0;
f15dat.controllist(2).var(3).name = [f15dat.controllist(2).type 'RampStart'];
f15dat.controllist(2).var(3).val = 0.0;
f15dat.controllist(2).var(4).name = [f15dat.controllist(2).type 'RampEnd'];
f15dat.controllist(2).var(4).val = 0.0;
f15dat.controllist(2).var(5).name = [f15dat.controllist(2).type 'RampReferenceTime'];
f15dat.controllist(2).var(5).val = 'coldstart';
f15dat.controllist(2).var(6).name = [f15dat.controllist(2).type 'SkipSnaps'];
f15dat.controllist(2).var(6).val = 0;

% Put into the msh class
obj.f15 = f15dat;
end
Expand Down
2 changes: 1 addition & 1 deletion utilities/Make_offset63.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
obj.offset63.num_times = length(time_vector);
obj.offset63.time_interval = round(...
seconds(time_vector(end) - time_vector(1))/ ...
length(time_vector)...
(length(time_vector)-1)...
);
obj.offset63.default_val = 0;
obj.offset63.offset_nodes = offset_nodes;
Expand Down
2 changes: 1 addition & 1 deletion utilities/refine2_om.m
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@
nold = size(vert,1);
vert = [vert; new1(:,1:2)];
vert = [vert; new2(:,1:2)];
% make sure vertices are unique
% wjp: make sure vertices are unique
vert = unique(vert,'rows','stable');
nnew = size(vert,1);

Expand Down