Skip to content

Commit e908868

Browse files
fix ilamb tamplate for piControl runs (#702)
1 parent 38b47b4 commit e908868

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

zppy/templates/ilamb.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ lnd_ts_for_ilamb={{ output }}/post/lnd/{{ ts_land_grid }}/cmip_ts/monthly/
4040
atm_ts_for_ilamb={{ output }}/post/atm/{{ ts_atm_grid }}/cmip_ts/monthly/
4141
# Go through the time series files for between year1 and year2,
4242
# using a step size equal to the number of years per time series file
43-
for year in `seq ${Y1} {{ ts_num_years }} ${Y2}`;
43+
start_year=$(echo $Y1 | sed 's/^0*//')
44+
end_year=$(echo $Y2 | sed 's/^0*//')
45+
for year in `seq $start_year {{ ts_num_years }} $end_year`;
4446
do
45-
start_year=`printf "%04d" ${year}`
4647
end_year_int=$((${start_year} + {{ ts_num_years }} - 1))
48+
start_year=`printf "%04d" ${year}`
4749
end_year=`printf "%04d" ${end_year_int}`
4850
echo "Copying files for ${start_year} to ${end_year}"
4951
cp -s ${lnd_ts_for_ilamb}/*_*_*_*_*_*_${start_year}??-${end_year}??.nc .

0 commit comments

Comments
 (0)