DOI: 10.5281/zenodo.18248869
title: Runoff from Greenland's Firn Area - Why do MODIS, RCMs and a Firn Model disagree? - Code and Data

description: README v2 –  code and data for obtaining MODIS runoff limits and comparison to and between MAR and RACMO / IMAU-FDM

 

Differences to v1 of this repository

This version v2 of the repository includes the follwing changes compared to v1:

- contains new and updated versions of the code used in Machguth et al. (2026). Changes to the code were done in response to reviewers' requests for changes to the figures. updated code can be found mainly in the projects "Greenland_RCM_analysis" and "Notebooks". Elsewhere changes are minor or absent.

- provides also the MAR, RACMO and IMAU-FDM data. In the case of the MAR data, most variables that were not used in the study Machguth et al. (2026) were removed. This was done to reduce the data volume of this repository. Note that for easier up and download to and from this repository, the Greenland-wide MAR data were split  into four ZIP files. All included .nc files can be merged again into one folder after download.

- contains two tables (_depth_of_ice_slab_KAN_U.xlsx and _KAN_U_10m_firn_temperatures.xlsx) that were missing from v1 of this repository.

- clarifications, corrections and additional information in the README, as well as a correctly rendered Table 1.

 

Basic workflow

Table 1 lists the projects, the pieces of code in each project and the key output of each piece of code. This serves at illustrating the basic workflow. More detailed information on required input is provided below. The README files of the various projects provide details on how to use the code.

 

Table 1: General project overview. The projects and code are shown in the order they are intended to be used. In italic are parts of code that were not used for Machguth et al. (2026) but instead for Machguth et al. (2022). They might not be fully compatible anymore with runoff limits Yr calculated along flowline-polygons.

 






Project



Code



Output





flowlines



crop_gdalwarp.py



DEM, cropped and reprojected to required size and grid (identical to the MODIS files)





flowline_seedpoints.py



Seedpoints to calculate flowlines





flowline.py



Flowlines and flowline- polygons





MODIS_Greenland



MODIS_array_filter.py



Daily MODIS grids filtered for outliers





MODIS_stddev_spatial.py



Daily grids of MODIS spatial standard deviation





MODIS_mean_stddev.py



Greenland-wide map of background MODIS spatial standard deviation





MODIS_NDWI_tiff_to_nc.py



MODIS NDWI converted from tiff to netCDF





MODIS_find_slush_limit.py



Table of all detected daily Yr





Greenland_RCM_analysis_prep



modis_vs_mar.py



Tables of daily MAR Yr for all flowline-polygons





modis_vs_racmo.py



Table of daily RACMO Yr for all flowline-polygons





MODIS_Greenland_analysis



MODIS_A_SLmax.py



Calculates annual maxima of the Yr, written into table. Creates plots visualizing MODIS Yr spatial and temporal distribution – only used in Machguth et al. (2022)





MODIS_A_SLanalyis.py



Plots that visualize progression and forcing behind MODIS Yr – only used in Machguth et al. (2022)





MODIS_comp_RCM_maxYs.py



For all of Greenland: Plots that compare RCM and MODIS maxYr





MODIS_comp_RCM_Ys.py



For all of Greenland: Plots that compare RCM and MODIS daily Yr





Greenland_RCM_analysis



RCM_analysis_comp_Ktransect.py



For the K-transect: Plots/tables that compare RACMO/FDM and MAR Yr as well as various RCM parameters





Jupyter notebooks



K-transect_MAR_Greenland-wide_to_K-transect.ipynb



Writes MAR .nc files that contain data only for the K-Transect





K-transect_RACMO-MAR_depth-data-plot.ipynb



For the K-transect: Plots to compare depth information of MAR and RACMO/FDM





 

Input and output data

All required input data is provided in this repository, with some limitations explained in the following. 

Note 1: Basically all data are provided to (i) run the runoff (Y_obs) limit detection, and (ii) to repeat all the RCM analysis and comparison to MODIS Y_obs. However, the MODIS data for all of Greenland are too volumous and thus only the MODIS data for the so called “test” data set for runoff limit detection are provided. These files include sat_modis_proc_test_l1.zip, sat_modis_proc_test_l2.zip, sat_modis_proc_test_l3.zip and sat_modis_proc_test_l2_NDWI.zip. The complete MODIS data (MOD10A1 and MOD09GA), however, can be downloaded from the data sources mentioned in Section 2.1 of Machguth et al. (2026).

