Page MenuHomec4science

3_exec_postprocess.sh
No OneTemporary

File Metadata

Created
Fri, May 23, 00:48

3_exec_postprocess.sh

#!/bin/bash
## == Settings
#SBATCH --job-name=postprocess_hr
#SBATCH --account=leso-pb
#SBATCH --nodes=1
#SBATCH --mem=125G
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --time=03:00:00
#SBATCH --chdir=./output
#SBATCH --array=1-1 ###97
#SBATCH -o postprocess_hr_%A_%a.out # Standard output
#SBATCH -e postprocess_hr_%A_%a.err # Standard error
echo STARTING AT $(date)
echo
## ====== Specify here the needed modules
module purge
module load gcc python/3.7.3
## ====== Get slurm array ID
N=1 # ${SLURM_ARRAY_TASK_ID}
echo Slurm array task ID: $N
echo
WORKDIR=/scratch/walch/workdir_solar_MMH_base # PATH TO WORKING DIRECTORY
FLATDIR=/scratch/walch/workdir_solar_EW_scenarios
## ====== User input
YEAR=MMH_base
ROOFTOPS=/work/hyenergy/output/solar_potential/geographic_potential/CH_ROOFS_all_replaced.csv
# $FLATDIR\/files/flat_roofs_baseline.csv
AVAIL_AREA=/work/hyenergy/output/solar_potential/geographic_potential/available_area/PRED_available_area_unc_filled.csv
PATH_TO_SCRIPT_ANNUAL=$WORKDIR\/merge_annual_data.py
N_BATCHES=95 #97
LAST_BATCH=`expr $N_BATCHES - 1`
START_BATCH=0
## ===== Variable definitions
CURR_ID=`expr $N - 1`
## ===== Execute script
source activate py3_geo
# Save annual data
PV_PATH=$WORKDIR\/tmp_$YEAR
OUTPATH=$WORKDIR\/files_$YEAR
echo
echo CHECKING EXISTANCE AND CHECKSUM OF BATCH FILES
echo
python $WORKDIR\/check_files.py $PV_PATH $N_BATCHES
mkdir $OUTPATH
python $PATH_TO_SCRIPT_ANNUAL $PV_PATH $ROOFTOPS $AVAIL_AREA $OUTPATH\/$YEAR\_annual_roofs_flat.csv
conda deactivate
echo
echo FINISHED AT $(date)

Event Timeline