Step 6: Default LISFLOOD output

LISFLOOD can generate a wide variety of output. Output is generated as either maps or time series (netCDF format, which can be visualised with any netCDF viewer e.g. Panoply). Reporting of output files can be switched on and off using options in the LISFLOOD settings file.

For instance, maps of discharge at each time step are generated by using the option repDischargeMaps=1. Time series of discharge values are generate by activating the option repDischargeTs=1

A number of output files are specific to optional modules, such as the simulation of reservoirs.

The users can manage the steps reported in the output maps via the ‘ReportSteps’ key of the settings .xml file: the list of options and the relevant instructions can be found here.

State maps

Output state maps are reported when switching on the option repStateMaps=1 (note that the file names can always be changed by the user, although this is not recommended). These maps can be used to define the initial conditions of a succeeding simulation. 

A full list of state maps can be found here

To speed up the pre-run, with ‘InitLisflood’ = 1 the output is limited to the maps required for the initialization of the cold start or when performing the prerun in temporal chunks.

Other output maps

This paragraph provides examples of output maps that are not included in the repStateMaps but can be of interest to many users:

  1. Maps of discharge; reporting of these maps can be activated using the option repDischargeMaps=1

  2. Surface runoff maps, that is runoff from both impervious and permeable surfaces can be activated using the option repSurfaceRunoffMaps=1

  3. Total runoff maps, that is the sum of surface runoff and runoff from upper and lower groundwater zones can be activated using the option repTotalRunoffMaps=1

  4. Seepage maps, that is flow from the third soil layer to the upper groundwater zone can be activated using the option repSeepSubToGWMaps=1

Time series Time series file have .tss extension and they can be opened with any text editor. These files are organized in a number of columns. Specifically, the first column shows the timestep and the other columns show the values of the selected output variable for each gauge or site. Gauges and sites locations must be defined by the users in the settings file.

  1. Time series with values of meteorological input variables, averaged over the area upstream of each gauge location; reporting of these time series can be activated using the option repMeteoUpsGauges=1

  2. Time series with values of model state variables (examples are soil moisture and lower groundwater storage), averaged over area upstream of each gauge location; reporting of these time series can be activated using the option repStateUpsGauges=1

  3. Time series with values of model rate variables (examples are the outflow from the upper and lower groundwater zones to the channels; the vertical seepage and percolation flows), averaged over area upstream of each gauge location; reporting of these time series can be activated using the option repRateUpsGauges=1

  4. Time series that are specific to other options (e.g. simulation of reservoirs).

It is important to be aware of the spatial domain for which each time series is computed. For instance, all rate variables are reported as pixel-average values. Soil moisture and groundwater storage are reported for the permeable fraction of each pixel only. The reported snow cover is the average of the snow depths in snow zones A, B and C.

This Annex summarises most of the options to report additional output maps.

Output data compression (int16 packing)

By default, output maps are written as floating-point values (float32 or float64, controlled by the OutputMapsDataType setting). For large simulations (long time series, global domains, many variables) this can produce very large files.

LISFLOOD offers an optional lossy compression that stores output maps as signed 16-bit integers (int16) using the CF-convention scale_factor/add_offset packing scheme. This roughly halves the file size compared to float32 (2 bytes per value instead of 4) and reduces it fourfold compared to float64.

How to enable it

Add the following to the settings file:

<textvar name="OutputPacking" value="True"/>
  • "False" (default): output maps are written as raw floating-point values.
  • "True": output maps are packed into int16 using per-variable scale_factor and add_offset.

No further user action is required. The scale_factor and add_offset for each variable are defined internally (see default_options.py). Standard netCDF readers (xarray, CDO, NCO, ncview, Panoply) automatically unpack the values on read, so from a user perspective the data appears as normal floating-point.

Packing and unpacking formulas

When writing, each floating-point value is encoded into an integer:

packed_int = round( (value - add_offset) / scale_factor )

When reading, the CF-compliant reader restores the physical value:

value = packed_int * scale_factor + add_offset

The packed integer is stored in the range [-32766, +32767]. The value -32767 is reserved as the fill value (_FillValue) for masked / outside-domain pixels, so it is never used for real data.

Precision and value range

The scale_factor directly determines both the resolution and the representable range of a packed variable:

  • Resolution (quantization step): equal to scale_factor. A value read back can differ from the original by at most scale_factor / 2.
  • Representable range:
    • minimum = add_offset + scale_factor * (-32766)
    • maximum = add_offset + scale_factor * (+32767)

For a target physical range [min, max], the parameters are chosen as:

scale_factor = (max - min) / 65533
add_offset   = (min + max) / 2

(65533 is the number of usable integer levels, i.e. 32767 - (-32766).)

Example — actual soil evaporation (ESActMaps) uses scale_factor = 3.1e-4, add_offset = 10.0:

  • minimum = 10.0 + 3.1e-4 * (-32766) ≈ 0.0 mm/day
  • maximum = 10.0 + 3.1e-4 * (+32767) ≈ +20.2 mm/day
  • resolution ≈ 3.1e-4 mm/day (values accurate to about ±1.5e-4 mm/day)

The add_offset is placed at the centre of the target range (here 10.0, the midpoint of roughly 0–20 mm/day), so the available integer levels are distributed symmetrically around it.