Note 2: While we only provide the MODIS test data for the runoff limit detection, we here provide the full output of the Greenland-wide runoff limit detection.

Note 3: the PDF README provided refers to v1, please disregard.

 

Input to flowlines/crop_gdalwarp.py

arcticdem_mosaic_100m_v30_greenland_icesheet_geoidCorr.tif

 

Input to flowlines/flowline_seedpoints.py

seedline_v2.1.shp

 

Input to flowlines/flowline.py

In the case of using the test data, no seed file exists. Do not provide one, seed points will be calculated along a north-south line as specified.

greenland_vel_mosaic200_2015-2018_vx_v02-composite-crop.tif

greenland_vel_mosaic200_2015-2018_vy_v02-composite-crop.tif

dem_test_gapfilled.tif

In case of calculating flowlines Greenland-wide:

greenland_vel_mosaic500_2015-2018_vx_v02-composite-crop.tif

greenland_vel_mosaic500_2015-2018_vy_v02-composite-crop.tif

arcticdem_mosaic_500m_v30_greenland_icesheet_geoidCorr_GapFilled.tif

seedpoints_v3.4.shp

 

Input to MODIS_Greenland/MODIS_array_filter.py

/sat_modis_proc_GR_l1test/*

 

Input to MODIS_Greenland/MODIS_stddev_spatial.py

/sat_modis_proc_test_l2/*

 

Input to MODIS_Greenland/MODIS_mean_stddev.py

/sat_modis_proc_test_l3/*

dem_test_gapfilled.tif

 

Input to MODIS_Greenland/ MODIS_NDWI_tiff_to_nc.py

Input data were computed directly on Google Earth Engine, they have not been preserved, only output data exist.

 

Input to MODIS_Greenland/MODIS_find_slush_limit.py

/sat_modis_proc_test_l3/*

/sat_modis_proc_test_l2_NDWI/*

mask_greenland_icesheet/dem_test_gapfilled.tif

Ys_polygons__test_W20km.shp

flowlines__test_W20km.shp

test_MOD10A1.l3.v4_yrs2000-2021_doy126-136_stddev_median.tif

 

Input to Greenland_RCM_analysis_prep/modis_vs_mar.py

This code is a direct copy of notebooks that were used to compare Greenland-wide max Y_obs to max Y_rcm MAR. It has not been tested, not all input data might be included in the repository.

/flash/tedstona/MARv.HorstRCMStudy_20240624/*

flowline Polygons

/flash/tedstona/_list_PolyIDs.xlsx

 

Input to Greenland_RCM_analysis_prep/modis_vs_racmo.py

This code is a direct copy of notebooks that were used to compare Greenland-wide max Y_obs to max Y_rcm MAR. It has not been tested, not all input data might be included in the repository.

/flash/tedstona/RACMO/1km/runoff/*

arcticdem_mosaic_500m_v30_greenland_icesheet_GeoidCorr_GapFilled_RACMO1km.tif

racmo_polys.nc

 

Input to MODIS_Greenland_analysis/MODIS_A_SLmax.py

_test_slush-limit_output_table.xlsx

or the Greenland-wide output data:

_GR_slush-limit_output_table.xlsx

 

Input to MODIS_Greenland_analysis/MODIS_A_SLanalyis.py

KAN_U_hourly_v3_fewer_columns.xlsx

KAN_M_hourly_v3_fewer_columns.xlsx

(selected_SL_years_and_stripes_20km.xlsx: not found and was also only used in Machguth et al., 2022)

__test_table_complete_annual_max_SL.xlsx

__test_slush-limit_output_table_OnlyValidEntries.xlsx

or the Greenland-wide output data:

__GR_table_complete_annual_max_SL.xlsx

__GR_test_slush-limit_output_table_OnlyValidEntries.xlsx

 

Input to MODIS_Greenland_analysis/MODIS_comp_RCM_maxYs.py

It has not been tested whether this file also works with the “test” data.

RACMO2.3p2_ERA5_3h_FGRN055.1km-rlim-RUa1mm.xlsx

MAR-v.20240624-rlim-RUa1mm.xlsx

_stripes_with_aquifers.xlsx

__test_table_simple_annual_max_SL.xlsx

__test_table_complete_annual_max_SL.xlsx

or the Greenland-wide output data:

__GR_table_simple_annual_max_SL.xlsx

__GR_table_complete_annual_max_SL.xlsx

 

Input to MODIS_Greenland_analysis/MODIS_comp_RCM_Ys.py

It has not been tested whether this file also works with the “test” data.

__GR_slush-limit_output_table_OnlyValidEntries.xlsx

flowlines_daily_rlims_RACMO_1mmEvents_10mmAnnual_2000_2021.xlsx

flowlines_daily_rlims_MAR-v.20240624_1mmEvents_10mmAnnual_2000_2021.xlsx

 

Input to Greenland_RCM_analysis/RCM_analysis_comp_Ktransect.py

It has not been tested whether this file also works with the “test” data.

/MARv3.14_Greenland-wide_continuous_reduced/*

/FDM_Greenland-wide/* 

/RACMO-FDM_K-Transect_updated/* 

/RACMO_Greenland-wide/* 

/MARv3.14_K-transect_continuous/*

FGRN055_Masks.nc

__GR_slush-limit_output_table_OnlyValidEntries.xlsx

__GR_table_simple_annual_max_SL.xlsx

__GR_table_complete_annual_max_SL.xlsx

 

Input to _notebooks\K-transect_MAR_Greenland-wide_to_K-transect.ipynb

This notebooks applies the Bresenham algorithm to extract those RCM grid cells that are located closest along the K-Transect (or any other Transect). The output of this notebook is already provided in this repository as /MARv3.14_K-transect_continuous/* . (The input to _notebooks\K-transect_MAR_Greenland-wide_to_K-transect.ipynb would be all netCDF files of /MAR_v3.14_reduced_*/). 

