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
5de9b807
Commit
5de9b807
authored
5 years ago
by
James Harle
Browse files
Options
Download
Email Patches
Plain Diff
remove py2 has_key(), various blank space errors and update
namelist_local
parent
d55e84e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
26 deletions
+20
-26
inputs/namelist_local.bdy
inputs/namelist_local.bdy
+1
-1
pynemo/nemo_bdy_setup.py
pynemo/nemo_bdy_setup.py
+2
-2
pynemo/nemo_bdy_zgrv2.py
pynemo/nemo_bdy_zgrv2.py
+1
-0
pynemo/tide/tpxo_extract_HC.py
pynemo/tide/tpxo_extract_HC.py
+16
-23
No files found.
inputs/namelist_local.bdy
View file @
5de9b807
...
...
@@ -40,7 +40,7 @@
!------------------------------------------------------------------------------
! I/O
!------------------------------------------------------------------------------
sn_src_dir = '/Users/jdha/Projects/GitHub/PyNEMO/inputs/src_data.ncml' ! src_files/'
sn_src_dir = '/Users/jdha/Projects/GitHub/PyNEMO
3
/inputs/src_data
_local
.ncml' ! src_files/'
sn_dst_dir = './outputs'
sn_fn = 'NNA_R12' ! prefix for output files
nn_fv = -1e20 ! set fill value for output files
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_setup.py
View file @
5de9b807
...
...
@@ -204,11 +204,11 @@ def _get_val(vars_dictionary, bool_vars_dictionary, line):
if
name_prefix
==
'ln'
:
if
value
.
find
(
'true'
)
is
not
-
1
:
if
vars_dictionary
.
has_key
(
name
)
!=
True
:
if
(
name
in
vars_dictionary
)
!=
True
:
vars_dictionary
[
name
]
=
True
bool_vars_dictionary
[
name
]
=
True
elif
value
.
find
(
'false'
)
is
not
-
1
:
if
vars_dictionary
.
has_key
(
name
)
!=
True
:
if
(
name
in
vars_dictionary
)
!=
True
:
vars_dictionary
[
name
]
=
False
bool_vars_dictionary
[
name
]
=
False
else
:
...
...
This diff is collapsed.
Click to expand it.
pynemo/nemo_bdy_zgrv2.py
View file @
5de9b807
...
...
@@ -52,6 +52,7 @@ class Depth:
# Check inputs
# FIX ME? Errors for wrong obj arg len. probably better to work around
print
(
settings
)
if
settings
[
'sco'
]:
# hc = ... FIX ME??
# Depth of water column at t-point
...
...
This diff is collapsed.
Click to expand it.
pynemo/tide/tpxo_extract_HC.py
View file @
5de9b807
...
...
@@ -18,21 +18,21 @@ class TpxoExtract(object):
"""initialises the Extract of tide information from the netcdf
Tidal files"""
# Set tide model
tide_model
=
'TPXO'
tide_model
=
'TPXO'
if
tide_model
==
'TPXO'
:
# Define stuff to generalise Tide model
hRe_name
=
'hRe'
hIm_name
=
'hIm'
lon_z_name
=
'lon_z'
lat_z_name
=
'lat_z'
if
tide_model
==
'TPXO'
:
# Define stuff to generalise Tide model
hRe_name
=
'hRe'
hIm_name
=
'hIm'
lon_z_name
=
'lon_z'
lat_z_name
=
'lat_z'
URe_name
=
'URe'
UIm_name
=
'UIm'
lon_u_name
=
'lon_u'
lat_u_name
=
'lat_u'
UIm_name
=
'UIm'
lon_u_name
=
'lon_u'
lat_u_name
=
'lat_u'
VRe_name
=
'VRe'
VIm_name
=
'VIm'
lon_v_name
=
'lon_v'
lat_v_name
=
'lat_v'
VIm_name
=
'VIm'
lon_v_name
=
'lon_v'
lat_v_name
=
'lat_v'
mz_name
=
'mz'
mu_name
=
'mu'
mv_name
=
'mv'
...
...
@@ -52,18 +52,11 @@ class TpxoExtract(object):
self
.
cons
=
[]
for
ncon
in
range
(
self
.
height_dataset
.
variables
[
'con'
].
shape
[
0
]):
self
.
cons
.
append
(
self
.
height_dataset
.
variables
[
'con'
][
ncon
,
:].
tostring
().
strip
())
elif
tide_model
==
'FES'
:
constituents
=
[
'2N2'
,
'EPS2'
,
'J1'
,
'K1'
,
'K2'
,
'L2'
,
'LA2'
,
'M2'
,
'M3'
,
'M4'
,
'M6'
,
'M8'
,
'MF'
,
'MKS2'
,
'MM'
,
'MN4'
,
'MS4'
,
'MSF'
,
'MSQM'
,
'MTM'
,
'MU2'
,
'N2'
,
'N4'
,
'NU2'
,
'O1'
,
'P1'
,
'Q1'
,
'R2'
,
'S1'
,
'S2'
,
'S4'
,
'SA'
,
'SSA'
,
'T2'
]
elif
tide_model
==
'FES'
:
constituents
=
[
'2N2'
,
'EPS2'
,
'J1'
,
'K1'
,
'K2'
,
'L2'
,
'LA2'
,
'M2'
,
'M3'
,
'M4'
,
'M6'
,
'M8'
,
'MF'
,
'MKS2'
,
'MM'
,
'MN4'
,
'MS4'
,
'MSF'
,
'MSQM'
,
'MTM'
,
'MU2'
,
'N2'
,
'N4'
,
'NU2'
,
'O1'
,
'P1'
,
'Q1'
,
'R2'
,
'S1'
,
'S2'
,
'S4'
,
'SA'
,
'SSA'
,
'T2'
]
print
(
'did not actually code stuff for FES in this routine. Though that would be ideal. Instead put it in fes_extract_HC.py'
)
else
:
print
(
'Don''t know that tide model'
)
else
:
print
(
'Don''t know that tide model'
)
# Wrap coordinates in longitude if the domain is global
glob
=
0
...
...
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