transfer.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env bash
  2. # local_transfer.sh: Copies the EC-Earth output from the
  3. # remote machine to a local folder and extract it
  4. LOCAL_DIR=/esarchive/exp/ecearth/%EXPID%
  5. set -xvue
  6. HPCARCH=%HPCARCH%
  7. CHUNK=%CHUNK%
  8. #
  9. # Copy Model output
  10. #
  11. mkdir -p $LOCAL_DIR
  12. cd $LOCAL_DIR
  13. if [ ${HPCARCH} == 'cca-intel' ]
  14. then
  15. chunk=$( printf "%03d\n" ${CHUNK} )
  16. for m in ifs nemo
  17. do
  18. mkdir -p ${m}/${chunk}
  19. for f in `ecaccess-file-dir %HPCHOST%:%HPCROOTDIR%/%SDATE%/%MEMBER%/runtime/output/${m}/$chunk`
  20. do
  21. ecaccess-file-mget -force %HPCHOST%:%HPCROOTDIR%/%SDATE%/%MEMBER%/runtime/output/${m}/$chunk/$f ${m}/$chunk/
  22. done
  23. done
  24. else
  25. rsync -avz --remove-source-files --no-group --omit-dir-times --chmod=g+rwxs,o-rwx %HPCUSER%@%HPCHOST%:%HPCROOTDIR%/%SDATE%/%MEMBER%/runtime/output/ifs/??? .
  26. rsync -avz --remove-source-files --no-group --omit-dir-times --chmod=g+rwxs,o-rwx %HPCUSER%@%HPCHOST%:%HPCROOTDIR%/%SDATE%/%MEMBER%/runtime/output/nemo/??? .
  27. fi
  28. #
  29. # Extract output
  30. #
  31. #for filename in CMOR*.tar.gz
  32. #do
  33. # tar -zxvf $filename
  34. # rm $filename
  35. #done