Skip to content

Commit ffdef9d

Browse files
Assuring the spatial domain is fully covered (#50)
In this commit, a value of 0.1 degrees is added/subtracted to/from the minimum and maximum values of latitude and longitude extents. This is to assure that the spatial domain of the requested area is fully covered in the subsetted dataset files. Previously, the extents were not accurately covered. The value of 0.1 degress reflect the resolution of RDRSv2.1. Signed-off-by: Kasra Keshavarz <[email protected]>
1 parent 24e7b0a commit ffdef9d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

scripts/eccc-rdrs/rdrs.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,22 @@ maxLon=$(echo $lonLims | cut -d ',' -f 2)
206206
# unload and load necessary modules
207207
unload_core_modules
208208
load_ncl_module
209+
209210
# choose a sample file as all files share the same grid
210211
domainFile="$(find "${datasetDir}/" -type f -name "*.nc" | head -n 1)"
212+
211213
# parse the upper and lower bounds of a given spatial limit
212214
minLat=$(echo $latLims | cut -d ',' -f 1)
213215
maxLat=$(echo $latLims | cut -d ',' -f 2)
214216
minLon=$(echo $lonLims | cut -d ',' -f 1)
215217
maxLon=$(echo $lonLims | cut -d ',' -f 2)
216218

219+
# adding/subtracting 0.1 degree to/from max/min values
220+
minLat=$(bc <<< "$minLat - 0.1")
221+
maxLat=$(bc <<< "$maxLat + 0.1")
222+
minLon=$(bc <<< "$minLon - 0.1")
223+
maxLon=$(bc <<< "$maxLon + 0.1")
224+
217225
# extract the associated indices corresponding to $latLims and $lonLims
218226
coordIdx="$(ncl -nQ 'coord_file='\"$domainFile\" 'minlat='"$minLat" 'maxlat='"$maxLat" 'minlon='"$minLon" 'maxlon='"$maxLon" "$coordIdxScript")"
219227

scripts/ouranos-espo-g6-r2/espo-g6-r2.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,22 @@ maxLon=$(echo $lonLims | cut -d ',' -f 2)
229229
# unload and load necessary modules
230230
unload_core_modules
231231
load_ncl_module
232+
232233
# choose a sample file as all files share the same grid
233234
domainFile=$(find ${datasetDir} -type f -name "*.nc" | head -n 1)
235+
234236
# parse the upper and lower bounds of a given spatial limit
235237
minLat=$(echo $latLims | cut -d ',' -f 1)
236238
maxLat=$(echo $latLims | cut -d ',' -f 2)
237239
minLon=$(echo $lonLims | cut -d ',' -f 1)
238240
maxLon=$(echo $lonLims | cut -d ',' -f 2)
239241

242+
# adding/subtracting 0.1 degree to/from max/min values
243+
minLat=$(bc <<< "$minLat - 0.1")
244+
maxLat=$(bc <<< "$maxLat + 0.1")
245+
minLon=$(bc <<< "$minLon - 0.1")
246+
maxLon=$(bc <<< "$maxLon + 0.1")
247+
240248
# extract the associated indices corresponding to $latLims and $lonLims
241249
coordIdx="$(ncl -nQ 'coord_file='\"$domainFile\" 'minlat='"$minLat" 'maxlat='"$maxLat" 'minlon='"$minLon" 'maxlon='"$maxLon" "$coordIdxScript")"
242250

0 commit comments

Comments
 (0)