# Slurm commandos to put in the terminal # need to run every RGI region separately once for end yr 2100 and 2300 # the amount of arrays corresponds to the amount of glaciers/1000 (in Alps w. 3927 glaciers, need 1-4) # complete sbatch --array=1-28 run_slurm_with_hydro_per_rgi_reg.slurm 01 2100 sbatch --array=1-19 run_slurm_with_hydro_per_rgi_reg.slurm 02 2100 sbatch --array=1-5 run_slurm_with_hydro_per_rgi_reg.slurm 03 2100 sbatch --array=1-8 run_slurm_with_hydro_per_rgi_reg.slurm 04 2100 sbatch --array=1-21 run_slurm_with_hydro_per_rgi_reg.slurm 05 2100 # due to connectivity level 2, some will be removed afterwards sbatch --array=1-1 run_slurm_with_hydro_per_rgi_reg.slurm 06 2100 sbatch --array=1-2 run_slurm_with_hydro_per_rgi_reg.slurm 07 2100 sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 08 2100 sbatch --array=1-2 run_slurm_with_hydro_per_rgi_reg.slurm 09 2100 sbatch --array=1-6 run_slurm_with_hydro_per_rgi_reg.slurm 10 2100 sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 11 2100 sbatch --array=1-2 run_slurm_with_hydro_per_rgi_reg.slurm 12 2100 sbatch --array=1-55 run_slurm_with_hydro_per_rgi_reg.slurm 13 2100 sbatch --array=1-28 run_slurm_with_hydro_per_rgi_reg.slurm 14 2100 sbatch --array=1-14 run_slurm_with_hydro_per_rgi_reg.slurm 15 2100 sbatch --array=1-3 run_slurm_with_hydro_per_rgi_reg.slurm 16 2100 sbatch --array=1-16 run_slurm_with_hydro_per_rgi_reg.slurm 17 2100 sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 18 2100 sbatch --array=1-3 run_slurm_with_hydro_per_rgi_reg.slurm 19 2100 ### not yet running sbatch --array=1-28 run_slurm_with_hydro_per_rgi_reg.slurm 01 2300 sbatch --array=1-19 run_slurm_with_hydro_per_rgi_reg.slurm 02 2300 sbatch --array=1-5 run_slurm_with_hydro_per_rgi_reg.slurm 03 2300 sbatch --array=1-8 run_slurm_with_hydro_per_rgi_reg.slurm 04 2300 sbatch --array=1-21 run_slurm_with_hydro_per_rgi_reg.slurm 05 2300 sbatch --array=1-1 run_slurm_with_hydro_per_rgi_reg.slurm 06 2300 sbatch --array=1-2 run_slurm_with_hydro_per_rgi_reg.slurm 07 2300 sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 08 2300 sbatch --array=1-2 run_slurm_with_hydro_per_rgi_reg.slurm 09 2300 sbatch --array=1-6 run_slurm_with_hydro_per_rgi_reg.slurm 10 2300 sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 11 2300 sbatch --array=1-2 run_slurm_with_hydro_per_rgi_reg.slurm 12 2300 sbatch --array=1-55 run_slurm_with_hydro_per_rgi_reg.slurm 13 2300 sbatch --array=1-28 run_slurm_with_hydro_per_rgi_reg.slurm 14 2300 sbatch --array=1-14 run_slurm_with_hydro_per_rgi_reg.slurm 15 2300 sbatch --array=1-3 run_slurm_with_hydro_per_rgi_reg.slurm 16 2300 sbatch --array=1-16 run_slurm_with_hydro_per_rgi_reg.slurm 17 2300 sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 18 2300 sbatch --array=1-3 run_slurm_with_hydro_per_rgi_reg.slurm 19 2300 ###################### # create slurm command list # of this shape # sbatch --array=1-4 run_slurm_with_hydro_per_rgi_reg.slurm 11 2100 from oggm import utils import pandas as pd # get the dataset where coordinates of glaciers are stored frgi = utils.file_downloader('https://cluster.klima.uni-bremen.de/~oggm/rgi/rgi62_stats.h5') #frgi = '/home/users/lschuster/glacierMIP/rgi62_stats.h5' odf = pd.read_hdf(frgi, index_col=0) n_glac_per_batch = 1000 for end_yr in [2100, 2300]: for rgi_reg in odf['O1Region'].unique(): n_batches = int(np.ceil(len(odf.loc[odf.O1Region == rgi_reg])/n_glac_per_batch)) print(f'sbatch --array=1-{n_batches} run_slurm_with_hydro_per_rgi_reg.slurm {rgi_reg} {end_yr}') print('\n') ##############