tflowline.rst - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
(HTM) git clone git://src.adamsgaard.dk/pism
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tflowline.rst (2404B)
---
1 .. include:: ../../global.txt
2
3 .. _sec-flowline-modeling:
4
5 Using PISM for flow-line modeling
6 ---------------------------------
7
8 As described in sections :ref:`sec-coords` and :ref:`sec-grid`, PISM is a
9 three-dimensional model. Moreover, parameters ``Mx`` and ``My`` have to be greater than or
10 equal to three, so it is not possible to turn PISM into a 2D (flow-line) model by setting
11 ``Mx`` or ``My`` to 1.
12
13 There is a way around this, though: by using the :opt:`-periodicity` option to tell PISM
14 to make the computational grid :math:`y`-periodic and providing initial and boundary
15 conditions that are functions of :math:`x` only one can ensure that there is no flow in
16 the :math:`y`\-direction. (Option :opt:`-periodicity` takes an argument specifying the
17 direction: ``none``, ``x``, ``y`` and ``xy`` --- for "periodic in both X- and
18 Y-directions".)
19
20 In this case ``Mx`` can be any number; we want to avoid unnecessary computations, though,
21 so "``-Mx 3``" is the obvious choice.
22
23 One remaining problem is that PISM still expects input files to contain both ``x`` and
24 ``y`` dimensions. To help with this, PISM comes with a Python script ``flowline.py`` that
25 turns NetCDF files with :math:`N` grid points along a flow line into files with 2D fields
26 containing :math:`N\times3` grid points.\ [#]_
27
28 Here's an example which uses the script ``util/flowlineslab.py`` to create a minimal, and
29 obviously unrealistic, dataset. A file ``slab.nc`` is created by ``util/flowlineslab.py``,
30 but it is not ready to use with PISM. Proceed as follows, after checking that ``util/`` is
31 on your path:
32
33 .. code-block:: bash
34
35 flowlineslab.py # creates slab.nc with only an x-direction
36 flowline.py -o slab-in.nc --expand -d y slab.nc
37
38
39 produces a PISM-ready ``slab-in.nc``. Specifically, ``flowline.py`` "expands" its input
40 file in the y-direction. Now we can "bootstrap" from ``slab-in.nc``:
41
42 .. code-block:: none
43
44 mpiexec -n 2 pismr -surface given -i slab-in.nc -bootstrap -periodicity y \
45 -Mx 201 -My 3 -Lx 1000 -Ly 4 -Lz 2000 -Mz 11 -y 10000 -o pism-out.nc
46
47 To make it easier to visualize data in the file created by PISM, "collapse" it:
48
49 .. code-block:: none
50
51 flowline.py -o slab-out.nc --collapse -d y pism-out.nc
52
53 .. rubric:: Footnotes
54
55 .. [#] This script requires the ``numpy`` and ``netCDF4`` Python modules. Run
56 ``flowline.py --help`` for a full list of options.