Skip to content

Commit 3e98b45

Browse files
Bumping version, correcting paths in Daymet, and adding parsable option
1 parent 48ae682 commit 3e98b45

File tree

6 files changed

+41
-8
lines changed

6 files changed

+41
-8
lines changed

CHANGELOG

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
Changelog
22
=========
3+
[v0.4.0] - August 11th, 2023
4+
# Improvements
5+
* `--parsable` option now added when the script submits jobs to the SLURM
6+
scheduler
7+
# Fixed
8+
* Issue with the `Daymet` dataset is fixed and now subsetting is done properly
9+
10+
[v0.3.0] - June 16th, 2023
11+
# Improvements
12+
* Ensemble members are now processed in parallel mode
13+
14+
# Datasets
15+
* AB Government climate projections are added to the dataset (data
16+
currently not publicly available)
317

418
[v0.2.0] - May 5th, 2023
519

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.0
1+
0.4.0

assets/coord_closest_daymet_idx.ncl

100644100755
File mode changed.

assets/coord_daymet_idx.ncl

100644100755
File mode changed.

extract-dataset.sh

+24-5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Script options:
5858
on the SLURM system; optional
5959
-k, --no-chunk No parallelization, recommended for small domains
6060
-p, --prefix=STR Prefix prepended to the output files
61+
-b, --parsable Parsable SLURM message mainly used
62+
for chained job submissions
6163
-c, --cache=DIR Path of the cache directory; optional
6264
-E, [email protected] E-mail user when job starts, ends, and finishes; optional
6365
-V, --version Show version
@@ -113,7 +115,7 @@ shopt -s expand_aliases
113115
# Parsing input arguments
114116
# =======================
115117
# argument parsing using getopt - WORKS ONLY ON LINUX BY DEFAULT
116-
parsedArguments=$(getopt -a -n extract-dataset -o jhVE:d:i:v:o:s:e:t:l:n:p:c:m:ka: --long submit-job,help,version,email:,dataset:,dataset-dir:,variable:,output-dir:,start-date:,end-date:,time-scale:,lat-lims:,lon-lims:,prefix:,cache:,ensemble:,no-chunk,shape-file: -- "$@")
118+
parsedArguments=$(getopt -a -n extract-dataset -o jhVbE:d:i:v:o:s:e:t:l:n:p:c:m:ka: --long submit-job,help,version,parsable,email:,dataset:,dataset-dir:,variable:,output-dir:,start-date:,end-date:,time-scale:,lat-lims:,lon-lims:,prefix:,cache:,ensemble:,no-chunk,shape-file: -- "$@")
117119
validArguments=$?
118120
# check if there is no valid options
119121
if [ "$validArguments" != "0" ]; then
@@ -148,6 +150,7 @@ do
148150
-m | --ensemble) ensemble="$2" ; shift 2 ;; # optional
149151
-k | --no-chunk) parallel=false ; shift ;; # optional
150152
-p | --prefix) prefixStr="$2" ; shift 2 ;; # required
153+
-b | --parsable) parsable=true ; shift ;; # optional
151154
-c | --cache) cache="$2" ; shift 2 ;; # optional
152155
-a | --shape-file) shapefile="$2" ; shift 2 ;; # optional
153156

@@ -180,8 +183,21 @@ fi
180183

181184
# email withought job submission not allowed
182185
if [[ -n $email ]] && [[ -z $jobSubmission ]]; then
183-
echo "$(basename $0): Email is not supported wihtout job submission;"
184-
echo "$(basename $0): Continuing without email notification..."
186+
echo "$(basename $0): ERROR! Email is not supported wihtout job submission;"
187+
exit 1;
188+
fi
189+
190+
# parsable without job submission not allowed
191+
if [[ $parsable==true ]] && [[ -z $jobSubmission ]]; then
192+
echo "$(basename $0): ERROR! --parsable argument cannot be used without job submission"
193+
exit 1;
194+
fi
195+
196+
# if parsable argument is provided
197+
if [[ -n $parsable ]]; then
198+
parsable="--parsable"
199+
else
200+
parsable=""
185201
fi
186202

187203
# if shapefile is provided extract the extents from it
@@ -402,12 +418,13 @@ call_processing_func () {
402418
#SBATCH --nodes=1
403419
#SBATCH --account=rpp-kshook
404420
#SBATCH --time=04:00:00
405-
#SBATCH --mem=8192M
421+
#SBATCH --mem=8000M
406422
#SBATCH --job-name=DATA_${scriptName}
407423
#SBATCH --error=$logDir/datatool_%A-%a_err.txt
408424
#SBATCH --output=$logDir/datatool_%A-%a.txt
409425
#SBATCH --mail-user=$email
410426
#SBATCH --mail-type=BEGIN,END,FAIL
427+
#SBATCH ${parsable}
411428
412429
$(declare -p startDateArr)
413430
$(declare -p endDateArr)
@@ -430,7 +447,9 @@ call_processing_func () {
430447
srun ${script} --start-date="\$tBegin" --end-date="\$tEnd" --cache="${cache}-\${SLURM_ARRAY_JOB_ID}-\${SLURM_ARRAY_TASK_ID}" --ensemble="\${member}"
431448
EOF
432449

433-
echo "$(basename $0): job submission details are printed under $logDir"
450+
if [[ -z $parsable ]]; then
451+
echo "$(basename $0): job submission details are printed under $logDir"
452+
fi
434453

435454
# serial run
436455
else

scripts/daymet/daymet.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ latDim="y" # latitude dimension
125125
lonDim="x" # longitude dimension
126126

127127
# spatial extraction script address
128-
coordIdxScript="$(dirname $0)/../assets/coord_daymet_idx.ncl"
129-
coordClosestIdxScript="$(dirname $0)/../assets/coord_closest_daymet_idx.ncl"
128+
coordIdxScript="$(dirname $0)/../../assets/coord_daymet_idx.ncl"
129+
coordClosestIdxScript="$(dirname $0)/../../assets/coord_closest_daymet_idx.ncl"
130130

131131
# ===================
132132
# Necessary Functions

0 commit comments

Comments
 (0)