tregridding.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
       ---
       tregridding.rst (4986B)
       ---
            1 .. include:: ../../global.txt
            2 
            3 .. _sec-regridding:
            4 
            5 Regridding
            6 ----------
            7 
            8 .. FIXME: Mention that -regrid_file without -regrid_vars re-grids model state variables
            9    for all selected sub-models.
           10 
           11 It is common to want to interpolate a coarse grid model state onto a finer grid or vice
           12 versa. For example, one might want to do the EISMINT II experiment on the default grid,
           13 producing output ``foo.nc``, but then interpolate both the ice thickness and the
           14 temperature onto a finer grid. The basic idea of "regridding" in PISM is that one starts
           15 over from the beginning on the finer grid, but one extracts the desired variables stored
           16 in the coarse grid file and interpolates these onto the finer grid before proceeding with
           17 the actual computation.
           18 
           19 The transfer from grid to grid is reasonably general --- one can go from coarse to fine or
           20 vice versa in each dimension `x,y,z` --- but the transfer must always be done by
           21 *interpolation* and never *extrapolation*. (An attempt to do the latter will always
           22 produce a PISM error.)
           23 
           24 Such "regridding" is done using the :opt:`-regrid_file` and :opt:`-regrid_vars` commands
           25 as in this example: }
           26 
           27 .. code-block:: none
           28 
           29     pisms -eisII A -Mx 101 -My 101 -Mz 201 -y 1000 \
           30           -regrid_file foo.nc -regrid_vars thk,temp -o bar.nc
           31 
           32 By specifying regridded variables "``thk,temp``", the ice thickness and temperature values
           33 from the old grid are interpolated onto the new grid. Here one doesn't need to regrid the
           34 bed elevation, which is set identically zero as part of the EISMINT II experiment A
           35 description, nor the ice surface elevation, which is computed as the bed elevation plus
           36 the ice thickness at each time step anyway.
           37 
           38 A slightly different use of regridding occurs when "bootstrapping", as described in
           39 section :ref:`sec-initboot` and illustrated by example in section :ref:`sec-start`.
           40 
           41 See :numref:`tab-regridvar` for the regriddable variables using ``-regrid_file``.
           42 Only model state variables are regriddable, while climate and boundary data generally are
           43 not explicitly regriddable. (Bootstrapping, however, allows the same general interpolation
           44 as this explicit regrid.)
           45 
           46 .. list-table:: Regriddable variables.  Use ``-regrid_vars`` with these names.
           47    :header-rows: 1
           48    :name: tab-regridvar
           49 
           50    * - Name
           51      - Description
           52    * - :var:`age`
           53      - age of ice
           54    * - :var:`bwat`
           55      - effective thickness of subglacial melt water
           56    * - :var:`bmelt`
           57      - basal melt rate
           58    * - :var:`dbdt`
           59      - bedrock uplift rate
           60    * - :var:`litho_temp`
           61      - lithosphere (bedrock) temperature
           62    * - :var:`mask`
           63      - grounded/dragging/floating integer mask, see section :ref:`sec-floatmask`
           64    * - :var:`temp`
           65      - ice temperature
           66    * - :var:`thk`
           67      - land ice thickness
           68    * - :var:`topg`
           69      - bedrock surface elevation
           70    * - :var:`enthalpy`
           71      - ice enthalpy
           72 
           73 Here is another example: suppose you have an output of a PISM run on a fairly coarse grid
           74 (stored in ``foo.nc``) and you want to continue this run on a finer grid. This can be done
           75 using ``-regrid_file`` along with ``-bootstrap``:
           76 
           77 .. code-block:: none
           78 
           79    pismr -i foo.nc -bootstrap -Mx 201 -My 201 -Mz 21 -Lz 4000 \
           80          -regrid_file foo.nc -regrid_vars litho_temp,enthalpy -y 100 -o bar.nc \
           81          -surface constant
           82 
           83 In this case all the model-state 2D variables present in ``foo.nc`` will be interpolated
           84 onto the new grid during bootstrapping, which happens first, while three-dimensional
           85 variables are filled using heuristics mentioned in section :ref:`sec-initboot`. Then
           86 temperature in bedrock (``litho_temp``) and ice enthalpy (``enthalpy``) will be
           87 interpolated from ``foo.nc`` onto the new grid during the regridding stage, overriding
           88 values set at the bootstrapping stage. All of this, bootstrapping and regridding, occurs
           89 before the first time step.
           90 
           91 By default PISM checks the grid overlap and stops if the current computational domain is
           92 not a subset of the one in a ``-regrid_file``. It is possible to disable this check and
           93 allow constant extrapolation: use the option :opt:`-allow_extrapolation`.
           94 
           95 For example, in a PISM run the ice thickness has to be lower than the vertical extent of
           96 the computational domain. If the ice thickness exceeds ``Lz`` PISM saves the model state
           97 and stops with an error message.
           98 
           99 .. code-block:: none
          100 
          101    pismr -i input.nc -bootstrap -Mz 11 -Lz 1000 -z_spacing equal \
          102          -y 3e3 \
          103          -o too-short.nc
          104    PISM ERROR: Ice thickness exceeds the height of the computational box (1000.0000 m).
          105                The model state was saved to 'too-short_max_thickness.nc'.
          106                To continue this simulation, run with
          107                -i too-short_max_thickness.nc -bootstrap -regrid_file too-short_max_thickness.nc \
          108                -allow_extrapolation -Lz N [other options]
          109                where N > 1000.0000.
          110 
          111 Regridding with extrapolation makes it possible to extend the vertical grid and continue a
          112 simulation like this one --- just follow the instructions provided in the error message.