oggm.tasks.run_with_hydro

On this page

oggm.tasks.run_with_hydro#

oggm.tasks.run_with_hydro(gdir, settings_filesuffix='', run_task=None, store_monthly_hydro=False, fixed_geometry_spinup_yr=None, ref_area_from_y0=False, ref_area_yr=None, ref_geometry_filesuffix=None, **kwargs)[source]#

Run the flowline model and add hydro diagnostics.

The on-glacier melt is corrected so that, together with the solid precipitation, it matches the mass change of the dynamical model. For this the run needs to store the total glacier mass, i.e. ‘mass’ must be in PARAMS[‘store_diagnostic_variables’] (the default). Using the mass (instead of the ice volume times a fixed ice density) also accounts for mass balance models with a snow/firn bucket system (e.g. SfcTypeTIModel), where part of the glacier mass has a lower density.

If the mass balance model of the run tracks surface types (e.g. SfcTypeTIModel), the on-glacier melt is additionally split into snow_melt_on_glacier (buckets younger than one year), firn_melt_on_glacier (older buckets) and ice_melt_on_glacier. The three components are rescaled so that they always sum up to melt_on_glacier (i.e. the residual and bias corrections are distributed proportionally). For mass balance models without surface type tracking these three variables are NaN. Note that for mass balance models with a memory of the past (e.g. SfcTypeTIModel), use_previous_mbs is set to True after the dynamical run, because the mass balance values stored during the run are revisited here.

Two area-weighted air temperature diagnostics can be computed as well (the temperature after downscaling, i.e. the one used by the mass balance model for melt and for the solid/liquid precipitation split). Like the other hydro variables they are computed if their name is in PARAMS[‘store_diagnostic_variables’] (the default).

  • temp_on_glacier: weighted by the (evolving) glacier area, at the surface elevation of the model at that time.

  • temp_ref_area: weighted by the reference area, at the reference surface elevation, i.e. fixed geometry. This one is independent of the glacier evolution and is the diagnostic asked for by GlacierMIP4. Note that with the default ref_area_yr=None the reference area is the largest area of the simulation while the elevations are the ones of the first year of the (reference) geometry file: use ref_area_yr or ref_area_from_y0 for a consistent fixed geometry.

TODOs:
  • Add the possibility to record MB during run to improve performance (requires change in API)

  • …

Parameters:
gdiroggm.GlacierDirectory

the glacier directory to process

settings_filesuffix: str

You can use a different set of settings by providing a filesuffix. This is useful for sensitivity experiments. Code-wise the settings_filesuffix is set in the @entity-task decorater.

run_taskfunc

any of the run_*` tasks in the oggm.flowline module. The mass balance model used needs to have the add_climate output kwarg available though.

store_monthly_hydrobool

also compute monthly hydrological diagnostics. The monthly outputs are stored in 2D fields (years, months)

ref_area_yrint

the hydrological output is computed over a reference area, which per default is the largest area covered by the glacier in the simulation period. Use this kwarg to force a specific area to the state of the glacier at the provided simulation year.

ref_area_from_y0bool

overwrite ref_area_yr to the first year of the timeseries

ref_geometry_filesuffixstr

this kwarg allows to copy the reference area from a previous simulation (useful for projections with historical spinup for example). Set to a model_geometry file filesuffix that is present in the current directory (e.g. _historical for pre-processed gdirs). If set, ref_area_yr and ref_area_from_y0 refer to this file instead.

fixed_geometry_spinup_yrint

if set to an integer, the model will artificially prolongate all outputs of run_until_and_store to encompass all time stamps starting from the chosen year. The only output affected are the glacier wide diagnostic files - all other outputs are set to constants during “spinup”

**kwargsall valid kwargs for run_task

Notes

Files written to the glacier directory: