Description
Overview This code is required to analyse the outputs of TOPKAPI-ETH as ran for the upper Rio Santa catchment to produce the figures presented in the paper ‘Thin and ephemeral snow shapes melt and runoff dynamics in the Peruvian Andes’. The model set-up and run codes are available on Zenodo at DOI: 10.5281/zenodo.15301957 and the outputs of the model runs are available on Zenodo at DOI: 10.5281/zenodo.15297284. Steps to run the analysis code 1. Download model outputs. In order to run the analysis codes presented here you will first need to download the model output data to your own file system. These can be found here: 10.5281/zenodo.15297284. You will also need to unzip all the folders before you start. 2. Download the analysis codes and unzip them (you can choose to download only one folder at a time if necessary). 3. Set the file paths for your system. The only change necessary should be to set the path to where you saved the output data. In each of the primary MATLAB codes there are lines at the beginning which set this (named dir_out and dir_long_out). Please set these correctly before you start to run the code. 4. Check model number and code options. a. Note that the model was run twice, the first run (MB_26) saved the majority of the outputs, and the second run (MB_27) was conducted to save the daily snow grids without the other variables. Therefore in most of the analysis codes the Run_nums and rS values (which set the run number) should be set to 26, with the exception of the Snow_only code where it should be set to 27. b. All the analysis files allow the time of analysis to be changed. By default it is set from 01/11/2008 to 31/10/2018, which corresponds with the analysis period of the paper. However, you can easily change the StartDate and EndDate options to shorter periods as required. There is a risk that some figures will not plot correctly but the analysis code itself is written to adjust to the run time stated. 5. Run the primary MATLAB file for that analysis (see below for details). Structure of the analysis codes The code saved here is used to create the main figures for the paper. Each folder is self-contained with all the supplementary data and functions required, so you can download only one folder and run the code individually. Comparing_runs: This code is used to compare the mass balance data from remote sensing and field measurements with the model outputs. This is used to create Figure 1c, SI Figure 11 and SI Figure 17. These codes start from SMB_compare_runs.m. The remote sensing comparisons are applied against altitudinally resolved glacier mass balances (rs_evan_smb_1520.asc and the uncertainties rs_evan_smbu_1520.asc) and those from Hugonnet et al. (2021) (rs_hu_dhdt_yyyy.asc and the uncertainties rs_hu_err_yyyy.asc). The additional files rs_smb_f_p1.asc and rs_smb_f_p2.asc are older versions superceeded by the rs_evan_smb_1520.asc file, but they are included as they are needed in the code. Glacier_reservoirs: This code is used to analyse the fraction of snow and ice melt and rain to runoff and how this changes over time in the measured sub-catchments. It also compares the modelled and measured runoff in the measured sub-catchments. It is used to create Figure 3 and SI Figure 10. These codes start from Glacier_reservoirs_all_vars.m. Grids_only: This code is used to analyse the spatial variation in melt inputs and snowcover. It is used to create Figure 1b, Figure 2 and Figure 4. These codes start from Hydro_grid_analysis.m, with the separate code plotMapand Piev4.m run from within this file too. Note that the figures are plotted and saved within the sub-function Load_hydro_grids, so if you’d like to make changes to the figures, stop the code within this sub-function. I will move the graphing code into the main function in the next version of this code. Point_analysis: This code is used to analyse the outputs which were saved hourly at selected points across the catchment, as well as compare the point based albedo records with the model. It is used to create Figure 5b, SI Figure 12 and SI Figure 16. These codes start from Point_analysis.m. Snow_only: This code is used to analyse the daily snow grids, to compare the modelled and MODIS snowlines and to create the data for the map of snow types. It is used to create Figure 1d, SI Figure 11 and SI Figure 17 (and contributes the data needed for SI Figure 18). These codes start from Snow_grid_analysis.m. Due to the large number of files which need to be loaded along with the iterative method used to derive snow line elevations, this code can take several hours to run. It will take a further few hours if you choose to run the code to create the map of ephemeral snow. There are some additional options in this code: With_glac > Determines if the snowline elevations are calculated including (=1) or excluding (=0) glacier areas. Default=0; Map_on > Determines whether the code to create the map of ephemeral snow (and the snow duration and depth with elevation relationships) is run. This is computationally demanding due to the need to analyse each cell at a time to reduce the RAM requirements. Threshold > Determines the snow depth in mm w.e. above which a modeled cell is defined as snow covered. SA_analysis: This code is used to determine the catchment hypsometry for all the catchments containing snow identified in Figure 5c. It can be run from the file SA_analysis_lv07.m. It also includes the QGIS map used to create Figure 5a, this is called Peru_wide_analysis_forZenodo and is saved in the Map subfolder. All the necessary data for the map is saved in the Data subfolder.
Date made available | 5 May 2025 |
---|---|
Publisher | ZENODO |
Keywords
- glaciers
- Peruvian Andes
- TOPKAPI-ETH
- snow
- runoff
- peru