Values falling outside the representable range are clipped to the nearest bound, and a warning is issued once per variable during the run. Because packing is lossy, a tiny quantization error is expected: for instance an input of exactly 0.0 may be read back as a value on the order of 1e-4. This is far below any hydrologically meaningful threshold and is normal for packed datasets (the same behaviour applies to ERA5, CMIP6, and other CF-packed products).

Variables that are never packed

  • State and “end” maps (used to initialise warm-start runs) are always written at full floating-point precision, regardless of the OutputPacking setting. This preserves the exact model state needed for a bit-reproducible restart.
  • Variables whose value range is too wide to pack meaningfully with a linear scale/offset (for example discharge, which spans several orders of magnitude globally) are intentionally excluded from OutputPacking. Discharge has its own dedicated logarithmic packing option, described next.

Logarithmic packing of discharge (OutputPackingDischarge)

Discharge cannot be packed with the linear scale_factor/add_offset scheme without unacceptable precision loss, because on a global domain it spans several orders of magnitude (from near-zero headwater flows to hundreds of thousands of m³/s at major river mouths). A single linear step size is either far too coarse for small flows or wastes the entire integer range on the largest ones.

OutputPackingDischarge solves this by packing discharge in log10 space, which gives near-constant relative precision (about 0.027% per step) across the whole range.

This option is completely independent of OutputPacking. You can enable either, both, or neither:

<textvar name="OutputPackingDischarge" value="True"/>
  • "False" (default): discharge is written as raw floating-point values.
  • "True": the DischargeMaps output is packed into int16 using the logarithmic encoding below.

Encoding. The resolved range is 0.01 to 500000 m³/s. The transform is:

stored = round( (log10(q) - packing_log_min) / packing_log_scale ) + packing_int_offset
q      = 10 ** ( packing_log_min + packing_log_scale * (stored - packing_int_offset) )

This is a non-CF encoding, so standard netCDF readers will not auto-unpack it via scale_factor/add_offset. Instead, the writer tags the variable with explicit custom attributes describing the transform so a post-processing step can invert it:

Attribute Meaning
packing "log10" — identifies the scheme
packing_log_min log10(0.01) = -2.0
packing_log_scale log-space step size per integer level
packing_int_offset integer offset (-32766) mapped to packing_log_min
packing_valid_min / packing_valid_max resolved physical range (0.01 / 500000 m³/s)

Value handling.

  • Discharge below 0.01 m³/s — including zero, negative, and missing values — is stored as _FillValue (read back as masked/NaN). Such values carry no useful information at this precision. Please note that same _FillValue is also used in masked region, thus you will need mask map to check whether the value is outside the mask or is just below 0.01
  • Discharge above 500000 m³/s is clipped to the maximum.
  • As with any lossy packing, a small relative quantization error (~0.027% per step, well under 0.02% round-trip) is expected.

Interaction with temporal aggregation. Monthly/yearly mean discharge keeps log packing (it stays within the resolved range). Sum-aggregated discharge disables log packing automatically (a period sum can exceed 500000 m³/s), and is written as floating-point — the same policy used for linear packing.

Temporal aggregation of output maps

Instead of writing a value at every model time step, LISFLOOD can aggregate selected output variables to daily, monthly or yearly means or sums. This dramatically reduces output volume for long simulations while retaining the climatologically relevant signal.

Six settings control temporal aggregation, each taking a semicolon-separated list of output variable names:

<textvar name="OutputDailyMean"   value="DischargeMaps"/>
<textvar name="OutputDailySum"    value="ETActMaps"/>
<textvar name="OutputMonthlyMean" value="SnowCoverMaps;DischargeMaps;UZMaps;LZMaps"/>
<textvar name="OutputMonthlySum"  value="ETActMaps;SurfaceRunoffMaps"/>
<textvar name="OutputYearlyMean"  value="Theta1Maps;Theta2Maps"/>
<textvar name="OutputYearlySum"   value="TotalRunoffMaps"/>
  • Mean aggregation writes the average of all time steps within each period.
  • Sum aggregation writes the accumulated total over each period.
  • A value is written only at the end of a completed period (day-end, month-end or year-end). Partial periods at the end of a simulation are not written.
  • When a variable is listed for aggregation, its normal per-time-step output is suppressed to avoid duplication.

The aggregation boundaries are detected directly from the calendar date and therefore work for daily as well as sub-daily time steps. Daily aggregation is mainly useful with sub-daily steps (e.g. 6-hourly), where it writes one value per calendar day; with a daily time step it reproduces the per-step values.

Requirement: temporal aggregation is only available with netCDF output (writeNetcdf or writeNetcdfStack). Listing a variable in an aggregation setting while writing PCRaster maps stops the run at start-up with an error.

Threaded output (outputThreads): when enabled, map output is written by background threads. The output is identical to synchronous output, including aggregated values and file or time-step selection: the model clock state needed for a write (step, date, end-of-run flag, reporting checkpoint) is captured when the write is staged.

Interaction with packing:

  • Mean aggregates stay within the same value range as the daily values, so int16 packing (if OutputPacking = True) is applied as usual.
  • Sum aggregates can greatly exceed the daily value range (a monthly sum can be up to ~30× a daily value). To prevent overflow, packing is automatically disabled for sum-aggregated outputs, which are always written as floating-point.