Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
PyNEMO
Commits
8341942c
Commit
8341942c
authored
5 years ago
by
thopri
Browse files
Options
Download
Email Patches
Plain Diff
added try except block to provide useful error for time counter discprency
parent
ee8706f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
inputs/namelist_remote.bdy
inputs/namelist_remote.bdy
+1
-1
pynemo/nemo_bdy_extr_tm3.py
pynemo/nemo_bdy_extr_tm3.py
+11
-3
No files found.
inputs/namelist_remote.bdy
View file @
8341942c
...
...
@@ -56,7 +56,7 @@
ln_mask_file = .false. ! =T : read mask from file
cn_mask_file = 'mask.nc' ! name of mask file
! (if ln_mask_file=.TRUE.)
ln_dyn2d = .
tru
e. ! boundary conditions for
ln_dyn2d = .
fals
e. ! boundary conditions for
! barotropic fields
ln_dyn3d = .false. ! boundary conditions for
! baroclinic velocities
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_extr_tm3.py
View file @
8341942c
...
...
@@ -844,14 +844,22 @@ class Extract:
for
v
in
self
.
var_nam
:
intfn
=
interp1d
(
time_counter
,
self
.
d_bdy
[
v
][
year
][
'data'
][:,:,:],
axis
=
0
,
bounds_error
=
True
)
self
.
d_bdy
[
v
][
year
][
'data'
]
=
intfn
(
np
.
arange
(
time_000
,
time_end
,
86400
))
try
:
self
.
d_bdy
[
v
][
year
][
'data'
]
=
intfn
(
np
.
arange
(
time_000
,
time_end
,
86400
))
except
ValueError
as
e
:
logging
.
error
(
'Value error in time_counter, does time horizon in data and bdy file match?'
)
raise
ValueError
(
'Value error in time_counter, does time horizon in data and bdy file match?'
)
from
e
else
:
for
v
in
self
.
var_nam
:
for
t
in
range
(
dstep
):
intfn
=
interp1d
(
time_counter
[
t
::
dstep
],
self
.
d_bdy
[
v
].
data
[
t
::
dstep
,:,:],
axis
=
0
,
bounds_error
=
True
)
self
.
d_bdy
[
v
].
data
[
t
::
dstep
,:,:]
=
intfn
(
np
.
arange
(
time_000
,
time_end
,
86400
))
try
:
self
.
d_bdy
[
v
].
data
[
t
::
dstep
,
:,
:]
=
intfn
(
np
.
arange
(
time_000
,
time_end
,
86400
))
except
ValueError
as
e
:
logging
.
error
(
'Value error in time_counter, does time horizon in data and bdy file match?'
)
raise
ValueError
(
'Value error in time_counter, does time horizon in data and bdy file match?'
)
from
e
self
.
time_counter
=
time_counter
def
write_out
(
self
,
year
,
month
,
ind
,
unit_origin
):
...
...
This diff is collapsed.
Click to expand it.
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