Commit ee8706f3 authored by thopri's avatar thopri
Browse files

moved unit test namelists to new folder

parent 25555aba
......@@ -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)
......
......@@ -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
......@@ -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 parameters that are not on the T grid.
# Define Grids using lowercase character 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')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment