.. currentmodule:: oggm

Version history
===============

v1.x (unreleased)
-----------------

Enhancements
~~~~~~~~~~~~

- ``run_with_hydro`` can now store two area-weighted air temperature
  diagnostics, i.e. the downscaled temperature (temperature bias and lapse
  rate applied) which the mass balance model actually uses for melt and for
  the solid/liquid precipitation split. ``temp_ref_area`` is weighted by the
  reference area *and* evaluated at the reference surface elevation, i.e. it
  is a fixed geometry diagnostic which does not depend on the glacier
  evolution: this is the diagnostic asked for by GlacierMIP4 (use it together
  with ``ref_area_yr`` or ``ref_area_from_y0``, so that areas and elevations
  refer to the same year). ``temp_on_glacier`` is weighted by the evolving
  glacier area, at the surface elevation of the model. Both are in the default
  ``PARAMS['store_diagnostic_variables']``, like the other hydro variables, and
  are only computed by ``run_with_hydro``. Note that these are per glacier
  means, so a regional average has to be area-weighted by the user.
  ``SfcTypeTIModel`` and ``RandomMassBalance`` gained the
  ``get_annual_climate`` / ``get_monthly_climate`` methods this needs
  (:pull:`1998`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The preprocessing can now be run in chunks, so that a big RGI region does not
  have to fit into a single cluster job. ``oggm_prepro`` gained
  ``--chunk-idx`` / ``--chunk-size`` (chunks are blocks of the RGI id space, of
  100 or 1000 glaciers, chosen so that they line up with the glacier directory
  tar bundles), and two half levels ``3a`` and ``4a`` for ``--start-level`` /
  ``--max-level`` which stop where the work stops being per-glacier: ``3a`` is
  L3 without the Glen A calibration, the inversion and the summary files,
  ``4a`` is L4 without the summary files. Stages are chained through glacier
  directory tar files on disk with the new ``--start-from-dir``, the local
  equivalent of ``--start-base-url``. Nothing needs merging afterwards: the
  whole-region stages write the summary files exactly as a single job would.
  New helpers :py:func:`workflow.get_rgi_chunk`,
  :py:func:`workflow.count_rgi_chunks` and
  :py:func:`workflow.print_slurm_array` make the same chunking available to
  ordinary runs, and the new ``oggm_prepro_chunks`` command tells you how many
  chunks a region has. See the documentation for a complete SLURM example (:pull:`1991`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- ``calibrate_inversion_from_ref_table`` gained a ``glen_a_factor`` keyword to
  skip the calibration and invert with a known A factor instead. The factor a
  run converged to is reported in ``df.attrs`` and written by
  ``run_prepro_levels`` to ``L3/summary/inversion_glen_a_{rgi_reg}.json``, so
  that it can be given back later with ``--inversion-glen-a-factor``.
- New ``oggm_prepro_diag`` command (and the underlying ``oggm.diagnostics``
  module) which diagnoses a finished preprocessing run: point it at the
  summary files of an ``oggm_prepro`` run and it writes a report, the tables
  it is made of, and a set of plots. It answers, per RGI region and globally:
  how much of the run completed (and on which tasks the rest failed), how the
  dynamic spinup and the dynamic melt_f calibration went, how the modelled
  mass change compares to the geodetic observations of Hugonnet et al. (2021),
  how the modelled area compares to the RGI inventory area at the date of the
  inventory, and what the calibrated mass balance parameters look like. This
  is meant for comparing two runs made with different options - e.g. to pick a
  spinup strategy. ``utils.get_geodetic_mb_dataframe`` grows a ``regional``
  keyword to fetch the regional averages published by Hugonnet et al., which
  the comparison uses (:pull:`1988`). The spinup section also reports what the
  spinup series *contains* (from ``is_fixed_geometry_spinup``) and not only
  what ``used_spinup_option`` says: a dynamic spinup which did not converge
  over the requested period is retried over a shorter one and the years before
  it are filled with a fixed geometry, which the statistics still report as a
  success.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added type aliases to autodocs which allows Sphinx to recognise OGGM classes
  (:pull:`1800`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- New global task ``calibrate_inversion_from_ref_table`` generalises
  ``calibrate_inversion_from_consensus`` to calibrate the ice thickness
  inversion against an arbitrary reference volume table (given as a DataFrame,
  a path or a URL). By default it now uses the IceBoost v2 products, with the
  RGI6 or RGI7 table selected automatically from the glacier directories.
  ``calibrate_inversion_from_consensus`` is deprecated but still available: it
  keeps calibrating against the Farinotti et al. (2019) consensus estimate.
  Note that the default reference for RGI6 ``run_prepro_levels`` inversions
  changes accordingly from the consensus estimate to IceBoost v2 (:pull:`1942`).
- New ``cfg.PARAMS['store_output_on_error']`` (default ``False``): when a run
  fails mid-simulation (e.g. a glacier growing out of its domain), the output
  files (diagnostics, geometry and flowline diagnostics) are written truncated
  to the last successfully completed year before the error is re-raised,
  instead of losing all output. This is meant for projections; preprocessing
  and spinup runs should keep failing loudly (hence the ``False`` default).
  Truncated files carry a ``partial_output`` global attribute, and
  ``run_with_hydro`` also adds the hydro diagnostics to them. ``compile_run_output``
  merges files of different lengths onto a common time axis and now always
  reports two per-glacier variables, ``is_partial_output`` and
  ``error_during_run`` (:pull:`1929`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- ``area_min_h`` is now a default diagnostic output variable: it is the
  glacier area computed from grid points thicker than
  ``cfg.PARAMS['min_ice_thick_for_area']`` (2 m), which avoids area spikes due
  to interannual variability in snowfall. It is named ``area_min_h_m2`` in the
  per-glacier ``model_diagnostics`` files and ``area_min_h`` in the compiled
  output. This is the recommended area variable for most applications
  (:pull:`1940`).
  By `Fabien Maussion <https://github.com/fmaussion>`_ and
  `Patrick Schmitt <https://github.com/pat-schmitt>`_
- `run_prepro_levels` now allows to set a custom climate data processing
  module and custom geodetic data file to create glacier directories (:pull:`1910`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- `run_prepro_levels` and `mb_calibration_from_geodetic_mb` now accept a
  `temp_bias_file_path` to supply a custom temperature-bias file (path or URL)
  for the `informed_threestep` calibration, so it can be used together with an
  arbitrary custom climate dataset instead of the hardcoded w5e5/era5 files
  (:pull:`1941`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- `utils.get_geodetic_mb_dataframe` now selects the geodetic observations file
  matching the RGI version (new `rgi_version` keyword, defaulting to
  ``cfg.PARAMS['rgi_version']``): the observations are indexed by glacier id,
  so RGI6 and RGI7G need different files. `mb_calibration_from_geodetic_mb`
  passes the glacier's own RGI version, so RGI7G glacier directories now
  calibrate on RGI7G observations out of the box. RGI7C is not available yet
  (:pull:`1976`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The temperature bias prior file used by the `informed_threestep` calibration
  can now be created from the command line, instead of with a notebook. The new
  ``oggm_temp_bias`` command (and the underlying
  ``utils.compute_temp_bias_dataframe``) summarizes the per-glacier biases of a
  `temp_melt` preprocessing run per climate grid point and writes the csv file
  (plus diagnostic plots) which can then be fed back to `oggm_prepro` with
  ``--temp-bias-file-path``. The climate grid is inferred from the glacier
  statistics themselves, so this works with any (custom) climate dataset.
  ``oggm_prepro`` also gets a ``--temp-bias-run`` preset for the preprocessing
  step itself: it stops at level 3, skips the ice thickness inversion and
  writes nothing but the level 3 glacier statistics file, which is the input of
  ``oggm_temp_bias`` (it requires ``--mb-calibration-strategy temp_melt`` or
  ``temp_melt_regional`` to be set explicitly).
  New utility function ``utils.weighted_quantile_1d`` (:pull:`1973`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- ``oggm_temp_bias`` now writes a ``<output file stem>_summary.txt`` diagnostic
  file next to the csv (the same content also goes to the log). It reports the
  provenance and parameters of the run, how many glaciers are missing from the
  file and which tasks they failed on (globally and per RGI region), how many
  glaciers have no bias for their own grid point because it had to be grouped,
  which grid points are still below ``min_glaciers`` at the maximum search
  radius (with the largest ones listed), and the mean, standard deviation and
  percentiles of all the bias columns.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Test durations are now visible in Actions logs (:pull:`1920`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- New kwarg `spinup_extra_years_to_try` in `run_dynamic_spinup` (and in the
  dynamic melt_f calibration run and fallback functions, exposed on the command
  line as ``--dynamic-spinup-extra-years-to-try``) to be able to provide a list
  of years to start the spinup *before* the requested start year. They are
  counted backwards from the requested start year, are tried shortest extension
  first (so the longest spinup is tried last), are clipped to the start of the
  climate data and are only used if they result in a start year earlier than
  all previously tried ones. They are a last resort: the dynamic spinup first
  tries the requested start year, and then - unless `allow_shorter_spinup` is
  set to `False`, see below - the two shorter periods it always fell back to
  (halfway to the shortest allowed period, and then the shortest allowed period
  itself, which during the melt_f calibration starts at the beginning of the
  geodetic mass balance period). So for a glacier with an RGI date of 2010, a
  requested start year of 1980 and a geodetic period starting in 2000, the
  spinup is tried starting at 1980, 1990 and 2000, and only then at 1970,
  1960, ... (for extra years 10, 20, ...). This replaces the never released
  kwarg `spinup_periods_to_try`, whose values were counted backwards from the
  RGI date instead, so that the same value meant a different start year for
  every glacier, and could even result in an additional attempt starting
  *after* the requested start year (:pull:`1914`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- New kwarg `allow_shorter_spinup` in `run_dynamic_spinup` (and in the dynamic
  melt_f calibration run and fallback functions, exposed on the command line as
  ``--dynamic-spinup-no-shorter-periods``). Per default (`True`, the previous
  behaviour) the dynamic spinup falls back to shorter spinup periods if the
  spinup at the requested start year failed, and therefore can start after the
  requested start year; with `False` these shorter periods are not tried and
  the spinup never starts after the requested start year. The intermediate one
  of these shorter periods is now rounded up to a whole year, so that the
  dynamic spinup always starts at a whole year (before, it could start in the
  middle of a year, e.g. in 1989.5). Further, glacier
  outlines which are older than the requested start year now keep their own
  target year (the dynamic spinup starts before the requested start year),
  instead of moving the target year to the start year, which resulted in a
  zero-length spinup.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- `base_dir_to_tar` now groups glacier directories into bundles of 100 by
  default (previously 1000); ``bundle_size`` accepts either 100 or 1000.
  Smaller bundles make downloads more granular and faster while keeping the
  number of files per directory manageable. Reading is fully backwards
  compatible: existing base URLs keep serving the 1000-glacier bundles, while
  newly created URLs use the 100-glacier bundles. Both RGI6 and RGI7 IDs are
  supported (:pull:`1925`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- Some tests have been refactored from unittest to pytest. (:pull:`1925`,
  :pull:`1936`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- Replaced `scipy.linalg.solve_banded` with `scipy.linalg.lapack.dgtsv` for
  solving linear systems with a tridiagonal matrix in `SemiImplicitModel`. This
  change speeds up regional simulations by at least 10%  (:pull:`1885`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Test optimisations for climate, mass balance calibration, and dynamic
  spinup (:pull:`1933`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- Added ``DailyTIModel``, adapted from the
  `massbalance-sandbox <https://github.com/OGGM/massbalance-sandbox>`_
  (developed by `Lilian Schuster <https://github.com/lilianschuster>`_). It is
  in principle the same as ``MonthlyTIModel`` but at daily resolution. A new
  ``get_daily_mb`` method was added to the ``MassBalanceModel`` class
  (:pull:`1800`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_ and
  `Nicolas Gampierakis <https://github.com/gampnico>`_
- New utility functions ``get_days_of_year``, ``get_seconds_of_year``,
  ``get_days_of_month`` and ``get_seconds_of_month``, which take the actual
  length of a month into account and can optionally account for leap years.
  For the same reason, new ``sec_in_month`` and ``sec_in_year`` methods were
  added to the ``MassBalanceModel`` class (:pull:`1800`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_ and
  `Nicolas Gampierakis <https://github.com/gampnico>`_
- ``floatyear_to_date`` and ``date_to_floatyear`` now optionally support
  daily resolution and take leap years into account (:pull:`1800`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_ and
  `Nicolas Gampierakis <https://github.com/gampnico>`_
- Added a new ``SfcTypeTIModel`` mass balance model, based on
  `Lilian Schuster <https://github.com/lilianschuster>`_'s work in the
  `massbalance-sandbox <https://github.com/OGGM/massbalance-sandbox>`_. This
  mass balance model includes a bucket system that tracks the conversion of
  fresh snow to glacier ice, with each bucket having its own melt factor and
  density (currently experimental). You can use ``SfcTypeTIModel`` together with
  ``MonthlyTIModel`` or ``DailyTIModel`` (:pull:`1801`, :pull:`1805`,
  :pull:`1830`, :pull:`1831`, :pull:`1899`, :pull:`1916`, :pull:`1928`,
  :pull:`1939`, :pull:`1944`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- New ``mb_diagnostics.nc`` files to store the ``SfcTypeTIModel`` state at the
  end of a dynamic run. In particular, these files can be used to initialize the
  buckets again to continue a dynamic run (e.g. to run multiple projections, all
  starting from the same model state). It is also possible to store a
  ``MultipleFlowlineMassBalance``, when working with multiple flowlines
  (:pull:`1899`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- New model output variable ``mass_kg``, the total glacier mass. When using
  ``SfcTypeTIModel``, volume, mass and thickness diagnostics are further
  split into an ice and a firn/snow part (``volume_ice_m3``/
  ``volume_firn_m3``, ``mass_ice_kg``/``mass_firn_kg``,
  ``thickness_ice_m``/``thickness_firn_m`` for the flowline diagnostics),
  with the standard (unsuffixed) variable being their sum. This behavior can
  be disabled with the new ``FlowlineModel`` keyword
  ``include_firn_outputs=False``, in which case only the ice part is stored
  under the standard variable name (:pull:`1899`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- ``mb_calibration_from_scalar_mb`` now allows arbitrary "non-full-year"
  reference periods for the provided reference mass balance (:pull:`1819`,
  :pull:`1828`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added two new CI test environments, ``models_dynamics`` and ``models_mb``,
  to parallelise test execution (:pull:`1907`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- ``run_with_hydro`` now fully supports mass balance models with surface type
  tracking (e.g. ``SfcTypeTIModel``). The mass-conservation correction of the
  on-glacier melt is now based on the total glacier mass of the dynamical run
  (``mass_kg``, which includes the snow and firn buckets with their lower
  densities) instead of the ice volume times a fixed ice density. For this,
  'mass' is now required in ``cfg.PARAMS['store_diagnostic_variables']`` (it
  is part of the defaults). For mass balance models with surface type
  tracking, the on-glacier melt is additionally split into the new default
  output variables ``snow_melt_on_glacier`` (buckets younger than one year),
  ``firn_melt_on_glacier`` and ``ice_melt_on_glacier``, which always sum up
  to ``melt_on_glacier`` (for other mass balance models they are NaN). For
  this, ``SfcTypeTIModel`` now tracks the melt per surface type (new
  ``get_annual_melt`` and ``get_monthly_melt`` methods and ``snow_melt``,
  ``firn_melt`` and ``ice_melt`` properties), whereby pure aging of the
  buckets is never counted as melt (:pull:`1959`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- New ``store_hydro_output`` kwarg in ``run_prepro_levels`` (and
  ``--store-hydro-output`` CLI flag) to also compute and store hydrological
  model output during preprocessing, via ``run_with_hydro``. The accompanying
  ``store_monthly_hydro`` kwarg (and ``--store-monthly-hydro`` CLI flag)
  additionally stores this hydrological output at monthly resolution. It is
  opt-in and defaults to ``False``, like in ``run_with_hydro``, since it
  increases data usage quite a bit. The new ``ref_area_yr`` kwarg (and
  ``--ref-area-yr`` CLI flag) lets users force the hydrological reference area
  to the glacier state of a given simulation year, instead of the default
  largest area during the simulation period (:pull:`1965`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_

Bug fixes
~~~~~~~~~

- ``init_present_time_glacier`` no longer fails with "Trapezoid beds need to
  have origin widths > 0" when the inversion returns a trapezoid sitting
  exactly on its physical boundary (thickness = width / lambda, i.e. a zero
  origin width). Such sections are now nudged back just above their minimum
  instead of raising, while sections which are materially below it still
  raise, with a more informative error (:pull:`1989`).
  By `Ruitang Yang <https://github.com/Ruitangtang>`_
- Fixed a variable name bug in `prepare_for_inversion` where passing
  `invert_with_trapezoid=False` did not disable trapezoidal bed shapes but
  instead cleared the rectangular flag (:pull:`1931`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Fixed test runtime due to unnecessary downloads (:pull:`1934`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- `map_proj='utm'` now raises a clear `InvalidParamsError` when a glacier lies
  beyond UTM's validity band (north of 84°N or south of 80°S), pointing users
  to `map_proj='tmerc'` (:pull:`1946`).
- GH workflows will timeout after one hour to prevent hanging tests from
  blocking runners or reaching usage limits (:pull:`1920`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- Fixed the modelled dmdtda calculation in the dynamic melt_f calibration
  (``dynamic_melt_f_run`` and ``dynamic_melt_f_run_with_dynamic_spinup``) to
  use ``mass_kg`` directly instead of deriving mass from ``volume`` and
  ``cfg.PARAMS['ice_density']`` (:pull:`1928`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Fixed a bug in ``compile_to_netcdf`` decorator, avoiding to raise an error if
  a single chunk failes (:pull:`1954`).
  By Copilot and `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Fixed a multiprocessing memory blowup in large ``execute_entity_task`` runs
  (e.g. ``oggm_prepro`` on tens of thousands of glaciers): ``GlacierDirectory``
  no longer re-serializes its ``settings``/``observations`` on every task
  dispatched to a worker process. They are now dropped before pickling and
  rebuilt from disk in the worker instead (:pull:`1967`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Fixed a size regression in the glacier directories: each ``Flowline``
  kept a reference to the model settings, and with it a shallow copy of
  ``cfg.PARAMS``, which holds ``intersects_gdf`` - a region-wide table.
  A flowline only ever needed two of those parameters, so ``Flowline`` now stores
  ``min_ice_thick_for_length`` and ``glacier_length_method`` directly and no
  longer has a ``settings`` attribute. They are read from the glacier settings
  (or from ``cfg.PARAMS`` when the flowline is built without a glacier
  directory) when the flowline is created, and can be overridden per flowline
  by setting the attributes (:pull:`1979`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Model constructors no longer silently persist a non-default ``temp_melt`` to
  the gdir settings file. ``check_calib_params`` now validates the effective
  model parameters instead of the settings file, and calibration tasks record
  ``mb_global_params`` from the model used (:pull:`1961`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- ``SemiImplicitModel`` now reads its calving parameters from the model settings
  instead of ``cfg.PARAMS``, so runs using a ``settings_filesuffix`` are no
  longer silently calving with the default configuration. ``do_calving`` is now
  also ignored for non-tidewater glaciers (:pull:`1961`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- Entity tasks can now declare ``@entity_task(log, workflow_return_value=False)``,
  which leads to ``execute_entity_task`` discarding the tasks output when
  multiprocessing. The caller can still pass ``return_value=True`` explicitly, and
  calling the tasks directly is unaffected. This has been applied to all
  "run_*" tasks to avoid memory issues (see "breaking changes") (:pull:`1977`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Multiple fixes to the test suite, missing assertions, test logic (:pull:`1960`).
  By `Nicolas Gampierakis <http://github.com/gampnico>`_.
- ``--dynamic-spinup-extra-years-to-try`` now converts its values to integers.
  They were passed on as strings, which made the flag unusable: any explicit
  value crashed the dynamic spinup with a ``TypeError``. Non-numeric values
  (other than the documented ``none``) now raise an ``InvalidParamsError``
  (:pull:`1986`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- Fixed a quadratic slowdown in ``extend_past_climate_run``: with recent pandas
  versions, ``read_csv`` returns a frame with one block per column, which made
  the per-glacier ``DataFrame.values`` call in the loop rebuild the entire
  table each time. Everything the loop needs is now materialized once. This
  step took over two hours for RGI region 13 in a ``oggm_prepro`` run and is
  back to seconds; the results are unchanged (:pull:`1990`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- ``merge_consecutive_run_outputs`` no longer drops the global attributes of
  the second file: ``xr.concat`` keeps the attributes of the first dataset
  only, so merging a historical run with a truncated future run (see
  ``store_output_on_error``) silently lost the ``partial_output`` and
  ``error_during_run`` flags of the latter. Both files' attributes are now
  kept, the first file still winning on the keys they share (:pull:`1991`).
  By `Fabien Maussion <https://github.com/fmaussion>`_

Breaking changes
~~~~~~~~~~~~~~~~

- The boolean flags of the ``oggm_prepro``, ``oggm_benchmark`` and
  ``oggm_temp_bias`` commands (``--elev-bands``, ``--test``, ``--disable-mp``,
  and all the others) no longer accept a value. They used to store whatever
  string followed them, and since every non-empty string is truthy,
  ``--elev-bands False`` turned elev-bands *on*. Passing a value is now an
  error: use the bare flag to switch a behaviour on, and omit it to switch it
  off (:pull:`1986`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- The glacier intersects are no longer stored in
  ``cfg.PARAMS['intersects_gdf']``, but in ``cfg.INTERSECTS_GDF``. They are a
  (potentially large, region wide) dataframe and not a parameter, and having
  them in ``cfg.PARAMS`` meant they were silently copied and pickled along
  wherever the parameters are, which is not what a parameter dict is for. The
  way to set them, ``cfg.set_intersects_db``, is unchanged, and so is
  ``cfg.PARAMS['use_intersects']`` (:pull:`1980`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The temperature-bias prior file of the `informed_threestep` calibration
  now always has to given explicitly. There is no
  default file anymore: `utils.get_temp_bias_dataframe` takes a single
  `file_path` argument and `mb_calibration_from_geodetic_mb` raises an error
  if `temp_bias_file_path` is not set.
  The file has to match the setup it is used with, and it is created with a
  `temp_bias_run` and the ``oggm_temp_bias`` command (:pull:`1976`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The regional mass balance calibration introduced in 163 is removed again.
  It was useful as RGI7 calibration data was missing (:pull:`1976`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The default reference for RGI6 all initial glacier volumes is now
  IceBoost v2 - this replaces the previous consensus estimate (:pull:`1942`).
- Renamed ``cfg.PARAMS['dynamic_spinup_min_ice_thick']`` to
  ``cfg.PARAMS['min_ice_thick_for_area']`` and the associated diagnostic output
  variable ``area_m2_min_h`` to ``area_min_h_m2`` in the per-glacier
  ``model_diagnostics`` files (units now consistently at the end of the name,
  as for the other variables; in the compiled output the variable is named
  ``area_min_h``, previously ``area_m2_min_h``). The
  ``dynamic_spinup_min_ice_thick`` keyword of
  ``FlowlineModel.run_until_and_store`` is renamed to ``min_ice_thick_for_area``
  accordingly. (:pull:`1940`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Furthermore, the default of
  ``cfg.PARAMS['min_ice_thick_for_length']`` was changed from 0 to 2 m, so that
  ``length_m`` now also filters out length spikes due to climate variability
  (set it back to 0 to recover the previous raw length) (:pull:`1940`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Resolved inverted sign of flowline diagnostics flux divergence (:pull:`1815`).
  This is a breaking change because the OGGM output files have now an opposite
  sign for that variable.
  By `Brandon Tober <https://github.com/btobers>`_
- Support for reading and writing HDF files with pytables is deprecated. Files
  should instead use parquet with ZSTD compression. This adds ``pyarrow`` as a
  core dependency and removes ``tables`` (pytables), which we are very glad to
  see go as it was a recurrent source of installation pain (:pull:`1924`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- Added a new way of handling model parameters, settings and observations.
  Previously these were scattered across several locations (``cfg.PARAMS``,
  ``mb_calib.json``, ``gdir.get_diagnostics``); everything is now centralised
  in two new per-glacier files, ``settings.yml`` and ``observations.yml``.
  Global parameters are still stored in ``cfg.PARAMS``, but can now also be
  accessed through the same interface as glacier-specific settings (you do
  not need to know where a parameter is stored to look it up). All OGGM
  tasks now accept a ``settings_filesuffix`` keyword argument, and tasks
  that use observations also accept ``observations_filesuffix``, which makes
  it much more convenient to run sensitivity studies. For backwards
  compatibility, parameters are still added to diagnostics (:pull:`1777`,
  :pull:`1785`, :pull:`1788`, :pull:`1795`, :pull:`1833`, :pull:`1882`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- ``MassBalanceModel`` and ``FlowlineModel`` now take the actual number of
  days per month into account; previously all months were assumed to have
  the same length (:pull:`1800`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_ and
  `Nicolas Gampierakis <https://github.com/gampnico>`_
- ``MassBalanceModel.get_specific_mb`` now supports three different
  ``time_resolution``s: annual, monthly and daily (:pull:`1800`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_ and
  `Nicolas Gampierakis <https://github.com/gampnico>`_
- Renamed ``gdir.write_monthly_climate_file`` to ``gdir.write_climate_file``,
  which can now also write daily climate data (:pull:`1800`, :pull:`1808`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_,
  `Nicolas Gampierakis <https://github.com/gampnico>`_ and
  `Fabien Maussion <https://github.com/fmaussion>`_
- Renamed ``utils.monthly_timeseries`` to ``utils.float_years_timeseries``,
  which can now also create timeseries at daily resolution (:pull:`1800`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_ and
  `Nicolas Gampierakis <https://github.com/gampnico>`_
- Renamed observation variable names for consistency across all tasks: the
  reference mass balance period ``ref_period`` is now ``ref_mb_period``,
  the reference volume ``volume_m3_reference`` is now ``ref_volume_m3``,
  the reference mass balance in dynamic melt_f calibartion ``ref_dmdtda`` is now
  ``ref_mb``,  ``err_ref_dmdtda`` is now ``ref_mb_err`` and
  ``err_dmdtda_scaling_factor`` is now ``ref_mb_err_scaling_factor``
  (:pull:`1795`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Renamed ``rho`` to ``ice_density`` at several locations, to not get confused
  with ``snow_density``, intoduced with ``SfcTypeTIModel`` (:pull:`1899`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- ``workflow.execute_entity_task`` no longer collects the model objects
  returned by the ``run_*`` tasks. With multiprocessing this would
  run the main process out of memory on large RGI regions (:pull:`1977`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- ``read_pickle`` and ``write_pickle`` have been removed in favour of
  ``read_store`` and ``write_store``, which store data as npz files in the
  glacier directory's ``data_store`` folder. Existing pickles from older
  glacier directories are still read transparently by ``read_store``
  (:pull:`1908`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.



v1.6.3 (April 13, 2026)
-----------------------

This is the final release in the 1.6.x series. It is fully backwards-compatible
and brings a range of bug fixes, improvements, as well as new and updated
standard projections. Thanks to the 8 contributors who made this release possible!

The main highlight is a new generation of preprocessed glacier directories,
including fully operational RGI7 support and ERA5-calibrated directories with climate
data extending to 2025. New directories including
`avalanche maps <https://github.com/OGGM/Snowslide>`_ are also available.

Model improvements are plenty: highlights include calving support in the default
dynamical solver (``SemiImplicitModel``),
`Glacier3dViz <https://glacier3dviz.oggm.org>`_
and its ice thickness distribution algorithm, and RGI7 support. See below for a
comprehensive list of changes.

We also added two new `tutorials <https://tutorials.oggm.org>`_ showcasing the
new directories, and a third one for glacier runoff sensitivity analysis.

This release was designed to produce only small changes to the standard projections
released a couple of years ago (v1.6.1), before more substancial changes are coming with 1.7
and GlacierMIP4.
See
`this blogpost <https://oggm.org/2026/01/07/oggm_v16-gdirs-and-projection-options/>`_
for a broader discussion on new glacier directories and the new projections.

While 1.6.3 was just released, **v1.7 is around the corner.** Several major
developments are `already in progress <https://github.com/OGGM/oggm/tree/dev>`_,
including the move of the daily mass balance model to core OGGM and improved
parameter handling. Stay tuned for more coming soon!

.. _preprodirupdates:

New preprocessed directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The new default directories are mostly a data-quality and "behind-the-scenes"
improvement over the previous ones, but with some notable differences:

- the map projection was changed from "local mercator" to UTM. This has a
  very minor influence on glacier grids and geometries (with slightly larger
  distortions near UTM zone boundaries)
- the default topography dataset is now COPDEM (almost) globally
  (previously NASADEM in mid-latitudes)
- ERA5 directories now include data up to 2025
- RGI7 directories are now available with a full workflow
- the ``_w_data`` folders now include additional datasets: ITS_LIVE v2,
  Cook et al. (2023, Alps only), and GlaThiDa. Bugs in some datasets
  (Hugonnet, Millan) have also been corrected
- new directories including avalanche maps are available
- other general enhancements and bug fixes that are listed below

By design, the new directories lead to very similar results to the previous
(OGGM v1.6.1) ones, with small differences mainly due to topography updates
and bug fixes. Larger differences may arise when using the new ERA5 or RGI7
directories, but these remain much smaller than those resulting from different
calibration choices or model structures. See
`this blogpost <https://oggm.org/2026/01/07/oggm_v16-gdirs-and-projection-options/>`_
for a summary.

Contributors
~~~~~~~~~~~~

Thanks to all contributors to this release:
`Nicolas Gampierakis <https://github.com/gampnico>`_,
`Dan Goldberg <https://github.com/dngoldberg>`_,
`Chloe Hancock <https://github.com/chloe-hancock>`_,
`Marin Kneib <https://github.com/MarinKneib>`_,
`Fabien Maussion <https://github.com/fmaussion>`_,
`Patrick Schmitt <https://github.com/pat-schmitt>`_,
`Lilian Schuster <https://github.com/lilianschuster>`_, and
`Beatriz Recinos <https://github.com/bearecinos>`_!

Enhancements
~~~~~~~~~~~~
- Added ``tasks.compute_fl_diagnostics_quantiles``, this task is designed to
  calculate quantiles from multiple fl_diagnostic files. It enables users to
  compute metrics such as the median flowline across various GCM projections
  (:pull:`1746`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- New ranking options for the ``distribute.assign_points_to_band`` task, which
  determines the order in which pixels "melt away" when redistributing flowline
  model runs into 2D for visualization purposes. It is now possible to combine
  different variables from ``gridded_data`` (e.g. ``slope``,
  ``dis_from_border``, ...) to define this ranking, providing greater flexibility
  and control over how the melting sequence is visualized (:pull:`1746`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added BedMachine products to the shop (:pull:`1753`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Updated itslive velocity products to v2 (:pull:`1753`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added "reset_state()" function to ``MassBalanceModel`` to signal any state-dependent
  mass balance model to "reset its state" at the start of the period. This function
  does nothing in the parent class and would only be implemented by a state-ful
  mass balance model. There might be a use for this in the future, but for now
  it's just a placeholder (:pull:`1757`).
  By `Dan Goldberg <https://github.com/dngoldberg>`_ and
  `Fabien Maussion <https://github.com/fmaussion>`_.
- Added the ability to use an incomplete version of the full `params.cfg` file
  to override some default parameter values. This can be done by providing the
  file during initialization with ``cfg.initialize(file=mini_params_filepath)``
  (:pull:`1776`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added a `compile_fl_diagnostics` (:pull:`1753`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- New standard glacier directories now use a new reference lookup
  table to decide on the topo data to use (:pull:`1781`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added the possibility to provide a custom grid  in
  ``workflow.merge_gridded_data``. If no grid is provided, the default is to
  merge all grids of the provided gdirs (:pull:`1779`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Flowlines shapefiles output now have more attributes and are easier to
  use (:pull:`1786`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Flowline diagnostic variables can now be saved with a monthly resolution.
  With this the unit of some variables depends on the requested resolution.
  To reflect this the correct unit is stored in the attributes of the variables
  and the following variable names were changed: ``dhdt_myr`` -> ``dhdt``,
  ``climatic_mb_myr`` -> ``climatic_mb`` and ``flux_divergence_myr`` ->
  ``flux_divergence`` (:pull:`1792`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- New `workflow.invert_from_params` task which allows to specify which (regional)
  glen A and sliding parameters to use. This is useful if you don't have any
  data to calibrate to (:pull:`1816`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Many additions to the `prepro_levels` routine to accomodate the many additions
  to the glacier directories (RGI7, new climate data, etc.), as well as exporting
  geotiffs of ice thickness fields, etc. (:pull:`1816`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- New precipitation correction factors for ERA5 data and bias files according to the
  new glacier directories in OGGM 1.6.3. (:pull:`1816`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- New `calibrate_inversion_from_volume` which is the entity task version of
  `calibrate_inversion_from_consensus`. It finds the "best Glen A" to match
  the reference volume for a single glacier. (:pull:`1816`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new way to calibrate the mass balance model with MB
  timeseries (:pull:`1827`).
  By `Chloe Hancock <https://github.com/chloe-hancock>`_
- SemiImplicitModel (the default dynamical solver in OGGM) now also
  supports calving like FluxBasedModel does (:pull:`1858`). Inversion
  with calving remains poorly supported / untested since v1.6 series,
  but this is an important step to re-offer a full calving workflow in
  OGGM core. By `Beatriz Recinos <https://github.com/bearecinos>`_
- Refactored installation. Pip installations now accept optional dependencies,
  and no longer requires dedicated yaml files. Added support for `uv`.
  (:pull:`1849`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- Added CI workflow for new releases (:pull:`1867`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_
- Added the option to compute hypsometries as part of the preprocessing CLI.
  Previously this would have been a separate step (:pull:`1872`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Generated and documented new preprocessed directories including
  contributions from avalanches (:pull:`1877`).
  By `Marin Kneib <https://github.com/MarinKneib>`_

Bug fixes
~~~~~~~~~

- Fixed a bug where Millan velocities would be assigned 0
  instead of NaN in grid points without velocity (:pull:`1753`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- `apparent_mb_from_any_mb` no longer computes mass-balance twice (:pull:`1757`).
  By `Dan Goldberg <https://github.com/dngoldberg>`_ and
  `Fabien Maussion <https://github.com/fmaussion>`_.
- Fixed small bug in which ERA5 data was missatributed for two Pyrenean glaciers (:pull:`1843`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- Fixed ``TimeoutError`` when running tests when urlopen hangs on DNS lookup (:pull:`1813`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- Refactored mass balance functions `get_specific_mb` and `get_ela`. These
  are no longer recursive and have been optimised for performance.
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- Changed COPDEM data source (again) - this comes with good sides as the download
  is much easier now (:pull:`1773`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Fixed an issue in how we stored the `dem.tif` files in the pre-procecessed
  directories, which meant that some files could take as much as 4 times more
  space as necessary (:issue:`1856`). In total this leads to pre-processed
  files roughly 20-40% larger than the previous versions, which unfortunately
  impacts some of the glacier directories created for this release.
  See also :issue:`1864` for a more pervasive continuation of the issue and
  why gdirs still remain larger *after* the fix.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Fixed ``ModuleNotFoundError`` caused by calling ``distutils`` which has been
  deprecated since Python 3.12. Reimplements ``strtobool`` natively.
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.
- Removed deprecated ``pkg_resources`` module as this was removed from
  Python 3.12 and setuptools 82.0 (:pull:`1875`).
  By `Nicolas Gampierakis <https://github.com/gampnico>`_.

Breaking changes
~~~~~~~~~~~~~~~~

While we try to avoid breaking changes in minor releases, the following changes might
break some code, but remain minor in nature:

- `PARAMS['use_winter_prcp_fac']` `cfg.PARAMS['use_temp_bias_from_file']` have been replaced
  by explicit calls in code (:pull:`1816`). In general, parameters that indicate whether
  an action should be taken or not in a workflow should never have been a parameter
  in the first place. There are several other instances of this in OGGM, that will be
  reviewed in 1.7.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Changed to the default in `distribute_thickness_per_altitude` to *not* smooth the
  resulting thickness fields. This would yield to weird effects at glacier boundaries
  and seemed overkill since topography is smoothed quite aggressively as well (:pull:`1773`).
  By `Fabien Maussion <https://github.com/fmaussion>`_

v1.6.2 (August 25, 2024)
------------------------

A new minor release of the OGGM with several improvements and bug fixes.
The changes and additions are important, but not fundamental.
Most users should switch to this version if they don't care about
full reproducibility of existing results. The previous 1.6 preprocessed
directories are still compatible and can be used with this version.
Some bugs have been fixed however (see below), and if they matter to you,
you may have to reprocess the data yourself or be patient (we aim to
publish a "final" 1.6.X release sometime soon, which will comprise
updated preprocessed repositories, including a working version of RGI7
repositories).

Enhancements
~~~~~~~~~~~~

- There is now a possibility for initializing a elevation-band flowline using
  external thickness data and conduct a dynamic run with it (:pull:`1658`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- The default minimum thickness for the dynamic spinup was changed from 10 m
  to 2 m. The new value was found in a local study and makes a larger
  difference for smaller (thinner) glaciers (:pull:`1667`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Two new functions, ``workflow.merge_gridded_data`` and
  ``sandbox.distribute_2d.merge_simulated_thickness``, have been introduced
  for merging distributed data from multiple glacier directories, including
  the possibility of adding topography to the merged grid. The latter function
  acts as a wrapper for the first one, specifically designed for merging
  distributed thickness data from a dynamic model run (:pull:`1674`,
  :pull:`1691`, :pull:`1697` and :pull:`1719`).
  By `Alex Fischer <https://github.com/afisc>`_ and
  `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added a new calving module to the sandbox. The module is based on
  Malles et al., 2023, but is currently still in development and
  cannot be used operationally yet. In general, calving is not
  operational in the v1.6 series, it can only be used on a glacier
  by glacier basis and is not yet fully integrated in the workflow
  (:pull:`1615`).
  Based on :pull:`1403` and :pull:`1532` (unmerged).
  By `Jan Malles <https://github.com/jmalles>`_ and
  `Fabien Maussion <https://github.com/fmaussion>`_
- Added new last millennium climate data to the shop:
  LMR Online and  ModE-RA (:pull:`1712`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added the option to use the 2D mask of a glacier for the calibration
  of the mass balance. One can now calibrate the mass balance from 2D data, which
  adds consistency when also the run itself is fully distributed. Changes are
  found in :pull:`1709`.
  By `Alex Fischer <https://github.com/afisc>`_
- Added Cook et al 2023 Alps thickness data to the shop (:pull:`1724`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added support for RGI7 (:pull:`1657`, :pull:`1702` and :pull:`1720`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added GlaThiDa data to the shop (:pull:`1663`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added an installation guide for Windows users (:pull:`1666` and :pull:`1683`).
  By `Anouk Vlug <https://github.com/anoukvlug>`_ and
  `Rebekka Neugebauer <https://github.com/rebneugebauer>`_
- Made it easier to run parameter perturbation experiments by
  allowing more than one ``mb_calib.json`` file in the
  working directory (:pull:`1678`) and by adding a new
  ``perturbate_mb_params`` task (:pull:`1669`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Preprocessed directories can now have categorical resolution
  classes like GloGEM does, where users can choose
  bins where a given dx is used (:pull:`1664`). It looks nicer
  to the eye, but I still think the continuous ``dx`` approach is better.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The mass-balance model can now be calibrated on regional averages
  instead of glacier-per-glacier values. This is useful to trick
  RGI7 into being calibrated (:pull:`1692`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added the rgi7g_to_complex task which adds a mask of glacier
  entities in the glacier complex glacier dirs (:pull:`1736`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- A new global task (`glathida.compile_glathida_on_grid`) is available to generate
  big tables that can be used for e.g. ML workflows for ice thickness estimation
  (:pull:`1782`).
  By `Fabien Maussion <https://github.com/fmaussion>`_

Bug fixes
~~~~~~~~~

- Fixed a bug in ``inversion.filter_inversion_output`` that caused an error
  for small glaciers with fewer than five grid points containing ice
  (:pull:`1635`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Changed variable name from ``t_bias`` to ``t_spinup`` in
  ``dynamic_spinup.run_dynamic_spinup``, to avoid confusions with
  variable names of the massbalance models (:pull:`1671`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Fixed a bug in ``dynamic_spinup.run_dynamic_melt_f_calibration`` that allowed
  the melt_f value to slightly exceed the defined limits (:pull:`1685`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- The binned variables in the elevation band flowlines did not use the
  glacier mask when preserving the total values. This is a bad
  bug that is now fixed (:pull:`1661`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- When converting a variable of gridded_data to an tiff-file using
  ``tasks.gridded_data_var_to_geotiff`` the resulting coordinates where
  shifted half a pixel, this is now fixed (:pull:`1682`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- When adding the Hugonnet et al. (2021) dh/dt maps to the glacier directory
  and multiple files are needed, previously there was no check to ensure they
  all used the same coordinate reference system (CRS). This caused errors
  during the file merging process. The bug fix now checks if the files have
  different CRS. If they do, all files are converted to a single, common CRS
  to make sure they can be merged without issues (:pull:`1698`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- COPDEM data is now downloaded from public http server (no credentials
  required) (:pull:`1684`).
  By `Codruț Diaconu <https://github.com/dcodrut>`_


v1.6.1 (August 27, 2023)
------------------------

A new minor release of the OGGM with several improvements and bug fixes.
We recommend all users currently using 1.6.0 to switch to this version if they
are still in the testing/learning phase. If you rely on your results
staying strictly the same, you should stick to the version you are currently
running.


Breaking changes
~~~~~~~~~~~~~~~~

OGGM 1.6.1 should be fully compatible with 1.6.0 code. We have updated the
pre-procecessed directories however, and recommend users to switch to the
new OGGM version if possible.

The new pre-processed directories are available in the 2023.3 version:
https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/L3-L5_files/2023.3

These incorporate all the changes listed below.

Bug fixes
~~~~~~~~~

- Corrected a small bug in the W5E5 climate files, which led to some glaciers
  getting climate data from a grid point further away than they should. This
  should affect the results of a few thousand glaciers in a minimal way.
  Fix (:pull:`1547`, :pull:`1557`) by `Lilian Schuster <https://github.com/lilianschuster>`_
- Added more flexibility to ``compile_run_output``. It is now possible to
  compile runs with different data variables (the default is NaN). It is
  needed to compile different spinup strategies together, as some include
  special data variables (e.g. ``is_fixed_geometry_spinup``) (:pull:`1563`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Fixed a problem in the hydro outputs where on some occasions ``melt_on_glacier``
  would be negative. We changed this term to become a positive term for
  snowfall on glacier instead (:pull:`1584`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- Fixed an issue with volume below water level computations with lake-terminating
  glaciers (:pull:`1584`). This affected only diagnostic computations of the
  ``volume_below_water`` variable and should be insignificant.
  By `Fabien Maussion <https://github.com/fmaussion>`_

Enhancements
~~~~~~~~~~~~

- There is now the possibility to compute distributed area and thickness
  changes from the flowline projections (:pull:`1576`, :pull:`1585`,
  :pull:`1619`, :pull:`1623`). The
  functionality is currently in the sandbox but is documented in the tutorials.
  By `Anouk Vlug <https://github.com/anoukvlug>`_, `Patrick Schmitt <https://github.com/pat-schmitt>`_
  and `Fabien Maussion <https://github.com/fmaussion>`_
- Added three new flowline diagnostic variables: thickness change in one year
  (``dhdt``), forcing climatic mass balance (``climatic_mb``) and flux divergence
  (``flux_divergence``). All variables are in units meter of ice per year
  (:pull:`1595`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added more flexibility to ``run_dynamic_spinup``. Users can now specify a target
  year and a desired value to match. The default is still the same, matching area
  or volume at the RGI date (:pull:`1600`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added possibility to use MultiPolygon outlines together with elevation bands.
  That can be useful when working with local glacier inventories with multiple
  outlines (e.g. older outline single polygon but newer outline multi polygon for
  the same glacier) (:pull:`1604`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- OGGM can now read RGI7 files. OGGM was used to generate the RGI-TOPO dataset
  as well as auxiliary products for RGI7 (:pull:`1572`, :pull:`1590`).
  By `Alexander Fischer <https://github.com/afisc>`_
  and `Fabien Maussion <https://github.com/fmaussion>`_
- The pre-processed directories are now run with dynamical spinup and calibration
  as the standard option. Dynamical calibration is run with a lower error
  tolerance than before, improving results in all regions (:pull:`1558`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- OGGM now provides "standard" projections, attached to a specific OGGM version
  (:pull:`1627`). This will be a huge asset for many users and will help to
  track important changes as OGGM continues to improve.
  By `Lilian Schuster <https://github.com/lilianschuster>`_


v1.6.0 (March 10, 2023)
-----------------------

A new major release of the OGGM with several important changes. We recommend
all users to switch to this version only if they are ready for a new study,
or are prepared to rerun their simulations with changed results.

Breaking changes
~~~~~~~~~~~~~~~~

- we removed the ``init_glacier_regions`` task, which was deprecated since
  a few OGGM versions. Similarly, other old functions
  (e.g. ``process_cmip5_data``) were also removed.
- several default parameters were updated to new values. See "migrating guide"
  (in construction) to navigate through these changes.
- the calibration of the mass balance models with the :math:`t^*` ("T star")
  method is no longer supported. The new calibration scheme is considerably
  more flexible, but relies on new parameter names.
- as a result, old workflows and old glacier directories cannot be used (after
  Level 3) in OGGM v1.6 anymore.

.. warning::

    Because of the many changes, the list below is not exhaustive at all. We
    preferred to focus on what is new in the tutorials, and recommend all returning
    users to go over the new tutorials to familiarize themselves with the changes.

Enhancements
~~~~~~~~~~~~

- added support for new reference data (W5E5), a bias corrected dataset based
  on ERA5. This will become the new default in OGGM (:pull:`1435`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- added support for a precipitation factor varying per glacier (:pull:`1435`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- Added a new entity task ``run_dynamic_melt_f_calibration``. This task
  dynamically calibrates the temperature sensitivity mu star to a geodetic
  mass-balance observation. There are different options available how this is
  done, the default incorporates an inversion and a dynamic spinup in each
  iteration (:pull:`1425`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added two new output variables in ``FlowlineModel.run_until_and_store()``
  (``area_m2_min_h`` and ``volume_m3_min_h``) which are needed for a dynamic
  mu star calibration which should include the minimum ice thickness argument
  of an dynamic spinup (needed as a filter for interannual changes of especially
  the area). Also included ``cfg.PARAMS['dynamic_spinup_min_ice_thick']`` to be
  able to globally define the used minimum ice thickness for the dynamic spinup
  (:pull:`1425`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Rearanged the entity tasks ``run_dynamic_melt_f_calibration`` and
  ``run_dynamic_spinup`` with all help functions in new modul
  ``oggm.core.dynamic_spinup`` (:pull:`1425`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Rearanged the prepro levels. Level 4 now adds a historical run (previously
  done in level 5) and a spinup historical run (using dynamic mu star calibration).
  Level 5 now replaces level 4 and creates the minigdirs (where only the files
  for a model run are kept and no inversion is possible anymore) (:pull:`1425`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added support for Millan et al 2022 velocity and thickness in the shop (:pull:`1443`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added support for Hugonnet et al 2021 dhdt in the shop (:pull:`1529`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added trapezoidal downstream line (:pull:`1491`). Can be selected with
  ``cfg.PARAMS['downstream_line_shape']``, with the options ``'parabol'`` (default)
  or ``'trapezoidal'`` before calling ``init_present_time_glacier(gdir)``.
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added option to plot flowline velocities in ``graphics.plot_modeloutput_map()``
  (:pull:`1496`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added option to extend the plot limits when plotting multiple gdirs. Could be
  used with ``extend_plot_limits=True``, e.g.
  ``graphics.plot_modeloutput_map(gdirs, extend_plot_limits=True)``
  (:pull:`1508`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added new argument ``add_fixed_geometry_spinup`` to extend the model run of
  ``run_dynamic_spinup`` with a fixed-geometry-spinup if the spinup period is
  shortened(:pull:`1514`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added SemiImplicitModel for a single trapezoid or rectangular flowline developed
  by `Dan Goldberg <https://github.com/dngoldberg>`_ (:pull:`1507`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Adapted ``filter_inversion_output`` to conserve the bed shape during
  filtering (:pull:`1502`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Adapted calculation of inversion flux to avoid zero thickness at last grid
  point (:pull:`1502`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added the possibility to use the UTM map proj instead of the local TM used
  by OGGM usually (:pull:`1526`). Leads to qualitative and quantitative
  differences when used.
  By `Fabien Maussion <https://github.com/fmaussion>`_


Bug fixes
~~~~~~~~~

- corrected a but in ``apparent_mb_from_any_mb``, where only two years of MB
  would be used instead of a range of years (:pull:`1426`).
  By `Bowen <https://github.com/bowenbelongstonature>`_
- Corrected ``source`` argument in ``tasks.define_glacier_region`` to handle a
  list of DEM sources. (:pull:`1506`).
  By `Daniel Otto <https://github.com/d-otto>`_


v1.5.3 (02.04.2022)
-------------------

New release of the OGGM model, setting the ground for a major update to be
released soon. Several major improvements available for testing, and will
become the default in a future major release:

- new ``MassRedistributionCurveModel`` which uses the Huss curves to parameterize
  glacier retreat.
- new ``mu_star_calibration_from_geodetic_mb`` task which now calibrates
  each glacier individually
- new ``run_dynamic_spinup`` task which used the ice dynamics model to spinup the
  model (instead of the default equilibrium assumption)
- and much more! See below.


Breaking changes
~~~~~~~~~~~~~~~~

- In the process of adding new output diagnostic files (:pull:`1308`), the
  signature and return output of ``FlowlineModel.run_until_and_store``
  changed. We hope that this change won't affect too many of our users but
  if it does, it should be relatively straightforward to update your code:
  users now control the number of outputs with the ``fl_diag_path`` and
  ``geom_path`` kwargs. Most users will probably have used the ``run_*``
  tasks anyway, and won't be affected by this change (except maybe for the
  point below). By `Fabien Maussion <https://github.com/fmaussion>`_
- Furthermore, ``cfg.PARAMS['store_model_geometry']`` is now set to ``False``
  per default. If you were relying on these files (e.g. for a run with spinup
  or similar), your code will fail with ``FileNotFoundError`` for the
  ``model_geometry`` files. Setting ``cfg.PARAMS['store_model_geometry']``
  back to ``True`` should solve the issue.
- Copernicus DEM 90m is now called ``'COPDEM90'`` instead of ``'COPDEM'`` and also uses the
  2021 release with additional data corrections (:pull:`1364`).


Enhancements & bug fixes
~~~~~~~~~~~~~~~~~~~~~~~~

- Added the ELA back as a variable. Unlike before it is now a diagnostic
  variable that can be computed independent of a model run with
  ``global_tasks.compile_ela`` (:pull:`1333`).
  By `Anouk Vlug <https://github.com/anoukvlug>`_
- Added a ``prescribe_years`` kwarg to ``RandomMassBalance`` to control
  which years are picked instead of the random number generator (:pull:`1310`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a ``stop_criterion`` kwarg to ``run_until_and_store``, so that
  users can specify when a simulation has to stop based on their chosen
  criteria (:pull:`1303`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Implemented a ``MassRedistributionCurveModel`` under the FlowlineModel
  interface, which uses the Huss curves to parameterize glacier retreat.
  There is some parameterisation for advance as well, but a very coarse one
  (:pull:`1288`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new ``mu_star_calibration_from_geodetic_mb`` task which now calibrates
  each glacier individually from the reference geodetic MB data. This is a rather
  quick solution for now, but it opens new avenues (:pull:`1286`).
  A bug in the new feature was later corrected (:pull:`1351`).
  By `Fabien Maussion <https://github.com/fmaussion>`_ and
  `Lilian Schuster <https://github.com/lilianschuster>`_
- Added a new ``utils.get_geodetic_mb_dataframe`` which returns the
  reference geodetic MB data, currently from Hugonnet et al 2021.
  Also changed the behavior of ``cfg.DATA`` to be shared
  across processes (:pull:`1285`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new output diagnostic files containing variables along the flowlines
  instead of aggregated at the glacier level (:pull:`1308`). These files are
  stored in the glacier directory (``gdir.get_filepath('fl_diagnostics')``) and
  are not saved per default. Set ``cfg.PARAMS['store_fl_diagnostics'] = True``
  to activate it.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new keyword argument to ``run_with_hydro``, ``run_from_climate_data``,
  and ``run_until_and_store``: ``fixed_geometry_spinup_yr`` which allows to
  "start" a simulation at an earlier date than the RGI date (:pull:`1327`). In practice,
  it computes the glacier volume change from SMB only (fixed geometry),
  ignoring glacier area change in this period. Therefore, it is only valid for
  short periods of times (years, not decades).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added new keyword arguments to ``run_with_hydro`` which allow to
  select which glacier area should be used as reference for the hydro
  computations (:pull:`1331`). Furthermore, it also allows to use a previous
  geometry file for the computations, i.e. allowing for continuous
  historical to projections outputs (if needed).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The package "descartes" is no longer a required dependency for oggm.
- Added a new entity task ``run_dynamic_spinup``. This task dynamically spinup
  the glacier to match the area or volume at the RGI date. To do so the glacier
  is simulated from the recent past (default 1980) to the RGI date. The unknown
  glacier geometry at the start of the simulation is iteratively changed with
  a short constant climate run with a varying temperature bias
  (:pull:`1342`, :pull:`1361`).
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added new options to `write_centerlines_to_shape` which allow to output
  smoother and more correct centerlines (:pull:`1357`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added the 30m version of the
  `Copernicus DEM <https://spacedata.copernicus.eu>`_.
  This DEM can be set with ``source='COPDEM30'`` and can be useful for smaller sized glaciers.
  An account with Copernicus is required to access the DEM (free for academics).
  (:pull:`1364`). By `Matthias Dusch <https://github.com/matthiasdusch>`_
- Added a new `merge_consecutive_run_outputs` entity task which allows to merge
  two output files together (:pull:`1379`). This is useful to merge e.g.
  spinup + historical or historical + projection runs in post-processing.
  By `Fabien Maussion <https://github.com/fmaussion>`_


v1.5.2 (29.08.2021)
-------------------

Very minor release to remove the dependency on the ``python-colorspace`` package.

Breaking changes
~~~~~~~~~~~~~~~~

- Removed use and dependency on the ``python-colorspace`` package. Although
  not very dramatic, this change might change the way your plots look like
  (:pull:`1284`). Users can specify their own colormaps anyways to get back to
  the old plots.
  By `Fabien Maussion <https://github.com/fmaussion>`_

v1.5.1 (28.08.2021)
-------------------

This is a minor release of OGGM, containing mostly bugfixes and a few new
features.

Breaking changes
~~~~~~~~~~~~~~~~

This version should be fully backwards compatible.

Enhancements
~~~~~~~~~~~~

- Added ``cook_rgidf()`` function in ``oggm.utils`` to simplify the use
  of a non-RGI glacier inventory in OGGM (:pull:`1251`).
  By `Li Fei <https://github.com/Keeptg>`_
- Added support for last millennium reanalysis data to the shop (:pull:`1257`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new ``apply_func``  argument in ``utils.compile_glacier_statistics``
  that allows user to compute any new statistics from a gdir themselves (:pull:`1259`)
  By `Li Fei <https://github.com/Keeptg>`_
- Added a new ``workflow.match_geodetic_mb_for_selection`` function to match
  the MB bias for any selection of glaciers (:pull:`1248`)
  By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added functionality to control the area over which the hydrological
  output is computed (:pull:`1264`, :pull:`1276`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new (wrong) way to compute equilibrium runs based on the average
  climate (:pull:`1275`).
  By `Fabien Maussion <https://github.com/fmaussion>`_

Bug fixes
~~~~~~~~~

- Fixed a quite bad bug where monthly runoff data would have very large artifacts
  (:pull:`1283`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Small bug fix to ensure backwards compatibility of ``gdir.get_filepath('model_run')``.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Various backwards compatibility fixes (mostly xarray).

v1.5.0
------

This a new update of the OGGM model. It should be largely compatible with
OGGM v1.4.0. **The main addition in this release is the computation of
hydrological diagnostics.** Check-out the new tutorial at
https://tutorials.oggm.org !

Breaking changes
~~~~~~~~~~~~~~~~

- Mass balance models now do their computations with float64 arrays instead
  of float32 (:pull:`1211`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- `prcp_bias` renamed to `prcp_fac` in mass balance models (:pull:`1211`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- Various name changes (with deprecation cycle, i.e. old code should still
  work): ``gdir.get_filepath('model_run')`` renamed to ``gdir.get_filepath('model_geometry')``;
  ``run_path`` kwarg in ``run_until_and_store`` renamed to ``geom_path``.


Enhancements
~~~~~~~~~~~~

- Mass balance models now properly refer to ``prcp_fac`` (was incorrectly named
  ``prcp_bias``) (:pull:`1211`).
  Additionally, the ``run_*`` tasks in ``oggm.core.flowline`` can now also adjust
  the precipitation factor for sensitivity experiments.
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- Users can now choose the variables that are written in diagnostics files
  and can also choose not to write the glacier geometry files during the run
  (:pull:`1219`). The respective global parameters are ``store_diagnostic_variables``
  and ``store_model_geometry``.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added experimental ``run_with_hydro`` task which computes hydrological
  diagnostics after a standard dynamical run (:pull:`1224`).
  This is highly experimental, will likely change in the future.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added monthly output to ``run_with_hydro`` (:pull:`1232`).
  By `Sarah Hanus <https://github.com/sarah-hanus>`_ and
  `Fabien Maussion <https://github.com/fmaussion>`_
- Added new diagnostic variables (`terminus_thick_0` ...) to better track
  the thickness at the terminus (:pull:`1230`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Temperature and precipitation corrections can now also be applied on a
  monthly basis for the PastMassBalanceModel (:pull:`1247`).
  By `Fabien Maussion <https://github.com/fmaussion>`_


Bug fixes
~~~~~~~~~

- Fixed bug in hydro date / calendar date conversions with month=1 (i.e.
  no conversion) (:pull:`1220`).
  By `Lilian Schuster <https://github.com/lilianschuster>`_
- Fixed bug in ``graphics.plot_distributed_thickness`` which led to an error with
  elevation bands flowlines (:pull:`1241`).
  By `Li Fei <https://github.com/Keeptg>`_

v1.4.0 (17.02.2021)
-------------------

This a new major update of the OGGM model. It it the result of one year
of development, with several non-backwards compatible changes.

We recommend all users to update to this version.

.. admonition:: **Major new release 1.4!**

    There have been a large number of additions too long to be summarized,
    and the list below is far from complete (we have waited way too long for
    this release). Here are the highlights:

       - new option to compute centerlines: "elevation band flowlines"
       - new option to calibrate OGGM mass balance regionally to geodetic
         estimates
       - new option to calibrate the creep parameter Glen A to match the ice
         thickness to the Farinotti et al. (2019) consensus
       - users can now choose from a variety of pre-processed directories,
         including with new climate data (e.g. ERA5)
       - OGGM now has a calving parameterization (switched off per default)
       - OGGM shop, to download several new input datasets
       - Historical runs ("spin-up") are now available per default and can
         be readily used for projections
       - and much much more....


**Note:** not all changes since v1.3.1 are documented below. We'll try to be
better with documenting changes in the future.

Breaking changes
~~~~~~~~~~~~~~~~

- The dynamical model now has a "real" parameterization for calving (WIP).
  A blog post explaining it can be found
  `on the website <https://oggm.org/2020/02/16/calving-param/>`_
  (:pull:`945`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The calving parameterization has been extended and made more useful
  by logging its output to compiled files. See :pull:`996` for code changes
  and watch out for upcoming changes in the documentation and notebooks.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The new default when applying GCM data to a glacier is to correct for
  temperature standard deviation (:pull:`978`). The previous default was
  wrong and should not be the default.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a new "glacier directory initialization" global task:
  `init_glacier_directories` (:pull:`983`, :issue:`965`). It replaces
  `init_glacier_regions` and covers all its functionality, except that
  it does *not* process the DEM data (this was a confusing "feature" of
  `init_glacier_regions`). The old task `init_glacier_regions` is officially
  deprecated but without warnings for now. Since it is a very widely used
  task, we prefer to deprecate it in a slow cycle: first, change the
  documentation, deprecate later.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- More climate datasets are now supported in OGGM (:pull:`1036`).
  A new task (`historical_climate_qc`) has been added to quality check the
  climate timeseries.
  This has not been tested intensively yet and is still a WIP.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The order of the tasks applied to  the preprocessed levels has
  changed, climate data comes in later (:pull:`1038`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The default DEMS used for each glacier have changed for more modern ones
  (:pull:`1073`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The inversion tasks now can invert for trapezoid shapes (:pull:`1045`). This
  has non-trivial consequences for the model workflow. First and foremost,
  the decision about using a trapezoid bed (instead of parabolic when the
  parabola is too "flat") is taken *at the inversion step* and not afterwards.
  The forward model and the inversion are therefore much more consistent.
  Furthermore, the task `filter_inversion_output` was simplified to take the
  estimated downstream bedshapes into account and now preserves glacier area,
  not volume. This also is a step towards more physical consistency between
  inverse and forward model.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- The `vascaling` module has been removed from oggm core (:pull:`1065`). It
  is now available via a separate package (`oggm-vas <https://github.com/OGGM/oggm-vas>`_,
  maintained by Moritz Oberrauch).
- New options to compute the length of a glacier during a run:
  `PARAMS['min_ice_thick_for_length']` and `PARAMS['glacier_length_method']`
  (:pull:`1069`). By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- Several further important changes to be documented later in
  (:pull:`1099`). By `Fabien Maussion <https://github.com/fmaussion>`_.


Enhancements
~~~~~~~~~~~~

- Added Copernicus DEM GLO-90 as optional DEM. Requires credentials to
  ``spacedata.copernicus.eu`` stored in a local ``.netrc`` file. Credentials
  can be added on the command line via ``$ oggm_netrc_credentials``
  (:pull:`961`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- Added NASADEM as optional DEM. This is a improved version of  SRTM and could
  replace the current SRTM (https://lpdaac.usgs.gov/products/nasadem_hgtv001/).
  (:pull:`971`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- Added support for "squeezed" flowlines from Huss & Farinotti 2012
  (:pull:`1040`). The corresponding tasks are
  :py:func:`tasks.elevation_band_flowline` and
  :py:func:`tasks.fixed_dx_elevation_band_flowline`.
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added a `calibrate_inversion_from_consensus` global task which
  calibrates Glen A so that the volume of glaciers in a selection is
  matched (:pull:`1043`).
  By `Fabien Maussion <https://github.com/fmaussion>`_
- Added support for writing a NetCDF variable in ``gridded_data.nc`` file to
  a georeferenced GeoTiff file (:pull:`1118`). The new task are
  :py:func:`tasks.gridded_data_var_to_geotiff`.
  By `Li Fei <https://github.com/Keeptg>`_
- Added a `find_inversion_calving_from_any_mb` task which uses the Recinos et
  al. approach, but on any mass balance profile (:pull:`1043`).
  By `Fabien Maussion <https://github.com/fmaussion>`_


Bug fixes
~~~~~~~~~

- Maintenance updates for upstream libraries and various small bug fixes
  (:pull:`957`, :pull:`967`, :pull:`968`, :pull:`958`, :pull:`974`, :pull:`977`,
  :pull:`976`, :pull:`1124`).
  By `Fabien Maussion <https://github.com/fmaussion>`_,
  `Matthias Dusch <https://github.com/matthiasdusch>`_ and
  `Li Fei <https://github.com/Keeptg>`_.


v1.3.1 (16.02.2020)
-------------------

Minor release with small improvements but an important and necessary change in
multiprocessing.

Enhancements
~~~~~~~~~~~~

- After a recent change in multiprocessing, creating a pool of workers became
  very slow. This change was necessary because of race conditions in GDAL,
  but these conditions are rarely relevant to users. We now make this
  change in multiprocessing optional (:pull:`937`)
- various improvements and changes in the dynamical model - mass balance model
  API. These were necessary to allow compatibility with the PyGEM model
  (:pull:`938`, :pull:`946`, :pull:`949`, :pull:`953`, :pull:`951`).
  By `Fabien Maussion <https://github.com/fmaussion>`_ and
  `David Rounce <https://github.com/drounce>`_.
- added a "flux gate" to allow for precise mass-conservation checks in
  numerical experiments (:pull:`944`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.


v1.3.0 (02.02.2020)
-------------------

The time stepping scheme of OGGM has been fixed for several flaws.
`This blog post <https://oggm.org/2020/01/18/stability-analysis/>`_
explains it in detail. We expect some changes in OGGM results after this
release, but they should not be noticeable in a vast majority of the cases.

We recommend all users to update to this version.

Breaking changes
~~~~~~~~~~~~~~~~

- The adaptive time stepping scheme of OGGM has been fixed for several flaws
  which lead to unstable results in certain conditions.
  See `the blog post <https://oggm.org/2020/01/18/stability-analysis/>`_
  for a full description. The API didn't change in the process, but the
  OGGM results are likely to change slightly in some conditions.
  (:issue:`731`, :issue:`860`, :pull:`931`).
  By `Fabien Maussion <https://github.com/fmaussion>`_ and
  `Alex Jarosch <https://github.com/alexjarosch>`_.

Enhancements
~~~~~~~~~~~~

- The `test_models` test module has been refactored to use pytest fixtures
  instead of unittest classes (:pull:`934` and :pull:`922`).
  By `Chris Merrill <https://github.com/C-Merrill>`_.


v1.2.0 (04.01.2020)
-------------------

**OGGM is released under a new license.** We now use the
`BSD-3-Clause <https://github.com/OGGM/oggm/blob/master/LICENSE.txt>`_ license.

v1.1.3 (03.01.2020)
-------------------

Minor release of the OGGM model with several small improvements.
We don't expect major changes in the model results due to this release.

**Important:** this will be the last release under a GPL license. The next
release (v1.2) will be done without modifications but under a BSD-3-Clause
License.

Enhancements
~~~~~~~~~~~~

- New function ``cfg.add_to_basenames`` now allows users to define their own
  entries in glacier directories (:issue:`731`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- New function ``inversion.compute_inversion_velocities`` writes the section and
  surface veloicites in the inversion output (:issue:`876`).
  By `Beatriz Recinos <https://github.com/bearecinos>`_.
- Added ASTER v3 as optional DEM. Requires credentials to
  ``urs.earthdata.nasa.gov`` stored in a local ``.netrc`` file. Credentials
  can be added on the command line via ``$ oggm_netrc_credentials``
  (:pull:`884`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- Added a global task (``tasks.compile_task_time`` and the associated method at
  the GlacierDirectory level ``get_task_time``) to time the execution of
  entity tasks (:issue:`918`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Improved performance of numerical core thanks to changes in our calls to
  `np.clip` (:pull:`873` and :pull:`903`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added a function `cfg.initialize_minimal` to run the flowline model
  without enforcing a full download of the demo files (:pull:`921`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.

Bug fixes
~~~~~~~~~

- Small bugs in DEM processing fixed - internal refactoring followed,
  hopefully for the good (:pull:`890` and :pull:`886`).
  By `Fabien Maussion <https://github.com/fmaussion>`_ and
  `Matthias Dusch <https://github.com/matthiasdusch>`_.


v1.1.2 (12.09.2019)
-------------------

Minor release of the OGGM model, with several substantial improvements, most
notably:

- update in the inversion procedure for calving glaciers (Recinos et al., 2019)
- new glacier evolution model based on Marzeion et al., 2012

We don't expect major changes in the model results due to this release.


Breaking changes
~~~~~~~~~~~~~~~~

- ``run_until`` now makes sure that the years (months) are not crossed by
  the adaptive time-stepping scheme (:issue:`710`). ``run_until`` and
  ``run_until_and_store`` should now be consistent. The change is unlikely to
  affect the majority of users (which used ``run_until_and_store``), but
  the results or ``run_until`` can be affected (:pull:`726`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- ``find_inversion_calving`` has been renamed to
  ``find_inversion_calving_loop`` and will probably be deprecated soon
  (:pull:`794`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- ``use_rgi_area=False`` now also recomputes CenLon and CenLat on the fly.
  (:issue:`838`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.

Enhancements
~~~~~~~~~~~~

- Added new ``gridded_attributes`` and ``gridded_mb_attributes`` tasks to
  add raster glacier attributes such as slope, aspect, mass balance...
  to the glacier directory (:pull:`725`). This can be useful for statistical
  modelling of glacier thickness.
  By `Matteo Castellani <https://github.com/MatCast>`_.
- Added support for a new DEM dataset: Mapzen, found on Amazon cloud
  (:issue:`748`, :pull:`759`). Also added some utility functions to handle
  DEMs, to be improved further in the near future.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added support for a new DEM dataset: REMA (:pull:`759`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added an option to pre-process all DEMs at once (:pull:`771`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added support for another evolution model: the volume-area-scaling based
  model of Marzeion et al., 2012 (:pull:`662`). This is a major enhancement
  to the code base as it increases the number of choices available to users
  and demonstrates the modularity of the model.
  By `Moritz Oberrauch <https://github.com/oberrauch>`_.
- Changed the way the calving flux is computed during the ice thickness
  inversion. This no longer relies on an iteration over mu*, but solves
  for `h` instead. The new function is likely to replace the "old"
  calving loop (:pull:`794`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- ``compile_climate_input`` and ``compile_run_output`` are now faster for
  larger numbers of glaciers thanks to temporary files (:pull:`814`).
  By `Anouk Vlug <https://github.com/anoukvlug>`_. Could be made faster with
  multiprocessing one day.
- OGGM can now run in "minimal mode", i.e. without many of the hard
  dependencies (:issue:`420`). This is useful for teaching or idealized
  simulations, but won't work in production.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- the flowline model gives access to new diagnostics such as ice velocity and
  flux along the flowline. The numerical core code changed in the process,
  and we will monitor performance after this change (:pull:`853`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.


Bug fixes
~~~~~~~~~

- Preprocessed directories at the level 3 now also have the glacier flowlines
  ready for the run (:issue:`736`, :pull:`771`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Nominal glaciers now error early in the processing chain (:issue:`832`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Specific MB (not used operationally) was wrongly computer for zero ice
  thickness rectangular or parabolic sections. This is now corrected
  (:issue:`828`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Fixed a bug in model output files where SH glaciers were wrongly attributed
  with NH calendar dates (:issue:`824`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.


v1.1.1 (24.04.2019)
-------------------

Minor release of the OGGM model, with several bugfixes and some improvements.

We don't expect any change in the model results due to this release.

Enhancements
~~~~~~~~~~~~

- Adapted ``graphics.plot_domain``, ``graphics.plot_centerlines`` and
  ``graphics_plot_modeloutput_map`` to work with merged glaciers (:pull:`726`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- Added (and updated) an official task to find the calving flux based on the
  mass-conservation inversion (`inversion.find_inversion_calving`). This
  is still in experimentation phase! (:pull:`720`).
  By `Beatriz Recinos <https://github.com/bearecinos>`_.
- Added a mechanism to add custom MB data to OGGM (:issue:`724`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The ALOS Global Digital Surface Model "ALOS World 3D - 30m" DEM from JAXA can
  now be used as alternative DEM within OGGM (:pull:`734`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- Switch to setuptools-scm as a version control system (:issue:`727`).
  By `Timo Rothenpieler <https://github.com/TimoRoth>`_.

Bug fixes
~~~~~~~~~

- Fixed several problems with the file download verification algorithm.
  By `Timo Rothenpieler <https://github.com/TimoRoth>`_.
- Fixed a timing problem in the benchmark command line tool (:pull:`717`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.


v1.1 (28.02.2019)
-----------------

This is a major new release of the OGGM model, with substantial improvements
to version 1. We recommend to use this version from now on. It coincides
with the publication of our publication in
`Geoscientific Model Development <https://www.geosci-model-dev.net/12/909/2019/>`_.

New contributors to the project:

- **Matthias Dusch** (PhD student, University of Innsbruck), added extensive
  cross-validation tools and an associated website.
- **Philipp Gregor** (Master student, University of Innsbruck), added options
  to switch on lateral bed stress in the flowline ice dynamics
- **Nicolas Champollion** (PostDoc, University of Bremen), added GCM data
  IO routines.
- **Sadie Bartholomew** (Software Engineer, UK Met Office), added ability to
  replace colormaps in graphics with HCL-based colors using python-colorspace.

Breaking changes
~~~~~~~~~~~~~~~~

- The utils.copy_to_basedir() function is changed to being an entity task. In
  addition gcm_data files, when present, will from now on always be copied
  when using this task (:issue:`467` & :pull:`468`).
  By `Anouk Vlug <https://github.com/anoukvlug>`_.
- Accumulation Area Ratio (AAR) is now correctly computed (:issue:`361`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The method used to apply CRU and GCM anomalies to the climatology has
  changed for precipitation: we now use scaled anomalies instead of the
  standard anomalies (:pull:`393`). The previous method might have lead to
  negative values in some cases. The corresponding reference t* have also
  been updated (:pull:`407`). This change has some consequences on the
  the model results: cross-validation indicates very similar scores, but
  the influence on global model output has not been assessed yet.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- It is now possible to run a simulation with spinup in the standard
  workflow (:pull:`411`). For this to happen it was necessary to clean up
  the many `*filesuffix` options. The new names are more explicit
  but not backwards compatible. The previous `filesuffix` is now
  called `output_filesuffix`. The previous `input_filesuffix` is now
  called `climate_input_filesuffix`. The `random_glacier_evolution` task
  is now called `run_random_climate` for consistency with the other tasks
  See the PR linked above for more info.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- RGI version 4 isn't supported anymore (:issue:`142`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Rework of the 2d interpolation tasks for ice thickness in the context of
  `ITMIX2 <http://oggm.org/2018/05/21/g2ti/>`_. The new interpolation
  are better, but not backwards compatible. Aside of me I don't think
  anybody was using them (:pull:`465`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Diagnostic variables (length, area, volume, ELA) are now stored at annual
  steps instead of monthly steps (:pull:`488`). The old behavior can still be
  used with the ``store_monthly_step`` kwarg. Most users should not notice
  this change because the regionally compiled files were stored at yearly
  steps anyways.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The list of reference t* dates is now generated differently: instead of
  the complex (and sort of useless) nearest neighbor algorithm we are now
  referring back to the original method of Marzeion et al. (2012). This comes
  together with other breaking changes, altogether likely to change the
  results of the mass balance model for some glaciers. For more details see
  the PR: :pull:`509`
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The ice dynamics parameters (Glen A, N, ice density) are now "real"
  parameters accessible via ``cfg.PARAMS`` (:pull:`520`, :issue:`511` and
  :issue:`27`). Previously, they were also accessible via a module attribute
  in ``cfg``, which was more confusing than helping. Deprecated and removed
  a couple of other things on the go, such as the dangerous `
  ``optimize_inversion_params`` task (this cannot be optimized yet) and the
  useless ``volume_inversion`` wrapper (now called
  ``mass_conservation_inversion``)
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The temperature sensitivity mu* is now flowline specific, instead of
  glacier wide. This change was necessary because it now allows low-lying
  tributaries to exist, despite of too high glacier wide mu*. This change
  had some wider reaching consequences in the code base and in the
  mass balance models in particular: :pull:`539`. This will also allow to
  merge neighboring glaciers in the future.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The "human readable" mu* information is now stored in a JSON dict instead
  of a csv: :pull:`568`.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The global task `glacier_characteristics` has been renamed to
  `compile_glacier_statistics` (:pull:`571`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The ``process_cesm_data`` task has been been moved to `gcm_climate.py`
  addressing: :issue:`469` & :pull:`582`.
  By `Anouk Vlug <https://github.com/anoukvlug>`_.
- The shapefiles are now stored in the glacier directories as compressed
  tar files, addressing :issue:`367` & :issue:`615`. This option can be
  turned off with `cfg.PARAMS['use_tar_shapefiles'] = False`.
  By `Fabien Maussion <https://github.com/fmaussion>`_.

Enhancements
~~~~~~~~~~~~

- Added a utility function to easily get intersects files (:pull:`402`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The old GlaThiDa file linking the total volume of glaciers (T database) to
  RGI has been updated to RGI Version 6 (:pull:`403`).
  Generally, we do not recommend to use these data for calibration or
  validation because of largely unknown uncertainties.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The computing efficiency of the 2D shallow ice model has been increased
  by a factor 2 (:pull:`415`), by avoiding useless repetitions of indexing
  operations. The results shouldn't change at all.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added optional shape factors for mass-conservation inversion and
  FluxBasedModel to account for lateral drag dependent on the bed shape
  (:pull:`429`). Accepted settings for shape factors are `None`,
  `'Adhikari'` (Adhikari & Marshall 2012), `'Nye'` (Nye, 1965; equivalent to
  Adhikari) and `'Huss'` (Huss & Farinotti 2012). Thorough tests with
  applied shape factors are still missing.
  By `Philipp Gregor <https://github.com/phigre>`_.
- Some amelioration to the mass balance models (:pull:`434`). Added a
  ``repeat`` kwarg to the ``PastMassBalance`` in order to loop over a
  selected period. Added an ``UncertainMassBalance`` model which wraps
  an existing model and adds random uncertainty to it.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The DEM sources are now clearly stated in each glacier directory,
  along with the original data citation (:pull:`441`). We encourage
  to always cite the original data providers.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added some diagnostic tools which make it easier to detect dubious glacier
  outlines or DEM errors (:pull:`445`). This will be used to report to the
  RGI authors.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added a new parameter (``PARAMS['use_rgi_area']``), which specifies whether
  OGGM should use the reference area provided by RGI or the one computed
  from the local map and reprojected outlines  (:pull:`458`, default: True).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- A new ``simple_glacier_masks`` tasks allows to compute glacier rasters in
  a more robust way than the default OGGM method (:pull:`476`). This is useful
  for simpler workflows or to compute global statistics for external tools
  like `rgitools <http://rgitools.readthedocs.io/en/latest/>`_. This task
  also computes hypsometry files much like RGI does.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Reference glaciers now have mass balance profiles attached to them, if
  available. You can get the profiles with ``gdir.get_ref_mb_profile()``
  (:pull:`493`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- New ``process_histalp_data`` task to run OGGM with HISTALP data
  automatically. The task comes with a list of predefined t* like CRU and
  with different default parameters
  (see `blog <https://oggm.org/2018/08/10/histalp-parameters/>`_). The PR
  also adds some safety checks at the calibration and computation of the
  mass balance to make sure there is no misused parameters (:pull:`493`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The ``process_cesm_data`` function has been split into two functions, to make
  it easier to run oggm with the climate of other GCM's: ``process_cesm_data``
  reads the CESM files and handles the CESM specific file logic.
  ``process_gcm_data`` is the general task able to handle all kind of data.
  ``process_cesm_data`` can also be used as an example when you plan make a
  function for running OGGM with another GCM (:issue:`469` & :pull:`582`).
  `Anouk Vlug <https://github.com/anoukvlug>`_.
- New ``process_dummy_cru_file`` task to run OGGM with randomized CRU data
  (:pull:`603`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Colormaps in some graphics are replaced with Hue-Chroma-Luminance (HCL) based
  improvements when python-colorspace is (optionally) installed (:pull:`587`).
  By `Sadie Bartholomew <https://github.com/sadielbartholomew>`_.
- Added a workflow ``merge_glacier_tasks`` which merges tributary/surrounding
  glaciers to a main glacier, allowing mass exchange between them. This is
  helpful/necessary/intended for growing glacier experiments (e.g.
  paleoglaciology) (:pull:`624`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- New ``oggm_prepro`` command line tool to run the OGGM preprocessing tasks
  and compress the directories (:pull:`648`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- `init_glacier_regions` task now accepts RGI Ids strings as input instead of
  only Geodataframes previously (:pull:`656`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- The ``entity_task`` decorator now accepts a fallback-function which will be
  executed if a task fails and `cfg.PARAMS['continue_on_error'] = True`. So far
  only one fallback function is implemented for `climate.local_t_star`
  (:pull:`663`).
  By `Matthias Dusch <https://github.com/matthiasdusch>`_.
- New `process_gcm_data` task to handle CMIP5 files.
  By `Nicolas Champollion <https://github.com/nchampollion>`_.


Bug fixes
~~~~~~~~~

- Remove dependency to deprecated matplotlib._cntr module (:issue:`418`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Fixed a bug in tidewater glaciers terminus position finding, where
  in some rare cases the percentile threshold was too low (:pull:`444`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Fixed a caching bug in the test suite, where some tests used to fail when run
  for a second time on a modified gdir (:pull:`448`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Fixed a problem with netCDF4 versions > 1.3 which returns masked arrays
  per default. We now prevent netCDF4 to return masked arrays altogether
  (:issue:`482`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.


Internals
~~~~~~~~~

- We now use a dedicated server for input data such as modified RGI files
  (:pull:`408`). By `Fabien Maussion <https://github.com/fmaussion>`_.
- Test fix for googlemaps.
  By `Fabien Maussion <https://github.com/fmaussion>`_.
- Added a utility function (:py:func:`~utils.idealized_gdir`) useful
  to dow flowline experiments without have to create a local map (:pull:`413`).
  By `Fabien Maussion <https://github.com/fmaussion>`_.


.. _whats-new.1.0:

v1.0 (16 January 2018)
----------------------

This is the first official major release of OGGM. It is concomitant to the
submission of a manuscript to
`Geoscientific Model Development (GMD) <https://www.geoscientific-model-development.net>`_.

This marks the stabilization of the codebase (hopefully) and implies that
future changes will have to be documented carefully to ensure traceability.

New contributors to the project:

- **Anouk Vlug** (PhD student, University of Bremen), added the CESM
  climate data tools.
- **Anton Butenko** (PhD student, University of Bremen), developed the
  downstream bedshape algorithm
- **Beatriz Recinos** (PhD student, University of Bremen), participated to the
  development of the calving parametrization
- **Julia Eis** (PhD student, University of Bremen), developed the glacier
  partitioning algorithm
- **Schmitty Smith** (PhD student,  Northand College, Wisconsin US), added
  optional parameters to the mass balance models


.. _whats-new.0.1.1:

v0.1.1 (16 February 2017)
-------------------------

Minor release: changes in ITMIX to handle the synthetic glacier cases.

It was tagged only recently for long term documentation purposes and storage
on `Zenodo <https://zenodo.org/record/292630>`_.

.. _whats-new.0.1.0:

v0.1 (29 March 2016)
--------------------

Initial release, used to prepare the data submitted to ITMIX (see
`here <http://www.fabienmaussion.info/2016/06/18/itmix-experiment-phase1/>`_).


This release is the result of several months of development (outside of GitHub
for a large part). Several people have contributed to this release:

- **Michael Adamer** (intern, UIBK), participated to the development of the
  centerline determination algorithm (2014)
- **Kévin Fourteau** (intern, UIBK, ENS Cachan), participated to the
  development of the inversion and the flowline modelling algorithms
  (2014-2015)
- **Alexander H. Jarosch** (Associate Professor, University of Iceland),
  developed the MUSCL-SuperBee model (:pull:`23`)
- **Johannes Landmann** (intern, UIBK), participated to the
  `links between databases`_ project (2015)
- **Ben Marzeion** (project leader, University of Bremen)
- **Fabien Maussion** (project leader, UIBK)
- **Felix Oesterle** (Post-Doc, UIBK) provided the
  AWS deployment script (:pull:`25`)
- **Timo Rothenpieler** (programmer, University of Bremen), participated to the
  OGGM deployment script (e.g. :pull:`34`, :pull:`48`), and developed OGGM
  `installation`_ tools
- **Christian Wild** (master student, UIBK), participated to the development of
  the centerline determination algorithm (2014)

.. _links between databases: https://github.com/OGGM/databases-links
.. _installation: https://github.com/OGGM/OGGM-Anaconda
