OGGM / oggm

Open Global Glacier Model
http://oggm.org
BSD 3-Clause "New" or "Revised" License
217 stars 104 forks source link

Negative volume with fixed-geometry-spinup #1513

Open pat-schmitt opened 1 year ago

pat-schmitt commented 1 year ago

When using the fixed-geometry-spinup the volume in the past can become negative. Probably, this is only a problem for small glaciers but can be easily overseen when aggregating the results of multiple glaciers.

I would suggest clipping the value of the volume to zero after the calculation here https://github.com/OGGM/oggm/blob/master/oggm/core/flowline.py#L1266. Not sure if this leads to unwanted site-effects with run_with_hydro, but I don't think so.

fixed_geometry_spinup_negative_volume

I created the figure with:

from oggm import cfg, workflow, tasks
import xarray as xr
import matplotlib.pyplot as plt

cfg.initialize(logging_level='WARNING')
cfg.PATHS['working_dir'] = utils.gettempdir(dirname='Test_fixed_geometry_spinup', reset=True)

gdir = workflow.init_glacier_directories(
            ['RGI60-11.00033'],
            from_prepro_level=3, prepro_border=160,
            prepro_base_url='https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/L3-L5_files/centerlines/w5e5/qc0/pcpwin/match_geod_pergla/')[0]

tasks.run_from_climate_data(gdir, fixed_geometry_spinup_yr=1980,
                            output_filesuffix='_fixed_geometry_spinup')

fp = gdir.get_filepath('model_diagnostics',
                       filesuffix='_fixed_geometry_spinup')
with xr.open_dataset(fp) as ds:
    ds = ds.load()

ds.volume_m3.plot(figsize=(10, 5))
fig = plt.gcf()
fig.set_facecolor('white')
plt.savefig('fixed_geometry_spinup_negative_volume.png')
fmaussion commented 1 year ago

Thanks for the report!

Unfortunately I think that for mass-conservation it is necessary to keep it like that (especially for hydro, yes).

This is unfortunate, but I don't think there is a better solution. For non-hydro applications it's probably best to not have negative volumes, maybe people should be informed to clip the data beforehand