Skip to content

Commit

Permalink
Assuring the last day of each year is December 31
Browse files Browse the repository at this point in the history
  • Loading branch information
kasra-keshavarz committed May 22, 2024
1 parent 5b2a53a commit 963c652
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/eccc-rdrs/rdrs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ for yr in $yearsRange; do

# setting the end point, either the end of current year, or the $endDate
# last time-step of the current year
endOfCurrentYearUnix=$(date --date="$yr-01-01 +1year -1day" "+%s")
endOfCurrentYearUnix=$(date --date="$yr-01-01 23:00:00 +1year -1day" "+%s")
if [[ $endOfCurrentYearUnix -le $endDateUnix ]]; then
endPointUnix=$endOfCurrentYearUnix
else
Expand All @@ -287,7 +287,7 @@ for yr in $yearsRange; do

# creating file name
file="${toDateFormatted}12.nc" # current file name

# extracting variables from the files and spatial subsetting
# assuring the process finished using an `until` loop
until ncks -A -v ${variables} \
Expand Down

0 comments on commit 963c652

Please sign in to comment.