diff --git a/scripts/eccc-rdrs/rdrs.sh b/scripts/eccc-rdrs/rdrs.sh index 18b04b1..e00937e 100755 --- a/scripts/eccc-rdrs/rdrs.sh +++ b/scripts/eccc-rdrs/rdrs.sh @@ -206,14 +206,22 @@ maxLon=$(echo $lonLims | cut -d ',' -f 2) # unload and load necessary modules unload_core_modules load_ncl_module + # choose a sample file as all files share the same grid domainFile="$(find "${datasetDir}/" -type f -name "*.nc" | head -n 1)" + # parse the upper and lower bounds of a given spatial limit minLat=$(echo $latLims | cut -d ',' -f 1) maxLat=$(echo $latLims | cut -d ',' -f 2) minLon=$(echo $lonLims | cut -d ',' -f 1) maxLon=$(echo $lonLims | cut -d ',' -f 2) +# adding/subtracting 0.1 degree to/from max/min values +minLat=$(bc <<< "$minLat - 0.1") +maxLat=$(bc <<< "$maxLat + 0.1") +minLon=$(bc <<< "$minLon - 0.1") +maxLon=$(bc <<< "$maxLon + 0.1") + # extract the associated indices corresponding to $latLims and $lonLims coordIdx="$(ncl -nQ 'coord_file='\"$domainFile\" 'minlat='"$minLat" 'maxlat='"$maxLat" 'minlon='"$minLon" 'maxlon='"$maxLon" "$coordIdxScript")" diff --git a/scripts/ouranos-espo-g6-r2/espo-g6-r2.sh b/scripts/ouranos-espo-g6-r2/espo-g6-r2.sh index 7d96d74..0934fb1 100755 --- a/scripts/ouranos-espo-g6-r2/espo-g6-r2.sh +++ b/scripts/ouranos-espo-g6-r2/espo-g6-r2.sh @@ -229,14 +229,22 @@ maxLon=$(echo $lonLims | cut -d ',' -f 2) # unload and load necessary modules unload_core_modules load_ncl_module + # choose a sample file as all files share the same grid domainFile=$(find ${datasetDir} -type f -name "*.nc" | head -n 1) + # parse the upper and lower bounds of a given spatial limit minLat=$(echo $latLims | cut -d ',' -f 1) maxLat=$(echo $latLims | cut -d ',' -f 2) minLon=$(echo $lonLims | cut -d ',' -f 1) maxLon=$(echo $lonLims | cut -d ',' -f 2) +# adding/subtracting 0.1 degree to/from max/min values +minLat=$(bc <<< "$minLat - 0.1") +maxLat=$(bc <<< "$maxLat + 0.1") +minLon=$(bc <<< "$minLon - 0.1") +maxLon=$(bc <<< "$maxLon + 0.1") + # extract the associated indices corresponding to $latLims and $lonLims coordIdx="$(ncl -nQ 'coord_file='\"$domainFile\" 'minlat='"$minLat" 'maxlat='"$maxLat" 'minlon='"$minLon" 'maxlon='"$maxLon" "$coordIdxScript")"