# Mask subregion using coorainate in the R1.dat file: # Input file: Data/pr_exp28_daily.nc # Masked file: ofile_R1.nc cdo maskregion,R1.dat Data/pr_exp28_daily.nc ofile_R1.nc #Or: count=2 cat lonlat_r2r20.dat | while read -r lon1 lon2 lat1 lat2; do cdo sellonlatbox,${lon1},${lon2},${lat1},${lat2} ifile ofile_R${count}.nc count=$((count+1)) done