{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2020-12-21 17:06:46: oggm.cfg: Reading default parameters from the OGGM `params.cfg` configuration file.\n", "2020-12-21 17:06:46: oggm.cfg: Multiprocessing switched ON according to the parameter file.\n", "2020-12-21 17:06:46: oggm.cfg: Multiprocessing: using all available processors (N=32)\n", "2020-12-21 17:06:46: oggm.utils: Checking the download verification file checksum...\n" ] } ], "source": [ "import os\n", "from oggm import utils, cfg\n", "cfg.initialize()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "era5_eb\n", "01\n", "02\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/users/fmaussion/.py3/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3337: DtypeWarning: Columns (21,22,42) have mixed types.Specify dtype option on import or set low_memory=False.\n", " if (await self.run_code(code, result, async_=asy)):\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "03\n", "04\n", "05\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/users/fmaussion/.py3/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3337: DtypeWarning: Columns (3,22,23,43) have mixed types.Specify dtype option on import or set low_memory=False.\n", " if (await self.run_code(code, result, async_=asy)):\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "06\n", "07\n", "08\n", "09\n", "10\n", "11\n", "12\n", "13\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/users/fmaussion/.py3/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3337: DtypeWarning: Columns (22,23,43) have mixed types.Specify dtype option on import or set low_memory=False.\n", " if (await self.run_code(code, result, async_=asy)):\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "14\n", "15\n", "16\n", "17\n", "18\n", "cera5_eb\n", "01\n", "02\n", "03\n", "04\n", "05\n", "06\n", "07\n", "08\n", "09\n", "10\n", "11\n", "12\n", "13\n", "14\n", "15\n", "16\n", "17\n", "18\n", "era5_eb_nocalv\n", "01\n", "02\n", "03\n", "04\n", "05\n", "06\n", "07\n", "08\n", "09\n", "10\n", "11\n", "12\n", "13\n", "14\n", "15\n", "16\n", "17\n", "18\n", "era5_fl\n", "01\n", "02\n", "03\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/users/fmaussion/notebooks/oggm/oggm/utils/_workflow.py:1595: RuntimeWarning: invalid value encountered in float_scalars\n", " bsl = ods.volume_bsl.data[fid, i] / ods.volume.data[fid, i]\n", "/home/users/fmaussion/notebooks/oggm/oggm/utils/_workflow.py:1596: RuntimeWarning: invalid value encountered in float_scalars\n", " bwl = ods.volume_bwl.data[fid, i] / ods.volume.data[fid, i]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "04\n", "05\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/users/fmaussion/.py3/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3337: DtypeWarning: Columns (3) have mixed types.Specify dtype option on import or set low_memory=False.\n", " if (await self.run_code(code, result, async_=asy)):\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "06\n", "07\n", "08\n", "09\n", "10\n", "11\n", "12\n", "13\n", "14\n", "15\n", "16\n", "17\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/users/fmaussion/.py3/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3337: DtypeWarning: Columns (61) have mixed types.Specify dtype option on import or set low_memory=False.\n", " if (await self.run_code(code, result, async_=asy)):\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "18\n" ] } ], "source": [ "# Add the extended files\n", "exps = ['era5_eb', 'cera5_eb', 'era5_eb_nocalv', 'era5_fl']\n", "for exp in exps:\n", " print(exp)\n", " for rgi_reg in range(1, 19):\n", " rgi_reg = '{:02d}'.format(rgi_reg)\n", " print(rgi_reg)\n", " sum_dir = '/home/www/fmaussion/gdirs/final_prepro_cmip6/{}/RGI62/b_080/L5/summary/'.format(exp)\n", " sum_dir_L3 = '/home/www/fmaussion/gdirs/final_prepro_cmip6/{}/RGI62/b_080/L3/summary/'.format(exp)\n", " pf = os.path.join(sum_dir, 'historical_run_output_{}.nc'.format(rgi_reg))\n", " mf = os.path.join(sum_dir, 'fixed_geometry_mass_balance_{}.csv'.format(rgi_reg))\n", " # This is crucial - extending calving only with L3 data!!!\n", " sf = os.path.join(sum_dir_L3, 'glacier_statistics_{}.csv'.format(rgi_reg))\n", " opath = os.path.join(sum_dir, 'historical_run_output_extended_corrected_{}.nc'.format(rgi_reg))\n", " utils.extend_past_climate_run(past_run_file=pf,\n", " fixed_geometry_mb_file=mf,\n", " glacier_statistics_file=sf,\n", " path=opath);" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "era5_eb\n", "19\n", "cera5_eb\n", "19\n", "era5_eb_nocalv\n", "19\n", "era5_fl\n", "19\n" ] } ], "source": [ "# Add the extended files\n", "exps = ['era5_eb', 'cera5_eb', 'era5_eb_nocalv', 'era5_fl']\n", "for exp in exps:\n", " print(exp)\n", " for rgi_reg in [19]:\n", " rgi_reg = '{:02d}'.format(rgi_reg)\n", " print(rgi_reg)\n", " sum_dir = '/home/www/fmaussion/gdirs/final_prepro_cmip6/{}/RGI62/b_080/L5/summary/'.format(exp)\n", " sum_dir_L3 = '/home/www/fmaussion/gdirs/final_prepro_cmip6/{}/RGI62/b_080/L3/summary/'.format(exp)\n", " pf = os.path.join(sum_dir, 'historical_run_output_{}.nc'.format(rgi_reg))\n", " mf = os.path.join(sum_dir, 'fixed_geometry_mass_balance_{}.csv'.format(rgi_reg))\n", " # This is crucial - extending calving only with L3 data!!!\n", " sf = os.path.join(sum_dir_L3, 'glacier_statistics_{}.csv'.format(rgi_reg))\n", " opath = os.path.join(sum_dir, 'historical_run_output_extended_corrected_{}.nc'.format(rgi_reg))\n", " utils.extend_past_climate_run(past_run_file=pf,\n", " fixed_geometry_mb_file=mf,\n", " glacier_statistics_file=sf,\n", " path=opath);" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }