Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PyFVCOM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
PyFVCOM
Commits
dc3ed03e
Commit
dc3ed03e
authored
Dec 22, 2017
by
Mike Bedington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix writing of river names to netcdf to cope with single river input
parent
7de2c7e3
Pipeline
#770
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
PyFVCOM/preproc.py
PyFVCOM/preproc.py
+2
-2
No files found.
PyFVCOM/preproc.py
View file @
dc3ed03e
...
...
@@ -18,7 +18,7 @@ import scipy.optimize
import
numpy
as
np
import
multiprocessing
from
netCDF4
import
Dataset
,
date2num
,
num2date
from
netCDF4
import
Dataset
,
date2num
,
num2date
,
stringtochar
from
scipy.interpolate
import
RegularGridInterpolator
from
dateutil.relativedelta
import
relativedelta
from
datetime
import
datetime
...
...
@@ -1126,7 +1126,7 @@ class Model(Domain):
dims
=
{
'namelen'
:
80
,
'rivers'
:
self
.
dims
.
river
,
'time'
:
0
,
'DateStrLen'
:
26
}
with
WriteForcing
(
str
(
output_file
),
dims
,
global_attributes
=
globals
,
clobber
=
True
,
format
=
'NETCDF4'
,
**
kwargs
)
as
river
:
# We need to force the river names to be right-padded to 80 characters and transposed for the netCDF array.
river_names
=
map
(
list
,
zip
(
*
[
list
(
'{:80s}'
.
format
(
i
))
for
i
in
self
.
river
.
names
]))
river_names
=
stringtochar
(
np
.
asarray
(
self
.
river
.
names
,
dtype
=
'S80'
))
river
.
add_variable
(
'river_names'
,
river_names
,
[
'rivers'
,
'namelen'
],
format
=
'c'
,
ncopts
=
ncopts
)
river
.
write_fvcom_time
(
self
.
river
.
time
,
ncopts
=
ncopts
)
...
...
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