Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rose_fvcom_setup
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
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
PML-modelling
rose_fvcom_setup
Commits
72d057b3
Commit
72d057b3
authored
Jan 29, 2019
by
Modellers Operational
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixs in CMEMS start file
parent
1da69a0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
app/generate_CMEMS_start/file/make_restart.py
app/generate_CMEMS_start/file/make_restart.py
+9
-1
No files found.
app/generate_CMEMS_start/file/make_restart.py
View file @
72d057b3
...
...
@@ -2,6 +2,7 @@ import multiprocessing
import
numpy
as
np
import
datetime
as
dt
import
glob
as
gb
import
sys
from
pathlib
import
Path
import
PyFVCOM
as
pf
...
...
@@ -35,7 +36,12 @@ restart.time.datetime = np.asarray([start_date])
ref_date
=
dt
.
datetime
(
1858
,
11
,
17
,
0
,
0
,
0
)
restart
.
time
.
time
=
np
.
asarray
([(
start_date
-
ref_date
).
days
])
restart
.
time
.
Itime
=
np
.
asarray
([(
start_date
-
ref_date
).
days
])
restart
.
time
.
Times
=
np
.
asarray
([
'{}T00:00:00.0000000'
.
format
(
start_date
.
strftime
(
'%Y-%m-%d'
))])
restart
.
time
.
Times
=
np
.
asarray
([
'{}T00:00:00.000000'
.
format
(
start_date
.
strftime
(
'%Y-%m-%d'
))])
restart
.
replaced
.
append
(
'time'
)
restart
.
replaced
.
append
(
'Itime'
)
restart
.
replaced
.
append
(
'Times'
)
# We need to bracket the restart data in time with CMEMS data to ensure it interpolates properly.
for
this_fvcom
,
this_var
in
fvcom_cmems_names
.
items
():
...
...
@@ -78,5 +84,7 @@ for this_fvcom, this_var in fvcom_cmems_names.items():
restart
.
replace_variable_with_regular
(
this_fvcom
,
this_var
[
1
],
this_data_reader
,
constrain_coordinates
=
True
,
mode
=
this_mode
)
# replace Times as need to be a 26 character array
restart
.
time
.
Times
=
np
.
asarray
(
list
(
restart
.
time
.
Times
[
0
]))[
np
.
newaxis
,:]
restart
.
write_restart
(
'{}_restart_0001.nc'
.
format
(
grid
))
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