Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
0bdb3aca
Commit
0bdb3aca
authored
Nov 09, 2012
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a couple of new variables, including the positions of the element vertices
parent
4172281c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
fvcom_prepro/write_FVCOM_forcing.m
fvcom_prepro/write_FVCOM_forcing.m
+16
-1
No files found.
fvcom_prepro/write_FVCOM_forcing.m
View file @
0bdb3aca
...
...
@@ -77,6 +77,10 @@ else
y
=
Mobj
.
lat
;
end
% Create element vertices positions
xc
=
nodes2elems
(
x
,
Mobj
);
yc
=
nodes2elems
(
y
,
Mobj
);
%--------------------------------------------------------------------------
% Create the NetCDF header for the FVCOM forcing file
%--------------------------------------------------------------------------
...
...
@@ -93,10 +97,11 @@ for i=1:length(suffixes)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'type'
,
'FVCOM Forcing File'
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'source'
,
'FVCOM grid (unstructured) surface forcing'
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'references'
,
'http://fvcom.smast.umassd.edu, http://codfish.smast.umassd.edu
, http://www.pml.ac.uk
'
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'references'
,
'http://fvcom.smast.umassd.edu, http://codfish.smast.umassd.edu'
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'institution'
,
'Plymouth Marine Laboratory'
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'history'
,
'Created with write_FVCOM_forcing.m from the fvcom-toolbox (https://github.com/pwcazenave/fvcom-toolbox)'
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'infos'
,
infos
)
netcdf
.
putAtt
(
nc
,
netcdf
.
getConstant
(
'NC_GLOBAL'
),
'CoordinateSystem'
,
Mobj
.
nativeCoords
)
% Dimensions
three_dimid
=
netcdf
.
defDim
(
nc
,
'three'
,
3
);
...
...
@@ -128,6 +133,14 @@ for i=1:length(suffixes)
y_varid
=
netcdf
.
defVar
(
nc
,
'y'
,
'NC_FLOAT'
,
node_dimid
);
netcdf
.
putAtt
(
nc
,
y_varid
,
'long_name'
,
'nodal y-coordinate'
);
netcdf
.
putAtt
(
nc
,
y_varid
,
'units'
,
'm'
);
xc_varid
=
netcdf
.
defVar
(
nc
,
'xc'
,
'NC_FLOAT'
,
node_dimid
);
netcdf
.
putAtt
(
nc
,
xc_varid
,
'long_name'
,
'zonal x-coordinate'
);
netcdf
.
putAtt
(
nc
,
xc_varid
,
'units'
,
'm'
);
yc_varid
=
netcdf
.
defVar
(
nc
,
'yc'
,
'NC_FLOAT'
,
node_dimid
);
netcdf
.
putAtt
(
nc
,
yc_varid
,
'long_name'
,
'zonal y-coordinate'
);
netcdf
.
putAtt
(
nc
,
yc_varid
,
'units'
,
'm'
);
nv_varid
=
netcdf
.
defVar
(
nc
,
'nv'
,
'NC_FLOAT'
,[
nele_dimid
,
three_dimid
]);
netcdf
.
putAtt
(
nc
,
nv_varid
,
'long_name'
,
'nodes surrounding element'
);
...
...
@@ -274,6 +287,8 @@ for i=1:length(suffixes)
netcdf
.
putVar
(
nc
,
itime2_varid
,
0
,
ntimes
,
mod
(
data
.
time
,
1
)
*
24
*
3600
*
1000
);
netcdf
.
putVar
(
nc
,
x_varid
,
x
);
netcdf
.
putVar
(
nc
,
y_varid
,
y
);
netcdf
.
putVar
(
nc
,
xc_varid
,
xc
);
netcdf
.
putVar
(
nc
,
yc_varid
,
yc
);
% Now do the dynamic ones. Set the heat flux to not done (0) until we
% hit one of the holy trinity (shtfl, lhtfl, nlwrs).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment