#!/bin/csh

date +"%Y/%m/%d %H:%M:%S -- $0 -- starting..."

set vicNl = /home/disk/columbia2/marketa/SRC/VIC_4.0.7_w_spatial_pert_staticlinks/vicNl

# run for 101 variations in pert_prcp for sep:
foreach n ( `seq -f%02g 0 100` )
  date +"%Y/%m/%d %H:%M:%S -- $0 -- $n"
  awk '{for(i=1;i<NF;i++){if(i==11){printf("%.3f ",1+'${n}'*0.02);}else{printf("%s ",$i);}} \
	printf("%s\n",$NF);}' pert_prcp.bak >! pert_prcp

  $vicNl -g VIC.conf >&! log.$n
  mv fluxes_35.78125_-112.28125 fluxes_35.78125_-112.28125.$n
end

wait
date +"%Y/%m/%d %H:%M:%S -- $0 -- DONE."
exit

