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
c99779e3
Commit
c99779e3
authored
5 years ago
by
James Harle
Browse files
Options
Download
Email Patches
Plain Diff
Bug fix to scale factors
parent
39e9e750
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
pynemo/nemo_bdy_zgrv2.py
pynemo/nemo_bdy_zgrv2.py
+3
-1
No files found.
pynemo/nemo_bdy_zgrv2.py
View file @
c99779e3
...
...
@@ -68,6 +68,7 @@ class Depth:
v_ind
=
sub2ind
(
mbathy
.
shape
,
bdy_v
[:,
0
],
bdy_v
[:,
1
])
v_ind2
=
sub2ind
(
mbathy
.
shape
,
bdy_v
[:,
0
],
bdy_v
[:,
1
]
+
1
)
[
tmp_zt
,
tmp_zw
]
=
e3_to_depth
(
np
.
squeeze
(
nc
[
'e3t'
][:,:,:,:]),
np
.
squeeze
(
nc
[
'e3w'
][:,:,:,:]),
nz
)
# This is very slow
self
.
logger
.
debug
(
'starting nc reads loop'
)
for
k
in
range
(
nz
):
...
...
@@ -85,7 +86,8 @@ class Depth:
# jelt: replace 'load gdep[wt] with load e3[tw] and compute gdep[tw]
#wrk1 = nc['gdept'][0,k,:,:]#nc.variables['gdept'][0,k,:,:]
#wrk2 = nc['gdepw'][0,k,:,:]#nc.variables['gdepw'][0,k,:,:]
[
wrk1
,
wrk2
]
=
e3_to_depth
(
nc
[
'e3t'
][
0
,
k
,:,:],
nc
[
'e3w'
][
0
,
k
,:,:],
nz
)
#print 'e3t shape: ', nc['e3t_0'][:].shape
[
wrk1
,
wrk2
]
=
tmp_zt
[
k
,:,:],
tmp_zw
[
k
,:,:]
# Replace deep levels that are not used with NaN
wrk2
[
mbathy
+
1
<
k
+
1
]
=
np
.
NaN
...
...
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