Skip to content

Bug fix: station name reading methods #281

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

Merged
merged 2 commits into from
Feb 21, 2023
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
27 changes: 18 additions & 9 deletions @msh/private/readfort15.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@

% STAE location
if ( f15dat.nstae > 0 )

f15dat.elvstaloc = zeros(f15dat.nstae,2) ;
f15dat.elvstaname = strings(f15dat.nstae,1) ;
for k = 1: f15dat.nstae
val = readlinevec( fid ) ;
[val,name] = readlinevecname( fid ) ;

f15dat.elvstaloc(k,1:2) = val(1:2)' ;
f15dat.elvstaname(k) = name;
end
end

Expand All @@ -274,11 +275,13 @@

% STAV location
if ( f15dat.nstav > 0 )
f15dat.velstaloc = zeros(f15dat.nstav,2) ;
f15dat.velstaloc = zeros(f15dat.nstav,2) ;
f15dat.velstaname = strings(f15dat.nstav,1) ;
for k = 1: f15dat.nstav
val = readlinevec( fid ) ;
[val,name] = readlinevecname( fid ) ;

f15dat.velstaloc(k,1:2) = val ;
f15dat.velstaname(k) = name ;
end
end

Expand Down Expand Up @@ -317,7 +320,6 @@
f15dat.outgm = readlinevec( fid ) ;
end


% NFREQ
f15dat.nfreq = readlinescalar( fid ) ;
for k = 1: f15dat.nfreq
Expand Down Expand Up @@ -379,5 +381,12 @@
[token,rem] = strtok(msg) ;

end

end

function [vec, name] = readlinevecname( fid )

msg = fgetl(fid) ;
[token, name] = strtok(msg,"!");
vec = sscanf(token,'%f');

end
end
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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 and https://github.com/CHLNDDEV/OceanMesh2D/pull/272
- Removed dependency on statistics toolbox when using the 'nanfill' option in `msh.interp`. https://github.com/CHLNDDEV/OceanMesh2D/pull/269
- Missing routines for reading in elvstaname and velstaname in readfort15.m by adding readlinevecname() method. https://github.com/CHLNDDEV/OceanMesh2D/pull/281

### [5.0.0] - 2021-07-29
## Added
Expand Down