download_atm_perturb.sh 651 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # Before downloading; the perturb it should be well prepared at ECMWF's c2a in the
  3. # context of cfu's infrastructure (use "prepare_atm_perturb.cmd" over there first).
  4. # nohup ./download_atm_perturb.sh T255L62 b0ga >& download.log &
  5. #
  6. set -xuve
  7. date
  8. grd=$1
  9. ver=$2
  10. src=ec:/c3m/perturb/atmos/$grd/$ver
  11. dst=/cfu/releases/perturb/atmos/$grd/$ver
  12. mkdir -p $dst
  13. list=atm-${grd}-${ver}
  14. if [[ ! -a $list ]]; then
  15. ecaccess-file-dir $src > $list
  16. fi
  17. for l in $(cat $list); do
  18. ecaccess-file-get $src/$l $dst/$l
  19. if [[ $? -ne 0 ]]; then
  20. exit 1
  21. fi
  22. cat $list | sed -e '1d' > ${list}.tmp
  23. mv ${list}.tmp $list
  24. done
  25. cat $list; rm $list
  26. date