While this notebook can be applied to any other Greenland-wide dataset, note that (i) the IMAU-FDM data in /RACMO-FDM_K-Transect_updated/ were obtained directly from IMAU (due to the imense data volume of Greenland-wide IMAU-FDM output for all firn layers) and (ii) that the RACMO grid cells along the K-Transect are extracted on the fly in RCM_analysis_comp_Ktransect.py, also using the Bresenham algorithm.

 

Input to _notebooks\K-transect_RACMO-MAR_depth-data-plot.ipynb

_depth_of_ice_slab_KAN_U.xlsx

_KAN_U_10m_firn_temperatures.xlsx

/RACMO-FDM_K-Transect_updated/*

/MARv3.14_K-transect_continuous/*

 

Input to _notebooks\scatter_plots_production.pynb

table_influence_difference_maxysrcm_incl-albedo_v7.4.xlsx which is being written to output by Greenland_RCM_analysis\RCM_analysis_comp_Ktransect_tables.py

 

Output data

The basic output files of the runoff limit detection for all of Greenland are:

_GR_slush-limit_output_table.xlsx (written by MODIS_Greenland/MODIS_find_slush_limit.py)

__GR_slush-limit_output_table_OnlyValidEntries.xlsx (by MODIS_Greenland_analysis/MODIS_A_SLmax.py)

__GR_table_simple_annual_max_SL.xlsx  (by MODIS_Greenland_analysis/MODIS_A_SLmax.py)

__GR_table_complete_annual_max_SL.xlsx  (by MODIS_Greenland_analysis/MODIS_A_SLmax.py)

 

The basic output files of the runoff limit detection for the “test” data set are:

_test_slush-limit_output_table.xlsx (written by MODIS_Greenland/MODIS_find_slush_limit.py)

__test_slush-limit_output_table_OnlyValidEntries.xlsx (by MODIS_Greenland_analysis/MODIS_A_SLmax.py)

__test_table_simple_annual_max_SL.xlsx  (by MODIS_Greenland_analysis/MODIS_A_SLmax.py)

__test_table_complete_annual_max_SL.xlsx  (by MODIS_Greenland_analysis/MODIS_A_SLmax.py)