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
78941e5c
Commit
78941e5c
authored
5 years ago
by
James Harle
Browse files
Options
Download
Email Patches
Plain Diff
2to3
parent
01b364e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
pynemo/profile.py
pynemo/profile.py
+7
-7
pynemo/pynemo_exe.py
pynemo/pynemo_exe.py
+7
-7
No files found.
pynemo/profile.py
View file @
78941e5c
...
...
@@ -245,13 +245,13 @@ def process_bdy(setup_filepath=0, mask_gui=False):
'values in input bdy file'
)
return
yrs
=
range
(
yr_000
,
yr_end
+
1
)
yrs
=
list
(
range
(
yr_000
,
yr_end
+
1
)
)
if
yr_end
-
yr_000
>=
1
:
if
range
(
mn_000
,
mn_end
+
1
)
<
12
:
if
list
(
range
(
mn_000
,
mn_end
+
1
)
)
<
12
:
logger
.
info
(
'Warning: All months will be extracted as the number '
+
'of years is greater than 1'
)
mns
=
range
(
1
,
13
)
mns
=
list
(
range
(
1
,
13
)
)
else
:
mn_000
=
settings
[
'month_000'
]
mn_end
=
settings
[
'month_end'
]
...
...
@@ -259,7 +259,7 @@ def process_bdy(setup_filepath=0, mask_gui=False):
logging
.
error
(
'Please check the nn_month_000 and nn_month_end '
+
'values in input bdy file'
)
return
mns
=
range
(
mn_000
,
mn_end
+
1
)
mns
=
list
(
range
(
mn_000
,
mn_end
+
1
)
)
# Enter the loop for each year and month extraction
...
...
@@ -312,7 +312,7 @@ def process_bdy(setup_filepath=0, mask_gui=False):
# Initialise the mapping indices for each grid
for
key
,
val
in
emap
.
items
():
for
key
,
val
in
list
(
emap
.
items
()
)
:
extract_obj
[
key
]
=
extract
.
Extract
(
Setup
.
settings
,
SourceCoord
,
DstCoord
,
...
...
@@ -325,7 +325,7 @@ def process_bdy(setup_filepath=0, mask_gui=False):
for
year
in
yrs
:
for
month
in
mns
:
for
key
,
val
in
emap
.
items
():
for
key
,
val
in
list
(
emap
.
items
()
)
:
# Extract the data for a given month and year
...
...
@@ -380,7 +380,7 @@ def write_tidal_data(setup_var, dst_coord_var, grid, tide_cons, cons):
const_name
=
setup_var
.
settings
[
'clname'
][
tide_con
]
const_name
=
const_name
.
replace
(
"'"
,
""
).
upper
()
for
key
,
val
in
tmap
.
items
():
for
key
,
val
in
list
(
tmap
.
items
()
)
:
fout_tide
=
setup_var
.
settings
[
'dst_dir'
]
+
\
setup_var
.
settings
[
'fn'
]
+
\
...
...
This diff is collapsed.
Click to expand it.
pynemo/pynemo_exe.py
View file @
78941e5c
...
...
@@ -5,7 +5,7 @@ Entry for the project
'''
import
sys
,
getopt
import
profile
from
.
import
profile
import
logging
# Logging set to info
...
...
@@ -20,14 +20,14 @@ def main():
try
:
opts
,
dummy_args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"hs:g"
,
[
"help"
,
"setup="
,
"mask_gui"
])
except
getopt
.
GetoptError
:
print
"usage: pynemo -g -s <namelist.bdy> "
print
(
"usage: pynemo -g -s <namelist.bdy> "
)
sys
.
exit
(
2
)
for
opt
,
arg
in
opts
:
if
opt
==
"-h"
:
print
"usage: pynemo [-g] -s <namelist.bdy> "
print
" -g (optional) will open settings editor before extracting the data"
print
" -s <bdy filename> file to use"
print
(
"usage: pynemo [-g] -s <namelist.bdy> "
)
print
(
" -g (optional) will open settings editor before extracting the data"
)
print
(
" -s <bdy filename> file to use"
)
sys
.
exit
()
elif
opt
in
(
"-s"
,
"--setup"
):
setup_file
=
arg
...
...
@@ -35,7 +35,7 @@ def main():
mask_gui
=
True
if
setup_file
==
""
:
print
"usage: pynemo [-g] -s <namelist.bdy> "
print
(
"usage: pynemo [-g] -s <namelist.bdy> "
)
sys
.
exit
(
2
)
#Logger
...
...
@@ -43,7 +43,7 @@ def main():
t0
=
time
.
time
()
profile
.
process_bdy
(
setup_file
,
mask_gui
)
t1
=
time
.
time
()
print
"Execution Time: %s"
%
(
t1
-
t0
)
print
(
"Execution Time: %s"
%
(
t1
-
t0
)
)
if
__name__
==
"__main__"
:
main
()
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