|
1 | 1 | Installation |
2 | 2 | ============ |
3 | 3 |
|
4 | | -Required Dependencies |
5 | | ----------------------- |
6 | | - |
7 | | - - Python 3.9+ |
8 | | - - numpy (1.11 or later; 1.14 required to build on Windows) |
9 | | - - wrapt (1.10 or later) |
10 | | - - setuptools (38.0 or later) |
11 | | - |
12 | | - |
13 | | -Highly Recommended Packages |
14 | | ----------------------------- |
15 | | - |
16 | | - - xarray (0.7.0 or later) |
17 | | - - PyNIO (1.4.3 or later) |
18 | | - - netCDF4-python (1.2.0 or later) |
19 | | - |
20 | | - |
21 | | -Plotting Packages |
22 | | -------------------------- |
23 | | - |
24 | | - - PyNGL (1.4.3 or later) |
25 | | - - matplotlib (1.4.3 or later) |
26 | | - - cartopy (0.13 or later) |
27 | | - - basemap (1.0.8 or later) |
28 | | - |
29 | | - |
30 | 4 | Installing via Conda |
31 | 5 | --------------------- |
32 | 6 |
|
33 | 7 | The easiest way to install wrf-python is using |
34 | | -`Conda <http://conda.pydata.org/docs/>`_:: |
| 8 | +`Conda <https://docs.conda.io>`_:: |
35 | 9 |
|
36 | | - conda install -c conda-forge wrf-python |
| 10 | + conda install conda-forge::wrf-python |
37 | 11 | |
38 | 12 | .. note:: |
39 | 13 |
|
40 | | - If you use conda to install wrf-python on a supercomputer like |
41 | | - Yellowstone or Cheyenne, we recommend that you do not load any python |
| 14 | + If you use Conda to install WRF-Python on a supercomputer like |
| 15 | + Derecho or Casper, we recommend that you do not load any Python |
42 | 16 | related modules via the 'module load' command. The packages installed |
43 | | - by the 'module load' system will not play nicely with packages installed |
44 | | - via conda. |
| 17 | + by the 'module load' system may not play nicely with packages installed |
| 18 | + via Conda. |
45 | 19 |
|
46 | | - Further, some systems will install python packages to a ~/.local directory, |
47 | | - which will be found by the miniconda python interpreter and cause various |
| 20 | + Further, some systems will install Python packages to a ~/.local directory, |
| 21 | + which will be found by the Conda Python interpreter and cause various |
48 | 22 | import problems. If you have a ~/.local directory, we strongly suggest |
49 | 23 | renaming it (mv ~/.local ~/.local_backup). |
50 | 24 |
|
51 | 25 |
|
52 | | -Installing on Yellowstone |
53 | | ----------------------------- |
54 | | - |
55 | | -On Yellowstone, wrf-python can also be installed using the module load system, |
56 | | -if this is preferred over using conda. |
57 | | - |
58 | | -Unfortunately, because wrf-python requires newer dependencies, it is not |
59 | | -available using the 'all-python-libs' module, so many of the dependencies |
60 | | -need to be manually installed (most are for xarray). |
61 | | - |
62 | | -Also, make sure you are running in the gnu/4.8.2 compiler environment or |
63 | | -you will get import errors for a missing libquadmath library when you |
64 | | -go to import wrf-python. |
65 | | - |
66 | | -To install:: |
| 26 | +WRF-Python on NSF NCAR HPC |
| 27 | +-------------------------- |
67 | 28 |
|
68 | | - module load gnu/4.8.2 or module swap intel gnu/4.8.2 |
69 | | - module load python/2.7.7 |
70 | | - module load numpy/1.11.0 wrapt/1.10.10 scipy/0.17.1 bottleneck/1.1.0 numexpr/2.6.0 pyside/1.1.2 matplotlib/1.5.1 pandas/0.18.1 netcdf4python/1.2.4 xarray/0.8.2 |
71 | | - module load wrf-python/1.0.1 |
| 29 | +WRF-Python is included in the `NCAR Python Library <https://ncar-hpc-docs.readthedocs.io/en/latest/environment-and-software/user-environment/package-managers/conda/#the-ncar-python-library>`_ on the NSF NCAR HPC systems or can be installed using a supported package manager of your choice. |
72 | 30 |
|
73 | 31 |
|
74 | 32 | Installing via Source Code |
75 | 33 | -------------------------- |
76 | 34 |
|
77 | 35 | Installation via source code will require a Fortran and C compiler in order |
78 | | -to run f2py. You can get them |
79 | | -`here <https://gcc.gnu.org/wiki/GFortranBinaries>`_. |
| 36 | +to run F2PY. |
80 | 37 |
|
81 | | -The source code is available via github: |
| 38 | +The source code is available on GitHub: |
82 | 39 |
|
83 | 40 | https://github.com/NCAR/wrf-python |
84 | 41 |
|
85 | | -Or PyPI: |
86 | | - |
87 | | -https://pypi.python.org/pypi/wrf-python |
88 | | - |
89 | | -To install, if you do not need OpenMP support, change your working directory |
| 42 | +To install, change your working directory |
90 | 43 | to the wrf-python source directory and run:: |
91 | 44 |
|
92 | 45 | $ pip install . |
93 | | - |
94 | | -Beginning with wrf-python 1.1, OpenMP is supported, but preprocessing the |
95 | | -ompgen.F90 file is required, which also requires running f2py to |
96 | | -build the .pyf file. To simplify this process, you can use the build scripts in |
97 | | -the *build_scripts* directory as a guide, or just call the script directly. |
98 | | - |
99 | | -Below is a sample from a build script for GNU compiler with OpenMP enabled: |
100 | | - |
101 | | -.. code-block:: none |
102 | | -
|
103 | | - cd ../fortran/build_help |
104 | | - |
105 | | - gfortran -o sizes -fopenmp omp_sizes.f90 |
106 | | - |
107 | | - python sub_sizes.py |
108 | | -
|
109 | | - cd .. |
110 | | - |
111 | | - gfortran -E ompgen.F90 -fopenmp -cpp -o omp.f90 |
112 | | - |
113 | | - f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature |
114 | | - |
115 | | - cd .. |
116 | | -
|
117 | | - python setup.py clean --all |
118 | | - |
119 | | - python setup.py config_fc --f90flags="-mtune=generic -fopenmp" build_ext --libraries="gomp" build |
120 | | - |
121 | | - pip install . |
122 | | -
|
123 | | -Beginning with numpy 1.14, f2py extensions can now be built using the MSVC |
124 | | -compiler and mingw gfortran compiler. Numpy 1.14 is required to build |
125 | | -wrf-python for Python 3.5+. |
126 | | - |
127 | | -.. note:: |
128 | | - |
129 | | - If you are building on a supercomputer and receiving linker related |
130 | | - errors (e.g. missing symbols, undefined references, etc), you probably |
131 | | - need to unset the LDFLAGS environment variable. System administrators on |
132 | | - supercomputing systems often define LDFLAGS for you so that you don't need |
133 | | - to worry about where libraries like NetCDF are installed. Unfortunately, |
134 | | - this can cause problems with the numpy.distutils build system. To fix, |
135 | | - using the build command from above:: |
136 | | - |
137 | | - $ unset LDFLAGS python setup.py config_fc --f90flags="-mtune=generic -fopenmp" build_ext --libraries="gomp" build |
138 | | - |
139 | | - |
| 46 | + |
0 commit comments