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
ee8706f3
Commit
ee8706f3
authored
5 years ago
by
thopri
Browse files
Options
Download
Email Patches
Plain Diff
moved unit test namelists to new folder
parent
25555aba
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
11 deletions
+11
-11
README.rst
README.rst
+1
-2
pynemo/unit_tests/UT_config.py
pynemo/unit_tests/UT_config.py
+4
-2
pynemo/unit_tests/namelists/namelist_unit_test_offset.bdy
pynemo/unit_tests/namelists/namelist_unit_test_offset.bdy
+0
-0
pynemo/unit_tests/namelists/namelist_unit_test_orth.bdy
pynemo/unit_tests/namelists/namelist_unit_test_orth.bdy
+0
-0
pynemo/unit_tests/namelists/namelist_unit_test_rotated.bdy
pynemo/unit_tests/namelists/namelist_unit_test_rotated.bdy
+0
-0
pynemo/unit_tests/test_gen.py
pynemo/unit_tests/test_gen.py
+6
-7
test_scripts/resample_netcdf.py
test_scripts/resample_netcdf.py
+0
-0
No files found.
README.rst
View file @
ee8706f3
...
...
@@ -20,7 +20,7 @@ Steps to take to install PyNEMO, creating a specific conda virtual environment i
- Install Conda, either Anaconda or Miniconda (outside scope of this readme)
- Create conda environment for PyNEMO::
$ cd
to/
PyNEMO
/directory
$ cd PyNEMO
$ conda env create -f pynemo_37.yml
- Activate the new virtual environment::
...
...
@@ -56,7 +56,6 @@ To reactivate, the following needs to be typed::
$ source activate pynemo3
To use PyNEMO, the following command is entered: (the example will run an benchmarking test)::
$ pynemo -s /path/to/namelist/file (e.g. PyNEMO/inputs/namelist_remote.bdy)
...
...
This diff is collapsed.
Click to expand it.
pynemo/unit_tests/UT_config.py
View file @
ee8706f3
...
...
@@ -8,5 +8,7 @@ Config file for Unit test functions, file paths for I/O etc are defined here.
input_dir
=
'pynemo/unit_tests/test_inputs/'
# test output directory
output_dir
=
'pynemo/unit_tests/test_outputs/'
# unit test directory
unit_dir
=
'pynemo/unit_tests/'
# namelist directory
unit_dir
=
'pynemo/unit_tests/namelists/'
# plot grids
plot_grids
=
False
This diff is collapsed.
Click to expand it.
pynemo/unit_tests/namelist_unit_test_offset.bdy
→
pynemo/unit_tests/
namelists/
namelist_unit_test_offset.bdy
View file @
ee8706f3
File moved
This diff is collapsed.
Click to expand it.
pynemo/unit_tests/namelist_unit_test_orth.bdy
→
pynemo/unit_tests/
namelists/
namelist_unit_test_orth.bdy
View file @
ee8706f3
File moved
This diff is collapsed.
Click to expand it.
pynemo/unit_tests/namelist_unit_test_rotated.bdy
→
pynemo/unit_tests/
namelists/
namelist_unit_test_rotated.bdy
View file @
ee8706f3
File moved
This diff is collapsed.
Click to expand it.
pynemo/unit_tests/test_gen.py
View file @
ee8706f3
...
...
@@ -9,8 +9,7 @@ The source coordinate grid is also plotted (green).
from
pynemo.unit_tests
import
gen_tools
as
gt
from
pynemo.unit_tests
import
UT_config
as
config
# TODO: remove hard coded file names and directories.
# TODO: organise the variables better, (maybe in a single dict?)
# TODO: organise the variables better, (maybe in a single dict or class?)
def
_main
():
#define directory for test input data for PyNEMO
...
...
@@ -101,10 +100,10 @@ def _main():
bathy
=
gt
.
write_bathy
(
bathy_fname
,
grid_h3
,
grid_z3
)
if
write_coord_H
+
write_coord_Z
+
bathy
==
0
:
print
(
"Offset child grid gneration successful!"
)
#
plot orginal, rotatated and source lat and lon
#
gt.plot_grids(grid_h2['latt'],grid_h2['lont'],grid_rot['latt'],grid_rot['lont'],grid_h3['latt'], \
#
grid_h3['lont'],grid_h1['latt'],grid_h1['lont'])
if
config
.
plot_grids
==
True
:
#
plot orginal, rotatated and source lat and lon
gt
.
plot_grids
(
grid_h2
[
'latt'
],
grid_h2
[
'lont'
],
grid_rot
[
'latt'
],
grid_rot
[
'lont'
],
grid_h3
[
'latt'
],
\
grid_h3
[
'lont'
],
grid_h1
[
'latt'
],
grid_h1
[
'lont'
])
# write boundary files (constant parameters)
out_fname
=
config
.
input_dir
+
'output_boundary'
#drop file extension
...
...
@@ -116,7 +115,7 @@ def _main():
}
params_v
=
{
'param1'
:
{
'name'
:
'vo'
,
'const_value'
:
0.5
,
'longname'
:
'Meridional current'
,
'units'
:
'ms-1'
}
}
#
TODO: This needs to be adapted for p
ara
me
ter
s that are not on the T grid.
#
Define Grids using lowercase ch
ara
c
ter
string
boundary_T
=
gt
.
write_parameter
(
out_fname
,
grid_h1
,
grid_z1
,
params_t
,
't'
)
boundary_U
=
gt
.
write_parameter
(
out_fname
,
grid_h1
,
grid_z1
,
params_u
,
'u'
)
boundary_V
=
gt
.
write_parameter
(
out_fname
,
grid_h1
,
grid_z1
,
params_v
,
'v'
)
...
...
This diff is collapsed.
Click to expand it.
pynemo/unit_tes
ts/resample_netcdf.py
→
test_scrip
ts/resample_netcdf.py
View file @
ee8706f3
File moved
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