forked from ESMG/pyroms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
141 lines (94 loc) · 4.3 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Welcome to Pyroms!
Pyroms is a collection of tools to help with input and output files
from the Regional Ocean Modeling System (ROMS). It was originally
started by Rob Hetland as a googlecode project, then he morphed it
into octant, also at googlecode. Frederic Castruccio then created a
fork and renamed it back to pyroms. This version is still rather
rough around the edges.
Prerequisites
-------------
Now using Anaconda python to download python 3.x and a bunch of other stuff:
* Python itself. You will need a version that's at least 3.4.
* numpy.
* scipy.
* matplotlib. This is a plotting package to reproduce the Matlab
plotting, complete with everything you might not like about
Matlab plotting. This also contains the gui tools, but it
depends on an underlying gui package, be that tk, wx, X11, or
qt. If it can't find any of them, it's time to install one.
* basemap from matplotlib. These are the map tools for Python,
complete with etopo2 in the examples directory (user beware).
* netCDF4 from Jeff Whitaker. This sits on top of the hdf5 and
netcdf4 libraries.
* ipython. Fred Castruccio recommends using "ipython --pylab" for
interactive fun. It preloads both numpy and the matplotlib
pylab package. (Or just run jupyter notebook)
* natgrid from http://github.com/matplotlib/natgrid for at least
one of the examples.
Planning to move to ESMF. Download it with:
conda install --channel https://conda.anaconda.org/conda-forge esmf
Installing Python
-----------------
Assumes you have already fetched Anaconda and have 'conda' in your path.
To make conda-forge the default channel, put this in your $HOME/.condarc:
channels:
- conda-forge
To make your own Anaconda environment named myenv (or most anything else):
conda create --name myenv
conda activate myenv
conda install -n myenv netCDF4
conda install scipy
conda install basemap
conda install jupyter
If you want high-res coastlines, get:
conda install -c conda-forge basemap-data-hires
If get this error:
KeyError: 'PROJ_LIB'
from:
pyproj_datadir = os.environ['PROJ_LIB']
You need to set the PROJ_LIB environment variable:
export PROJ_LIB=$CONDA_PREFIX/share/proj
You shouldn't need your own environment if you control the whole system,
but I need to make an environment on the supercomputer since their default
does not include netCDF4 (and more).
Installing Pyroms
-----------------
Pyroms is currently in three different packages, pyroms itself,
pyroms_toolbox, and bathy_smoother. We are in the process of creating
setup.py scripts for each, plus an examples directory.
For now,
cd pyroms_toolbox; python setup.py build
python setup.py install --prefix=xxx;
cd ..
cd bathy_smoother; python setup.py build;
python setup.py install --prefix=xxx;
cd ..
cd pyroms; check the paths in the install script and see if it runs...
Maybe cut and paste from it into a bash shell.
I had to hack the scrip makefile for the fortran90 netcdf stuff. The
anaconda netcdf-fortran reports:
nf-config not yet implemented for cmake builds
A note on the .so files from fortran: They might now end up with names like:
scrip.cpython-35m-x86_64-linux-gnu.so
It's OK - they'll load as long as they are in your PYTHONPATH. You might
also need libgu.so to be in your LD_LIBRARY_PATH.
There has been a change in how Python looks for these things. I now need:
from pyroms import _iso
which used to be:
import _iso
Make sure this site-packages directory is in your PYTHONPATH. As for
libgu.so, it went into $DESTDIR/lib, for me $HOME/python/lib - that's
what needs to be in the LD_LIBRARY_PATH.
Also, f2py may or may not be called f2py3, depending. It's listed explicitly
in the scrip makefile and under pyroms_toolbox/pyroms_toolbox/src/makefile.
Running
-------
We have a gridid.txt file that's pointed to by the PYROMS_GRIDID_FILE
environment variable. If you are operating on files containing
sufficient grid information already, you won't need to use this.
An example is provided in the examples directory.
Doxygen
-------
Running "doxygen .doxygen" in any of pyroms, pyroms_toolbox or
bathy_smoother will generate doxygen files. Edit the .doxygen files to
specify html vs. some other output format.